/* COPYRIGHT Esri - https://js.arcgis.com/1.2/LICENSE.txt */
import{a as P}from"./FOQPGXXA.js";import{a as C,b as L,c as N,n as m,q as w,s as x}from"./5CQPQ7AE.js";var _=(n,r)=>{let t=n;for(;t;){if(t===r)return!0;if(!t.parentNode)return!1;t.parentNode instanceof ShadowRoot?t=t.parentNode.host:t=t.parentNode}return!1},d=(n,r,t)=>{let e=D(r).subscribe;return e(o=>{o.some(s=>_(n,s.target))&&t()})},g={},D=n=>{let r=n.join(","),t=g[r];if(t!==void 0)return t;let e=new Set,o=new MutationObserver(s=>e.forEach(a=>a(s)));globalThis.document&&o.observe(document.documentElement,{attributes:!0,attributeFilter:n,subtree:!0});let i={subscribe:s=>(e.add(s),()=>{e.delete(s),e.size===0&&(o.disconnect(),g[r]=void 0)})};return g[r]=i,i},S=(n,r)=>{let t=n;for(;t;){let e=t.closest?.(r);if(e)return e;let o=t.getRootNode?.();if(o===globalThis.document)return;t=o.host}};var h=(n,r,t)=>S(n,`[${r}]`)?.getAttribute(r)??t;var j="ar,bg,bs,ca,cs,da,de,el,en,es,et,fi,fr,he,hr,hu,id,it,ja,ko,lt,lv,nl,nb,no,pl,pt-BR,pt-PT,ro,ru,sk,sl,sr,sv,th,tr,uk,vi,zh-CN,zh-HK,zh-TW".split(","),F=new Set(j),f="en",z={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},V=async(n,r,t="")=>{let e=`${r}/${t}`,o=`${e}${n}.json`;return b[o]??(b[o]=O(n,e)),await b[o]},b={},O=async(n,r)=>{let t=`${r}${n}.json`;try{let e=await fetch(t);if(e.ok)return await e.json()}catch(e){return m("error","intl",`An unknown error occurred while fetching localization strings at ${t}`,{detail:{error:e}}),{}}return n===f?{}:await O(f,r)},v=n=>{let r=h(n,"lang",globalThis.navigator?.language||f);return{lang:r,t9nLocale:k(r)}},k=n=>{let[r,t]=n.split("-"),e=r.toLowerCase(),o=e;return t&&(o=`${e}-${t.toUpperCase()}`),o=z[o]??o,F.has(o)?o:t?k(e):f},T=(n,r,t,e)=>{let o,i=()=>G(n,r(),e).then(s=>{(o?.lang!==s.lang||o.t9nLocale!==s.t9nLocale||o.t9nStrings!==s.t9nStrings)&&t(s),o=s}).catch(s=>{m("error","intl","Error updating component locale state",{detail:{error:s}})});return queueMicrotask(i),d(n,["lang"],i)},G=async(n,r,t=n.localName.split("-").slice(1).join("-"))=>{let{lang:e,t9nLocale:o}=v(n),i=`${r}/${t}/t9n`,a=t===null?{}:await V(o,i,"messages.");return{lang:e,t9nLocale:o,t9nStrings:a}};var $=n=>R(void 0,n);var E=class extends x{constructor(r,t){super(r);let e=this.exports;try{L(this.component);let o=t(this.component,this),i=this.exports!==e;if(C(o)){i||this.setProvisionalExports(o);let s=o.then(a=>{this.exports=a,super.catchUpLifecycle()}).catch(a=>{this.P.reject(a)});this.onLoad(async()=>await s)}else(!i||o!==void 0)&&(this.exports=o),queueMicrotask(()=>super.catchUpLifecycle())}catch(o){this.P.reject(o)}}catchUpLifecycle(){}},R=P(E);var A="ltr",pt=()=>$((n,r)=>{r.exports=A,r.onLifecycle(()=>{let t=()=>{let e=h(n.el,"dir",A);r.exports=e==="rtl"?"rtl":"ltr"};return t(),d(n.el,["dir"],t)})}),dt=n=>(r={})=>$((t,e)=>{let o=v(t.el),i={_lang:o.lang,_t9nLocale:o.t9nLocale,_loading:!0},s=t;e.onLifecycle(()=>T(t.el,()=>n("./assets"),({t9nLocale:c,t9nStrings:l,lang:u})=>{let p={...l,_lang:u,_t9nLocale:c,_loading:!1};e.exports=p;let y=l.componentLabel;typeof y=="string"&&"label"in t&&t.label==null&&(t.label??=y),a(s.messageOverrides)},r.name));let a=c=>{let l=e.exports,u=l._original??l,p=M(u,c);c&&(p._original=u),e.exports=p};return"messageOverrides"in s&&e.onUpdate(c=>{c.has("messageOverrides")&&a(s.messageOverrides)}),r.blocking?(e.setProvisionalExports(i,!1),e.ready):i}),M=(n,r)=>{if(!r)return n;let t={...n};return Object.entries(r).forEach(([e,o])=>{n[e]!==void 0&&(typeof o=="object"?t[e]=M(n[e],o):t[e]=o??n[e])}),t},ht=n=>H,U="arcgisPropertyChange",H=(...n)=>{let r=N(),t=w(U,void 0,r),e=!0;return r.manager.onUpdated(o=>{if(e||!r.el.isConnected){e=!1;return}for(let i of n)o.has(i)&&t.emit({name:i})}),t};export{pt as a,dt as b,ht as c};
