@nent/core
Version:
5 lines • 11.8 kB
JavaScript
/*!
* NENT 2022
*/
let e,t,n,l=!1,o=!1,s=!1,r=!1,i=null,c=!1;const f="undefined"!=typeof window?window:{},u=f.document||{head:{}},a={t:0,l:"",jmp:e=>e(),raf:e=>requestAnimationFrame(e),ael:(e,t,n,l)=>e.addEventListener(t,n,l),rel:(e,t,n,l)=>e.removeEventListener(t,n,l),ce:(e,t)=>new CustomEvent(e,t)},$=e=>Promise.resolve(e),d=(()=>{try{return new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync}catch(e){}return!1})(),p=(e,t,n)=>{n&&n.map((([n,l,o])=>{const s=h(e,n),r=m(t,o),i=w(n);a.ael(s,l,r,i),(t.o=t.o||[]).push((()=>a.rel(s,l,r,i)))}))},m=(e,t)=>n=>{try{256&e.t?e.i[t](n):(e.u=e.u||[]).push([t,n])}catch(e){ae(e)}},h=(e,t)=>16&t?u.body:e,w=e=>0!=(2&e),b="http://www.w3.org/1999/xlink",y=new WeakMap,g=e=>"sc-"+e.$,k={},v=e=>"object"==(e=typeof e)||"function"===e,j=(e,t,...n)=>{let l=null,o=null,s=null,r=!1,i=!1;const c=[],f=t=>{for(let n=0;n<t.length;n++)l=t[n],Array.isArray(l)?f(l):null!=l&&"boolean"!=typeof l&&((r="function"!=typeof e&&!v(l))&&(l+=""),r&&i?c[c.length-1].p+=l:c.push(r?S(null,l):l),i=r)};if(f(n),t){t.key&&(o=t.key),t.name&&(s=t.name);{const e=t.className||t.class;e&&(t.class="object"!=typeof e?e:Object.keys(e).filter((t=>e[t])).join(" "))}}const u=S(e,null);return u.m=t,c.length>0&&(u.h=c),u.g=o,u.k=s,u},S=(e,t)=>({t:0,v:e,p:t,j:null,h:null,m:null,g:null,k:null}),O={},M=(e,t,n,l,o,s)=>{if(n!==l){let r=ue(e,t),i=t.toLowerCase();if("class"===t){const t=e.classList,o=R(n),s=R(l);t.remove(...o.filter((e=>e&&!s.includes(e)))),t.add(...s.filter((e=>e&&!o.includes(e))))}else if("style"===t){for(const t in n)l&&null!=l[t]||(t.includes("-")?e.style.removeProperty(t):e.style[t]="");for(const t in l)n&&l[t]===n[t]||(t.includes("-")?e.style.setProperty(t,l[t]):e.style[t]=l[t])}else if("key"===t);else if("ref"===t)l&&l(e);else if(r||"o"!==t[0]||"n"!==t[1]){const c=v(l);if((r||c&&null!==l)&&!o)try{if(e.tagName.includes("-"))e[t]=l;else{const o=null==l?"":l;"list"===t?r=!1:null!=n&&e[t]==o||(e[t]=o)}}catch(e){}let f=!1;i!==(i=i.replace(/^xlink\:?/,""))&&(t=i,f=!0),null==l||!1===l?!1===l&&""!==e.getAttribute(t)||(f?e.removeAttributeNS(b,t):e.removeAttribute(t)):(!r||4&s||o)&&!c&&(l=!0===l?"":l,f?e.setAttributeNS(b,t,l):e.setAttribute(t,l))}else t="-"===t[2]?t.slice(3):ue(f,i)?i.slice(2):i[2]+t.slice(3),n&&a.rel(e,t,n,!1),l&&a.ael(e,t,l,!1)}},C=/\s/,R=e=>e?e.split(C):[],x=(e,t,n,l)=>{const o=11===t.j.nodeType&&t.j.host?t.j.host:t.j,s=e&&e.m||k,r=t.m||k;for(l in s)l in r||M(o,l,s[l],void 0,n,t.t);for(l in r)M(o,l,s[l],r[l],n,t.t)},P=(o,i,c,f)=>{const a=i.h[c];let $,d,p,m=0;if(l||(s=!0,"slot"===a.v&&(e&&f.classList.add(e+"-s"),a.t|=a.h?2:1)),null!==a.p)$=a.j=u.createTextNode(a.p);else if(1&a.t)$=a.j=u.createTextNode("");else{if(r||(r="svg"===a.v),$=a.j=u.createElementNS(r?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",2&a.t?"slot-fb":a.v),r&&"foreignObject"===a.v&&(r=!1),x(null,a,r),null!=e&&$["s-si"]!==e&&$.classList.add($["s-si"]=e),a.h)for(m=0;m<a.h.length;++m)d=P(o,a,m,$),d&&$.appendChild(d);"svg"===a.v?r=!1:"foreignObject"===$.tagName&&(r=!0)}return $["s-hn"]=n,3&a.t&&($["s-sr"]=!0,$["s-cr"]=t,$["s-sn"]=a.k||"",p=o&&o.h&&o.h[c],p&&p.v===a.v&&o.j&&T(o.j,!1)),$},T=(e,t)=>{a.t|=1;const l=e.childNodes;for(let e=l.length-1;e>=0;e--){const o=l[e];o["s-hn"]!==n&&o["s-ol"]&&(A(o).insertBefore(o,E(o)),o["s-ol"].remove(),o["s-ol"]=void 0,s=!0),t&&T(o,t)}a.t&=-2},L=(e,t,l,o,s,r)=>{let i,c=e["s-cr"]&&e["s-cr"].parentNode||e;for(c.shadowRoot&&c.tagName===n&&(c=c.shadowRoot);s<=r;++s)o[s]&&(i=P(null,l,s,e),i&&(o[s].j=i,c.insertBefore(i,E(t))))},N=(e,t,n,l,s)=>{for(;t<=n;++t)(l=e[t])&&(s=l.j,V(l),o=!0,s["s-ol"]?s["s-ol"].remove():T(s,!0),s.remove())},W=(e,t)=>e.v===t.v&&("slot"===e.v?e.k===t.k:e.g===t.g),E=e=>e&&e["s-ol"]||e,A=e=>(e["s-ol"]?e["s-ol"]:e).parentNode,D=(e,t)=>{const n=t.j=e.j,l=e.h,o=t.h,s=t.v,i=t.p;let c;null===i?(r="svg"===s||"foreignObject"!==s&&r,"slot"===s||x(e,t,r),null!==l&&null!==o?((e,t,n,l)=>{let o,s,r=0,i=0,c=0,f=0,u=t.length-1,a=t[0],$=t[u],d=l.length-1,p=l[0],m=l[d];for(;r<=u&&i<=d;)if(null==a)a=t[++r];else if(null==$)$=t[--u];else if(null==p)p=l[++i];else if(null==m)m=l[--d];else if(W(a,p))D(a,p),a=t[++r],p=l[++i];else if(W($,m))D($,m),$=t[--u],m=l[--d];else if(W(a,m))"slot"!==a.v&&"slot"!==m.v||T(a.j.parentNode,!1),D(a,m),e.insertBefore(a.j,$.j.nextSibling),a=t[++r],m=l[--d];else if(W($,p))"slot"!==a.v&&"slot"!==m.v||T($.j.parentNode,!1),D($,p),e.insertBefore($.j,a.j),$=t[--u],p=l[++i];else{for(c=-1,f=r;f<=u;++f)if(t[f]&&null!==t[f].g&&t[f].g===p.g){c=f;break}c>=0?(s=t[c],s.v!==p.v?o=P(t&&t[i],n,c,e):(D(s,p),t[c]=void 0,o=s.j),p=l[++i]):(o=P(t&&t[i],n,i,e),p=l[++i]),o&&A(a.j).insertBefore(o,E(a.j))}r>u?L(e,null==l[d+1]?null:l[d+1].j,n,l,i,d):i>d&&N(t,r,u)})(n,l,t,o):null!==o?(null!==e.p&&(n.textContent=""),L(n,null,t,o,0,o.length-1)):null!==l&&N(l,0,l.length-1),r&&"svg"===s&&(r=!1)):(c=n["s-cr"])?c.parentNode.textContent=i:e.p!==i&&(n.data=i)},F=e=>{const t=e.childNodes;let n,l,o,s,r,i;for(l=0,o=t.length;l<o;l++)if(n=t[l],1===n.nodeType){if(n["s-sr"])for(r=n["s-sn"],n.hidden=!1,s=0;s<o;s++)if(i=t[s].nodeType,t[s]["s-hn"]!==n["s-hn"]||""!==r){if(1===i&&r===t[s].getAttribute("slot")){n.hidden=!0;break}}else if(1===i||3===i&&""!==t[s].textContent.trim()){n.hidden=!0;break}F(n)}},H=[],U=e=>{let t,n,l,s,r,i,c=0;const f=e.childNodes,u=f.length;for(;c<u;c++){if(t=f[c],t["s-sr"]&&(n=t["s-cr"])&&n.parentNode)for(l=n.parentNode.childNodes,s=t["s-sn"],i=l.length-1;i>=0;i--)n=l[i],n["s-cn"]||n["s-nr"]||n["s-hn"]===t["s-hn"]||(q(n,s)?(r=H.find((e=>e.S===n)),o=!0,n["s-sn"]=n["s-sn"]||s,r?r.O=t:H.push({O:t,S:n}),n["s-sr"]&&H.map((e=>{q(e.S,n["s-sn"])&&(r=H.find((e=>e.S===n)),r&&!e.O&&(e.O=r.O))}))):H.some((e=>e.S===n))||H.push({S:n}));1===t.nodeType&&U(t)}},q=(e,t)=>1===e.nodeType?null===e.getAttribute("slot")&&""===t||e.getAttribute("slot")===t:e["s-sn"]===t||""===t,V=e=>{e.m&&e.m.ref&&e.m.ref(null),e.h&&e.h.map(V)},_=e=>ie(e).M,z=(e,t,n)=>{const l=_(e);return{emit:e=>B(l,t,{bubbles:!!(4&n),composed:!!(2&n),cancelable:!!(1&n),detail:e})}},B=(e,t,n)=>{const l=a.ce(t,n);return e.dispatchEvent(l),l},G=(e,t)=>{t&&!e.C&&t["s-p"]&&t["s-p"].push(new Promise((t=>e.C=t)))},I=(e,t)=>{if(e.t|=16,!(4&e.t))return G(e,e.R),ke((()=>J(e,t)));e.t|=512},J=(e,t)=>{const n=e.i;let l;return t&&(e.t|=256,e.u&&(e.u.map((([e,t])=>te(n,e,t))),e.u=null),l=te(n,"componentWillLoad")),l=ne(l,(()=>te(n,"componentWillRender"))),ne(l,(()=>K(e,n,t)))},K=async(e,t,n)=>{const l=e.M,o=l["s-rc"];n&&(e=>{const t=e.P,n=e.M,l=t.t,o=((e,t)=>{let n=g(t);const l=pe.get(n);if(e=11===e.nodeType?e:u,l)if("string"==typeof l){let t,o=y.get(e=e.head||e);o||y.set(e,o=new Set),o.has(n)||(t=u.createElement("style"),t.innerHTML=l,e.insertBefore(t,e.querySelector("link")),o&&o.add(n))}else e.adoptedStyleSheets.includes(l)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,l]);return n})(n.shadowRoot?n.shadowRoot:n.getRootNode(),t);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(e);Q(e,t),o&&(o.map((e=>e())),l["s-rc"]=void 0);{const t=l["s-p"],n=()=>Y(e);0===t.length?n():(Promise.all(t).then(n),e.t|=4,t.length=0)}},Q=(r,c)=>{try{i=c,c=c.render&&c.render(),r.t&=-17,r.t|=2,((r,i)=>{const c=r.M,f=r.P,$=r.T||S(null,null),d=(e=>e&&e.v===O)(i)?i:j(null,null,i);if(n=c.tagName,f.L&&(d.m=d.m||{},f.L.map((([e,t])=>d.m[t]=c[e]))),d.v=null,d.t|=4,r.T=d,d.j=$.j=c.shadowRoot||c,e=c["s-sc"],t=c["s-cr"],l=0!=(1&f.t),o=!1,D($,d),a.t|=1,s){let e,t,n,l,o,s;U(d.j);let r=0;for(;r<H.length;r++)e=H[r],t=e.S,t["s-ol"]||(n=u.createTextNode(""),n["s-nr"]=t,t.parentNode.insertBefore(t["s-ol"]=n,t));for(r=0;r<H.length;r++)if(e=H[r],t=e.S,e.O){for(l=e.O.parentNode,o=e.O.nextSibling,n=t["s-ol"];n=n.previousSibling;)if(s=n["s-nr"],s&&s["s-sn"]===t["s-sn"]&&l===s.parentNode&&(s=s.nextSibling,!s||!s["s-nr"])){o=s;break}(!o&&l!==t.parentNode||t.nextSibling!==o)&&t!==o&&(!t["s-hn"]&&t["s-ol"]&&(t["s-hn"]=t["s-ol"].parentNode.nodeName),l.insertBefore(t,o))}else 1===t.nodeType&&(t.hidden=!0)}o&&F(d.j),a.t&=-2,H.length=0})(r,c)}catch(e){ae(e,r.M)}return i=null,null},X=()=>i,Y=e=>{const t=e.M,n=e.i,l=e.R;te(n,"componentDidRender"),64&e.t||(e.t|=64,le(t),te(n,"componentDidLoad"),e.N(t),l||ee()),e.W(t),e.C&&(e.C(),e.C=void 0),512&e.t&&ge((()=>I(e,!1))),e.t&=-517},Z=e=>{{const t=ie(e),n=t.M.isConnected;return n&&2==(18&t.t)&&I(t,!1),n}},ee=()=>{le(u.documentElement),ge((()=>B(f,"appload",{detail:{namespace:"nent"}})))},te=(e,t,n)=>{if(e&&e[t])try{return e[t](n)}catch(e){ae(e)}},ne=(e,t)=>e&&e.then?e.then(t):t(),le=e=>e.classList.add("hydrated"),oe=(e,t,n)=>{if(t.A){const l=Object.entries(t.A),o=e.prototype;if(l.map((([e,[l]])=>{31&l||2&n&&32&l?Object.defineProperty(o,e,{get(){return((e,t)=>ie(this).D.get(t))(0,e)},set(n){((e,t,n,l)=>{const o=ie(e),s=o.D.get(t),r=o.t,i=o.i;n=((e,t)=>null==e||v(e)?e:4&t?"false"!==e&&(""===e||!!e):2&t?parseFloat(e):1&t?e+"":e)(n,l.A[t][0]),8&r&&void 0!==s||n===s||Number.isNaN(s)&&Number.isNaN(n)||(o.D.set(t,n),i&&2==(18&r)&&I(o,!1))})(this,e,n,t)},configurable:!0,enumerable:!0}):1&n&&64&l&&Object.defineProperty(o,e,{value(...t){const n=ie(this);return n.F.then((()=>n.i[e](...t)))}})})),1&n){const n=new Map;o.attributeChangedCallback=function(e,t,l){a.jmp((()=>{const t=n.get(e);if(this.hasOwnProperty(t))l=this[t],delete this[t];else if(o.hasOwnProperty(t)&&"number"==typeof this[t]&&this[t]==l)return;this[t]=(null!==l||"boolean"!=typeof this[t])&&l}))},e.observedAttributes=l.filter((([e,t])=>15&t[0])).map((([e,l])=>{const o=l[1]||e;return n.set(o,e),512&l[0]&&t.L.push([e,o]),o}))}}return e},se=(e,t={})=>{const n=t.exclude||[],l=f.customElements,o=[];let s,r=!0;Object.assign(a,t),a.l=new URL(t.resourcesUrl||"./",u.baseURI).href,e.map((e=>{e[1].map((t=>{const i={t:t[0],$:t[1],A:t[2],H:t[3]};i.A=t[2],i.H=t[3],i.L=[];const c=i.$,f=class extends HTMLElement{constructor(e){super(e),fe(e=this,i),1&i.t&&e.attachShadow({mode:"open"})}connectedCallback(){s&&(clearTimeout(s),s=null),r?o.push(this):a.jmp((()=>(e=>{if(0==(1&a.t)){const t=ie(e),n=t.P,l=()=>{};if(1&t.t)p(e,t,n.H);else{t.t|=1,12&n.t&&(e=>{const t=e["s-cr"]=u.createComment("");t["s-cn"]=!0,e.insertBefore(t,e.firstChild)})(e);{let n=e;for(;n=n.parentNode||n.host;)if(n["s-p"]){G(t,t.R=n);break}}n.A&&Object.entries(n.A).map((([t,[n]])=>{if(31&n&&e.hasOwnProperty(t)){const n=e[t];delete e[t],e[t]=n}})),(async(e,t,n,l,o)=>{if(0==(32&t.t)){{if(t.t|=32,(o=de(n)).then){const e=()=>{};o=await o,e()}o.isProxied||(oe(o,n,2),o.isProxied=!0);const e=()=>{};t.t|=8;try{new o(t)}catch(e){ae(e)}t.t&=-9,e()}if(o.style){let e=o.style;const t=g(n);if(!pe.has(t)){const l=()=>{};((e,t,n)=>{let l=pe.get(e);d&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=t:l.replaceSync(t)):l=t,pe.set(e,l)})(t,e,!!(1&n.t)),l()}}}const s=t.R,r=()=>I(t,!0);s&&s["s-rc"]?s["s-rc"].push(r):r()})(0,t,n)}l()}})(this)))}disconnectedCallback(){a.jmp((()=>(()=>{if(0==(1&a.t)){const e=ie(this),t=e.i;e.o&&(e.o.map((e=>e())),e.o=void 0),te(t,"disconnectedCallback")}})()))}componentOnReady(){return ie(this).U}};i.q=e[0],n.includes(c)||l.get(c)||l.define(c,oe(f,i,1))}))})),r=!1,o.length?o.map((e=>e.connectedCallback())):a.jmp((()=>s=setTimeout(ee,30)))},re=new WeakMap,ie=e=>re.get(e),ce=(e,t)=>re.set(t.i=e,t),fe=(e,t)=>{const n={t:0,M:e,P:t,D:new Map};return n.F=new Promise((e=>n.W=e)),n.U=new Promise((e=>n.N=e)),e["s-p"]=[],e["s-rc"]=[],p(e,n,t.H),re.set(e,n)},ue=(e,t)=>t in e,ae=(e,t)=>(0,console.error)(e,t),$e=new Map,de=e=>{const t=e.$.replace(/-/g,"_"),n=e.q,l=$e.get(n);return l?l[t]:import(`./${n}.entry.js`).then((e=>($e.set(n,e),e[t])),ae)
/*!__STENCIL_STATIC_IMPORT_SWITCH__*/},pe=new Map,me=[],he=[],we=(e,t)=>n=>{e.push(n),c||(c=!0,t&&4&a.t?ge(ye):a.raf(ye))},be=e=>{for(let t=0;t<e.length;t++)try{e[t](performance.now())}catch(e){ae(e)}e.length=0},ye=()=>{be(me),be(he),(c=me.length>0)&&a.raf(ye)},ge=e=>$().then(e),ke=we(he,!0);export{O as H,_ as a,se as b,ae as c,z as d,Z as f,X as g,j as h,$ as p,ce as r,ke as w}