kritzel-stencil 0.4.4 → 0.4.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/kritzel-active-users_47.cjs.entry.js +79 -13
- package/dist/cjs/loader.cjs.js +1 -1
- package/dist/cjs/stencil.cjs.js +1 -1
- package/dist/collection/classes/core/viewport.class.js +14 -1
- package/dist/collection/components/core/kritzel-editor/kritzel-editor.js +48 -8
- package/dist/collection/components/core/kritzel-engine/kritzel-engine.js +84 -3
- package/dist/collection/constants/version.js +1 -1
- package/dist/components/index.js +1226 -1
- package/dist/components/kritzel-active-users.js +6 -1
- package/dist/components/kritzel-avatar.js +6 -1
- package/dist/components/kritzel-awareness-cursors.js +6 -1
- package/dist/components/kritzel-back-to-content.js +6 -1
- package/dist/components/kritzel-brush-style.js +64 -1
- package/dist/components/kritzel-button.js +6 -1
- package/dist/components/kritzel-color-palette.js +6 -1
- package/dist/components/kritzel-color.js +6 -1
- package/dist/components/kritzel-context-menu.js +6 -1
- package/dist/components/kritzel-controls.js +6 -1
- package/dist/components/kritzel-current-user-dialog.js +6 -1
- package/dist/components/kritzel-current-user.js +6 -1
- package/dist/components/kritzel-cursor-trail.js +6 -1
- package/dist/components/kritzel-dialog.js +6 -1
- package/dist/components/kritzel-dropdown.js +6 -1
- package/dist/components/kritzel-editor.js +4404 -1
- package/dist/components/kritzel-engine.js +6 -1
- package/dist/components/kritzel-export.js +6 -1
- package/dist/components/kritzel-font-family.js +6 -1
- package/dist/components/kritzel-font-size.js +6 -1
- package/dist/components/kritzel-font.js +6 -1
- package/dist/components/kritzel-icon.js +6 -1
- package/dist/components/kritzel-input.js +6 -1
- package/dist/components/kritzel-line-endings.js +6 -1
- package/dist/components/kritzel-loading-overlay.js +6 -1
- package/dist/components/kritzel-login-dialog.js +6 -1
- package/dist/components/kritzel-master-detail.js +6 -1
- package/dist/components/kritzel-menu-item.js +6 -1
- package/dist/components/kritzel-menu.js +6 -1
- package/dist/components/kritzel-more-menu.js +6 -1
- package/dist/components/kritzel-notification-card.js +6 -1
- package/dist/components/kritzel-numeric-input.js +6 -1
- package/dist/components/kritzel-opacity-slider.js +6 -1
- package/dist/components/kritzel-pill-tabs.js +6 -1
- package/dist/components/kritzel-portal.js +6 -1
- package/dist/components/kritzel-settings.js +6 -1
- package/dist/components/kritzel-shape-fill.js +6 -1
- package/dist/components/kritzel-share-dialog.js +6 -1
- package/dist/components/kritzel-slide-toggle.js +6 -1
- package/dist/components/kritzel-split-button.js +6 -1
- package/dist/components/kritzel-stroke-size.js +6 -1
- package/dist/components/kritzel-sync-indicator.js +6 -1
- package/dist/components/kritzel-tool-config.js +6 -1
- package/dist/components/kritzel-tooltip.js +6 -1
- package/dist/components/kritzel-utility-panel.js +6 -1
- package/dist/components/kritzel-watermark.js +6 -1
- package/dist/components/kritzel-workspace-manager.js +6 -1
- package/dist/components/kritzel-zoom-panel.js +6 -1
- package/dist/components/p-894OnDQV.js +39 -1
- package/dist/components/p-B43upypT.js +1500 -1
- package/dist/components/p-B5oHmPJb.js +97 -1
- package/dist/components/p-B6t5q-V4.js +63 -1
- package/dist/components/p-B8Xi4Clg.js +43 -1
- package/dist/components/p-BBmP8lVY.js +51726 -0
- package/dist/components/p-BDzlx2hB.js +135 -1
- package/dist/components/p-BFTU3MAI.js +7 -1
- package/dist/components/p-BFYtCsZu.js +56 -1
- package/dist/components/p-BI2ng9I_.js +62 -1
- package/dist/components/p-BTzlrIxe.js +194 -1
- package/dist/components/p-BmyTdQGy.js +1090 -1
- package/dist/components/p-BsANVili.js +150 -1
- package/dist/components/p-BxpKq94F.js +290 -1
- package/dist/components/p-C38P-Vd0.js +446 -1
- package/dist/components/p-C4NrrUfN.js +77 -1
- package/dist/components/p-CW-VyJgK.js +6 -1
- package/dist/components/p-CWRSGYOE.js +57 -1
- package/dist/components/p-CXpv9Rxe.js +106 -1
- package/dist/components/p-Ca-igU1f.js +320 -1
- package/dist/components/p-CdR76C4L.js +165 -1
- package/dist/components/p-Ch42cOeY.js +320 -0
- package/dist/components/p-ClFprFvz.js +209 -1
- package/dist/components/p-Cm33td2O.js +122 -1
- package/dist/components/p-CqLgB8JK.js +91 -1
- package/dist/components/p-Cr682JI_.js +156 -1
- package/dist/components/p-CsvMgk_f.js +62 -1
- package/dist/components/p-CwJwsRR3.js +277 -1
- package/dist/components/p-Cymum41a.js +88 -1
- package/dist/components/p-D09kgc5Q.js +94 -1
- package/dist/components/p-D30zs0kA.js +121 -1
- package/dist/components/p-D3y_Hauo.js +85 -1
- package/dist/components/p-D5jf8wAu.js +142 -1
- package/dist/components/p-D82VaHce.js +53 -1
- package/dist/components/p-DAwPPDMS.js +101 -1
- package/dist/components/p-DEBwmRTC.js +55 -1
- package/dist/components/p-DIazmg6w.js +52 -1
- package/dist/components/p-DJ88BrIW.js +70 -1
- package/dist/components/p-DJkKlUyZ.js +182 -1
- package/dist/components/p-DUYmwrWV.js +3267 -1
- package/dist/components/p-DX2nriaq.js +486 -1
- package/dist/components/p-Dd-pMvlr.js +20 -1
- package/dist/components/p-Df3BwVGy.js +299 -1
- package/dist/components/p-DgJ0ufzr.js +43 -1
- package/dist/components/p-DkUb2czk.js +70 -1
- package/dist/components/p-Dlp84thc.js +57 -1
- package/dist/components/p-JYj3Facr.js +431 -1
- package/dist/components/p-Ka7OWbnk.js +2304 -1
- package/dist/components/p-PSFAfAyd.js +49 -1
- package/dist/components/p-WUdQqYnu.js +118 -1
- package/dist/components/p-djJSnjAX.js +84 -1
- package/dist/components/p-e6Zpc9Vp.js +143 -1
- package/dist/components/p-jGOpkGDl.js +30 -1
- package/dist/components/p-pagW8YF7.js +99 -1
- package/dist/esm/kritzel-active-users_47.entry.js +79 -13
- package/dist/esm/loader.js +1 -1
- package/dist/esm/stencil.js +1 -1
- package/dist/stencil/index.esm.js +1172 -1
- package/dist/stencil/p-5b969a42.entry.js +36109 -0
- package/dist/stencil/p-DQuL1Twl.js +3 -1
- package/dist/stencil/p-Dhio9uis.js +1717 -2
- package/dist/stencil/p-fb32cd8f.entry.js +29 -1
- package/dist/stencil/p-uC7_X6yr.js +30737 -1
- package/dist/stencil/stencil.esm.js +21 -1
- package/dist/types/components/core/kritzel-editor/kritzel-editor.d.ts +2 -0
- package/dist/types/components/core/kritzel-engine/kritzel-engine.d.ts +7 -0
- package/dist/types/components.d.ts +10 -0
- package/dist/types/constants/version.d.ts +1 -1
- package/package.json +1 -1
- package/dist/components/p--Oazz-BP.js +0 -9
- package/dist/components/p-Xsiz1D5Q.js +0 -1
- package/dist/stencil/p-9abc21b9.entry.js +0 -9
|
@@ -1 +1,1500 @@
|
|
|
1
|
-
function t(t,e,n){const l="undefined"!=typeof HTMLElement?HTMLElement.prototype:null;for(;t&&t!==l;){const l=Object.getOwnPropertyDescriptor(t,e);if(l&&(!n||l.get))return l;t=Object.getPrototypeOf(t)}}var e,n=(e,n)=>{var l;Object.entries(null!=(l=n.l.t)?l:{}).map((([l,[o]])=>{if(31&o||32&o){const o=e[l],s=t(Object.getPrototypeOf(e),l,!0)||Object.getOwnPropertyDescriptor(e,l);s&&Object.defineProperty(e,l,{get(){return s.get.call(this)},set(t){s.set.call(this,t)},configurable:!0,enumerable:!0}),n.o.has(l)?e[l]=n.o.get(l):void 0!==o&&(e[l]=o)}}))},l=t=>{if(t.__stencil__getHostRef)return t.__stencil__getHostRef()},o=(t,e)=>e in t,s=(t,e)=>(0,console.error)(t,e),r=new Map,i="undefined"!=typeof window?window:{},c=i.HTMLElement||class{},u={i:0,u:"",jmp:t=>t(),raf:t=>requestAnimationFrame(t),ael:(t,e,n,l)=>t.addEventListener(e,n,l),rel:(t,e,n,l)=>t.removeEventListener(e,n,l),ce:(t,e)=>new CustomEvent(t,e)},f=(()=>{var t;let e=!1;try{null==(t=i.document)||t.addEventListener("e",null,Object.defineProperty({},"passive",{get(){e=!0}}))}catch(t){}return e})(),a=(()=>{try{return!!i.document.adoptedStyleSheets&&(new CSSStyleSheet,"function"==typeof(new CSSStyleSheet).replaceSync)}catch(t){}return!1})(),d=!!a&&(()=>!!i.document&&Object.getOwnPropertyDescriptor(i.document.adoptedStyleSheets,"length").writable)(),p=!1,h=[],b=[],m=(t,e)=>n=>{t.push(n),p||(p=!0,e&&4&u.i?$(y):u.raf(y))},v=t=>{for(let e=0;e<t.length;e++)try{t[e](performance.now())}catch(t){s(t)}t.length=0},y=()=>{v(h),v(b),(p=h.length>0)&&u.raf(y)},$=t=>Promise.resolve(undefined).then(t),g=m(b,!0),w=t=>{const e=new URL(t,u.u);return e.origin!==i.location.origin?e.href:e.pathname},j=t=>u.u=t;function O(){const t=this.attachShadow({mode:"open"});void 0===e&&(e=null),e&&(d?t.adoptedStyleSheets.push(e):t.adoptedStyleSheets=[...t.adoptedStyleSheets,e])}var S,k=new WeakMap,M=t=>"sc-"+t.p,E=t=>"object"==(t=typeof t)||"function"===t,A=(t,e,...n)=>{let l=null,o=null,s=!1,r=!1;const i=[],c=e=>{for(let n=0;n<e.length;n++)l=e[n],Array.isArray(l)?c(l):null!=l&&"boolean"!=typeof l&&((s="function"!=typeof t&&!E(l))&&(l=String(l)),s&&r?i[i.length-1].h+=l:i.push(s?C(null,l):l),r=s)};if(c(n),e){e.key&&(o=e.key);{const t=e.className||e.class;t&&(e.class="object"!=typeof t?t:Object.keys(t).filter((e=>t[e])).join(" "))}}const u=C(t,null);return u.m=e,i.length>0&&(u.v=i),u.$=o,u},C=(t,e)=>({i:0,j:t,h:null!=e?e:null,O:null,v:null,m:null,$:null}),x={},L=t=>{if(!t)return;const e=Object.keys(t);if(0===e.length)return;let n=!1;for(const l of e){if(n)break;for(const e of t[l])if("string"==typeof e){n=!0;break}}if(!n)return t;const l={};for(const n of e)l[n]=t[n].map((t=>"string"==typeof t?{[t]:0}:t));return l},N=(t,e)=>null==t||E(t)?t:4&e?"false"!==t&&(""===t||!!t):2&e?"string"==typeof t?parseFloat(t):"number"==typeof t?t:NaN:1&e?String(t):t,_=(t,e)=>{const n=t;return{emit:t=>D(n,e,{bubbles:!0,composed:!0,cancelable:!0,detail:t})}},D=(t,e,n)=>{const l=u.ce(e,n);return t.dispatchEvent(l),l},H=(t,e,n,s,r,c)=>{if(n===s)return;let f=o(t,e),a=e.toLowerCase();if("class"===e){const e=t.classList,l=R(n);let o=R(s);e.remove(...l.filter((t=>t&&!o.includes(t)))),e.add(...o.filter((t=>t&&!l.includes(t))))}else if("style"===e){for(const e in n)s&&null!=s[e]||(e.includes("-")?t.style.removeProperty(e):t.style[e]="");for(const e in s)n&&s[e]===n[e]||(e.includes("-")?t.style.setProperty(e,s[e]):t.style[e]=s[e])}else if("key"===e);else if("ref"===e)s&&Q(s,t);else if(t.__lookupSetter__(e)||"o"!==e[0]||"n"!==e[1]){if("a"===e[0]&&e.startsWith("attr:")){const n=e.slice(5);let o;{const e=l(t);if(e&&e.l&&e.l.t){const t=e.l.t[n];t&&t[1]&&(o=t[1])}}return o||(o=n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()),void(null==s||!1===s?!1===s&&""!==t.getAttribute(o)||t.removeAttribute(o):t.setAttribute(o,!0===s?"":s))}if("p"===e[0]&&e.startsWith("prop:")){const n=e.slice(5);try{t[n]=s}catch(t){}return}{const l=E(s);if((f||l&&null!==s)&&!r)try{if(t.tagName.includes("-"))t[e]!==s&&(t[e]=s);else{const l=null==s?"":s;"list"===e?f=!1:null!=n&&t[e]===l||("function"==typeof t.__lookupSetter__(e)?t[e]=l:t.setAttribute(e,l))}}catch(t){}null==s||!1===s?!1===s&&""!==t.getAttribute(e)||t.removeAttribute(e):(!f||4&c||r)&&!l&&1===t.nodeType&&t.setAttribute(e,s=!0===s?"":s)}}else if(e="-"===e[2]?e.slice(3):o(i,a)?a.slice(2):a[2]+e.slice(3),n||s){const l=e.endsWith(U);e=e.replace(W,""),n&&u.rel(t,e,n,l),s&&u.ael(t,e,s,l)}},P=/\s/,R=t=>("object"==typeof t&&t&&"baseVal"in t&&(t=t.baseVal),t&&"string"==typeof t?t.split(P):[]),U="Capture",W=new RegExp(U+"$"),F=(t,e,n)=>{const l=11===e.O.nodeType&&e.O.host?e.O.host:e.O,o=t&&t.m||{},s=e.m||{};for(const t of V(Object.keys(o)))t in s||H(l,t,o[t],void 0,n,e.i);for(const t of V(Object.keys(s)))H(l,t,o[t],s[t],n,e.i)};function V(t){return t.includes("ref")?[...t.filter((t=>"ref"!==t)),"ref"]:t}var q=!1,z=!1,T=[],Y=[],Z=(t,e,n)=>{const l=e.v[n];let o,s,r=0;if(null!=l.h)o=l.O=i.document.createTextNode(l.h);else{if(z||(z="svg"===l.j),!i.document)throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");if(o=l.O=i.document.createElementNS(z?"http://www.w3.org/2000/svg":"http://www.w3.org/1999/xhtml",l.j),z&&"foreignObject"===l.j&&(z=!1),F(null,l,z),l.v){const e="template"===l.j?o.content:o;for(r=0;r<l.v.length;++r)s=Z(t,l,r),s&&e.appendChild(s)}"svg"===l.j?z=!1:"foreignObject"===o.tagName&&(z=!0)}return o["s-hn"]=S,o},B=(t,e,n,l,o,s)=>{let r,i=t;for(i.shadowRoot&&i.tagName===S&&(i=i.shadowRoot),"template"===n.j&&(i=i.content);o<=s;++o)l[o]&&(r=Z(null,n,o),r&&(l[o].O=r,X(i,r,e)))},G=(t,e,n)=>{for(let l=e;l<=n;++l){const e=t[l];if(e){const t=e.O;K(e),t&&t.remove()}}},I=(t,e,n=!1)=>t.j===e.j&&(n?(n&&!t.$&&e.$&&(t.$=e.$),!0):t.$===e.$),J=(t,e,n=!1)=>{const l=e.O=t.O,o=t.v,s=e.v,r=e.j,i=e.h;null==i?(z="svg"===r||"foreignObject"!==r&&z,"slot"!==r||q||t.S!==e.S&&(e.O["s-sn"]=e.S||"",(t=>{u.i|=1;const e=t.closest(S.toLowerCase());if(null!=e){const n=Array.from(e.__childNodes||e.childNodes).find((t=>t["s-cr"])),l=Array.from(t.__childNodes||t.childNodes);for(const t of n?l.reverse():l)null!=t["s-sh"]&&(X(e,t,null!=n?n:null),t["s-sh"]=void 0)}u.i&=-2})(e.O.parentElement)),F(t,e,z),null!==o&&null!==s?((t,e,n,l,o=!1)=>{let s,r,i=0,c=0,u=0,f=0,a=e.length-1,d=e[0],p=e[a],h=l.length-1,b=l[0],m=l[h];const v="template"===n.j?t.content:t;for(;i<=a&&c<=h;)if(null==d)d=e[++i];else if(null==p)p=e[--a];else if(null==b)b=l[++c];else if(null==m)m=l[--h];else if(I(d,b,o))J(d,b,o),d=e[++i],b=l[++c];else if(I(p,m,o))J(p,m,o),p=e[--a],m=l[--h];else if(I(d,m,o))J(d,m,o),X(v,d.O,p.O.nextSibling),d=e[++i],m=l[--h];else if(I(p,b,o))J(p,b,o),X(v,p.O,d.O),p=e[--a],b=l[++c];else{for(u=-1,f=i;f<=a;++f)if(e[f]&&null!==e[f].$&&e[f].$===b.$){u=f;break}u>=0?(r=e[u],r.j!==b.j?s=Z(e&&e[c],n,u):(J(r,b,o),e[u]=void 0,s=r.O),b=l[++c]):(s=Z(e&&e[c],n,c),b=l[++c]),s&&X(d.O.parentNode,s,d.O)}i>a?B(t,null==l[h+1]?null:l[h+1].O,n,l,c,h):c>h&&G(e,i,a)})(l,o,e,s,n):null!==s?(null!==t.h&&(l.textContent=""),B(l,null,e,s,0,s.length-1)):!n&&null!==o&&G(o,0,o.length-1),z&&"svg"===r&&(z=!1)):t.h!==i&&(l.data=i)},K=t=>{t.m&&t.m.ref&&T.push((()=>t.m.ref(null))),t.v&&t.v.map(K)},Q=(t,e)=>{Y.push((()=>t(e)))},X=(t,e,n)=>t.__insertBefore?t.__insertBefore(e,n):null==t?void 0:t.insertBefore(e,n),tt=(t,e,n=!1)=>{const l=t.$hostElement$,o=t.l,s=t.k||C(null,null);var r;const i=(r=e)&&r.j===x?e:A(null,null,e);if(S=l.tagName,o.M&&(i.m=i.m||{},o.M.forEach((([t,e])=>{i.m[e]=l[t]}))),n&&i.m)for(const t of Object.keys(i.m))l.hasAttribute(t)&&!["key","ref","style","class"].includes(t)&&(i.m[t]=l[t]);i.j=null,i.i|=4,t.k=i,i.O=s.O=l.shadowRoot||l,q=!(!(1&o.i)||128&o.i),J(s,i,n),T.forEach((t=>t())),T.length=0,Y.forEach((t=>t())),Y.length=0},et=(t,e)=>{if(e&&!t.A&&e["s-p"]){const n=e["s-p"].push(new Promise((l=>t.A=()=>{e["s-p"].splice(n-1,1),l()})))}},nt=(t,e)=>{if(t.i|=16,4&t.i)return void(t.i|=512);et(t,t.C);const n=()=>lt(t,e);if(!e)return g(n);queueMicrotask((()=>{n()}))},lt=(t,e)=>{const n=t.$hostElement$,l=n;if(!l)throw new Error(`Can't render component <${n.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`);let o;return o=ft(l,e?"componentWillLoad":"componentWillUpdate",void 0,n),o=ot(o,(()=>ft(l,"componentWillRender",void 0,n))),ot(o,(()=>rt(t,l,e)))},ot=(t,e)=>st(t)?t.then(e).catch((t=>{console.error(t),e()})):e(),st=t=>t instanceof Promise||t&&t.then&&"function"==typeof t.then,rt=async(t,e,n)=>{var l;const o=t.$hostElement$,s=o["s-rc"];n&&(t=>{const e=t.l,n=t.$hostElement$,l=e.i,o=((t,e)=>{var n,l,o;const s=M(e),c=r.get(s);if(!i.document)return s;if(t=11===t.nodeType?t:i.document,c)if("string"==typeof c){let o,r=k.get(t=t.head||t);if(r||k.set(t,r=new Set),!r.has(s)){o=i.document.createElement("style"),o.textContent=c;const f=null!=(n=u.L)?n:function(){var t,e,n;return null!=(n=null==(e=null==(t=i.document.head)?void 0:t.querySelector('meta[name="csp-nonce"]'))?void 0:e.getAttribute("content"))?n:void 0}();if(null!=f&&o.setAttribute("nonce",f),!(1&e.i))if("HEAD"===t.nodeName){const e=t.querySelectorAll("link[rel=preconnect]"),n=e.length>0?e[e.length-1].nextSibling:t.querySelector("style");t.insertBefore(o,(null==n?void 0:n.parentNode)===t?n:null)}else if("host"in t)if(a){const e=new(null!=(l=t.defaultView)?l:t.ownerDocument.defaultView).CSSStyleSheet;e.replaceSync(c),d?t.adoptedStyleSheets.unshift(e):t.adoptedStyleSheets=[e,...t.adoptedStyleSheets]}else{const e=t.querySelector("style");e?e.textContent=c+e.textContent:t.prepend(o)}else t.append(o);1&e.i&&t.insertBefore(o,null),4&e.i&&(o.textContent+="slot-fb{display:contents}slot-fb[hidden]{display:none}"),r&&r.add(s)}}else{let e=k.get(t);if(e||k.set(t,e=new Set),!e.has(s)){const n=null!=(o=t.defaultView)?o:t.ownerDocument.defaultView;let l;if(c.constructor===n.CSSStyleSheet)l=c;else{l=new n.CSSStyleSheet;for(let t=0;t<c.cssRules.length;t++)l.insertRule(c.cssRules[t].cssText,t)}d?t.adoptedStyleSheets.push(l):t.adoptedStyleSheets=[...t.adoptedStyleSheets,l],e.add(s)}}return s})(n.shadowRoot?n.shadowRoot:n.getRootNode(),e);10&l&&(n["s-sc"]=o,n.classList.add(o+"-h"))})(t);it(t,e,o,n),s&&(s.map((t=>t())),o["s-rc"]=void 0);{const e=null!=(l=o["s-p"])?l:[],n=()=>ct(t);0===e.length?n():(Promise.all(e).then(n).catch(n),t.i|=4,e.length=0)}},it=(t,e,n,l)=>{try{e=e.render(),t.i&=-17,t.i|=2,tt(t,e,l)}catch(e){s(e,t.$hostElement$)}return null},ct=t=>{const e=t.$hostElement$,n=e,l=t.C;ft(n,"componentDidRender",void 0,e),64&t.i?ft(n,"componentDidUpdate",void 0,e):(t.i|=64,at(e),ft(n,"componentDidLoad",void 0,e),t.N(e),l||ut()),t.A&&(t.A(),t.A=void 0),512&t.i&&$((()=>nt(t,!1))),t.i&=-517},ut=()=>{$((()=>D(i,"appload",{detail:{namespace:"stencil"}})))},ft=(t,e,n,l)=>{if(t&&t[e])try{return t[e](n)}catch(t){s(t,l)}},at=t=>t.classList.add("hydrated"),dt=(t,e,n,o)=>{const r=l(t);if(!r)return;const i=t,c=r.o.get(e),u=r.i,f=i;n=N(n,o.t[e][0]);const a=Number.isNaN(c)&&Number.isNaN(n);if(n!==c&&!a){if(r.o.set(e,n),o._){const t=o._[e];t&&t.map((t=>{try{const[[l,o]]=Object.entries(t);(128&u||1&o)&&(f?f[l](n,c,e):r.D.push((()=>{r.H[l](n,c,e)})))}catch(t){s(t,i)}}))}if(2&u){if(f.componentShouldUpdate&&!1===f.componentShouldUpdate(n,c,e)&&!(16&u))return;16&u||nt(r,!1)}}},pt=(e,n)=>{var o,s;const r=e.prototype;{e.watchers&&!n._&&(n._=L(e.watchers)),e.deserializers&&!n.P&&(n.P=e.deserializers),e.serializers&&!n.R&&(n.R=e.serializers);const i=Object.entries(null!=(o=n.t)?o:{});i.map((([e,[o]])=>{if(31&o||32&o){const{get:s,set:i}=t(r,e)||{};s&&(n.t[e][0]|=2048),i&&(n.t[e][0]|=4096),Object.defineProperty(r,e,{get(){return s?s.apply(this):(t=e,l(this).o.get(t));var t},configurable:!0,enumerable:!0}),Object.defineProperty(r,e,{set(t){const s=l(this);if(s){if(i)return void 0===(32&o?this[e]:s.$hostElement$[e])&&s.o.get(e)&&(t=s.o.get(e)),i.apply(this,[N(t,o)]),void dt(this,e,t=32&o?this[e]:s.$hostElement$[e],n);dt(this,e,t,n)}}})}}));{const t=new Map;r.attributeChangedCallback=function(e,o,s){u.jmp((()=>{var c;const u=t.get(e),f=l(this);if(this.hasOwnProperty(u),r.hasOwnProperty(u)&&"number"==typeof this[u]&&this[u]==s)return;if(null==u){const t=null==f?void 0:f.i;if(f&&t&&!(8&t)&&s!==o){const l=this,r=null==(c=n._)?void 0:c[e];null==r||r.forEach((n=>{const[[r,i]]=Object.entries(n);null!=l[r]&&(128&t||1&i)&&l[r].call(l,s,o,e)}))}return}const a=i.find((([t])=>t===u)),d=a&&4&a[1][0],p=d&&null===s&&void 0===this[u];d&&(s=null!==s&&"false"!==s);const h=Object.getOwnPropertyDescriptor(r,u);p||s==this[u]||h.get&&!h.set||(this[u]=s)}))},e.observedAttributes=Array.from(new Set([...Object.keys(null!=(s=n._)?s:{}),...i.filter((([t,e])=>31&e[0])).map((([e,l])=>{var o;const s=l[1]||e;return t.set(s,e),512&l[0]&&(null==(o=n.M)||o.push([e,s])),s}))]))}}return e},ht=(t,e)=>{const o={i:e[0],p:e[1]};try{o.t=e[2],o.U=e[3],o._=L(t._),o.P=t.P,o.R=t.R,o.M=[];const i=t.prototype.connectedCallback,c=t.prototype.disconnectedCallback;return Object.assign(t.prototype,{__hasHostListenerAttached:!1,__registerHost(){((t,e)=>{const l={i:0,$hostElement$:t,l:e,o:new Map,W:new Map};l.F=new Promise((t=>l.N=t)),t["s-p"]=[],t["s-rc"]=[];const o=l;t.__stencil__getHostRef=()=>o,512&e.i&&n(t,l)})(this,o)},connectedCallback(){if(!this.__hasHostListenerAttached){const t=l(this);if(!t)return;bt(this,t,o.U),this.__hasHostListenerAttached=!0}(t=>{if(!(1&u.i)){const e=l(t);if(!e)return;const n=e.l,o=()=>{};if(1&e.i)bt(t,e,n.U),(null==e?void 0:e.H)||(null==e?void 0:e.F)&&e.F.then((()=>{}));else{e.i|=1;{let n=t;for(;n=n.parentNode||n.host;)if(n["s-p"]){et(e,e.C=n);break}}n.t&&Object.entries(n.t).map((([e,[n]])=>{if(31&n&&Object.prototype.hasOwnProperty.call(t,e)){const n=t[e];delete t[e],t[e]=n}})),(async(t,e,n)=>{let l;try{if(!(32&e.i)&&(e.i|=32,l=t.constructor,customElements.whenDefined(t.localName).then((()=>e.i|=128)),l&&l.style)){let t;"string"==typeof l.style&&(t=l.style);const e=M(n);if(!r.has(e)){const l=()=>{};((t,e,n)=>{let l=r.get(t);a&&n?(l=l||new CSSStyleSheet,"string"==typeof l?l=e:l.replaceSync(e)):l=e,r.set(t,l)})(e,t,!!(1&n.i)),l()}}const o=e.C,s=()=>nt(e,!0);o&&o["s-rc"]?o["s-rc"].push(s):s()}catch(n){s(n,t),e.A&&(e.A(),e.A=void 0),e.N&&e.N(t)}})(t,e,n)}o()}})(this),i&&i.call(this)},disconnectedCallback(){(async t=>{if(!(1&u.i)){const e=l(t);(null==e?void 0:e.V)&&(e.V.map((t=>t())),e.V=void 0)}k.has(t)&&k.delete(t),t.shadowRoot&&k.has(t.shadowRoot)&&k.delete(t.shadowRoot)})(this),c&&c.call(this)},__attachShadow(){if(this.shadowRoot){if("open"!==this.shadowRoot.mode)throw new Error(`Unable to re-use existing shadow root for ${o.p}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`)}else O.call(this,o)}}),Object.defineProperty(t,"is",{value:o.p,configurable:!0}),pt(t,o)}catch(e){return s(e),t}},bt=(t,e,n)=>{n&&i.document&&n.map((([n,l,o])=>{const s=vt(i.document,t,n),r=mt(e,o),c=yt(n);u.ael(s,l,r,c),(e.V=e.V||[]).push((()=>u.rel(s,l,r,c)))}))},mt=(t,e)=>n=>{try{t.$hostElement$[e](n)}catch(e){s(e,t.$hostElement$)}},vt=(t,e,n)=>4&n?t:8&n?i:e,yt=t=>f?{passive:!!(1&t),capture:!!(2&t)}:!!(2&t),$t=t=>u.L=t,gt=t=>Object.assign(u,t),wt=new WeakMap;function jt(t,e){let n=wt.get(e);n||(n={i:0,l:{i:0,p:e.tagName},$hostElement$:e},wt.set(e,n)),tt(n,t)}function Ot(t){return t}export{c as H,$t as a,gt as b,_ as c,x as d,w as g,A as h,ht as p,jt as r,j as s,Ot as t}
|
|
1
|
+
const NAMESPACE = 'stencil';
|
|
2
|
+
const BUILD = /* stencil */ { hotModuleReplacement: false, hydratedSelectorName: "hydrated", lazyLoad: false, state: true, updatable: true};
|
|
3
|
+
|
|
4
|
+
/*
|
|
5
|
+
Stencil Client Platform v4.43.5 | MIT Licensed | https://stenciljs.com
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
// src/utils/constants.ts
|
|
10
|
+
var SVG_NS = "http://www.w3.org/2000/svg";
|
|
11
|
+
var HTML_NS = "http://www.w3.org/1999/xhtml";
|
|
12
|
+
|
|
13
|
+
// src/utils/get-prop-descriptor.ts
|
|
14
|
+
function getPropertyDescriptor(obj, memberName, getOnly) {
|
|
15
|
+
const stopAt = typeof HTMLElement !== "undefined" ? HTMLElement.prototype : null;
|
|
16
|
+
while (obj && obj !== stopAt) {
|
|
17
|
+
const desc = Object.getOwnPropertyDescriptor(obj, memberName);
|
|
18
|
+
if (desc && (!getOnly || desc.get)) return desc;
|
|
19
|
+
obj = Object.getPrototypeOf(obj);
|
|
20
|
+
}
|
|
21
|
+
return void 0;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// src/utils/es2022-rewire-class-members.ts
|
|
25
|
+
var reWireGetterSetter = (instance, hostRef) => {
|
|
26
|
+
var _a;
|
|
27
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
28
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
29
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
30
|
+
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
31
|
+
const ogValue = instance[memberName];
|
|
32
|
+
const ogDescriptor = getPropertyDescriptor(Object.getPrototypeOf(instance), memberName, true) || Object.getOwnPropertyDescriptor(instance, memberName);
|
|
33
|
+
if (ogDescriptor) {
|
|
34
|
+
Object.defineProperty(instance, memberName, {
|
|
35
|
+
get() {
|
|
36
|
+
return ogDescriptor.get.call(this);
|
|
37
|
+
},
|
|
38
|
+
set(newValue) {
|
|
39
|
+
ogDescriptor.set.call(this, newValue);
|
|
40
|
+
},
|
|
41
|
+
configurable: true,
|
|
42
|
+
enumerable: true
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
if (hostRef.$instanceValues$.has(memberName)) {
|
|
46
|
+
instance[memberName] = hostRef.$instanceValues$.get(memberName);
|
|
47
|
+
} else if (ogValue !== void 0) {
|
|
48
|
+
instance[memberName] = ogValue;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
// src/client/client-host-ref.ts
|
|
55
|
+
var getHostRef = (ref) => {
|
|
56
|
+
if (ref.__stencil__getHostRef) {
|
|
57
|
+
return ref.__stencil__getHostRef();
|
|
58
|
+
}
|
|
59
|
+
return void 0;
|
|
60
|
+
};
|
|
61
|
+
var registerHost = (hostElement, cmpMeta) => {
|
|
62
|
+
const hostRef = {
|
|
63
|
+
$flags$: 0,
|
|
64
|
+
$hostElement$: hostElement,
|
|
65
|
+
$cmpMeta$: cmpMeta,
|
|
66
|
+
$instanceValues$: /* @__PURE__ */ new Map(),
|
|
67
|
+
$serializerValues$: /* @__PURE__ */ new Map()
|
|
68
|
+
};
|
|
69
|
+
{
|
|
70
|
+
hostRef.$onReadyPromise$ = new Promise((r) => hostRef.$onReadyResolve$ = r);
|
|
71
|
+
hostElement["s-p"] = [];
|
|
72
|
+
hostElement["s-rc"] = [];
|
|
73
|
+
}
|
|
74
|
+
const ref = hostRef;
|
|
75
|
+
hostElement.__stencil__getHostRef = () => ref;
|
|
76
|
+
if (cmpMeta.$flags$ & 512 /* hasModernPropertyDecls */ && (BUILD.state)) {
|
|
77
|
+
reWireGetterSetter(hostElement, hostRef);
|
|
78
|
+
}
|
|
79
|
+
return ref;
|
|
80
|
+
};
|
|
81
|
+
var isMemberInElement = (elm, memberName) => memberName in elm;
|
|
82
|
+
var consoleError = (e, el) => (0, console.error)(e, el);
|
|
83
|
+
|
|
84
|
+
// src/client/client-style.ts
|
|
85
|
+
var styles = /* @__PURE__ */ new Map();
|
|
86
|
+
var SLOT_FB_CSS = "slot-fb{display:contents}slot-fb[hidden]{display:none}";
|
|
87
|
+
var win = typeof window !== "undefined" ? window : {};
|
|
88
|
+
var H = win.HTMLElement || class {
|
|
89
|
+
};
|
|
90
|
+
var plt = {
|
|
91
|
+
$flags$: 0,
|
|
92
|
+
$resourcesUrl$: "",
|
|
93
|
+
jmp: (h2) => h2(),
|
|
94
|
+
raf: (h2) => requestAnimationFrame(h2),
|
|
95
|
+
ael: (el, eventName, listener, opts) => el.addEventListener(eventName, listener, opts),
|
|
96
|
+
rel: (el, eventName, listener, opts) => el.removeEventListener(eventName, listener, opts),
|
|
97
|
+
ce: (eventName, opts) => new CustomEvent(eventName, opts)
|
|
98
|
+
};
|
|
99
|
+
var supportsListenerOptions = /* @__PURE__ */ (() => {
|
|
100
|
+
var _a;
|
|
101
|
+
let supportsListenerOptions2 = false;
|
|
102
|
+
try {
|
|
103
|
+
(_a = win.document) == null ? void 0 : _a.addEventListener(
|
|
104
|
+
"e",
|
|
105
|
+
null,
|
|
106
|
+
Object.defineProperty({}, "passive", {
|
|
107
|
+
get() {
|
|
108
|
+
supportsListenerOptions2 = true;
|
|
109
|
+
}
|
|
110
|
+
})
|
|
111
|
+
);
|
|
112
|
+
} catch (e) {
|
|
113
|
+
}
|
|
114
|
+
return supportsListenerOptions2;
|
|
115
|
+
})();
|
|
116
|
+
var promiseResolve = (v) => Promise.resolve(v);
|
|
117
|
+
var supportsConstructableStylesheets = /* @__PURE__ */ (() => {
|
|
118
|
+
try {
|
|
119
|
+
if (!win.document.adoptedStyleSheets) {
|
|
120
|
+
return false;
|
|
121
|
+
}
|
|
122
|
+
new CSSStyleSheet();
|
|
123
|
+
return typeof new CSSStyleSheet().replaceSync === "function";
|
|
124
|
+
} catch (e) {
|
|
125
|
+
}
|
|
126
|
+
return false;
|
|
127
|
+
})() ;
|
|
128
|
+
var supportsMutableAdoptedStyleSheets = supportsConstructableStylesheets ? /* @__PURE__ */ (() => !!win.document && Object.getOwnPropertyDescriptor(win.document.adoptedStyleSheets, "length").writable)() : false;
|
|
129
|
+
var queuePending = false;
|
|
130
|
+
var queueDomReads = [];
|
|
131
|
+
var queueDomWrites = [];
|
|
132
|
+
var queueTask = (queue, write) => (cb) => {
|
|
133
|
+
queue.push(cb);
|
|
134
|
+
if (!queuePending) {
|
|
135
|
+
queuePending = true;
|
|
136
|
+
if (write && plt.$flags$ & 4 /* queueSync */) {
|
|
137
|
+
nextTick(flush);
|
|
138
|
+
} else {
|
|
139
|
+
plt.raf(flush);
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
};
|
|
143
|
+
var consume = (queue) => {
|
|
144
|
+
for (let i2 = 0; i2 < queue.length; i2++) {
|
|
145
|
+
try {
|
|
146
|
+
queue[i2](performance.now());
|
|
147
|
+
} catch (e) {
|
|
148
|
+
consoleError(e);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
151
|
+
queue.length = 0;
|
|
152
|
+
};
|
|
153
|
+
var flush = () => {
|
|
154
|
+
consume(queueDomReads);
|
|
155
|
+
{
|
|
156
|
+
consume(queueDomWrites);
|
|
157
|
+
if (queuePending = queueDomReads.length > 0) {
|
|
158
|
+
plt.raf(flush);
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
};
|
|
162
|
+
var nextTick = (cb) => promiseResolve().then(cb);
|
|
163
|
+
var writeTask = /* @__PURE__ */ queueTask(queueDomWrites, true);
|
|
164
|
+
|
|
165
|
+
// src/runtime/asset-path.ts
|
|
166
|
+
var getAssetPath = (path) => {
|
|
167
|
+
const assetUrl = new URL(path, plt.$resourcesUrl$);
|
|
168
|
+
return assetUrl.origin !== win.location.origin ? assetUrl.href : assetUrl.pathname;
|
|
169
|
+
};
|
|
170
|
+
var setAssetPath = (path) => plt.$resourcesUrl$ = path;
|
|
171
|
+
|
|
172
|
+
// src/utils/style.ts
|
|
173
|
+
function createStyleSheetIfNeededAndSupported(styles2) {
|
|
174
|
+
return void 0;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
// src/utils/shadow-root.ts
|
|
178
|
+
var globalStyleSheet;
|
|
179
|
+
function createShadowRoot(cmpMeta) {
|
|
180
|
+
var _a;
|
|
181
|
+
const opts = { mode: "open" };
|
|
182
|
+
const shadowRoot = this.attachShadow(opts);
|
|
183
|
+
if (globalStyleSheet === void 0) globalStyleSheet = (_a = createStyleSheetIfNeededAndSupported()) != null ? _a : null;
|
|
184
|
+
if (globalStyleSheet) {
|
|
185
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
186
|
+
shadowRoot.adoptedStyleSheets.push(globalStyleSheet);
|
|
187
|
+
} else {
|
|
188
|
+
shadowRoot.adoptedStyleSheets = [...shadowRoot.adoptedStyleSheets, globalStyleSheet];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
var createTime = (fnName, tagName = "") => {
|
|
193
|
+
{
|
|
194
|
+
return () => {
|
|
195
|
+
return;
|
|
196
|
+
};
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
|
|
200
|
+
// src/utils/query-nonce-meta-tag-content.ts
|
|
201
|
+
function queryNonceMetaTagContent(doc) {
|
|
202
|
+
var _a, _b, _c;
|
|
203
|
+
return (_c = (_b = (_a = doc.head) == null ? void 0 : _a.querySelector('meta[name="csp-nonce"]')) == null ? void 0 : _b.getAttribute("content")) != null ? _c : void 0;
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
// src/runtime/styles.ts
|
|
207
|
+
var rootAppliedStyles = /* @__PURE__ */ new WeakMap();
|
|
208
|
+
var registerStyle = (scopeId2, cssText, allowCS) => {
|
|
209
|
+
let style = styles.get(scopeId2);
|
|
210
|
+
if (supportsConstructableStylesheets && allowCS) {
|
|
211
|
+
style = style || new CSSStyleSheet();
|
|
212
|
+
if (typeof style === "string") {
|
|
213
|
+
style = cssText;
|
|
214
|
+
} else {
|
|
215
|
+
style.replaceSync(cssText);
|
|
216
|
+
}
|
|
217
|
+
} else {
|
|
218
|
+
style = cssText;
|
|
219
|
+
}
|
|
220
|
+
styles.set(scopeId2, style);
|
|
221
|
+
};
|
|
222
|
+
var addStyle = (styleContainerNode, cmpMeta, mode) => {
|
|
223
|
+
var _a, _b, _c;
|
|
224
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
225
|
+
const style = styles.get(scopeId2);
|
|
226
|
+
if (!win.document) {
|
|
227
|
+
return scopeId2;
|
|
228
|
+
}
|
|
229
|
+
styleContainerNode = styleContainerNode.nodeType === 11 /* DocumentFragment */ ? styleContainerNode : win.document;
|
|
230
|
+
if (style) {
|
|
231
|
+
if (typeof style === "string") {
|
|
232
|
+
styleContainerNode = styleContainerNode.head || styleContainerNode;
|
|
233
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
234
|
+
let styleElm;
|
|
235
|
+
if (!appliedStyles) {
|
|
236
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
237
|
+
}
|
|
238
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
239
|
+
styleElm = win.document.createElement("style");
|
|
240
|
+
styleElm.textContent = style;
|
|
241
|
+
const nonce = (_a = plt.$nonce$) != null ? _a : queryNonceMetaTagContent(win.document);
|
|
242
|
+
if (nonce != null) {
|
|
243
|
+
styleElm.setAttribute("nonce", nonce);
|
|
244
|
+
}
|
|
245
|
+
if (!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */)) {
|
|
246
|
+
if (styleContainerNode.nodeName === "HEAD") {
|
|
247
|
+
const preconnectLinks = styleContainerNode.querySelectorAll("link[rel=preconnect]");
|
|
248
|
+
const referenceNode2 = preconnectLinks.length > 0 ? preconnectLinks[preconnectLinks.length - 1].nextSibling : styleContainerNode.querySelector("style");
|
|
249
|
+
styleContainerNode.insertBefore(
|
|
250
|
+
styleElm,
|
|
251
|
+
(referenceNode2 == null ? void 0 : referenceNode2.parentNode) === styleContainerNode ? referenceNode2 : null
|
|
252
|
+
);
|
|
253
|
+
} else if ("host" in styleContainerNode) {
|
|
254
|
+
if (supportsConstructableStylesheets) {
|
|
255
|
+
const currentWindow = (_b = styleContainerNode.defaultView) != null ? _b : styleContainerNode.ownerDocument.defaultView;
|
|
256
|
+
const stylesheet = new currentWindow.CSSStyleSheet();
|
|
257
|
+
stylesheet.replaceSync(style);
|
|
258
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
259
|
+
styleContainerNode.adoptedStyleSheets.unshift(stylesheet);
|
|
260
|
+
} else {
|
|
261
|
+
styleContainerNode.adoptedStyleSheets = [stylesheet, ...styleContainerNode.adoptedStyleSheets];
|
|
262
|
+
}
|
|
263
|
+
} else {
|
|
264
|
+
const existingStyleContainer = styleContainerNode.querySelector("style");
|
|
265
|
+
if (existingStyleContainer && true) {
|
|
266
|
+
existingStyleContainer.textContent = style + existingStyleContainer.textContent;
|
|
267
|
+
} else {
|
|
268
|
+
styleContainerNode.prepend(styleElm);
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
} else {
|
|
272
|
+
styleContainerNode.append(styleElm);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
if (cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) {
|
|
276
|
+
styleContainerNode.insertBefore(styleElm, null);
|
|
277
|
+
}
|
|
278
|
+
if (cmpMeta.$flags$ & 4 /* hasSlotRelocation */) {
|
|
279
|
+
styleElm.textContent += SLOT_FB_CSS;
|
|
280
|
+
}
|
|
281
|
+
if (appliedStyles) {
|
|
282
|
+
appliedStyles.add(scopeId2);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
} else {
|
|
286
|
+
let appliedStyles = rootAppliedStyles.get(styleContainerNode);
|
|
287
|
+
if (!appliedStyles) {
|
|
288
|
+
rootAppliedStyles.set(styleContainerNode, appliedStyles = /* @__PURE__ */ new Set());
|
|
289
|
+
}
|
|
290
|
+
if (!appliedStyles.has(scopeId2)) {
|
|
291
|
+
const currentWindow = (_c = styleContainerNode.defaultView) != null ? _c : styleContainerNode.ownerDocument.defaultView;
|
|
292
|
+
let stylesheet;
|
|
293
|
+
if (style.constructor === currentWindow.CSSStyleSheet) {
|
|
294
|
+
stylesheet = style;
|
|
295
|
+
} else {
|
|
296
|
+
stylesheet = new currentWindow.CSSStyleSheet();
|
|
297
|
+
for (let i2 = 0; i2 < style.cssRules.length; i2++) {
|
|
298
|
+
stylesheet.insertRule(style.cssRules[i2].cssText, i2);
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
if (supportsMutableAdoptedStyleSheets) {
|
|
302
|
+
styleContainerNode.adoptedStyleSheets.push(stylesheet);
|
|
303
|
+
} else {
|
|
304
|
+
styleContainerNode.adoptedStyleSheets = [...styleContainerNode.adoptedStyleSheets, stylesheet];
|
|
305
|
+
}
|
|
306
|
+
appliedStyles.add(scopeId2);
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return scopeId2;
|
|
311
|
+
};
|
|
312
|
+
var attachStyles = (hostRef) => {
|
|
313
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
314
|
+
const elm = hostRef.$hostElement$;
|
|
315
|
+
const flags = cmpMeta.$flags$;
|
|
316
|
+
const endAttachStyles = createTime("attachStyles", cmpMeta.$tagName$);
|
|
317
|
+
const scopeId2 = addStyle(
|
|
318
|
+
elm.shadowRoot ? elm.shadowRoot : elm.getRootNode(),
|
|
319
|
+
cmpMeta);
|
|
320
|
+
if (flags & 10 /* needsScopedEncapsulation */) {
|
|
321
|
+
elm["s-sc"] = scopeId2;
|
|
322
|
+
elm.classList.add(scopeId2 + "-h");
|
|
323
|
+
}
|
|
324
|
+
endAttachStyles();
|
|
325
|
+
};
|
|
326
|
+
var getScopeId = (cmp, mode) => "sc-" + (cmp.$tagName$);
|
|
327
|
+
var isComplexType = (o) => {
|
|
328
|
+
o = typeof o;
|
|
329
|
+
return o === "object" || o === "function";
|
|
330
|
+
};
|
|
331
|
+
|
|
332
|
+
// src/runtime/vdom/h.ts
|
|
333
|
+
var h = (nodeName, vnodeData, ...children) => {
|
|
334
|
+
if (typeof nodeName === "string") {
|
|
335
|
+
nodeName = transformTag(nodeName);
|
|
336
|
+
}
|
|
337
|
+
let child = null;
|
|
338
|
+
let key = null;
|
|
339
|
+
let simple = false;
|
|
340
|
+
let lastSimple = false;
|
|
341
|
+
const vNodeChildren = [];
|
|
342
|
+
const walk = (c) => {
|
|
343
|
+
for (let i2 = 0; i2 < c.length; i2++) {
|
|
344
|
+
child = c[i2];
|
|
345
|
+
if (Array.isArray(child)) {
|
|
346
|
+
walk(child);
|
|
347
|
+
} else if (child != null && typeof child !== "boolean") {
|
|
348
|
+
if (simple = typeof nodeName !== "function" && !isComplexType(child)) {
|
|
349
|
+
child = String(child);
|
|
350
|
+
}
|
|
351
|
+
if (simple && lastSimple) {
|
|
352
|
+
vNodeChildren[vNodeChildren.length - 1].$text$ += child;
|
|
353
|
+
} else {
|
|
354
|
+
vNodeChildren.push(simple ? newVNode(null, child) : child);
|
|
355
|
+
}
|
|
356
|
+
lastSimple = simple;
|
|
357
|
+
}
|
|
358
|
+
}
|
|
359
|
+
};
|
|
360
|
+
walk(children);
|
|
361
|
+
if (vnodeData) {
|
|
362
|
+
if (vnodeData.key) {
|
|
363
|
+
key = vnodeData.key;
|
|
364
|
+
}
|
|
365
|
+
{
|
|
366
|
+
const classData = vnodeData.className || vnodeData.class;
|
|
367
|
+
if (classData) {
|
|
368
|
+
vnodeData.class = typeof classData !== "object" ? classData : Object.keys(classData).filter((k) => classData[k]).join(" ");
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
const vnode = newVNode(nodeName, null);
|
|
373
|
+
vnode.$attrs$ = vnodeData;
|
|
374
|
+
if (vNodeChildren.length > 0) {
|
|
375
|
+
vnode.$children$ = vNodeChildren;
|
|
376
|
+
}
|
|
377
|
+
{
|
|
378
|
+
vnode.$key$ = key;
|
|
379
|
+
}
|
|
380
|
+
return vnode;
|
|
381
|
+
};
|
|
382
|
+
var newVNode = (tag, text) => {
|
|
383
|
+
const vnode = {
|
|
384
|
+
$flags$: 0,
|
|
385
|
+
$tag$: tag,
|
|
386
|
+
// Normalize undefined to null to prevent rendering "undefined" as text
|
|
387
|
+
$text$: text != null ? text : null,
|
|
388
|
+
$elm$: null,
|
|
389
|
+
$children$: null
|
|
390
|
+
};
|
|
391
|
+
{
|
|
392
|
+
vnode.$attrs$ = null;
|
|
393
|
+
}
|
|
394
|
+
{
|
|
395
|
+
vnode.$key$ = null;
|
|
396
|
+
}
|
|
397
|
+
return vnode;
|
|
398
|
+
};
|
|
399
|
+
var Host = {};
|
|
400
|
+
var isHost = (node) => node && node.$tag$ === Host;
|
|
401
|
+
|
|
402
|
+
// src/runtime/normalize-watchers.ts
|
|
403
|
+
var normalizeWatchers = (raw) => {
|
|
404
|
+
if (!raw) return void 0;
|
|
405
|
+
const keys = Object.keys(raw);
|
|
406
|
+
if (keys.length === 0) return void 0;
|
|
407
|
+
let hasLegacy = false;
|
|
408
|
+
for (const propName of keys) {
|
|
409
|
+
if (hasLegacy) break;
|
|
410
|
+
for (const h2 of raw[propName]) {
|
|
411
|
+
if (typeof h2 === "string") {
|
|
412
|
+
hasLegacy = true;
|
|
413
|
+
break;
|
|
414
|
+
}
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
if (!hasLegacy) return raw;
|
|
418
|
+
const out = {};
|
|
419
|
+
for (const propName of keys) {
|
|
420
|
+
out[propName] = raw[propName].map(
|
|
421
|
+
(h2) => typeof h2 === "string" ? { [h2]: 0 } : h2
|
|
422
|
+
);
|
|
423
|
+
}
|
|
424
|
+
return out;
|
|
425
|
+
};
|
|
426
|
+
|
|
427
|
+
// src/runtime/parse-property-value.ts
|
|
428
|
+
var parsePropertyValue = (propValue, propType, isFormAssociated) => {
|
|
429
|
+
if (propValue != null && !isComplexType(propValue)) {
|
|
430
|
+
if (propType & 4 /* Boolean */) {
|
|
431
|
+
{
|
|
432
|
+
return propValue === "false" ? false : propValue === "" || !!propValue;
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
if (propType & 2 /* Number */) {
|
|
436
|
+
return typeof propValue === "string" ? parseFloat(propValue) : typeof propValue === "number" ? propValue : NaN;
|
|
437
|
+
}
|
|
438
|
+
if (propType & 1 /* String */) {
|
|
439
|
+
return String(propValue);
|
|
440
|
+
}
|
|
441
|
+
return propValue;
|
|
442
|
+
}
|
|
443
|
+
return propValue;
|
|
444
|
+
};
|
|
445
|
+
var getElement = (ref) => {
|
|
446
|
+
return ref;
|
|
447
|
+
};
|
|
448
|
+
|
|
449
|
+
// src/runtime/event-emitter.ts
|
|
450
|
+
var createEvent = (ref, name, flags) => {
|
|
451
|
+
const elm = getElement(ref);
|
|
452
|
+
return {
|
|
453
|
+
emit: (detail) => {
|
|
454
|
+
return emitEvent(elm, name, {
|
|
455
|
+
bubbles: true,
|
|
456
|
+
composed: true,
|
|
457
|
+
cancelable: true,
|
|
458
|
+
detail
|
|
459
|
+
});
|
|
460
|
+
}
|
|
461
|
+
};
|
|
462
|
+
};
|
|
463
|
+
var emitEvent = (elm, name, opts) => {
|
|
464
|
+
const ev = plt.ce(name, opts);
|
|
465
|
+
elm.dispatchEvent(ev);
|
|
466
|
+
return ev;
|
|
467
|
+
};
|
|
468
|
+
var setAccessor = (elm, memberName, oldValue, newValue, isSvg, flags, initialRender) => {
|
|
469
|
+
if (oldValue === newValue) {
|
|
470
|
+
return;
|
|
471
|
+
}
|
|
472
|
+
let isProp = isMemberInElement(elm, memberName);
|
|
473
|
+
let ln = memberName.toLowerCase();
|
|
474
|
+
if (memberName === "class") {
|
|
475
|
+
const classList = elm.classList;
|
|
476
|
+
const oldClasses = parseClassList(oldValue);
|
|
477
|
+
let newClasses = parseClassList(newValue);
|
|
478
|
+
{
|
|
479
|
+
classList.remove(...oldClasses.filter((c) => c && !newClasses.includes(c)));
|
|
480
|
+
classList.add(...newClasses.filter((c) => c && !oldClasses.includes(c)));
|
|
481
|
+
}
|
|
482
|
+
} else if (memberName === "style") {
|
|
483
|
+
{
|
|
484
|
+
for (const prop in oldValue) {
|
|
485
|
+
if (!newValue || newValue[prop] == null) {
|
|
486
|
+
if (prop.includes("-")) {
|
|
487
|
+
elm.style.removeProperty(prop);
|
|
488
|
+
} else {
|
|
489
|
+
elm.style[prop] = "";
|
|
490
|
+
}
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
for (const prop in newValue) {
|
|
495
|
+
if (!oldValue || newValue[prop] !== oldValue[prop]) {
|
|
496
|
+
if (prop.includes("-")) {
|
|
497
|
+
elm.style.setProperty(prop, newValue[prop]);
|
|
498
|
+
} else {
|
|
499
|
+
elm.style[prop] = newValue[prop];
|
|
500
|
+
}
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
} else if (memberName === "key") ; else if (memberName === "ref") {
|
|
504
|
+
if (newValue) {
|
|
505
|
+
queueRefAttachment(newValue, elm);
|
|
506
|
+
}
|
|
507
|
+
} else if ((!elm.__lookupSetter__(memberName)) && memberName[0] === "o" && memberName[1] === "n") {
|
|
508
|
+
if (memberName[2] === "-") {
|
|
509
|
+
memberName = memberName.slice(3);
|
|
510
|
+
} else if (isMemberInElement(win, ln)) {
|
|
511
|
+
memberName = ln.slice(2);
|
|
512
|
+
} else {
|
|
513
|
+
memberName = ln[2] + memberName.slice(3);
|
|
514
|
+
}
|
|
515
|
+
if (oldValue || newValue) {
|
|
516
|
+
const capture = memberName.endsWith(CAPTURE_EVENT_SUFFIX);
|
|
517
|
+
memberName = memberName.replace(CAPTURE_EVENT_REGEX, "");
|
|
518
|
+
if (oldValue) {
|
|
519
|
+
plt.rel(elm, memberName, oldValue, capture);
|
|
520
|
+
}
|
|
521
|
+
if (newValue) {
|
|
522
|
+
plt.ael(elm, memberName, newValue, capture);
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
} else if (memberName[0] === "a" && memberName.startsWith("attr:")) {
|
|
526
|
+
const propName = memberName.slice(5);
|
|
527
|
+
let attrName;
|
|
528
|
+
{
|
|
529
|
+
const hostRef = getHostRef(elm);
|
|
530
|
+
if (hostRef && hostRef.$cmpMeta$ && hostRef.$cmpMeta$.$members$) {
|
|
531
|
+
const memberMeta = hostRef.$cmpMeta$.$members$[propName];
|
|
532
|
+
if (memberMeta && memberMeta[1]) {
|
|
533
|
+
attrName = memberMeta[1];
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
if (!attrName) {
|
|
538
|
+
attrName = propName.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
|
|
539
|
+
}
|
|
540
|
+
if (newValue == null || newValue === false) {
|
|
541
|
+
if (newValue !== false || elm.getAttribute(attrName) === "") {
|
|
542
|
+
elm.removeAttribute(attrName);
|
|
543
|
+
}
|
|
544
|
+
} else {
|
|
545
|
+
elm.setAttribute(attrName, newValue === true ? "" : newValue);
|
|
546
|
+
}
|
|
547
|
+
return;
|
|
548
|
+
} else if (memberName[0] === "p" && memberName.startsWith("prop:")) {
|
|
549
|
+
const propName = memberName.slice(5);
|
|
550
|
+
try {
|
|
551
|
+
elm[propName] = newValue;
|
|
552
|
+
} catch (e) {
|
|
553
|
+
}
|
|
554
|
+
return;
|
|
555
|
+
} else {
|
|
556
|
+
const isComplex = isComplexType(newValue);
|
|
557
|
+
if ((isProp || isComplex && newValue !== null) && !isSvg) {
|
|
558
|
+
try {
|
|
559
|
+
if (!elm.tagName.includes("-")) {
|
|
560
|
+
const n = newValue == null ? "" : newValue;
|
|
561
|
+
if (memberName === "list") {
|
|
562
|
+
isProp = false;
|
|
563
|
+
} else if (oldValue == null || elm[memberName] !== n) {
|
|
564
|
+
if (typeof elm.__lookupSetter__(memberName) === "function") {
|
|
565
|
+
elm[memberName] = n;
|
|
566
|
+
} else {
|
|
567
|
+
elm.setAttribute(memberName, n);
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
} else if (elm[memberName] !== newValue) {
|
|
571
|
+
elm[memberName] = newValue;
|
|
572
|
+
}
|
|
573
|
+
} catch (e) {
|
|
574
|
+
}
|
|
575
|
+
}
|
|
576
|
+
if (newValue == null || newValue === false) {
|
|
577
|
+
if (newValue !== false || elm.getAttribute(memberName) === "") {
|
|
578
|
+
{
|
|
579
|
+
elm.removeAttribute(memberName);
|
|
580
|
+
}
|
|
581
|
+
}
|
|
582
|
+
} else if ((!isProp || flags & 4 /* isHost */ || isSvg) && !isComplex && elm.nodeType === 1 /* ElementNode */) {
|
|
583
|
+
newValue = newValue === true ? "" : newValue;
|
|
584
|
+
{
|
|
585
|
+
elm.setAttribute(memberName, newValue);
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
};
|
|
590
|
+
var parseClassListRegex = /\s/;
|
|
591
|
+
var parseClassList = (value) => {
|
|
592
|
+
if (typeof value === "object" && value && "baseVal" in value) {
|
|
593
|
+
value = value.baseVal;
|
|
594
|
+
}
|
|
595
|
+
if (!value || typeof value !== "string") {
|
|
596
|
+
return [];
|
|
597
|
+
}
|
|
598
|
+
return value.split(parseClassListRegex);
|
|
599
|
+
};
|
|
600
|
+
var CAPTURE_EVENT_SUFFIX = "Capture";
|
|
601
|
+
var CAPTURE_EVENT_REGEX = new RegExp(CAPTURE_EVENT_SUFFIX + "$");
|
|
602
|
+
|
|
603
|
+
// src/runtime/vdom/update-element.ts
|
|
604
|
+
var updateElement = (oldVnode, newVnode, isSvgMode2, isInitialRender) => {
|
|
605
|
+
const elm = newVnode.$elm$.nodeType === 11 /* DocumentFragment */ && newVnode.$elm$.host ? newVnode.$elm$.host : newVnode.$elm$;
|
|
606
|
+
const oldVnodeAttrs = oldVnode && oldVnode.$attrs$ || {};
|
|
607
|
+
const newVnodeAttrs = newVnode.$attrs$ || {};
|
|
608
|
+
{
|
|
609
|
+
for (const memberName of sortedAttrNames(Object.keys(oldVnodeAttrs))) {
|
|
610
|
+
if (!(memberName in newVnodeAttrs)) {
|
|
611
|
+
setAccessor(
|
|
612
|
+
elm,
|
|
613
|
+
memberName,
|
|
614
|
+
oldVnodeAttrs[memberName],
|
|
615
|
+
void 0,
|
|
616
|
+
isSvgMode2,
|
|
617
|
+
newVnode.$flags$);
|
|
618
|
+
}
|
|
619
|
+
}
|
|
620
|
+
}
|
|
621
|
+
for (const memberName of sortedAttrNames(Object.keys(newVnodeAttrs))) {
|
|
622
|
+
setAccessor(
|
|
623
|
+
elm,
|
|
624
|
+
memberName,
|
|
625
|
+
oldVnodeAttrs[memberName],
|
|
626
|
+
newVnodeAttrs[memberName],
|
|
627
|
+
isSvgMode2,
|
|
628
|
+
newVnode.$flags$);
|
|
629
|
+
}
|
|
630
|
+
};
|
|
631
|
+
function sortedAttrNames(attrNames) {
|
|
632
|
+
return attrNames.includes("ref") ? (
|
|
633
|
+
// we need to sort these to ensure that `'ref'` is the last attr
|
|
634
|
+
[...attrNames.filter((attr) => attr !== "ref"), "ref"]
|
|
635
|
+
) : (
|
|
636
|
+
// no need to sort, return the original array
|
|
637
|
+
attrNames
|
|
638
|
+
);
|
|
639
|
+
}
|
|
640
|
+
var hostTagName;
|
|
641
|
+
var useNativeShadowDom = false;
|
|
642
|
+
var isSvgMode = false;
|
|
643
|
+
var refCallbacksToRemove = [];
|
|
644
|
+
var refCallbacksToAttach = [];
|
|
645
|
+
var createElm = (oldParentVNode, newParentVNode, childIndex) => {
|
|
646
|
+
const newVNode2 = newParentVNode.$children$[childIndex];
|
|
647
|
+
let i2 = 0;
|
|
648
|
+
let elm;
|
|
649
|
+
let childNode;
|
|
650
|
+
if (newVNode2.$text$ != null) {
|
|
651
|
+
elm = newVNode2.$elm$ = win.document.createTextNode(newVNode2.$text$);
|
|
652
|
+
} else {
|
|
653
|
+
if (!isSvgMode) {
|
|
654
|
+
isSvgMode = newVNode2.$tag$ === "svg";
|
|
655
|
+
}
|
|
656
|
+
if (!win.document) {
|
|
657
|
+
throw new Error("You are trying to render a Stencil component in an environment that doesn't support the DOM.");
|
|
658
|
+
}
|
|
659
|
+
elm = newVNode2.$elm$ = win.document.createElementNS(
|
|
660
|
+
isSvgMode ? SVG_NS : HTML_NS,
|
|
661
|
+
newVNode2.$tag$
|
|
662
|
+
) ;
|
|
663
|
+
if (isSvgMode && newVNode2.$tag$ === "foreignObject") {
|
|
664
|
+
isSvgMode = false;
|
|
665
|
+
}
|
|
666
|
+
{
|
|
667
|
+
updateElement(null, newVNode2, isSvgMode);
|
|
668
|
+
}
|
|
669
|
+
if (newVNode2.$children$) {
|
|
670
|
+
const appendTarget = newVNode2.$tag$ === "template" ? elm.content : elm;
|
|
671
|
+
for (i2 = 0; i2 < newVNode2.$children$.length; ++i2) {
|
|
672
|
+
childNode = createElm(oldParentVNode, newVNode2, i2);
|
|
673
|
+
if (childNode) {
|
|
674
|
+
appendTarget.appendChild(childNode);
|
|
675
|
+
}
|
|
676
|
+
}
|
|
677
|
+
}
|
|
678
|
+
{
|
|
679
|
+
if (newVNode2.$tag$ === "svg") {
|
|
680
|
+
isSvgMode = false;
|
|
681
|
+
} else if (elm.tagName === "foreignObject") {
|
|
682
|
+
isSvgMode = true;
|
|
683
|
+
}
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
elm["s-hn"] = hostTagName;
|
|
687
|
+
return elm;
|
|
688
|
+
};
|
|
689
|
+
var relocateToHostRoot = (parentElm) => {
|
|
690
|
+
plt.$flags$ |= 1 /* isTmpDisconnected */;
|
|
691
|
+
const host = parentElm.closest(hostTagName.toLowerCase());
|
|
692
|
+
if (host != null) {
|
|
693
|
+
const contentRefNode = Array.from(host.__childNodes || host.childNodes).find(
|
|
694
|
+
(ref) => ref["s-cr"]
|
|
695
|
+
);
|
|
696
|
+
const childNodeArray = Array.from(
|
|
697
|
+
parentElm.__childNodes || parentElm.childNodes
|
|
698
|
+
);
|
|
699
|
+
for (const childNode of contentRefNode ? childNodeArray.reverse() : childNodeArray) {
|
|
700
|
+
if (childNode["s-sh"] != null) {
|
|
701
|
+
insertBefore(host, childNode, contentRefNode != null ? contentRefNode : null);
|
|
702
|
+
childNode["s-sh"] = void 0;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
plt.$flags$ &= -2 /* isTmpDisconnected */;
|
|
707
|
+
};
|
|
708
|
+
var addVnodes = (parentElm, before, parentVNode, vnodes, startIdx, endIdx) => {
|
|
709
|
+
let containerElm = parentElm;
|
|
710
|
+
let childNode;
|
|
711
|
+
if (containerElm.shadowRoot && containerElm.tagName === hostTagName) {
|
|
712
|
+
containerElm = containerElm.shadowRoot;
|
|
713
|
+
}
|
|
714
|
+
if (parentVNode.$tag$ === "template") {
|
|
715
|
+
containerElm = containerElm.content;
|
|
716
|
+
}
|
|
717
|
+
for (; startIdx <= endIdx; ++startIdx) {
|
|
718
|
+
if (vnodes[startIdx]) {
|
|
719
|
+
childNode = createElm(null, parentVNode, startIdx);
|
|
720
|
+
if (childNode) {
|
|
721
|
+
vnodes[startIdx].$elm$ = childNode;
|
|
722
|
+
insertBefore(containerElm, childNode, before);
|
|
723
|
+
}
|
|
724
|
+
}
|
|
725
|
+
}
|
|
726
|
+
};
|
|
727
|
+
var removeVnodes = (vnodes, startIdx, endIdx) => {
|
|
728
|
+
for (let index = startIdx; index <= endIdx; ++index) {
|
|
729
|
+
const vnode = vnodes[index];
|
|
730
|
+
if (vnode) {
|
|
731
|
+
const elm = vnode.$elm$;
|
|
732
|
+
nullifyVNodeRefs(vnode);
|
|
733
|
+
if (elm) {
|
|
734
|
+
elm.remove();
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
}
|
|
738
|
+
};
|
|
739
|
+
var updateChildren = (parentElm, oldCh, newVNode2, newCh, isInitialRender = false) => {
|
|
740
|
+
let oldStartIdx = 0;
|
|
741
|
+
let newStartIdx = 0;
|
|
742
|
+
let idxInOld = 0;
|
|
743
|
+
let i2 = 0;
|
|
744
|
+
let oldEndIdx = oldCh.length - 1;
|
|
745
|
+
let oldStartVnode = oldCh[0];
|
|
746
|
+
let oldEndVnode = oldCh[oldEndIdx];
|
|
747
|
+
let newEndIdx = newCh.length - 1;
|
|
748
|
+
let newStartVnode = newCh[0];
|
|
749
|
+
let newEndVnode = newCh[newEndIdx];
|
|
750
|
+
let node;
|
|
751
|
+
let elmToMove;
|
|
752
|
+
const containerElm = newVNode2.$tag$ === "template" ? parentElm.content : parentElm;
|
|
753
|
+
while (oldStartIdx <= oldEndIdx && newStartIdx <= newEndIdx) {
|
|
754
|
+
if (oldStartVnode == null) {
|
|
755
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
756
|
+
} else if (oldEndVnode == null) {
|
|
757
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
758
|
+
} else if (newStartVnode == null) {
|
|
759
|
+
newStartVnode = newCh[++newStartIdx];
|
|
760
|
+
} else if (newEndVnode == null) {
|
|
761
|
+
newEndVnode = newCh[--newEndIdx];
|
|
762
|
+
} else if (isSameVnode(oldStartVnode, newStartVnode, isInitialRender)) {
|
|
763
|
+
patch(oldStartVnode, newStartVnode, isInitialRender);
|
|
764
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
765
|
+
newStartVnode = newCh[++newStartIdx];
|
|
766
|
+
} else if (isSameVnode(oldEndVnode, newEndVnode, isInitialRender)) {
|
|
767
|
+
patch(oldEndVnode, newEndVnode, isInitialRender);
|
|
768
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
769
|
+
newEndVnode = newCh[--newEndIdx];
|
|
770
|
+
} else if (isSameVnode(oldStartVnode, newEndVnode, isInitialRender)) {
|
|
771
|
+
patch(oldStartVnode, newEndVnode, isInitialRender);
|
|
772
|
+
insertBefore(containerElm, oldStartVnode.$elm$, oldEndVnode.$elm$.nextSibling);
|
|
773
|
+
oldStartVnode = oldCh[++oldStartIdx];
|
|
774
|
+
newEndVnode = newCh[--newEndIdx];
|
|
775
|
+
} else if (isSameVnode(oldEndVnode, newStartVnode, isInitialRender)) {
|
|
776
|
+
patch(oldEndVnode, newStartVnode, isInitialRender);
|
|
777
|
+
insertBefore(containerElm, oldEndVnode.$elm$, oldStartVnode.$elm$);
|
|
778
|
+
oldEndVnode = oldCh[--oldEndIdx];
|
|
779
|
+
newStartVnode = newCh[++newStartIdx];
|
|
780
|
+
} else {
|
|
781
|
+
idxInOld = -1;
|
|
782
|
+
{
|
|
783
|
+
for (i2 = oldStartIdx; i2 <= oldEndIdx; ++i2) {
|
|
784
|
+
if (oldCh[i2] && oldCh[i2].$key$ !== null && oldCh[i2].$key$ === newStartVnode.$key$) {
|
|
785
|
+
idxInOld = i2;
|
|
786
|
+
break;
|
|
787
|
+
}
|
|
788
|
+
}
|
|
789
|
+
}
|
|
790
|
+
if (idxInOld >= 0) {
|
|
791
|
+
elmToMove = oldCh[idxInOld];
|
|
792
|
+
if (elmToMove.$tag$ !== newStartVnode.$tag$) {
|
|
793
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, idxInOld);
|
|
794
|
+
} else {
|
|
795
|
+
patch(elmToMove, newStartVnode, isInitialRender);
|
|
796
|
+
oldCh[idxInOld] = void 0;
|
|
797
|
+
node = elmToMove.$elm$;
|
|
798
|
+
}
|
|
799
|
+
newStartVnode = newCh[++newStartIdx];
|
|
800
|
+
} else {
|
|
801
|
+
node = createElm(oldCh && oldCh[newStartIdx], newVNode2, newStartIdx);
|
|
802
|
+
newStartVnode = newCh[++newStartIdx];
|
|
803
|
+
}
|
|
804
|
+
if (node) {
|
|
805
|
+
{
|
|
806
|
+
insertBefore(oldStartVnode.$elm$.parentNode, node, oldStartVnode.$elm$);
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
}
|
|
811
|
+
if (oldStartIdx > oldEndIdx) {
|
|
812
|
+
addVnodes(
|
|
813
|
+
parentElm,
|
|
814
|
+
newCh[newEndIdx + 1] == null ? null : newCh[newEndIdx + 1].$elm$,
|
|
815
|
+
newVNode2,
|
|
816
|
+
newCh,
|
|
817
|
+
newStartIdx,
|
|
818
|
+
newEndIdx
|
|
819
|
+
);
|
|
820
|
+
} else if (newStartIdx > newEndIdx) {
|
|
821
|
+
removeVnodes(oldCh, oldStartIdx, oldEndIdx);
|
|
822
|
+
}
|
|
823
|
+
};
|
|
824
|
+
var isSameVnode = (leftVNode, rightVNode, isInitialRender = false) => {
|
|
825
|
+
if (leftVNode.$tag$ === rightVNode.$tag$) {
|
|
826
|
+
if (!isInitialRender) {
|
|
827
|
+
return leftVNode.$key$ === rightVNode.$key$;
|
|
828
|
+
}
|
|
829
|
+
if (isInitialRender && !leftVNode.$key$ && rightVNode.$key$) {
|
|
830
|
+
leftVNode.$key$ = rightVNode.$key$;
|
|
831
|
+
}
|
|
832
|
+
return true;
|
|
833
|
+
}
|
|
834
|
+
return false;
|
|
835
|
+
};
|
|
836
|
+
var patch = (oldVNode, newVNode2, isInitialRender = false) => {
|
|
837
|
+
const elm = newVNode2.$elm$ = oldVNode.$elm$;
|
|
838
|
+
const oldChildren = oldVNode.$children$;
|
|
839
|
+
const newChildren = newVNode2.$children$;
|
|
840
|
+
const tag = newVNode2.$tag$;
|
|
841
|
+
const text = newVNode2.$text$;
|
|
842
|
+
if (text == null) {
|
|
843
|
+
{
|
|
844
|
+
isSvgMode = tag === "svg" ? true : tag === "foreignObject" ? false : isSvgMode;
|
|
845
|
+
}
|
|
846
|
+
{
|
|
847
|
+
if (tag === "slot" && !useNativeShadowDom) {
|
|
848
|
+
if (oldVNode.$name$ !== newVNode2.$name$) {
|
|
849
|
+
newVNode2.$elm$["s-sn"] = newVNode2.$name$ || "";
|
|
850
|
+
relocateToHostRoot(newVNode2.$elm$.parentElement);
|
|
851
|
+
}
|
|
852
|
+
}
|
|
853
|
+
updateElement(oldVNode, newVNode2, isSvgMode);
|
|
854
|
+
}
|
|
855
|
+
if (oldChildren !== null && newChildren !== null) {
|
|
856
|
+
updateChildren(elm, oldChildren, newVNode2, newChildren, isInitialRender);
|
|
857
|
+
} else if (newChildren !== null) {
|
|
858
|
+
if (oldVNode.$text$ !== null) {
|
|
859
|
+
elm.textContent = "";
|
|
860
|
+
}
|
|
861
|
+
addVnodes(elm, null, newVNode2, newChildren, 0, newChildren.length - 1);
|
|
862
|
+
} else if (
|
|
863
|
+
// don't do this on initial render as it can cause non-hydrated content to be removed
|
|
864
|
+
!isInitialRender && BUILD.updatable && oldChildren !== null
|
|
865
|
+
) {
|
|
866
|
+
removeVnodes(oldChildren, 0, oldChildren.length - 1);
|
|
867
|
+
} else ;
|
|
868
|
+
if (isSvgMode && tag === "svg") {
|
|
869
|
+
isSvgMode = false;
|
|
870
|
+
}
|
|
871
|
+
} else if (oldVNode.$text$ !== text) {
|
|
872
|
+
elm.data = text;
|
|
873
|
+
}
|
|
874
|
+
};
|
|
875
|
+
var nullifyVNodeRefs = (vNode) => {
|
|
876
|
+
{
|
|
877
|
+
if (vNode.$attrs$ && vNode.$attrs$.ref) {
|
|
878
|
+
refCallbacksToRemove.push(() => vNode.$attrs$.ref(null));
|
|
879
|
+
}
|
|
880
|
+
vNode.$children$ && vNode.$children$.map(nullifyVNodeRefs);
|
|
881
|
+
}
|
|
882
|
+
};
|
|
883
|
+
var queueRefAttachment = (refCallback, elm) => {
|
|
884
|
+
{
|
|
885
|
+
refCallbacksToAttach.push(() => refCallback(elm));
|
|
886
|
+
}
|
|
887
|
+
};
|
|
888
|
+
var flushQueuedRefCallbacks = () => {
|
|
889
|
+
{
|
|
890
|
+
refCallbacksToRemove.forEach((cb) => cb());
|
|
891
|
+
refCallbacksToRemove.length = 0;
|
|
892
|
+
refCallbacksToAttach.forEach((cb) => cb());
|
|
893
|
+
refCallbacksToAttach.length = 0;
|
|
894
|
+
}
|
|
895
|
+
};
|
|
896
|
+
var insertBefore = (parent, newNode, reference, isInitialLoad) => {
|
|
897
|
+
if (parent.__insertBefore) {
|
|
898
|
+
return parent.__insertBefore(newNode, reference);
|
|
899
|
+
} else {
|
|
900
|
+
return parent == null ? void 0 : parent.insertBefore(newNode, reference);
|
|
901
|
+
}
|
|
902
|
+
};
|
|
903
|
+
var renderVdom = (hostRef, renderFnResults, isInitialLoad = false) => {
|
|
904
|
+
const hostElm = hostRef.$hostElement$;
|
|
905
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
906
|
+
const oldVNode = hostRef.$vnode$ || newVNode(null, null);
|
|
907
|
+
const isHostElement = isHost(renderFnResults);
|
|
908
|
+
const rootVnode = isHostElement ? renderFnResults : h(null, null, renderFnResults);
|
|
909
|
+
hostTagName = hostElm.tagName;
|
|
910
|
+
if (cmpMeta.$attrsToReflect$) {
|
|
911
|
+
rootVnode.$attrs$ = rootVnode.$attrs$ || {};
|
|
912
|
+
cmpMeta.$attrsToReflect$.forEach(([propName, attribute]) => {
|
|
913
|
+
{
|
|
914
|
+
rootVnode.$attrs$[attribute] = hostElm[propName];
|
|
915
|
+
}
|
|
916
|
+
});
|
|
917
|
+
}
|
|
918
|
+
if (isInitialLoad && rootVnode.$attrs$) {
|
|
919
|
+
for (const key of Object.keys(rootVnode.$attrs$)) {
|
|
920
|
+
if (hostElm.hasAttribute(key) && !["key", "ref", "style", "class"].includes(key)) {
|
|
921
|
+
rootVnode.$attrs$[key] = hostElm[key];
|
|
922
|
+
}
|
|
923
|
+
}
|
|
924
|
+
}
|
|
925
|
+
rootVnode.$tag$ = null;
|
|
926
|
+
rootVnode.$flags$ |= 4 /* isHost */;
|
|
927
|
+
hostRef.$vnode$ = rootVnode;
|
|
928
|
+
rootVnode.$elm$ = oldVNode.$elm$ = hostElm.shadowRoot || hostElm ;
|
|
929
|
+
useNativeShadowDom = !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */) && !(cmpMeta.$flags$ & 128 /* shadowNeedsScopedCss */);
|
|
930
|
+
patch(oldVNode, rootVnode, isInitialLoad);
|
|
931
|
+
flushQueuedRefCallbacks();
|
|
932
|
+
};
|
|
933
|
+
|
|
934
|
+
// src/runtime/update-component.ts
|
|
935
|
+
var attachToAncestor = (hostRef, ancestorComponent) => {
|
|
936
|
+
if (ancestorComponent && !hostRef.$onRenderResolve$ && ancestorComponent["s-p"]) {
|
|
937
|
+
const index = ancestorComponent["s-p"].push(
|
|
938
|
+
new Promise(
|
|
939
|
+
(r) => hostRef.$onRenderResolve$ = () => {
|
|
940
|
+
ancestorComponent["s-p"].splice(index - 1, 1);
|
|
941
|
+
r();
|
|
942
|
+
}
|
|
943
|
+
)
|
|
944
|
+
);
|
|
945
|
+
}
|
|
946
|
+
};
|
|
947
|
+
var scheduleUpdate = (hostRef, isInitialLoad) => {
|
|
948
|
+
{
|
|
949
|
+
hostRef.$flags$ |= 16 /* isQueuedForUpdate */;
|
|
950
|
+
}
|
|
951
|
+
if (hostRef.$flags$ & 4 /* isWaitingForChildren */) {
|
|
952
|
+
hostRef.$flags$ |= 512 /* needsRerender */;
|
|
953
|
+
return;
|
|
954
|
+
}
|
|
955
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$);
|
|
956
|
+
const dispatch = () => dispatchHooks(hostRef, isInitialLoad);
|
|
957
|
+
if (isInitialLoad) {
|
|
958
|
+
queueMicrotask(() => {
|
|
959
|
+
dispatch();
|
|
960
|
+
});
|
|
961
|
+
return;
|
|
962
|
+
}
|
|
963
|
+
return writeTask(dispatch) ;
|
|
964
|
+
};
|
|
965
|
+
var dispatchHooks = (hostRef, isInitialLoad) => {
|
|
966
|
+
const elm = hostRef.$hostElement$;
|
|
967
|
+
const endSchedule = createTime("scheduleUpdate", hostRef.$cmpMeta$.$tagName$);
|
|
968
|
+
const instance = elm;
|
|
969
|
+
if (!instance) {
|
|
970
|
+
throw new Error(
|
|
971
|
+
`Can't render component <${elm.tagName.toLowerCase()} /> with invalid Stencil runtime! Make sure this imported component is compiled with a \`externalRuntime: true\` flag. For more information, please refer to https://stenciljs.com/docs/custom-elements#externalruntime`
|
|
972
|
+
);
|
|
973
|
+
}
|
|
974
|
+
let maybePromise;
|
|
975
|
+
if (isInitialLoad) {
|
|
976
|
+
maybePromise = safeCall(instance, "componentWillLoad", void 0, elm);
|
|
977
|
+
} else {
|
|
978
|
+
maybePromise = safeCall(instance, "componentWillUpdate", void 0, elm);
|
|
979
|
+
}
|
|
980
|
+
maybePromise = enqueue(maybePromise, () => safeCall(instance, "componentWillRender", void 0, elm));
|
|
981
|
+
endSchedule();
|
|
982
|
+
return enqueue(maybePromise, () => updateComponent(hostRef, instance, isInitialLoad));
|
|
983
|
+
};
|
|
984
|
+
var enqueue = (maybePromise, fn) => isPromisey(maybePromise) ? maybePromise.then(fn).catch((err) => {
|
|
985
|
+
console.error(err);
|
|
986
|
+
fn();
|
|
987
|
+
}) : fn();
|
|
988
|
+
var isPromisey = (maybePromise) => maybePromise instanceof Promise || maybePromise && maybePromise.then && typeof maybePromise.then === "function";
|
|
989
|
+
var updateComponent = async (hostRef, instance, isInitialLoad) => {
|
|
990
|
+
var _a;
|
|
991
|
+
const elm = hostRef.$hostElement$;
|
|
992
|
+
const endUpdate = createTime("update", hostRef.$cmpMeta$.$tagName$);
|
|
993
|
+
const rc = elm["s-rc"];
|
|
994
|
+
if (isInitialLoad) {
|
|
995
|
+
attachStyles(hostRef);
|
|
996
|
+
}
|
|
997
|
+
const endRender = createTime("render", hostRef.$cmpMeta$.$tagName$);
|
|
998
|
+
{
|
|
999
|
+
callRender(hostRef, instance, elm, isInitialLoad);
|
|
1000
|
+
}
|
|
1001
|
+
if (rc) {
|
|
1002
|
+
rc.map((cb) => cb());
|
|
1003
|
+
elm["s-rc"] = void 0;
|
|
1004
|
+
}
|
|
1005
|
+
endRender();
|
|
1006
|
+
endUpdate();
|
|
1007
|
+
{
|
|
1008
|
+
const childrenPromises = (_a = elm["s-p"]) != null ? _a : [];
|
|
1009
|
+
const postUpdate = () => postUpdateComponent(hostRef);
|
|
1010
|
+
if (childrenPromises.length === 0) {
|
|
1011
|
+
postUpdate();
|
|
1012
|
+
} else {
|
|
1013
|
+
Promise.all(childrenPromises).then(postUpdate).catch(postUpdate);
|
|
1014
|
+
hostRef.$flags$ |= 4 /* isWaitingForChildren */;
|
|
1015
|
+
childrenPromises.length = 0;
|
|
1016
|
+
}
|
|
1017
|
+
}
|
|
1018
|
+
};
|
|
1019
|
+
var callRender = (hostRef, instance, elm, isInitialLoad) => {
|
|
1020
|
+
try {
|
|
1021
|
+
instance = instance.render() ;
|
|
1022
|
+
{
|
|
1023
|
+
hostRef.$flags$ &= -17 /* isQueuedForUpdate */;
|
|
1024
|
+
}
|
|
1025
|
+
{
|
|
1026
|
+
hostRef.$flags$ |= 2 /* hasRendered */;
|
|
1027
|
+
}
|
|
1028
|
+
{
|
|
1029
|
+
{
|
|
1030
|
+
{
|
|
1031
|
+
renderVdom(hostRef, instance, isInitialLoad);
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
}
|
|
1035
|
+
} catch (e) {
|
|
1036
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1037
|
+
}
|
|
1038
|
+
return null;
|
|
1039
|
+
};
|
|
1040
|
+
var postUpdateComponent = (hostRef) => {
|
|
1041
|
+
const tagName = hostRef.$cmpMeta$.$tagName$;
|
|
1042
|
+
const elm = hostRef.$hostElement$;
|
|
1043
|
+
const endPostUpdate = createTime("postUpdate", tagName);
|
|
1044
|
+
const instance = elm;
|
|
1045
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1046
|
+
safeCall(instance, "componentDidRender", void 0, elm);
|
|
1047
|
+
if (!(hostRef.$flags$ & 64 /* hasLoadedComponent */)) {
|
|
1048
|
+
hostRef.$flags$ |= 64 /* hasLoadedComponent */;
|
|
1049
|
+
{
|
|
1050
|
+
addHydratedFlag(elm);
|
|
1051
|
+
}
|
|
1052
|
+
safeCall(instance, "componentDidLoad", void 0, elm);
|
|
1053
|
+
endPostUpdate();
|
|
1054
|
+
{
|
|
1055
|
+
hostRef.$onReadyResolve$(elm);
|
|
1056
|
+
if (!ancestorComponent) {
|
|
1057
|
+
appDidLoad();
|
|
1058
|
+
}
|
|
1059
|
+
}
|
|
1060
|
+
} else {
|
|
1061
|
+
safeCall(instance, "componentDidUpdate", void 0, elm);
|
|
1062
|
+
endPostUpdate();
|
|
1063
|
+
}
|
|
1064
|
+
{
|
|
1065
|
+
if (hostRef.$onRenderResolve$) {
|
|
1066
|
+
hostRef.$onRenderResolve$();
|
|
1067
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
1068
|
+
}
|
|
1069
|
+
if (hostRef.$flags$ & 512 /* needsRerender */) {
|
|
1070
|
+
nextTick(() => scheduleUpdate(hostRef, false));
|
|
1071
|
+
}
|
|
1072
|
+
hostRef.$flags$ &= -517;
|
|
1073
|
+
}
|
|
1074
|
+
};
|
|
1075
|
+
var appDidLoad = (who) => {
|
|
1076
|
+
nextTick(() => emitEvent(win, "appload", { detail: { namespace: NAMESPACE } }));
|
|
1077
|
+
};
|
|
1078
|
+
var safeCall = (instance, method, arg, elm) => {
|
|
1079
|
+
if (instance && instance[method]) {
|
|
1080
|
+
try {
|
|
1081
|
+
return instance[method](arg);
|
|
1082
|
+
} catch (e) {
|
|
1083
|
+
consoleError(e, elm);
|
|
1084
|
+
}
|
|
1085
|
+
}
|
|
1086
|
+
return void 0;
|
|
1087
|
+
};
|
|
1088
|
+
var addHydratedFlag = (elm) => {
|
|
1089
|
+
var _a;
|
|
1090
|
+
return elm.classList.add((_a = BUILD.hydratedSelectorName) != null ? _a : "hydrated") ;
|
|
1091
|
+
};
|
|
1092
|
+
|
|
1093
|
+
// src/runtime/set-value.ts
|
|
1094
|
+
var getValue = (ref, propName) => getHostRef(ref).$instanceValues$.get(propName);
|
|
1095
|
+
var setValue = (ref, propName, newVal, cmpMeta) => {
|
|
1096
|
+
const hostRef = getHostRef(ref);
|
|
1097
|
+
if (!hostRef) {
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
const elm = ref;
|
|
1101
|
+
const oldVal = hostRef.$instanceValues$.get(propName);
|
|
1102
|
+
const flags = hostRef.$flags$;
|
|
1103
|
+
const instance = elm;
|
|
1104
|
+
newVal = parsePropertyValue(
|
|
1105
|
+
newVal,
|
|
1106
|
+
cmpMeta.$members$[propName][0]);
|
|
1107
|
+
const areBothNaN = Number.isNaN(oldVal) && Number.isNaN(newVal);
|
|
1108
|
+
const didValueChange = newVal !== oldVal && !areBothNaN;
|
|
1109
|
+
if (didValueChange) {
|
|
1110
|
+
hostRef.$instanceValues$.set(propName, newVal);
|
|
1111
|
+
if (cmpMeta.$watchers$) {
|
|
1112
|
+
const watchMethods = cmpMeta.$watchers$[propName];
|
|
1113
|
+
if (watchMethods) {
|
|
1114
|
+
watchMethods.map((watcher) => {
|
|
1115
|
+
try {
|
|
1116
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
1117
|
+
if (flags & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */) {
|
|
1118
|
+
if (!instance) {
|
|
1119
|
+
hostRef.$fetchedCbList$.push(() => {
|
|
1120
|
+
hostRef.$lazyInstance$[watchMethodName](newVal, oldVal, propName);
|
|
1121
|
+
});
|
|
1122
|
+
} else {
|
|
1123
|
+
instance[watchMethodName](newVal, oldVal, propName);
|
|
1124
|
+
}
|
|
1125
|
+
}
|
|
1126
|
+
} catch (e) {
|
|
1127
|
+
consoleError(e, elm);
|
|
1128
|
+
}
|
|
1129
|
+
});
|
|
1130
|
+
}
|
|
1131
|
+
}
|
|
1132
|
+
if (flags & 2 /* hasRendered */) {
|
|
1133
|
+
if (instance.componentShouldUpdate) {
|
|
1134
|
+
const shouldUpdate = instance.componentShouldUpdate(newVal, oldVal, propName);
|
|
1135
|
+
if (shouldUpdate === false && !(flags & 16 /* isQueuedForUpdate */)) {
|
|
1136
|
+
return;
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
if (!(flags & 16 /* isQueuedForUpdate */)) {
|
|
1140
|
+
scheduleUpdate(hostRef, false);
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1143
|
+
}
|
|
1144
|
+
};
|
|
1145
|
+
|
|
1146
|
+
// src/runtime/proxy-component.ts
|
|
1147
|
+
var proxyComponent = (Cstr, cmpMeta, flags) => {
|
|
1148
|
+
var _a, _b;
|
|
1149
|
+
const prototype = Cstr.prototype;
|
|
1150
|
+
{
|
|
1151
|
+
{
|
|
1152
|
+
if (Cstr.watchers && !cmpMeta.$watchers$) {
|
|
1153
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.watchers);
|
|
1154
|
+
}
|
|
1155
|
+
if (Cstr.deserializers && !cmpMeta.$deserializers$) {
|
|
1156
|
+
cmpMeta.$deserializers$ = Cstr.deserializers;
|
|
1157
|
+
}
|
|
1158
|
+
if (Cstr.serializers && !cmpMeta.$serializers$) {
|
|
1159
|
+
cmpMeta.$serializers$ = Cstr.serializers;
|
|
1160
|
+
}
|
|
1161
|
+
}
|
|
1162
|
+
const members = Object.entries((_a = cmpMeta.$members$) != null ? _a : {});
|
|
1163
|
+
members.map(([memberName, [memberFlags]]) => {
|
|
1164
|
+
if ((memberFlags & 31 /* Prop */ || memberFlags & 32 /* State */)) {
|
|
1165
|
+
const { get: origGetter, set: origSetter } = getPropertyDescriptor(prototype, memberName) || {};
|
|
1166
|
+
if (origGetter) cmpMeta.$members$[memberName][0] |= 2048 /* Getter */;
|
|
1167
|
+
if (origSetter) cmpMeta.$members$[memberName][0] |= 4096 /* Setter */;
|
|
1168
|
+
{
|
|
1169
|
+
Object.defineProperty(prototype, memberName, {
|
|
1170
|
+
get() {
|
|
1171
|
+
{
|
|
1172
|
+
return origGetter ? origGetter.apply(this) : getValue(this, memberName);
|
|
1173
|
+
}
|
|
1174
|
+
},
|
|
1175
|
+
configurable: true,
|
|
1176
|
+
enumerable: true
|
|
1177
|
+
});
|
|
1178
|
+
}
|
|
1179
|
+
Object.defineProperty(prototype, memberName, {
|
|
1180
|
+
set(newValue) {
|
|
1181
|
+
const ref = getHostRef(this);
|
|
1182
|
+
if (!ref) {
|
|
1183
|
+
return;
|
|
1184
|
+
}
|
|
1185
|
+
if (origSetter) {
|
|
1186
|
+
const currentValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1187
|
+
if (typeof currentValue === "undefined" && ref.$instanceValues$.get(memberName)) {
|
|
1188
|
+
newValue = ref.$instanceValues$.get(memberName);
|
|
1189
|
+
}
|
|
1190
|
+
origSetter.apply(this, [
|
|
1191
|
+
parsePropertyValue(
|
|
1192
|
+
newValue,
|
|
1193
|
+
memberFlags)
|
|
1194
|
+
]);
|
|
1195
|
+
newValue = memberFlags & 32 /* State */ ? this[memberName] : ref.$hostElement$[memberName];
|
|
1196
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1197
|
+
return;
|
|
1198
|
+
}
|
|
1199
|
+
{
|
|
1200
|
+
setValue(this, memberName, newValue, cmpMeta);
|
|
1201
|
+
return;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
});
|
|
1205
|
+
}
|
|
1206
|
+
});
|
|
1207
|
+
{
|
|
1208
|
+
const attrNameToPropName = /* @__PURE__ */ new Map();
|
|
1209
|
+
prototype.attributeChangedCallback = function(attrName, oldValue, newValue) {
|
|
1210
|
+
plt.jmp(() => {
|
|
1211
|
+
var _a2;
|
|
1212
|
+
const propName = attrNameToPropName.get(attrName);
|
|
1213
|
+
const hostRef = getHostRef(this);
|
|
1214
|
+
if (this.hasOwnProperty(propName) && BUILD.lazyLoad) ;
|
|
1215
|
+
if (prototype.hasOwnProperty(propName) && typeof this[propName] === "number" && // cast type to number to avoid TS compiler issues
|
|
1216
|
+
this[propName] == newValue) {
|
|
1217
|
+
return;
|
|
1218
|
+
} else if (propName == null) {
|
|
1219
|
+
const flags2 = hostRef == null ? void 0 : hostRef.$flags$;
|
|
1220
|
+
if (hostRef && flags2 && !(flags2 & 8 /* isConstructingInstance */) && newValue !== oldValue) {
|
|
1221
|
+
const elm = this;
|
|
1222
|
+
const instance = elm;
|
|
1223
|
+
const entry = (_a2 = cmpMeta.$watchers$) == null ? void 0 : _a2[attrName];
|
|
1224
|
+
entry == null ? void 0 : entry.forEach((watcher) => {
|
|
1225
|
+
const [[watchMethodName, watcherFlags]] = Object.entries(watcher);
|
|
1226
|
+
if (instance[watchMethodName] != null && (flags2 & 128 /* isWatchReady */ || watcherFlags & 1 /* Immediate */)) {
|
|
1227
|
+
instance[watchMethodName].call(instance, newValue, oldValue, attrName);
|
|
1228
|
+
}
|
|
1229
|
+
});
|
|
1230
|
+
}
|
|
1231
|
+
return;
|
|
1232
|
+
}
|
|
1233
|
+
const propFlags = members.find(([m]) => m === propName);
|
|
1234
|
+
const isBooleanTarget = propFlags && propFlags[1][0] & 4 /* Boolean */;
|
|
1235
|
+
const isSpuriousBooleanRemoval = isBooleanTarget && newValue === null && this[propName] === void 0;
|
|
1236
|
+
if (isBooleanTarget) {
|
|
1237
|
+
newValue = newValue === null || newValue === "false" ? false : true;
|
|
1238
|
+
}
|
|
1239
|
+
const propDesc = Object.getOwnPropertyDescriptor(prototype, propName);
|
|
1240
|
+
if (!isSpuriousBooleanRemoval && newValue != this[propName] && (!propDesc.get || !!propDesc.set)) {
|
|
1241
|
+
this[propName] = newValue;
|
|
1242
|
+
}
|
|
1243
|
+
});
|
|
1244
|
+
};
|
|
1245
|
+
Cstr.observedAttributes = Array.from(
|
|
1246
|
+
/* @__PURE__ */ new Set([
|
|
1247
|
+
...Object.keys((_b = cmpMeta.$watchers$) != null ? _b : {}),
|
|
1248
|
+
...members.filter(([_, m]) => m[0] & 31 /* HasAttribute */).map(([propName, m]) => {
|
|
1249
|
+
var _a2;
|
|
1250
|
+
const attrName = m[1] || propName;
|
|
1251
|
+
attrNameToPropName.set(attrName, propName);
|
|
1252
|
+
if (m[0] & 512 /* ReflectAttr */) {
|
|
1253
|
+
(_a2 = cmpMeta.$attrsToReflect$) == null ? void 0 : _a2.push([propName, attrName]);
|
|
1254
|
+
}
|
|
1255
|
+
return attrName;
|
|
1256
|
+
})
|
|
1257
|
+
])
|
|
1258
|
+
);
|
|
1259
|
+
}
|
|
1260
|
+
}
|
|
1261
|
+
return Cstr;
|
|
1262
|
+
};
|
|
1263
|
+
|
|
1264
|
+
// src/runtime/initialize-component.ts
|
|
1265
|
+
var initializeComponent = async (elm, hostRef, cmpMeta, hmrVersionId) => {
|
|
1266
|
+
let Cstr;
|
|
1267
|
+
try {
|
|
1268
|
+
if ((hostRef.$flags$ & 32 /* hasInitializedComponent */) === 0) {
|
|
1269
|
+
hostRef.$flags$ |= 32 /* hasInitializedComponent */;
|
|
1270
|
+
{
|
|
1271
|
+
Cstr = elm.constructor;
|
|
1272
|
+
const cmpTag = elm.localName;
|
|
1273
|
+
customElements.whenDefined(cmpTag).then(() => hostRef.$flags$ |= 128 /* isWatchReady */);
|
|
1274
|
+
}
|
|
1275
|
+
if (Cstr && Cstr.style) {
|
|
1276
|
+
let style;
|
|
1277
|
+
if (typeof Cstr.style === "string") {
|
|
1278
|
+
style = Cstr.style;
|
|
1279
|
+
}
|
|
1280
|
+
const scopeId2 = getScopeId(cmpMeta);
|
|
1281
|
+
if (!styles.has(scopeId2) || BUILD.hotModuleReplacement) {
|
|
1282
|
+
const endRegisterStyles = createTime("registerStyles", cmpMeta.$tagName$);
|
|
1283
|
+
registerStyle(scopeId2, style, !!(cmpMeta.$flags$ & 1 /* shadowDomEncapsulation */));
|
|
1284
|
+
endRegisterStyles();
|
|
1285
|
+
}
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
const ancestorComponent = hostRef.$ancestorComponent$;
|
|
1289
|
+
const schedule = () => scheduleUpdate(hostRef, true);
|
|
1290
|
+
if (ancestorComponent && ancestorComponent["s-rc"]) {
|
|
1291
|
+
ancestorComponent["s-rc"].push(schedule);
|
|
1292
|
+
} else {
|
|
1293
|
+
schedule();
|
|
1294
|
+
}
|
|
1295
|
+
} catch (e) {
|
|
1296
|
+
consoleError(e, elm);
|
|
1297
|
+
if (hostRef.$onRenderResolve$) {
|
|
1298
|
+
hostRef.$onRenderResolve$();
|
|
1299
|
+
hostRef.$onRenderResolve$ = void 0;
|
|
1300
|
+
}
|
|
1301
|
+
if (hostRef.$onReadyResolve$) {
|
|
1302
|
+
hostRef.$onReadyResolve$(elm);
|
|
1303
|
+
}
|
|
1304
|
+
}
|
|
1305
|
+
};
|
|
1306
|
+
var fireConnectedCallback = (instance, elm) => {
|
|
1307
|
+
};
|
|
1308
|
+
|
|
1309
|
+
// src/runtime/connected-callback.ts
|
|
1310
|
+
var connectedCallback = (elm) => {
|
|
1311
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1312
|
+
const hostRef = getHostRef(elm);
|
|
1313
|
+
if (!hostRef) {
|
|
1314
|
+
return;
|
|
1315
|
+
}
|
|
1316
|
+
const cmpMeta = hostRef.$cmpMeta$;
|
|
1317
|
+
const endConnected = createTime("connectedCallback", cmpMeta.$tagName$);
|
|
1318
|
+
if (!(hostRef.$flags$ & 1 /* hasConnected */)) {
|
|
1319
|
+
hostRef.$flags$ |= 1 /* hasConnected */;
|
|
1320
|
+
{
|
|
1321
|
+
let ancestorComponent = elm;
|
|
1322
|
+
while (ancestorComponent = ancestorComponent.parentNode || ancestorComponent.host) {
|
|
1323
|
+
if (ancestorComponent["s-p"]) {
|
|
1324
|
+
attachToAncestor(hostRef, hostRef.$ancestorComponent$ = ancestorComponent);
|
|
1325
|
+
break;
|
|
1326
|
+
}
|
|
1327
|
+
}
|
|
1328
|
+
}
|
|
1329
|
+
if (cmpMeta.$members$) {
|
|
1330
|
+
Object.entries(cmpMeta.$members$).map(([memberName, [memberFlags]]) => {
|
|
1331
|
+
if (memberFlags & 31 /* Prop */ && Object.prototype.hasOwnProperty.call(elm, memberName)) {
|
|
1332
|
+
const value = elm[memberName];
|
|
1333
|
+
delete elm[memberName];
|
|
1334
|
+
elm[memberName] = value;
|
|
1335
|
+
}
|
|
1336
|
+
});
|
|
1337
|
+
}
|
|
1338
|
+
{
|
|
1339
|
+
initializeComponent(elm, hostRef, cmpMeta);
|
|
1340
|
+
}
|
|
1341
|
+
} else {
|
|
1342
|
+
addHostEventListeners(elm, hostRef, cmpMeta.$listeners$);
|
|
1343
|
+
if (hostRef == null ? void 0 : hostRef.$lazyInstance$) ; else if (hostRef == null ? void 0 : hostRef.$onReadyPromise$) {
|
|
1344
|
+
hostRef.$onReadyPromise$.then(() => fireConnectedCallback());
|
|
1345
|
+
}
|
|
1346
|
+
}
|
|
1347
|
+
endConnected();
|
|
1348
|
+
}
|
|
1349
|
+
};
|
|
1350
|
+
var disconnectedCallback = async (elm) => {
|
|
1351
|
+
if ((plt.$flags$ & 1 /* isTmpDisconnected */) === 0) {
|
|
1352
|
+
const hostRef = getHostRef(elm);
|
|
1353
|
+
{
|
|
1354
|
+
if (hostRef == null ? void 0 : hostRef.$rmListeners$) {
|
|
1355
|
+
hostRef.$rmListeners$.map((rmListener) => rmListener());
|
|
1356
|
+
hostRef.$rmListeners$ = void 0;
|
|
1357
|
+
}
|
|
1358
|
+
}
|
|
1359
|
+
}
|
|
1360
|
+
if (rootAppliedStyles.has(elm)) {
|
|
1361
|
+
rootAppliedStyles.delete(elm);
|
|
1362
|
+
}
|
|
1363
|
+
if (elm.shadowRoot && rootAppliedStyles.has(elm.shadowRoot)) {
|
|
1364
|
+
rootAppliedStyles.delete(elm.shadowRoot);
|
|
1365
|
+
}
|
|
1366
|
+
};
|
|
1367
|
+
var proxyCustomElement = (Cstr, compactMeta) => {
|
|
1368
|
+
const cmpMeta = {
|
|
1369
|
+
$flags$: compactMeta[0],
|
|
1370
|
+
$tagName$: compactMeta[1]
|
|
1371
|
+
};
|
|
1372
|
+
try {
|
|
1373
|
+
{
|
|
1374
|
+
cmpMeta.$members$ = compactMeta[2];
|
|
1375
|
+
}
|
|
1376
|
+
{
|
|
1377
|
+
cmpMeta.$listeners$ = compactMeta[3];
|
|
1378
|
+
}
|
|
1379
|
+
{
|
|
1380
|
+
cmpMeta.$watchers$ = normalizeWatchers(Cstr.$watchers$);
|
|
1381
|
+
cmpMeta.$deserializers$ = Cstr.$deserializers$;
|
|
1382
|
+
cmpMeta.$serializers$ = Cstr.$serializers$;
|
|
1383
|
+
}
|
|
1384
|
+
{
|
|
1385
|
+
cmpMeta.$attrsToReflect$ = [];
|
|
1386
|
+
}
|
|
1387
|
+
const originalConnectedCallback = Cstr.prototype.connectedCallback;
|
|
1388
|
+
const originalDisconnectedCallback = Cstr.prototype.disconnectedCallback;
|
|
1389
|
+
Object.assign(Cstr.prototype, {
|
|
1390
|
+
__hasHostListenerAttached: false,
|
|
1391
|
+
__registerHost() {
|
|
1392
|
+
registerHost(this, cmpMeta);
|
|
1393
|
+
},
|
|
1394
|
+
connectedCallback() {
|
|
1395
|
+
if (!this.__hasHostListenerAttached) {
|
|
1396
|
+
const hostRef = getHostRef(this);
|
|
1397
|
+
if (!hostRef) {
|
|
1398
|
+
return;
|
|
1399
|
+
}
|
|
1400
|
+
addHostEventListeners(this, hostRef, cmpMeta.$listeners$);
|
|
1401
|
+
this.__hasHostListenerAttached = true;
|
|
1402
|
+
}
|
|
1403
|
+
connectedCallback(this);
|
|
1404
|
+
if (originalConnectedCallback) {
|
|
1405
|
+
originalConnectedCallback.call(this);
|
|
1406
|
+
}
|
|
1407
|
+
},
|
|
1408
|
+
disconnectedCallback() {
|
|
1409
|
+
disconnectedCallback(this);
|
|
1410
|
+
if (originalDisconnectedCallback) {
|
|
1411
|
+
originalDisconnectedCallback.call(this);
|
|
1412
|
+
}
|
|
1413
|
+
},
|
|
1414
|
+
__attachShadow() {
|
|
1415
|
+
{
|
|
1416
|
+
if (!this.shadowRoot) {
|
|
1417
|
+
createShadowRoot.call(this, cmpMeta);
|
|
1418
|
+
} else {
|
|
1419
|
+
if (this.shadowRoot.mode !== "open") {
|
|
1420
|
+
throw new Error(
|
|
1421
|
+
`Unable to re-use existing shadow root for ${cmpMeta.$tagName$}! Mode is set to ${this.shadowRoot.mode} but Stencil only supports open shadow roots.`
|
|
1422
|
+
);
|
|
1423
|
+
}
|
|
1424
|
+
}
|
|
1425
|
+
}
|
|
1426
|
+
}
|
|
1427
|
+
});
|
|
1428
|
+
Object.defineProperty(Cstr, "is", {
|
|
1429
|
+
value: cmpMeta.$tagName$,
|
|
1430
|
+
configurable: true
|
|
1431
|
+
});
|
|
1432
|
+
return proxyComponent(Cstr, cmpMeta);
|
|
1433
|
+
} catch (e) {
|
|
1434
|
+
consoleError(e);
|
|
1435
|
+
return Cstr;
|
|
1436
|
+
}
|
|
1437
|
+
};
|
|
1438
|
+
var addHostEventListeners = (elm, hostRef, listeners, attachParentListeners) => {
|
|
1439
|
+
if (listeners && win.document) {
|
|
1440
|
+
listeners.map(([flags, name, method]) => {
|
|
1441
|
+
const target = getHostListenerTarget(win.document, elm, flags) ;
|
|
1442
|
+
const handler = hostListenerProxy(hostRef, method);
|
|
1443
|
+
const opts = hostListenerOpts(flags);
|
|
1444
|
+
plt.ael(target, name, handler, opts);
|
|
1445
|
+
(hostRef.$rmListeners$ = hostRef.$rmListeners$ || []).push(() => plt.rel(target, name, handler, opts));
|
|
1446
|
+
});
|
|
1447
|
+
}
|
|
1448
|
+
};
|
|
1449
|
+
var hostListenerProxy = (hostRef, methodName) => (ev) => {
|
|
1450
|
+
try {
|
|
1451
|
+
{
|
|
1452
|
+
hostRef.$hostElement$[methodName](ev);
|
|
1453
|
+
}
|
|
1454
|
+
} catch (e) {
|
|
1455
|
+
consoleError(e, hostRef.$hostElement$);
|
|
1456
|
+
}
|
|
1457
|
+
};
|
|
1458
|
+
var getHostListenerTarget = (doc, elm, flags) => {
|
|
1459
|
+
if (flags & 4 /* TargetDocument */) {
|
|
1460
|
+
return doc;
|
|
1461
|
+
}
|
|
1462
|
+
if (flags & 8 /* TargetWindow */) {
|
|
1463
|
+
return win;
|
|
1464
|
+
}
|
|
1465
|
+
return elm;
|
|
1466
|
+
};
|
|
1467
|
+
var hostListenerOpts = (flags) => supportsListenerOptions ? {
|
|
1468
|
+
passive: (flags & 1 /* Passive */) !== 0,
|
|
1469
|
+
capture: (flags & 2 /* Capture */) !== 0
|
|
1470
|
+
} : (flags & 2 /* Capture */) !== 0;
|
|
1471
|
+
|
|
1472
|
+
// src/runtime/nonce.ts
|
|
1473
|
+
var setNonce = (nonce) => plt.$nonce$ = nonce;
|
|
1474
|
+
|
|
1475
|
+
// src/runtime/platform-options.ts
|
|
1476
|
+
var setPlatformOptions = (opts) => Object.assign(plt, opts);
|
|
1477
|
+
|
|
1478
|
+
// src/runtime/render.ts
|
|
1479
|
+
var hostRefCache = /* @__PURE__ */ new WeakMap();
|
|
1480
|
+
function render(vnode, container) {
|
|
1481
|
+
let ref = hostRefCache.get(container);
|
|
1482
|
+
if (!ref) {
|
|
1483
|
+
const cmpMeta = {
|
|
1484
|
+
$flags$: 0,
|
|
1485
|
+
$tagName$: container.tagName
|
|
1486
|
+
};
|
|
1487
|
+
ref = {
|
|
1488
|
+
$flags$: 0,
|
|
1489
|
+
$cmpMeta$: cmpMeta,
|
|
1490
|
+
$hostElement$: container
|
|
1491
|
+
};
|
|
1492
|
+
hostRefCache.set(container, ref);
|
|
1493
|
+
}
|
|
1494
|
+
renderVdom(ref, vnode);
|
|
1495
|
+
}
|
|
1496
|
+
function transformTag(tag) {
|
|
1497
|
+
return tag;
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
export { H, setNonce as a, setPlatformOptions as b, createEvent as c, Host as d, getAssetPath as g, h, proxyCustomElement as p, render as r, setAssetPath as s, transformTag as t };
|