forked from WebReflection/heresy
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathes.js
8 lines (8 loc) · 22.1 KB
/
es.js
1
2
3
4
5
6
7
8
/*! (c) Andrea Giammarchi - ISC */var heresy=function(e){"use strict";var t,n=(...e)=>e
/*! (c) Andrea Giammarchi - ISC */,r="-"+Math.random().toFixed(6)+"%",s=!1;try{"content"in(t=document.createElement("template"))&&(t.innerHTML='<p tabindex="'+r+'"></p>',t.content.childNodes[0].getAttribute("tabindex")==r)||(r="_dt: "+r.slice(1,-1)+";",s=!0)}catch(e){}/*! (c) Andrea Giammarchi - ISC */var o="\x3c!--"+r+"--\x3e",a=/^(?:style|textarea)$/i,i=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i;
/*! (c) Andrea Giammarchi - ISC */
function c(e){return e.join(o).replace(g,b).replace(d,m)}/*! (c) Andrea Giammarchi - ISC */var l=" \\f\\n\\r\\t",u="[^"+l+"\\/>\"'=]+",f="["+l+"]+"+u,h="<([A-Za-z]+[A-Za-z0-9:._-]*)((?:",p="(?:\\s*=\\s*(?:'[^']*?'|\"[^\"]*?\"|<[^>]*?>|"+u.replace("\\/","")+"))?)",d=new RegExp(h+f+p+"+)(["+l+"]*/?>)","g"),g=new RegExp(h+f+p+"*)(["+l+"]*/>)","g"),v=new RegExp("("+f+"\\s*=\\s*)(['\"]?)"+o+"\\2","gi");function m(e,t,n,r){return"<"+t+n.replace(v,y)+r}function y(e,t,n){return t+(n||'"')+r+(n||'"')}function b(e,t,n){return i.test(t)?e:"<"+t+n+"></"+t+">"}const w=e=>document.createElementNS("http://www.w3.org/1999/xhtml",e),k=(e,t)=>("svg"===t?E:x)(e),x=e=>{const t=w("template");return t.innerHTML=e,t.content},E=e=>{const{content:t}=w("template"),n=w("div");n.innerHTML='<svg xmlns="http://www.w3.org/2000/svg">'+e+"</svg>";const{childNodes:r}=n.firstChild;let{length:s}=r;for(;s--;)t.appendChild(r[0]);return t},{indexOf:N}=[],A=(e,t,n,r,s,o)=>{const a="selectedIndex"in t;let i=a;for(;r<s;){const s=e(n[r],1);if(t.insertBefore(s,o),a&&i&&s.selected){i=!i;let{selectedIndex:e}=t;t.selectedIndex=e<0?r:N.call(t.querySelectorAll("option"),s)}r++}},C=(e,t)=>e==t,$=e=>e,_=(e,t,n,r,s,o,a)=>{const i=o-s;if(i<1)return-1;for(;n-t>=i;){let i=t,c=s;for(;i<n&&c<o&&a(e[i],r[c]);)i++,c++;if(c===o)return t;t=i+1}return-1},L=(e,t,n,r,s)=>n<r?e(t[n],0):0<n?e(t[n-1],-0).nextSibling:s,j=(e,t,n,r)=>{for(;n<r;)S(e(t[n++],-1))},M=(e,t,n)=>{let r=1,s=t;for(;r<s;){const t=(r+s)/2>>>0;n<e[t]?s=t:r=t+1}return r},O=(e,t,n,r,s,o,a,i,c,l,u,f,h)=>{((e,t,n,r,s,o,a,i,c)=>{const l=[],u=e.length;let f=a,h=0;for(;h<u;)switch(e[h++]){case 0:s++,f++;break;case 1:l.push(r[s]),A(t,n,r,s++,s,f<i?t(o[f],0):c);break;case-1:f++}for(h=0;h<u;)switch(e[h++]){case 0:a++;break;case-1:-1<l.indexOf(o[a])?a++:j(t,o,a++,a)}})(((e,t,n,r,s,o,a)=>{const i=n+o,c=[];let l,u,f,h,p,d,g;e:for(l=0;l<=i;l++){if(l>50)return null;for(g=l-1,p=l?c[l-1]:[0,0],d=c[l]=[],u=-l;u<=l;u+=2){for(h=u===-l||u!==l&&p[g+u-1]<p[g+u+1]?p[g+u+1]:p[g+u-1]+1,f=h-u;h<o&&f<n&&a(r[s+h],e[t+f]);)h++,f++;if(h===o&&f===n)break e;d[l+u]=h}}const v=Array(l/2+i/2);let m=v.length-1;for(l=c.length-1;l>=0;l--){for(;h>0&&f>0&&a(r[s+h-1],e[t+f-1]);)v[m--]=0,h--,f--;if(!l)break;g=l-1,p=l?c[l-1]:[0,0],u=h-f,u===-l||u!==l&&p[g+u-1]<p[g+u+1]?(f--,v[m--]=1):(h--,v[m--]=-1)}return v})(n,r,o,a,i,l,f)||((e,t,n,r,s,o,a,i)=>{let c=0,l=r<i?r:i;const u=Array(l++),f=Array(l);f[0]=-1;for(let e=1;e<l;e++)f[e]=a;const h=s.slice(o,a);for(let r=t;r<n;r++){const t=h.indexOf(e[r]);if(-1<t){const e=t+o;c=M(f,l,e),-1<c&&(f[c]=e,u[c]={newi:r,oldi:e,prev:u[c-1]})}}for(c=--l,--a;f[c]>a;)--c;l=i+r-c;const p=Array(l);let d=u[c];for(--n;d;){const{newi:e,oldi:t}=d;for(;n>e;)p[--l]=1,--n;for(;a>t;)p[--l]=-1,--a;p[--l]=0,--n,--a,d=d.prev}for(;n>=t;)p[--l]=1,--n;for(;a>=o;)p[--l]=-1,--a;return p})(n,r,s,o,a,i,c,l),e,t,n,r,a,i,u,h)},S=e=>(e.remove||T).call(e);function T(){const{parentNode:e}=this;e&&e.removeChild(this)}
/*! (c) 2018 Andrea Giammarchi (ISC) */const W=(e,t,n,r)=>{r||(r={});const s=r.compare||C,o=r.node||$,a=null==r.before?null:o(r.before,0),i=t.length;let c=i,l=0,u=n.length,f=0;for(;l<c&&f<u&&s(t[l],n[f]);)l++,f++;for(;l<c&&f<u&&s(t[c-1],n[u-1]);)c--,u--;const h=l===c,p=f===u;if(h&&p)return n;if(h&&f<u)return A(o,e,n,f,u,L(o,t,l,i,a)),n;if(p&&l<c)return j(o,t,l,c),n;const d=c-l,g=u-f;let v=-1;if(d<g){if(v=_(n,f,u,t,l,c,s),-1<v)return A(o,e,n,f,v,o(t[l],0)),A(o,e,n,v+d,u,L(o,t,c,i,a)),n}else if(g<d&&(v=_(t,l,c,n,f,u,s),-1<v))return j(o,t,l,v),j(o,t,v+g,c),n;return d<2||g<2?(A(o,e,n,f,u,o(t[l],0)),j(o,t,l,c),n):d===g&&((e,t,n,r,s,o)=>{for(;r<s&&o(n[r],e[t-1]);)r++,t--;return 0===t})(n,u,t,l,c,s)?(A(o,e,n,f,u,L(o,t,c,i,a)),n):(O(o,e,n,f,u,g,t,l,c,d,i,s,a),n)};/*! (c) Andrea Giammarchi - ISC */var Z=document.importNode,R="".trim,z=s?function(e,t){var n=t.join(" ");return t.slice.call(e,0).sort((function(e,t){return n.indexOf(e.name)<=n.indexOf(t.name)?-1:1}))}:function(e,t){return t.slice.call(e,0)};function D(e,t){for(var n=t.length,r=0;r<n;)e=e.childNodes[t[r++]];return e}function P(e,t,n,a){for(var i=e.attributes,c=[],l=[],u=z(i,n),f=u.length,h=0;h<f;){var p,d=u[h++],g=d.value===r;if(g||1<(p=d.value.split(o)).length){var v=d.name;if(c.indexOf(v)<0){c.push(v);var m=n.shift().replace(g?/^(?:|[\S\s]*?\s)(\S+?)\s*=\s*('|")?$/:new RegExp("^(?:|[\\S\\s]*?\\s)("+v+")\\s*=\\s*('|\")[\\S\\s]*","i"),"$1"),y=i[m]||i[m.toLowerCase()];if(g)t.push(F(y,a,m,null));else{for(var b=p.length-2;b--;)n.shift();t.push(F(y,a,m,p))}}l.push(d)}}h=0;for(var w=(0<(f=l.length)&&s&&!("ownerSVGElement"in e));h<f;){var k=l[h++];w&&(k.value=""),e.removeAttribute(k.name)}var x=e.nodeName;if(/^script$/i.test(x)){var E=document.createElement(x);for(f=i.length,h=0;h<f;)E.setAttributeNode(i[h++].cloneNode(!0));E.textContent=e.textContent,e.parentNode.replaceChild(E,e)}}function H(e,t){return{type:"any",node:e,path:t}}function F(e,t,n,r){return{type:"attr",node:e,path:t,name:n,sparse:r}}function I(e,t){return{type:"text",node:e,path:t}}var B=new WeakMap;function V(e,t){var n=(e.convert||c)(t),s=e.transform;s&&(n=s(n));var i=k(n,e.type);U(i);var l=[];!function e(t,n,s,i){for(var c=t.childNodes,l=c.length,u=0;u<l;){var f=c[u];switch(f.nodeType){case 1:var h=i.concat(u);P(f,n,s,h),e(f,n,s,h);break;case 8:var p=f.textContent;if(p===r)s.shift(),n.push(a.test(t.nodeName)?I(t,i):H(f,i.concat(u)));else switch(p.slice(0,2)){case"/*":if("*/"!==p.slice(-2))break;case"👻":t.removeChild(f),u--,l--}break;case 3:a.test(t.nodeName)&&R.call(f.textContent)===o&&(s.shift(),n.push(I(t,i)))}u++}}(i,l,t.slice(0),[]);var u={content:i,updates:function(n){for(var r=[],s=l.length,o=0,a=0;o<s;){var i=l[o++],c=D(n,i.path);switch(i.type){case"any":r.push({fn:e.any(c,[]),sparse:!1});break;case"attr":var u=i.sparse,f=e.attribute(c,i.name,i.node);null===u?r.push({fn:f,sparse:!1}):(a+=u.length-2,r.push({fn:f,sparse:!0,values:u}));break;case"text":r.push({fn:e.text(c),sparse:!1}),c.textContent=""}}return s+=a,function(){var e=arguments.length;if(s!==e-1)throw new Error(e-1+" values instead of "+s+"\n"+t.join("${value}"));for(var o=1,a=1;o<e;){var i=r[o-a];if(i.sparse){var c=i.values,l=c[0],u=1,f=c.length;for(a+=f-2;u<f;)l+=arguments[o++]+c[u++];i.fn(l)}else i.fn(arguments[o++])}return n}}};return B.set(t,u),u}function q(e,t){var n=B.get(t)||V(e,t);return n.updates(Z.call(document,n.content,!0))}var G=[];function U(e){for(var t=e.childNodes,n=t.length;n--;){var r=t[n];1!==r.nodeType&&0===R.call(r.textContent).length&&e.removeChild(r)}}
/*! (c) Andrea Giammarchi - ISC *//*! (c) Andrea Giammarchi - ISC */var J=function(){var e=/acit|ex(?:s|g|n|p|$)|rph|ows|mnc|ntw|ine[ch]|zoo|^ord/i,t=/([^A-Z])([A-Z]+)/g;return function(e,t){return"ownerSVGElement"in e?function(e,t){var n;t?n=t.cloneNode(!0):(e.setAttribute("style","--hyper:style;"),n=e.getAttributeNode("style"));return n.value="",e.setAttributeNode(n),r(n,!0)}(e,t):r(e.style,!1)};function n(e,t,n){return t+"-"+n.toLowerCase()}function r(r,s){var o,a;return function(i){var c,l,u,f;switch(typeof i){case"object":if(i){if("object"===o){if(!s&&a!==i)for(l in a)l in i||(r[l]="")}else s?r.value="":r.cssText="";for(l in c=s?{}:r,i)u="number"!=typeof(f=i[l])||e.test(l)?f:f+"px",!s&&/^--/.test(l)?c.setProperty(l,u):c[l]=u;o="object",s?r.value=function(e){var r,s=[];for(r in e)s.push(r.replace(t,n),":",e[r],";");return s.join("")}(a=c):a=i;break}default:a!=i&&(o="string",a=i,s?r.value=i||"":r.cssText=i||"")}}}}(),K=function(e,t){return(t=n.prototype).ELEMENT_NODE=1,t.nodeType=111,t.remove=function(e){var t=this.childNodes,n=this.firstChild,r=this.lastChild;if(this._=null,e&&2===t.length)r.parentNode.removeChild(r);else{var s=this.ownerDocument.createRange();s.setStartBefore(e?t[1]:n),s.setEndAfter(r),s.deleteContents()}return n},t.valueOf=function(e){var t=this._,n=null==t;if(n&&(t=this._=this.ownerDocument.createDocumentFragment()),n||e)for(var r=this.childNodes,s=0,o=r.length;s<o;s++)t.appendChild(r[s]);return t},n;function n(t){var n=this.childNodes=e.call(t,0);this.firstChild=n[0],this.lastChild=n[n.length-1],this.ownerDocument=n[0].ownerDocument,this._=null}}([].slice);
/*! (c) Andrea Giammarchi - ISC */const{isArray:Q}=Array,{create:X,freeze:Y,keys:ee}=Object,te=K.prototype.nodeType,ne=(e,t)=>e.nodeType===te?1/t<0?t?e.remove(!0):e.lastChild:t?e.valueOf(!0):e.firstChild:e,re=(e,t)=>{let n,r=!1;const s=t.cloneNode(!0);return t=>{n!==t&&(n=t,s.value!==t&&(null==t?(r&&(r=!1,e.removeAttributeNode(s)),s.value=t):(s.value=t,r||(r=!0,e.setAttributeNode(s)))))}},se=(e,t)=>{let n;return r=>{n!==r&&(n=r,e[t]!==r&&(null==r?(e[t]="",e.removeAttribute(t)):e[t]=r))}},oe=/^(?:form|list)$/i,ae=[].slice,ie=(e,t)=>e.ownerDocument.createTextNode(t);function ce(e){return this.type=e,function(e){/*! (c) Andrea Giammarchi - ISC */var t=G,n=U;return function(r){return t!==r&&(n=q(e,t=r)),n.apply(null,arguments)}}(this)}function le(e){return e(this)}ce.prototype={attribute(e,t,n){const r="svg"===this.type;switch(t){case"class":if(r)return re(e,n);t="className";case"data":case"props":return se(e,t);case"style":return J(e,n,r);case"ref":return(e=>t=>{t.current=e})(e);default:return"."===t.slice(0,1)?((e,t,n)=>n?n=>{try{e[t]=n}catch(r){e.setAttribute(t,n)}}:n=>{e[t]=n})(e,t.slice(1),r):"on"===t.slice(0,2)?((e,t)=>{let n,r=t.slice(2);return t.toLowerCase()in e&&(r=r.toLowerCase()),t=>{n!==t&&(n&&e.removeEventListener(r,n,!1),n=t,t&&e.addEventListener(r,t,!1))}})(e,t):t in e&&!r&&!oe.test(t)?se(e,t):re(e,n)}},any(e,t){const n={node:ne,before:e},{type:r}=this;let s,o=!1;const a=i=>{switch(typeof i){case"string":case"number":case"boolean":o?s!==i&&(s=i,t[0].textContent=i):(o=!0,s=i,t=W(e.parentNode,t,[ie(e,i)],n));break;case"function":a(i(e));break;case"object":case"undefined":if(null==i){o=!1,t=W(e.parentNode,t,[],n);break}default:if(o=!1,s=i,Q(i))if(0===i.length)t.length&&(t=W(e.parentNode,t,[],n));else switch(typeof i[0]){case"string":case"number":case"boolean":a(String(i));break;case"function":a(i.map(le,e));break;case"object":Q(i[0])&&(i=i.concat.apply([],i));default:t=W(e.parentNode,t,i,n)}else(e=>"ELEMENT_NODE"in e)(i)?t=W(e.parentNode,t,11===i.nodeType?ae.call(i.childNodes):[i],n):"text"in i?a(String(i.text)):"any"in i?a(i.any):"html"in i?t=W(e.parentNode,t,ae.call(k([].concat(i.html).join(""),r).childNodes),n):"length"in i&&a(ae.call(i))}};return a},text(e){let t;const n=r=>{if(t!==r){t=r;const s=typeof r;"object"===s&&r?"text"in r?n(String(r.text)):"any"in r?n(r.any):"html"in r?n([].concat(r.html).join("")):"length"in r&&n(ae.call(r).join("")):"function"===s?n(r(e)):e.textContent=null==r?"":r}};return n}};const ue=ce.prototype,fe=new WeakMap,he=e=>({html:pe("html",e),svg:pe("svg",e),render(t,n){const r="function"==typeof n?n():n,s=fe.get(t)||ge(t),o=r instanceof be?de(e,s,r):r;return o!==s.wire&&(s.wire=o,t.textContent="",t.appendChild(o.valueOf(!0))),t}}),pe=(e,t)=>{const r=new WeakMap;return s.for=(e,n)=>{const o=r.get(e)||(e=>{const t=X(null);return r.set(e,t),t})(e);return o[n]||(o[n]=(e=>function(){return de(t,e,s.apply(null,arguments))})({sub:[],stack:[],wire:null}))},s.node=function(){return de(t,{sub:[],stack:[],wire:null},s.apply(null,arguments)).valueOf(!0)},s;function s(){return new be(e,n.apply(null,arguments))}},de=(e,t,n)=>{const{sub:r,stack:s}=t,o={a:0,aLength:r.length,i:0,iLength:s.length},a=ve(e,t,n,o),{a:i,i:c,aLength:l,iLength:u}=o;return i<l&&r.splice(i),c<u&&s.splice(c),a},ge=e=>{const t={sub:[],stack:[],wire:null};return fe.set(e,t),t},ve=(e,t,n,r)=>{const{stack:s}=t,{i:o,iLength:a}=r,{type:i,args:c}=n,l=o===a;l&&(r.iLength=s.push({type:i,id:c[0],tag:null,wire:null})),r.i++,me(e,t,c,r);const u=s[o];return l||u.id!==c[0]||u.type!==i?(u.type=i,u.id=c[0],u.tag=new e(i),u.wire=ye(u.tag.apply(null,c))):u.tag.apply(null,c),u.wire},me=(e,t,n,r)=>{for(let s=1,{length:o}=n;s<o;s++){const o=n[s];if("object"==typeof o&&o)if(o instanceof be)n[s]=ve(e,t,o,r);else if(Q(o))for(let n=0,{length:s}=o;n<s;n++){const s=o[n];if("object"==typeof s&&s&&s instanceof be){const{sub:a}=t,{a:i,aLength:c}=r;i===c&&(r.aLength=a.push({sub:[],stack:[],wire:null})),r.a++,o[n]=de(e,a[i],s)}}}},ye=e=>{const t=e.childNodes,{length:n}=t;return 1===n?t[0]:n?new K(t):e};function be(e,t){this.type=e,this.args=t}Y(be);const{render:we,html:ke,svg:xe}=he(ce);var Ee="function"==typeof cancelAnimationFrame,Ne=Ee?cancelAnimationFrame:clearTimeout,Ae=Ee?requestAnimationFrame:setTimeout;function Ce(e){var t,n,r,s,o;return i(),function(e,i,l){return r=e,s=i,o=l,n||(n=Ae(a)),--t<0&&c(!0),c};function a(){i(),r.apply(s,o||[])}function i(){t=e||1/0,n=Ee?0:null}function c(e){var t=!!n;return t&&(Ne(n),e&&a()),t}}
/*! (c) Andrea Giammarchi - ISC */let $e=null;const _e=e=>{const t=[];return function n(){const r=$e,s=[];$e={hook:n,args:arguments,stack:t,i:0,length:t.length,after:s};try{return e.apply(null,arguments)}finally{$e=r;for(let e=0,{length:t}=s;e<t;e++)s[e]()}}},Le=new WeakMap,je=e=>{const t=Ce();return Le.set(e,t),t},Me=(e,t,n)=>{e.apply(t,n)},Oe={async:!1,always:!1},Se=(e,t)=>{const n=$e.i++,{hook:r,args:s,stack:o,length:a}=$e,{async:i,always:c}=t||Oe;n===a&&($e.length=o.push({$:"function"==typeof e?e():e,_:i?Le.get(r)||je(r):Me}));const l=o[n];return[l.$,e=>{const t="function"==typeof e?e(l.$):e;(c||l.$!==t)&&(l.$=t,l._(r,null,s))}]},Te=new WeakMap,We=({hook:e,args:t})=>{e.apply(null,t)};function Ze(e){this.value!==e&&(this.value=e,Te.get(this).forEach(We))}function Re({hook:e}){return e===this.hook}const ze=new WeakMap,De=()=>{},Pe=e=>(t,n)=>{const r=$e.i++,{hook:s,after:o,stack:a,length:i}=$e;if(r<i){const s=a[r],{update:i,values:c,stop:l}=s;if(!n||n.some(qe,c)){s.values=n,e&&l(e);const{clean:r}=s;r&&(s.clean=null,r());const a=()=>{s.clean=t()};e?i(a):o.push(a)}}else{const r=e?Ce():De,i={clean:null,update:r,values:n,stop:De};$e.length=a.push(i),(ze.get(s)||(e=>{const t=[];return ze.set(e,t),t})(s)).push(i);const c=()=>{i.clean=t()};e?i.stop=r(c):o.push(c)}},He=e=>{(ze.get(e)||[]).forEach(e=>{const{clean:t,stop:n}=e;n(),t&&(e.clean=null,t())})},Fe=ze.has.bind(ze),Ie=Pe(!0),Be=Pe(!1),Ve=(e,t)=>{const n=$e.i++,{stack:r,length:s}=$e;return n===s?$e.length=r.push({$:e(),_:t}):t&&!t.some(qe,r[n]._)||(r[n]={$:e(),_:t}),r[n].$};function qe(e,t){return e!==this[t]}let Ge=null;try{Ge=new{o(){}}.o}catch(e){}let Ue=e=>class extends e{};if(Ge){const{getPrototypeOf:e,setPrototypeOf:t}=Object,{construct:n}="object"==typeof Reflect?Reflect:{construct(e,n,r){const s=[null];for(let e=0;e<n.length;e++)s.push(n[e]);const o=e.bind.apply(e,s);return t(new o,r.prototype)}};Ue=function(r,s){function o(){return n(s?e(r):r,arguments,o)}return t(o.prototype,r.prototype),t(o,r)}}const Je={map:{},re:null},Ke=e=>new RegExp(`<(/)?(${e.join("|")})([^A-Za-z0-9:._-])`,"g");let Qe=null;const Xe=(e,t)=>{const{map:n,re:r}=Qe||t;return e.replace(r,(e,t,r,s)=>{const{tagName:o,is:a,element:i}=n[r];return i?t?`</${a}>`:`<${a}${s}`:t?`</${o}>`:`<${o} is="${a}"${s}`})},Ye=({tagName:e,is:t,element:n})=>n?t:`${e}[is="${t}"]`,et=()=>Qe,tt=e=>{Qe=e},nt={useCallback:(e,t)=>Ve(()=>e,t),useContext:e=>{const{hook:t,args:n}=$e,r=Te.get(e),s={hook:t,args:n};return r.some(Re,s)||r.push(s),e.value},useEffect:Ie,useLayoutEffect:Be,useMemo:Ve,useReducer:(e,t,n,r)=>{const s="function"==typeof n,o=Se(s?n(t):t,s?r:n);return[o[0],t=>{o[1](e(o[0],t))}]},useRef:e=>{const t=$e.i++,{stack:n,length:r}=$e;return t===r&&($e.length=n.push({current:e})),n[t]},useState:Se},{render:rt,html:st,svg:ot}=(e=>{const t=X(ue);return ee(e).forEach(n=>{t[n]=e[n](t[n]||("convert"===n?c:String))}),n.prototype=t,he(n);function n(){return ce.apply(this,arguments)}})({transform:()=>e=>Xe(e,Je)}),{defineProperties:at}=Object,it=new WeakMap,ct=new WeakMap,lt=new WeakMap,ut=new WeakSet,ft="attributeChangedCallback",ht="connectedCallback",pt=`dis${ht}`,dt=(e,t,n)=>{if(n in e){const r=e[n];t[n]={configurable:!0,value(){return Ct.call(this),r.apply(this,arguments)}}}else t[n]={configurable:!0,value:Ct}},gt=e=>{const{prototype:t}=e,n=[],r={html:{configurable:!0,get:Et},svg:{configurable:!0,get:Nt}};if(r["_🔥"]={value:{events:n,info:null}},"handleEvent"in t||(r.handleEvent={configurable:!0,value:At}),"render"in t&&t.render.length){const{oninit:e}=t;at(t,{oninit:{configurable:!0,value(){const t=_e(this.render.bind(this,nt));at(this,{render:{configurable:!0,value:t}}),this.addEventListener("disconnected",He.bind(null,t),!1),e&&e.apply(this,arguments)}}})}"oninit"in t&&(n.push("init"),dt(t,r,"render")),dt(t,r,ft),dt(t,r,ht),dt(t,r,pt),[[ft,"onattributechanged",$t],[ht,"onconnected",_t],[pt,"ondisconnected",jt],[ht,"render",Lt]].forEach(([e,s,o])=>{if(!(e in t)&&s in t)if("render"!==s&&n.push(s.slice(2)),e in r){const t=r[e].value;r[e]={configurable:!0,value(){return t.apply(this,arguments),o.apply(this,arguments)}}}else r[e]={configurable:!0,value:o}});const s=e.booleanAttributes||[];s.forEach(e=>{e in t||(r[e]={configurable:!0,get(){return this.hasAttribute(e)},set(t){t&&"false"!==t?this.setAttribute(e,t):this.removeAttribute(e)}})});const o=e.observedAttributes||[];o.forEach(e=>{e in t||(r[e]={configurable:!0,get(){return this.getAttribute(e)},set(t){null==t?this.removeAttribute(e):this.setAttribute(e,t)}})}),(e.mappedAttributes||[]).forEach(e=>{const s=new WeakMap,o="on"+e in t;o&&n.push(e),r[e]={configurable:!0,get(){return s.get(this)},set(t){if(s.set(this,t),o){const n=vt(e);if(n.detail=t,ut.has(this))this.dispatchEvent(n);else{const e=lt.get(this);e?e.push(n):lt.set(this,[n])}}}}}),at(t,r);const a=s.concat(o);return a.length?at(e,{observedAttributes:{configurable:!0,get:()=>a}}):e},vt=e=>new Event(e),mt=(...e)=>new be("html",e);mt.for=st.for;const yt=(...e)=>new be("svg",e);yt.for=ot.for;const bt=(e,t,n)=>{const r=wt(e,t,new WeakMap);return n.set(e,r),r},wt=(e,t,n)=>(r,...s)=>{const o=r,a=n.get(o)||((e,t,{info:n})=>{const r=n?Xe(t.join("_🔥"),n).split("_🔥"):t;return e.set(t,r),r})(n,o,e["_🔥"]);return rt(e,()=>t(a,...s))};function kt(e){this.addEventListener(e,this)}function xt(e){this.dispatchEvent(e)}function Et(){return it.get(this)||bt(this,mt,it)}function Nt(){return ct.get(this)||bt(this,yt,ct)}function At(e){this[`on${e.type}`](e)}function Ct(){if(!ut.has(this)){ut.add(this),this["_🔥"].events.forEach(kt,this),this.dispatchEvent(vt("init"));const e=lt.get(this);e&&(lt.delete(this),e.forEach(xt,this))}}function $t(e,t,n){const r=vt("attributechanged");r.attributeName=e,r.oldValue=t,r.newValue=n,this.dispatchEvent(r)}function _t(){this.dispatchEvent(vt("connected"))}function Lt(){this.render()}function jt(){this.dispatchEvent(vt("disconnected"))}const{create:Mt,defineProperty:Ot,defineProperties:St,getOwnPropertyNames:Tt,getOwnPropertySymbols:Wt,getOwnPropertyDescriptor:Zt,keys:Rt}=Object,zt={element:HTMLElement},Dt=new WeakMap,Pt=new WeakMap,Ht=new WeakMap,Ft=(e,t)=>("string"==typeof e?Bt(e,t,""):Bt(e.name,e,"")).Class,It=e=>{const t=Mt(null),n=Mt(null),r={prototype:n,statics:t};return Tt(e).concat(Wt(e)).forEach(r=>{const s=Zt(e,r);switch(s.enumerable=!1,r){case"extends":r="tagName";case"contains":case"includes":case"name":case"booleanAttributes":case"mappedAttributes":case"observedAttributes":case"style":case"tagName":t[r]=s;break;default:n[r]=s}}),r},Bt=(e,t,n)=>{if(!/^([A-Z][A-Za-z0-9_]*)(<([A-Za-z0-9:._-]+)>|:([A-Za-z0-9:._-]+))?$/.test(e))throw"Invalid name";const{$1:r,$3:s,$4:o}=RegExp;let a=s||o||t.tagName||t.extends||"element";const i="fragment"===a;if(i)a="element";else if(!/^[A-Za-z0-9:._-]+$/.test(a))throw"Invalid tag";let c="",l="";/*! (c) Andrea Giammarchi - ISC */var u;a.indexOf("-")<0?(c=r.replace(/([A-Z])([A-Z][a-z])/g,u="$1"+(u||"-")+"$2").replace(/([a-z])([A-Z])/g,u).toLowerCase()+n,c.indexOf("-")<0&&(l="-heresy")):(c=a+n,a="element");const f=c+l;if(customElements.get(f))throw`Duplicated ${f} definition`;const h=Ue("object"==typeof t?Ht.get(t)||((e,t)=>{const{statics:n,prototype:r}=It(e),s=Ue(zt[t]||(zt[t]=document.createElement(t).constructor),!1);return St(s.prototype,r),St(s,n),Ht.set(e,gt(s)),s})(t,a):Dt.get(t)||(e=>{const t=Ue(e,!1);return Dt.set(e,gt(t)),t})(t),!0),p="element"===a;if(Ot(h,"new",{value:p?()=>document.createElement(f):()=>document.createElement(a,{is:f})}),Ot(h.prototype,"is",{value:f}),""===n){const e=(e=>{const{length:t}=e;let n=0,r=0;for(;r<t;)n=(n<<5)-n+e.charCodeAt(r++),n&=n;return n.toString(36)})(c.toUpperCase());Je.map[r]=Gt(h,a,f,{id:e,i:0}),Je.re=Ke(Rt(Je.map))}if(i){const{render:e}=h.prototype;Ot(h.prototype,"render",{configurable:!0,value(){if(e&&e.apply(this,arguments),this.parentNode){const e=document.createRange();e.setStartBefore(this.firstChild),e.setEndAfter(this.lastChild),this.parentNode.replaceChild(e.extractContents(),this)}}})}const d=[f,h];return p||d.push({extends:a}),customElements.define(...d),{Class:h,is:f,name:r,tagName:a}};let Vt=Math.random();const qt=e=>{let t=Pt.get(e);if(!t){const n=("Heresy"+ ++Vt).replace(/[^He-y0-9]/g,"");Pt.set(e,t=Ft(n,e))}return()=>t.new()},Gt=(e,t,n,r)=>{const{prototype:s}=e,o=((e,t)=>({tagName:e,is:t,element:"element"===e}))(t,n),a=[Ye(o)],i=e.includes||e.contains;if(i){const e={};Rt(i).forEach(t=>{const n=`-${r.id}-${r.i++}`,{Class:s,is:o,name:c,tagName:l}=Bt(t,i[t],n);a.push(Ye(e[c]=Gt(s,l,o,r)))});const t=Ke(Rt(e)),{events:n}=s["_🔥"],o={events:n,info:{map:e,re:t}};if(Ot(s,"_🔥",{value:o}),"render"in s){const{render:e}=s,{info:t}=o;Ot(s,"render",{configurable:!0,value(){const n=et();tt(t);const r=e.apply(this,arguments);return tt(n),r}})}}return"style"in e&&(e=>{if((e||"").length){const t=document.createElement("style");t.type="text/css",t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e));const n=document.head||document.querySelector("head");n.insertBefore(t,n.lastChild)}})(e.style(...a)),o};return e.contextual=e=>{let t=!0,n=null;const r=_e((function(){return e.apply(n,arguments)}));return function e(){const s=r.apply(n=this,arguments);return t&&(t=!t,Fe(r)&&ze.set(e,ze.get(r))),s}},e.createContext=e=>{const t={value:e,provide:Ze};return Te.set(t,[]),t},e.define=Ft,e.defineHook=(e,t)=>{if(e in nt)throw new Error("duplicated hook "+e);nt[e]=t(nt)},e.html=mt,e.ref=(e,t)=>e?e[t]||(e[t]={current:null}):{current:null},e.render=(e,t)=>rt(e,"function"==typeof t?t:t instanceof be?()=>t:qt(t)),e.svg=yt,e}({});