/*! All material copyright Esri, All Rights Reserved, unless otherwise specified.
See https://js.arcgis.com/4.34/esri/copyright.txt for details.
v4.34.0-next.75 */
var v=(t,e)=>{let o=t;for(;o;){if(o===e)return!0;if(!o.parentNode)return!1;o.parentNode instanceof ShadowRoot?o=o.parentNode.host:o=o.parentNode}return!1},f=(t,e,o)=>{let n=E(e).subscribe;return n(s=>{s.some(r=>v(t,r.target))&&o()})},u={},E=t=>{let e=t.join(","),o=u[e];if(o!==void 0)return o;let n=new Set,s=new MutationObserver(r=>n.forEach(l=>l(r)));globalThis.document&&s.observe(document.documentElement,{attributes:!0,attributeFilter:t,subtree:!0});let c={subscribe:r=>(n.add(r),()=>{n.delete(r),n.size===0&&(s.disconnect(),u[e]=void 0)})};return u[e]=c,c},h=(t,e)=>{let o=t;for(;o;){let n=o.closest?.(e);if(n)return n;let s=o.getRootNode?.();if(s===globalThis.document)return;o=s.host}};function S(t){let e=h(t,".calcite-mode-dark, .calcite-mode-light, .calcite-mode-auto");return e?.classList.contains("calcite-mode-dark")||e?.classList.contains("calcite-mode-auto")&&window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light"}var p=(t,e,o)=>h(t,`[${e}]`)?.getAttribute(e)??o,A=async t=>{t!=null&&(g(t)?await t.setFocus():t.focus())},g=t=>typeof t.setFocus=="function",T=(t,e)=>{if(t?.shadowRoot){if(t.hasAttribute("hydrated")||t.hasAttribute("calcite-hydrated")){i(t,e);return}Promise.resolve(t.componentOnReady?.()).then(()=>i(t,e))}},L=t=>t.nodeType===Node.ELEMENT_NODE,i=(t,e="")=>{if(!L(t))return!1;if(t.matches(e))return g(t)&&setTimeout(()=>void t.setFocus(),0),!0;for(let n of t.children)if(i(n,e))return!0;let o=t.shadowRoot;if(o){for(let n of o.children)if(i(n,e))return!0}return!1};var y="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(","),w=new Set(y),a="en",N={pt:"pt-PT",nb:"no",nn:"no",zh:"zh-CN"},$=async(t,e,o="")=>{let n=`${e}/${o}`,s=`${n}${t}.json`;return d[s]??(d[s]=m(t,n)),await d[s]},d={},m=async(t,e)=>{let o=`${e}${t}.json`;try{let n=await fetch(o);if(n.ok)return await n.json()}catch(n){return console.error(n),{}}return t===a?{}:await m(a,e)},k=t=>{let e=p(t,"lang",globalThis.navigator?.language||a);return{lang:e,t9nLocale:b(e)}},b=t=>{let[e,o]=t.split("-"),n=e.toLowerCase(),s=n;return o&&(s=`${n}-${o.toUpperCase()}`),s=N[s]??s,w.has(s)?s:o?b(n):a},j=(t,e,o,n)=>{let s,c=()=>C(t,e(),n).then(r=>{(s?.lang!==r.lang||s.t9nLocale!==r.t9nLocale||s.t9nStrings!==r.t9nStrings)&&o(r),s=r}).catch(console.error);return queueMicrotask(c),f(t,["lang"],c)},C=async(t,e,o=t.localName.split("-").slice(1).join("-"))=>{let{lang:n,t9nLocale:s}=k(t),c=`${e}/${o}/t9n`,l=o===null?{}:await $(s,c,"messages.");return{lang:n,t9nLocale:s,t9nStrings:l}};export{f as a,S as b,A as c,T as d,w as e,$ as f,k as g,b as h,j as i};
