@esri/calcite-components
Version:
Web Components for Esri's Calcite Design System.
3 lines (2 loc) • 2.69 kB
JavaScript
/* COPYRIGHT Esri - https://js.arcgis.com/5.0/LICENSE.txt */
import{c as O,e as w}from"./MNIRD7Q7.js";import{a as x,b as E,c as h,d as u,e as C,f as P,o as f,q as v}from"./G7AHLVJ5.js";var L=e=>(...r)=>{let t=u(),o=new e(...r),s=o.exports;h(t.at(-1));let n=o.component.manager;n.W(o,s),o.watchExports(n.W.bind(n,o)),C(o);let a=[o.component,...t].reverse();return f(a,i=>i===void 0?void 0:D(o,i,s),s)},D=(e,{host:r,key:t,isReactive:o},s)=>{let n=r,a=n[t]!==e.exports,i=n[t]!==s,c=s!==e.exports;if(a&&!i&&c&&(n[t]=e.exports),r===e.component){if(o){let p=e.component.manager;i&&p.W(e,n[t]),e.onUpdate(m=>{if(m.has(t)){let b=n[t];b!==e.exports&&p.W(e,b)}})}e.O=o?void 0:t}let d=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{n[t]!==e.exports&&(d?P(()=>{n[t]=e.exports}):n[t]=e.exports)})};var M=e=>_(void 0,e),z=e=>r=>_(r,e),g=class extends v{constructor(r,t){super(r);let o=this.exports;try{E(this.component);let s=t(this.component,this),n=this.exports!==o;if(x(s)){n||this.setProvisionalExports(s);let a=s.then(i=>{this.exports=i,super.catchUpLifecycle()}).catch(i=>{this.P.reject(i)});this.onLoad(async()=>await a)}else(!n||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this.P.reject(s)}}catchUpLifecycle(){}},_=L(g),B=(e,r)=>new y(e,r),y=class extends v{#e;#t;#o;constructor(r,t){super(),!!1&&(this.#t=r,this.#o=t,this.#e=new MutationObserver(o=>{o.forEach(s=>{r.includes(s.attributeName)&&t.call(this.component,this.component.el.getAttribute(s.attributeName),s.oldValue,s.attributeName)})}))}hostConnected(){this.#t.forEach(r=>{this.component.el.hasAttribute(r)&&this.#o.call(this.component,null,this.component.el.getAttribute(r),r)}),this.#e.observe(this.component.el,{attributes:!0,attributeOldValue:!0,attributeFilter:this.#t})}hostDisconnected(){this.#e.disconnect()}};var J=e=>(...r)=>{let t=u(),o=new e(...r);return h(t.at(-1)),o};var Q=e=>(r={})=>M((t,o)=>{let s=O(t.el),n={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},a=t;o.onLifecycle(()=>w(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:l,lang:d})=>{let p={...l,_lang:d,_t9nLocale:c,_loading:!1};o.exports=p;let m=l.componentLabel;typeof m=="string"&&"label"in t&&t.label==null&&(t.label??=m),i(a.messageOverrides)},r.name));let i=c=>{let l=o.exports,d=l._original??l,p=N(d,c);c&&(p._original=d),o.exports=p};return"messageOverrides"in a&&o.onUpdate(c=>{c.has("messageOverrides")&&i(a.messageOverrides)}),r.blocking?(o.setProvisionalExports(n,!1),o.ready):n}),N=(e,r)=>{if(!r)return e;let t={...e};return Object.entries(r).forEach(([o,s])=>{e[o]!==void 0&&(typeof s=="object"?t[o]=N(e[o],s):t[o]=s??e[o])}),t};export{M as a,z as b,B as c,J as d,Q as e};