<commit_before><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
	xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:gui="uri:hui"
    version="1.0"
    exclude-result-prefixes="gui fn"
    >

<!--doc title:'Formula' class:'hui.ui.Formula' module:'input'
<formula name="«name»" state="«text»" padding="«pixels»">
    <fields···>
        ···
    </fields>
</formula>
-->
<xsl:template match="gui:formula">
	<form class="hui_formula hui_formula" id="{generate-id()}">
		<xsl:attribute name="style">
			<xsl:if test="@state and (not(//gui:gui/@state) or @state!=//gui:gui/@state)">
				<xsl:text>display:none;</xsl:text>
			</xsl:if>
			<xsl:if test="@padding">padding: <xsl:value-of select="@padding"/>px;</xsl:if>
		</xsl:attribute>
		<xsl:apply-templates/>
	</form>
	<script type="text/javascript">
		(function() {
			var <xsl:value-of select="generate-id()"/>_obj = new hui.ui.Formula({
				element:'<xsl:value-of select="generate-id()"/>',
				name:'<xsl:value-of select="@name"/>'
				<xsl:if test="@state">
					,state:'<xsl:value-of select="@state"/>'
				</xsl:if>
			});
			<xsl:call-template name="gui:createobject"/>		
		}());
	</script>
</xsl:template>

<xsl:template match="gui:formula//gui:header">
	<div class="hui_formula_header"><xsl:apply-templates/></div>
</xsl:template>

<!--doc title:'Fields' module:'input'
<fields labels="«'above' | 'besides'»">
    ···
</fields>
-->
<xsl:template match="gui:fields[not(@labels='above')]">
	<table class="hui_formula_fields">
		<xsl:apply-templates/>
	</table>
</xsl:template>

<!--doc title:'Fieldset' module:'input'
<fieldset legend="«text»">
    ···
</fieldset>
-->
<xsl:template match="gui:fieldset">
	<div class="hui_formula_fieldset">
		<xsl:if test="@top">
			<xsl:attribute name="style">margin-top: <xsl:value-of select="@top"/>px;</xsl:attribute>
		</xsl:if>
		<strong class="hui_formula_fieldset"><xsl:value-of select="@legend"/></strong>
		<xsl:apply-templates/>
	</div>
</xsl:template>



<!--doc title:'Field' module:'input'
<group>
    <field label="«text»" hint="«text»">
        ···
    </field>
</group>
-->
<xsl:template match="gui:fields/gui:field">
	<tr>
    	<xsl:attribute name="style">
    		<xsl:if test="@state and (not(//gui:gui/@state) or @state!=//gui:gui/@state) or @visible='false'">
    			<xsl:text>display:none;</xsl:text>
    		</xsl:if>
    	</xsl:attribute>
        <xsl:if test="@name">
            <xsl:attribute name="id">
                <xsl:value-of select="generate-id()"/>
            </xsl:attribute>
        </xsl:if>
		<th>
			<xsl:if test="gui:text-input[not(@multiline='true') and not(@breaks='true')] | gui:dropdown | gui:checkbox | gui:datetime-input | gui:style-length-input | gui:number-input | gui:radiobuttons">
				<xsl:attribute name="class">hui_formula_middle</xsl:attribute>
			</xsl:if>
			<label class="hui_formula_field"><xsl:value-of select="@label"/></label>
		</th>
		<td class="hui_formula_field">
			<div class="hui_formula_field_body"><xsl:apply-templates/></div>
			<xsl:if test="@hint"><p class="hui_formula_field_hint"><xsl:value-of select="@hint"/></p></xsl:if>
		</td>
	</tr>
    <xsl:if test="@name">
    	<script type="text/javascript">
    		(function() {
    			var <xsl:value-of select="generate-id()"/>_obj = new hui.ui.Formula.Field({
    				element:'<xsl:value-of select="generate-id()"/>',
    				name:'<xsl:value-of select="@name"/>'
    				<xsl:if test="@state">
    					,state:'<xsl:value-of select="@state"/>'
    				</xsl:if>
    			});
    			<xsl:call-template name="gui:createobject"/>		
    		}());
    	</script>        
    </xsl:if>
</xsl:template>

<xsl:template match="gui:fields[@labels='above']/gui:field">
	<xsl:call-template name="gui:field"/>
	<!--
	<tr><td>
		<xsl:if test="@label"><label class="hui_formula_field"><xsl:value-of select="@label"/></label></xsl:if>
		<div class="hui_formula_field_body"><xsl:apply-templates/></div>
		<xsl:if test="@hint"><p class="hui_formula_field_hint"><xsl:value-of select="@hint"/></p></xsl:if>
	</td></tr>
	-->
</xsl:template>

<xsl:template match="gui:field" name="gui:field">
	<div>
		<xsl:attribute name="class">
			<xsl:text>hui_formula_field</xsl:text>
			<xsl:if test="@compact='true'">
				<xsl:text> hui_formula_field_compact</xsl:text>
			</xsl:if>
		</xsl:attribute>
		<label class="hui_formula_field"><xsl:value-of select="@label"/></label><commit_msg>Don't write label if none exists<commit_after><?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
	xmlns="http://www.w3.org/1999/xhtml"
    xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
	xmlns:fn="http://www.w3.org/2005/xpath-functions"
    xmlns:gui="uri:hui"
    version="1.0"
    exclude-result-prefixes="gui fn"
    >

