UNPKG

@esri/calcite-components

Version:

Web Components for Esri's Calcite Design System.

5 lines (4 loc) 2.94 kB
/*! All material copyright ESRI, All Rights Reserved, unless otherwise specified. See https://github.com/Esri/calcite-design-system/blob/dev/LICENSE.md for details. v3.2.1 */ import{S as w,a as b,b as C,j as _,k as P,l as u,m,n as O,o as f,p as v,r as g}from"./BJZTU5BQ.js";var L=e=>(...o)=>{let t=m(),r=new e(...o),s=r.exports;u(t.at(-1));let n=r.component.manager;n._markExports(r,s),r.watchExports(a=>n._markExports(r,a)),O(r);let i=[r.component,...t].reverse();return v(i,a=>a===void 0?void 0:V(r,a,s),s)};function V(e,{host:o,key:t,isReactive:r},s){let n=o,i=n[t]!==e.exports,a=n[t]!==s,c=s!==e.exports;if(i&&!a&&c&&(n[t]=e.exports),o===e.component){if(r){let p=e.component.manager;a&&p._markExports(e,n[t]),e.onUpdate(h=>{if(h.has(t)){let E=n[t];E!==e.exports&&p._markExports(e,E)}})}e.assignedProperty=r?void 0:t}let d=e.component.constructor.elementProperties.get(t)?.readOnly;e.watchExports(()=>{n[t]!==e.exports&&(d?f(()=>{n[t]=e.exports}):n[t]=e.exports)})}var M=e=>N(void 0,e),ee=e=>o=>N(o,e),x=class extends g{constructor(o,t){super(o);let r=this.exports;try{P(this.component);let s=t(this.component,this),n=this.exports!==r;if(_(s)){n||this.setProvisionalExports(s);let i=s.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this._ready.reject(a),console.error(a)});this.onLoad(async()=>await i)}else(!n||s!==void 0)&&(this.exports=s),queueMicrotask(()=>super.catchUpLifecycle())}catch(s){this._ready.reject(s),console.error(s)}}catchUpLifecycle(){}},N=L(x),te=(e,o)=>new y(e,o),y=class extends g{constructor(o,t){super(),this._attributes=o,this._callback=t,!!1&&(this._observer=new MutationObserver(r=>{r.forEach(s=>{o.includes(s.attributeName)&&t.call(this.component,this.component.el.getAttribute(s.attributeName),s.oldValue,s.attributeName)})}))}hostConnected(){this._attributes.forEach(o=>{this.component.el.hasAttribute(o)&&this._callback.call(this.component,null,this.component.el.getAttribute(o),o)}),this._observer.observe(this.component.el,{attributes:!0,attributeOldValue:!0,attributeFilter:this._attributes})}hostDisconnected(){this._observer.disconnect()}};var re=e=>(...o)=>{let t=m(),r=new e(...o);return u(t.at(-1)),r};var k=e=>(o={})=>M((t,r)=>{let s=b(t.el),n={_lang:s.lang,_t9nLocale:s.t9nLocale,_loading:!0},i=t;r.onLifecycle(()=>C(t.el,()=>e("./assets"),({t9nLocale:c,t9nStrings:l,lang:d})=>{let p={...l,_lang:d,_t9nLocale:c,_loading:!1};r.exports=p;let h=l.componentLabel;typeof h=="string"&&"label"in t&&t.label==null&&(t.label??=h),a(i.messageOverrides)},o.name));function a(c){let l=r.exports,d=l._original??l,p=A(d,c);c&&(p._original=d),r.exports=p}return"messageOverrides"in i&&r.onUpdate(c=>{c.has("messageOverrides")&&a(i.messageOverrides)}),o.blocking?(r.setProvisionalExports(n,!1),r.ready):n});function A(e,o){if(!o)return e;let t={...e};return Object.entries(o).forEach(([r,s])=>{typeof s=="object"?t[r]=A(e[r],s):t[r]=s??e[r]}),t}var ae=k(w);export{ee as a,te as b,re as c,ae as d};