"use strict";const n=require("react"),b=require("./SSRProvider-DZRLwxPS.cjs.js"),s=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),v=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function i(e){if(Intl.Locale){let t=new Intl.Locale(e).maximize(),r=typeof t.getTextInfo=="function"?t.getTextInfo():t.textInfo;if(r)return r.direction==="rtl";if(t.script)return s.has(t.script)}let a=e.split("-")[0];return v.has(a)}const d=Symbol.for("react-aria.i18n.locale");function $(){let e=typeof window<"u"&&window[d]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([e])}catch{e="en-US"}return{locale:e,direction:i(e)?"rtl":"ltr"}}let f=$(),l=new Set;function c(){f=$();for(let e of l)e(f)}function u(){let e=b.$b5e257d569688ac6$export$535bd6ca7f90a273(),[a,t]=n.useState(f);return n.useEffect(()=>(l.size===0&&window.addEventListener("languagechange",c),l.add(t),()=>{l.delete(t),l.size===0&&window.removeEventListener("languagechange",c)}),[]),e?{locale:typeof window<"u"&&window[d]||"en-US",direction:"ltr"}:a}const o=n.createContext(null);function p(e){let{locale:a,children:t}=e,r=n.useMemo(()=>({locale:a,direction:i(a)?"rtl":"ltr"}),[a]);return n.createElement(o.Provider,{value:r},t)}function g(e){let{children:a}=e,t=u();return n.createElement(o.Provider,{value:t},a)}function h(e){let{locale:a,children:t}=e;return a?n.createElement(p,{locale:a,children:t}):n.createElement(g,{children:t})}function x(){let e=u();return n.useContext(o)||e}exports.$18f2051aff69b9bf$export$43bb16f9c6d9e3f7=x;exports.$18f2051aff69b9bf$export$a54013f0d02a8f82=h;
//# sourceMappingURL=context-XwB7Jud0.cjs.js.map
