<commit_before>const HTMLLinkElement=function(tag){const proxy={},link=document.querySelector("link#"+tag+"[rel\x3dimport], link[href*\x3d"+tag+"][rel\x3dimport]"),register=(event,handler)=>HTMLImports&&!!!HTMLImports.useNative?HTMLImports.whenReady((_)=>handler({target:link})):link.addEventListener(event,handler);Object.defineProperties(proxy,{"addEventListener":{writable:false,value:function(event,handler){!!!link?handler({target:proxy}):register(event,handler)}}});return proxy};
class TokenList{constructor(node){const tokenize=(node)=>(node.text=node.textContent)&&node.textContent.match(/{(\w+|#)}/g).map((symbol)=>symbol.match(/(\w+|#)/g)[0]).map(insert(node)),insert=(token)=>(symbol)=>(this[symbol]=this[symbol]||[])&&this[symbol].push(token);this.sift(node).map(tokenize)}sift(node){const nodes=[],visit=(node)=>node.nodeType===Node.TEXT_NODE?TEXT_NODE(node)&&NodeFilter.FILTER_ACCEPT:ELEMENT_NODE(node.attributes)&&NodeFilter.FILTER_REJECT,TEXT_NODE=(node)=>/{(\w+|#)}/.test(node.textContent),
ELEMENT_NODE=(attributes)=>Array.from(attributes).filter((attr)=>/{(\w+|#)}/g.test(attr.value)).map((attribute)=>nodes.push(attribute)),walker=document.createNodeIterator(node,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,visit);while(node=walker.nextNode())nodes.push(node);return nodes}bind(context){const replace=(symbol)=>this[symbol].map((token)=>token.textContent=token.text)&&this[symbol].map(replacement(symbol)),replacement=(symbol)=>(item)=>item.textContent=item.textContent.replace("{"+symbol+
"}",context[symbol]);Object.keys(this).filter((key)=>context[key]!==undefined).map(replace)}}
const HTMLTemplateElement=Template=function(name){return Object.assign(document.querySelector("template[name\x3d"+name+"]"),{bind});function bind(context){contexts=[].concat(...[context]);let clone,template=this.cloneNode(false);template.innerHTML=contexts.map((context)=>context).map((context,index)=>{context=typeof context==="object"?context:{self:context};context["#"]=index;clone=this.cloneNode(true);void(new TokenList(clone.content)).bind(context);return clone.innerHTML}).join("");void(this.dependents||
[]).map((dependent)=>dependent.remove());this.dependents=Array.from(template.content.childNodes);this.after(template.content);return this}};const EventTarget=(Element)=>class extends Element{connectedCallback(){(new HTMLLinkElement(this.tagName.toLowerCase())).addEventListener("load",this.onimport.bind(this))}on(event,handler){this.addEventListener(event,handler)}};const ParentNode=(Element)=>class extends Element{selectAll(selector){return this.querySelectorAll(selector)}select(selector){return this.selectAll(selector)[0]}};
const GlobalEventHandlers=(Element)=>class extends Element{onimport(event,root=event.target.import){root&&this.clone(root.querySelector("template"));Element.onconnect&&Element.onconnect.call(this);this.render()}register(onevents=(attr)=>/^on/.test(attr)){const mirror=(handler)=>onevents(handler)&&this[handler]===null&&(this[handler]=Element[handler].bind(this)),nodes="*",children=Array.from(this.querySelectorAll(nodes)),reflect=(node)=>Array.from(node.attributes).map((attr)=>attr.name).filter(onevents).map(reflection(node)),
reflection=(node)=>(event)=>node[event]=/{\s*(\w+)\s*}/.exec(node[event])&&Element[event]&&Element[event].bind(this)||node[event]||null;Object.getOwnPropertyNames(Element).map(mirror);void[this].concat(children).map(reflect)}};
const Component=(Element)=>class extends EventTarget(ParentNode(GlobalEventHandlers(Element))){constructor(){super();this.context={};this.initialize&&this.initialize();this.tokens=new TokenList(this)}render(){this.tokens.bind(this);Array.from(this.selectAll("template[name]")).map((template)=>template.getAttribute("name")).map((name)=>(new Template(name)).bind(this[name]));this.register();Element.onidle&&Element.onidle.call(this)}clone(template){const fragment=template.content.cloneNode(true),slots=
Array.from(fragment.querySelectorAll("slot")),replace=(replacement)=>slots.filter(match(replacement)).map(exchange(replacement)),match=(replacement)=>(slot)=>replacement.getAttribute("slot")===slot.getAttribute("name"),exchange=(replacement)=>(slot)=>slot.parentNode.replaceChild(replacement,slot);Array.from(template.attributes).map((attribute)=>this.setAttribute(attribute.name,attribute.value));Array.from(this.querySelectorAll("[slot]")).map(replace);this.innerHTML=template.innerHTML}};
const ElementPrototype=window.Element.prototype;const Element=(tag,CustomElementRegistry=window.customElements)=>(Element)=>CustomElementRegistry.define(...tag,Component(Element));Element.prototype=ElementPrototype;<commit_msg>:muscle: bump distribution for ./snuggsi.min.js<commit_after>const HTMLLinkElement=function(tag){const proxy={},link=document.querySelector("link#"+tag+"[rel\x3dimport], link[href*\x3d"+tag+"][rel\x3dimport]"),register=(event,handler)=>HTMLImports&&!!!HTMLImports.useNative?HTMLImports.whenReady((_)=>handler({target:link})):link.addEventListener(event,handler);Object.defineProperties(proxy,{"addEventListener":{writable:false,value:function(event,handler){!!!link?handler({target:proxy}):register(event,handler)}}});return proxy};
class TokenList{constructor(node){const tokenize=(node)=>(node.text=node.textContent)&&node.textContent.match(/{(\w+|#)}/g).map((symbol)=>symbol.match(/(\w+|#)/g)[0]).map(insert(node)),insert=(token)=>(symbol)=>(this[symbol]=this[symbol]||[])&&this[symbol].push(token);this.sift(node).map(tokenize)}sift(node){const nodes=[],visit=(node)=>node.nodeType===Node.TEXT_NODE?TEXT_NODE(node)&&NodeFilter.FILTER_ACCEPT:ELEMENT_NODE(node.attributes)&&NodeFilter.FILTER_REJECT,TEXT_NODE=(node)=>/{(\w+|#)}/.test(node.textContent),
ELEMENT_NODE=(attributes)=>Array.from(attributes).filter((attr)=>/{(\w+|#)}/g.test(attr.value)).map((attribute)=>nodes.push(attribute)),walker=document.createNodeIterator(node,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,visit);while(node=walker.nextNode())nodes.push(node);return nodes}bind(context){const replace=(symbol)=>this[symbol].map((token)=>token.textContent=token.text)&&this[symbol].map(replacement(symbol)),replacement=(symbol)=>(item)=>item.textContent=item.textContent.replace("{"+symbol+
"}",context[symbol]);Object.keys(this).filter((key)=>context[key]!==undefined).map(replace)}}
const HTMLTemplateElement=Template=function(name){return Object.assign(document.querySelector("template[name\x3d"+name+"]"),{bind});function bind(context){contexts=[].concat(...[context]);let clone,template=this.cloneNode(false);template.innerHTML=contexts.map((context)=>context).map((context,index)=>{context=typeof context==="object"?context:{self:context};context["#"]=index;clone=this.cloneNode(true);void(new TokenList(clone.content)).bind(context);return clone.innerHTML}).join("");void(this.dependents||
[]).map((dependent)=>dependent.remove());this.dependents=Array.from(template.content.childNodes);this.after(template.content);return this}};const EventTarget=(Element)=>class extends Element{connectedCallback(){(new HTMLLinkElement(this.tagName.toLowerCase())).addEventListener("load",this.onimport.bind(this))}on(event,handler){this.addEventListener(event,handler)}};const ParentNode=(Element)=>class extends Element{selectAll(selector){return this.querySelectorAll(selector)}select(selector){return this.selectAll(selector)[0]}};
const GlobalEventHandlers=(Element)=>class extends Element{onimport(event,document){(document=event.target.import)&&this.clone(document.querySelector("template"));Element.onconnect&&Element.onconnect.call(this);this.render()}register(){const onevents=(attr)=>/^on/.test(attr),mirror=(handler)=>onevents(handler)&&this[handler]===null&&(this[handler]=Element[handler].bind(this)),children=Array.from(this.querySelectorAll("*")),reflect=(node)=>Array.from(node.attributes).map((attr)=>attr.name).filter(onevents).map(reflection(node)),
reflection=(node)=>(event,handler)=>(handler=/{\s*(\w+)\s*}/.exec(node[event]))&&(handler=(handler||[])[1])&&(handler=Element[handler])&&(node[event]=handler.bind(this));Object.getOwnPropertyNames(Element).map(mirror);void[this].concat(children).map(reflect)}};
const Component=(Element)=>class extends EventTarget(ParentNode(GlobalEventHandlers(Element))){constructor(){super();this.context={};this.initialize&&this.initialize();this.tokens=new TokenList(this)}render(){this.tokens.bind(this);Array.from(this.selectAll("template[name]")).map((template)=>template.getAttribute("name")).map((name)=>(new Template(name)).bind(this[name]));this.register();Element.onidle&&Element.onidle.call(this)}clone(template){const fragment=template.content.cloneNode(true),slots=
Array.from(fragment.querySelectorAll("slot")),replace=(replacement)=>slots.filter(match(replacement)).map(exchange(replacement)),match=(replacement)=>(slot)=>replacement.getAttribute("slot")===slot.getAttribute("name"),exchange=(replacement)=>(slot)=>slot.parentNode.replaceChild(replacement,slot);Array.from(template.attributes).map((attribute)=>this.setAttribute(attribute.name,attribute.value));Array.from(this.querySelectorAll("[slot]")).map(replace);this.innerHTML=template.innerHTML}};
const ElementPrototype=window.Element.prototype;const Element=(tag,CustomElementRegistry=window.customElements)=>(Element)=>CustomElementRegistry.define(...tag,Component(Element));Element.prototype=ElementPrototype;
{'fraction_non_alphanumeric': 0.21645068008996465, 'fraction_numerical': 0.0013923101638641962, 'mean_word_length': 20.27107061503417, 'pattern_counts': {'":': 2, '<': 3, '<?xml version=': 0, '>': 81, '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': '5850420', 'n_tokens_mistral': 2753, 'n_tokens_neox': 2771, 'n_words': 101}