<!--doc title:'Formula' class:'hui.ui.Formula' module:'input'
<formula name="«name»" state="«text»" padding="«pixels»">
    <fields···>
        ···
    </fields>
</formula>
-->
<xsl:template match="gui:formula">
	<form class="hui_formula hui_formula" id="{generate-id()}">
		<xsl:attribute name="style">
			<xsl:if test="@state and (not(//gui:gui/@state) or @state!=//gui:gui/@state)">
				<xsl:text>display:none;</xsl:text>
			</xsl:if>
			<xsl:if test="@padding">padding: <xsl:value-of select="@padding"/>px;</xsl:if>
		</xsl:attribute>
		<xsl:apply-templates/>
	</form>
	<script type="text/javascript">
		(function() {
			var <xsl:value-of select="generate-id()"/>_obj = new hui.ui.Formula({
				element:'<xsl:value-of select="generate-id()"/>',
				name:'<xsl:value-of select="@name"/>'
				<xsl:if test="@state">
					,state:'<xsl:value-of select="@state"/>'
				</xsl:if>
			});
			<xsl:call-template name="gui:createobject"/>		
		}());
	</script>
</xsl:template>

<xsl:template match="gui:formula//gui:header">
	<div class="hui_formula_header"><xsl:apply-templates/></div>
</xsl:template>

<!--doc title:'Fields' module:'input'
<fields labels="«'above' | 'besides'»">
    ···
</fields>
-->
<xsl:template match="gui:fields[not(@labels='above')]">
	<table class="hui_formula_fields">
		<xsl:apply-templates/>
	</table>
</xsl:template>

<!--doc title:'Fieldset' module:'input'
<fieldset legend="«text»">
    ···
</fieldset>
-->
<xsl:template match="gui:fieldset">
	<div class="hui_formula_fieldset">
		<xsl:if test="@top">
			<xsl:attribute name="style">margin-top: <xsl:value-of select="@top"/>px;</xsl:attribute>
		</xsl:if>
		<strong class="hui_formula_fieldset"><xsl:value-of select="@legend"/></strong>
		<xsl:apply-templates/>
	</div>
</xsl:template>



<!--doc title:'Field' module:'input'
<group>
    <field label="«text»" hint="«text»">
        ···
    </field>
</group>
-->
<xsl:template match="gui:fields/gui:field">
	<tr>
    	<xsl:attribute name="style">
    		<xsl:if test="@state and (not(//gui:gui/@state) or @state!=//gui:gui/@state) or @visible='false'">
    			<xsl:text>display:none;</xsl:text>
    		</xsl:if>
    	</xsl:attribute>
        <xsl:if test="@name">
            <xsl:attribute name="id">
                <xsl:value-of select="generate-id()"/>
            </xsl:attribute>
        </xsl:if>
		<th>
			<xsl:if test="gui:text-input[not(@multiline='true') and not(@breaks='true')] | gui:dropdown | gui:checkbox | gui:datetime-input | gui:style-length-input | gui:number-input | gui:radiobuttons">
				<xsl:attribute name="class">hui_formula_middle</xsl:attribute>
			</xsl:if>
			<label class="hui_formula_field"><xsl:value-of select="@label"/></label>
		</th>
		<td class="hui_formula_field">
			<div class="hui_formula_field_body"><xsl:apply-templates/></div>
			<xsl:if test="@hint"><p class="hui_formula_field_hint"><xsl:value-of select="@hint"/></p></xsl:if>
		</td>
	</tr>
    <xsl:if test="@name">
    	<script type="text/javascript">
    		(function() {
    			var <xsl:value-of select="generate-id()"/>_obj = new hui.ui.Formula.Field({
    				element:'<xsl:value-of select="generate-id()"/>',
    				name:'<xsl:value-of select="@name"/>'
    				<xsl:if test="@state">
    					,state:'<xsl:value-of select="@state"/>'
    				</xsl:if>
    			});
    			<xsl:call-template name="gui:createobject"/>		
    		}());
    	</script>        
    </xsl:if>
</xsl:template>

<xsl:template match="gui:fields[@labels='above']/gui:field">
	<xsl:call-template name="gui:field"/>
	<!--
	<tr><td>
		<xsl:if test="@label"><label class="hui_formula_field"><xsl:value-of select="@label"/></label></xsl:if>
		<div class="hui_formula_field_body"><xsl:apply-templates/></div>
		<xsl:if test="@hint"><p class="hui_formula_field_hint"><xsl:value-of select="@hint"/></p></xsl:if>
	</td></tr>
	-->
</xsl:template>

<xsl:template match="gui:field" name="gui:field">
	<div>
		<xsl:attribute name="class">
			<xsl:text>hui_formula_field</xsl:text>
			<xsl:if test="@compact='true'">
				<xsl:text> hui_formula_field_compact</xsl:text>
			</xsl:if>
		</xsl:attribute>
        <xsl:if test="@label">
    		<label class="hui_formula_field"><xsl:value-of select="@label"/></label>            
        </xsl:if>
{'fraction_non_alphanumeric': 0.2349811571713589, 'fraction_numerical': 0.004433606739082243, 'mean_word_length': 4.276608187134503, 'pattern_counts': {'":': 0, '<': 291, '<?xml version=': 2, '>': 291, 'https://': 0, 'lorem ipsum': 0, 'www.': 6, 'xml': 10}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3257842', 'n_tokens_mistral': 3823, 'n_tokens_neox': 3297, 'n_words': 509}