text: const event_types={tap:1,change:1,click:1,dblclick:1,input:1,keydown:1,keypress:1,keyup:1,mousedown:1,mouseenter:1,mouseleave:1,mousemove:1,mouseout:1,mouseover:1,mouseup:1,mousewheel:1,touchstart:1,touchmove:1,touchend:1,reset:1,select:1,submit:1,toggle:1,blur:1,error:1,focus:1,load:1,resize:1,scroll:1};let is_static,counter=0;export default function compile(a,b){const c={};if(!b){if(is_static=!0,"string"!=typeof a)c.n=a.id||"tpl_"+counter++;else if(-1!==a.indexOf("<")){const b=document.createElement("div");b.innerHTML=a,a=b.firstElementChild,c.n=a.id||"tpl_"+counter++}else c.n=a,a=document.getElementById(a);a=a,a.content?a=a.content.firstElementChild:"TEMPLATE"===a.tagName&&(a=a.firstElementChild)}const d=a.tagName;if(d){if("INCLUDE"===d){const b=a.getAttribute("from");return c["+"]=b?b:strip(a.firstChild.nodeValue),c}"DIV"!==d&&(c.t=d.toLowerCase())}else{let b=a;if(b&&(b=b.nodeValue)&&(b=b.replace(/\s+/g," "),b&&b.trim())){const a=b.indexOf("{{@");if(-1!==a){const d=b.indexOf("}}",a);c.j=b.substring(a+3,d),b=b.substring(0,a)+b.substring(d+2)}b&&b.trim()&&(-1===b.indexOf("{{#")?handle_value(c,"x",b):handle_value(c,"h",b.replace(/{{#/g,"{{")))}return c.j||b&&b.trim()?c:null}const e=a.attributes;if(e.length)for(let b,f=0;f<e.length;f++)if(b=e[f].nodeName,"class"===b)handle_value(c,"c",void 0===a.className.baseVal?a.className:a.className.baseVal);else{let e=a.getAttribute(b);if("style"===b)handle_value(c,"s",e);else if("if"===b)handle_value(c,"f",e);else if("include"===b){if(!a.hasAttribute("for")){const a={};(c.i||(c.i=[])).push(a),handle_value(a,"+",e)}}else if("for"===b&&"LABEL"!==d){const b=a.getAttribute("include");b&&(c["@"]=strip(b)),handle_value(c,"r",e)}else if("max"===b)handle_value(c,"m",e);else if("js"===b)c.j=strip(e);else if("key"===b)handle_value(c,"k",e.replace("data.",""));else{if("bind"===b){const a=e.split(":");2>a.length&&a.unshift("value"),b=a[0],e="{{=="+a[1]+"}}"}event_types[b.substring(2)]&&-1!==e.indexOf("{{")&&(b=b.substring(2)),event_types[b]?handle_value(c.e||(c.e={}),b,e):handle_value(c.a||(c.a={}),b,e)}}const f=a.childNodes,g=f.length;if(g){let a=0;for(let b=0;b<g;b++){const d=compile(f[b],1);d&&(1===g&&3===f[b].nodeType?(d.j&&(c.j=d.j),d.h&&(c.h=d.h),d.x&&(c.x=d.x)):(c.i||(c.i=[]))[a++]=d)}1==a&&(c.i=c.i[0])}return b||(c.d=is_static),c}function handle_value(a,b,c){if(-1!==c.indexOf("{{")&&-1!==c.indexOf("}}")){const d=-1!==c.indexOf("{{=="),e=d||-1!==c.indexOf("{{=");is_static=!1;const f=c.replace(/{{==/g,"{{").replace(/{{=/g,"{{").replace(/"{{/g,"").replace(/}}"/g,"").replace(/{{/g,"' + ").replace(/}}/g," + '");a[b]=[("'"+f+"'").replace(/'' \+ /g,"").replace(/ \+ ''/g,"").trim()],d?a[b].push(2):e&&a[b].push(1)}else a[b]=c}function strip(a){return a.replace(/{{/g,"").replace(/}}/g,"").trim()}