<commit_before><%- if firstmap and messages then local msg; for _, msg in ipairs(messages) do -%>
	<div class="errorbox"><%=pcdata(msg)%></div>
<%- end end -%>

<%-+cbi/apply_xhr-%>

<div class="cbi-map" id="cbi-<%=self.config%>">
	<% if self.title and #self.title > 0 then %><h2 name="content"><%=self.title%></h2><% end %>
	<% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
	<%- if firstmap and applymap then cbi_apply_xhr(self.config, parsechain, redirect) end -%>
	<%- self:render_children() %>
	<br /><commit_msg>luci-base: add basic support for CBI map level tabbing<commit_after><%- if firstmap and messages then local msg; for _, msg in ipairs(messages) do -%>
	<div class="errorbox"><%=pcdata(msg)%></div>
<%- end end -%>

<%-+cbi/apply_xhr-%>

<div class="cbi-map" id="cbi-<%=self.config%>">
	<% if self.title and #self.title > 0 then %><h2 name="content"><%=self.title%></h2><% end %>
	<% if self.description and #self.description > 0 then %><div class="cbi-map-descr"><%=self.description%></div><% end %>
	<%- if firstmap and applymap then cbi_apply_xhr(self.config, parsechain, redirect) end -%>

	<% if self.tabbed then %>
		<ul class="cbi-tabmenu">
			<%- self.selected_tab = luci.http.formvalue("tab.m-" .. self.config) %>
			<% for i, section in ipairs(self.children) do %>
				<script type="text/javascript">cbi_c['container.m-<%=self.config%>.<%=section.sectiontype%>'] = 1;</script>
				<%- if not self.selected_tab then self.selected_tab = section.sectiontype end %>
				<li id="tab.m-<%=self.config%>.<%=section.sectiontype%>" class="cbi-tab<%=(section.sectiontype == self.selected_tab) and '' or '-disabled'%>">
					<a onclick="this.blur(); return cbi_t_switch('m-<%=self.config%>', '<%=section.sectiontype%>')" href="<%=REQUEST_URI%>?tab.m-<%=self.config%>=<%=section.sectiontype%>"><%=section.title or section.sectiontype %></a>
					<% if section.sectiontype == self.selected_tab then %><input type="hidden" id="tab.m-<%=self.config%>" name="tab.m-<%=self.config%>" value="<%=section.sectiontype%>" /><% end %>
				</li>
			<% end %>
		</ul>
		<% for i, section in ipairs(self.children) do %>
			<div class="cbi-tabcontainer" id="container.m-<%=self.config%>.<%=section.sectiontype%>"<% if section.sectiontype ~= self.selected_tab then %> style="display:none"<% end %>>
				<% section:render() %>
			</div>
			<script type="text/javascript">cbi_t_add('m-<%=self.config%>', '<%=section.sectiontype%>')</script>
		<% end %>
	<% else %>
		<%- self:render_children() %>
	<% end %>
	<br />
{'fraction_non_alphanumeric': 0.23518016272762496, 'fraction_numerical': 0.003487020534676482, 'mean_word_length': 4.789237668161435, 'pattern_counts': {'":': 0, '<': 90, '<?xml version=': 0, '>': 94, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, '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': '7308259', 'n_tokens_mistral': 1051, 'n_tokens_neox': 933, 'n_words': 184}