intlayer-editor 4.1.9 → 4.1.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -100,7 +100,7 @@ React keys must be passed directly to JSX without using spread:
100
100
  * Copyright(c) 2012-2014 Isaac Z. Schlueter
101
101
  * Copyright(c) 2015 Douglas Christopher Wilson
102
102
  * MIT Licensed
103
- */var $h;function By(){if($h)return $l.exports;$h=1;var e=Ty(),t=Dy(),r=by(),a=Ly();$l.exports=l,$l.exports.Negotiator=l;function l(s){if(!(this instanceof l))return new l(s);this.request=s}return l.prototype.charset=function(o){var u=this.charsets(o);return u&&u[0]},l.prototype.charsets=function(o){return e(this.request.headers["accept-charset"],o)},l.prototype.encoding=function(o,u){var d=this.encodings(o,u);return d&&d[0]},l.prototype.encodings=function(o,u){var d=u||{};return t(this.request.headers["accept-encoding"],o,d.preferred)},l.prototype.language=function(o){var u=this.languages(o);return u&&u[0]},l.prototype.languages=function(o){return r(this.request.headers["accept-language"],o)},l.prototype.mediaType=function(o){var u=this.mediaTypes(o);return u&&u[0]},l.prototype.mediaTypes=function(o){return a(this.request.headers.accept,o)},l.prototype.preferredCharset=l.prototype.charset,l.prototype.preferredCharsets=l.prototype.charsets,l.prototype.preferredEncoding=l.prototype.encoding,l.prototype.preferredEncodings=l.prototype.encodings,l.prototype.preferredLanguage=l.prototype.language,l.prototype.preferredLanguages=l.prototype.languages,l.prototype.preferredMediaType=l.prototype.mediaType,l.prototype.preferredMediaTypes=l.prototype.mediaTypes,$l.exports}By();h0().internationalization;const jp=e=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e),{internationalization:Fy}=h0(),{locales:Oy}=Fy,Py=(e,t=Oy)=>{const r=jp(e),a=r?new URL(e):new URL(e,"http://example.com"),l=a.pathname;l.startsWith("/")||(a.pathname=`/${l}`);const s=l.split("/"),o=s[1];if(t.includes(o)){s.splice(1,1);const u=s.join("/")??"/";a.pathname=u}return r?a.toString():a.toString().replace("http://example.com","")},{internationalization:Hy,middleware:Uy}=h0(),{locales:Vy,defaultLocale:Gy}=Hy,{prefixDefault:jy}=Uy,Ky=(e,t=Vy,r=Gy,a=jy)=>{const l=Py(e,t),s=jp(l),o=s?new URL(l):new URL(l,"http://example.com");let u=o.pathname;u.startsWith("/")||(u=`/${u}`);const d=s?`${o.protocol}//${o.host}`:"";return t.reduce((m,v)=>{const A=v.toString()===r.toString();let _=a||!A?`/${v}${u}`:u;_.length>1&&_.endsWith("/")&&(_=_.slice(0,-1));const N=s?`${d}${_}${o.search}${o.hash}`:`${_}${o.search}${o.hash}`;return m[v]=N,m},{})},{internationalization:Wy,middleware:Yy}=h0(),{locales:$y,defaultLocale:Zy}=Wy,{prefixDefault:qy}=Yy,Jy=(e,t,r=$y,a=Zy,l=qy)=>Ky(e,r,a,l)[t],Zh=(e,t,r)=>{let a=e,l=null,s=[];for(const o of t)l=a,o.type===m2.Object?(s=[o.key],a[o.key]||(a={...a,[o.key]:{}}),a=a[o.key]):o.type===m2.Array?(s=[o.key],a[o.key]||(a[o.key]={}),a=a[o.key]):o.type===m2.Translation?(s=[m2.Translation,o.key],a[m2.Translation]||(a[m2.Translation]={...a[m2.Translation],[o.key]:r}),a=a[m2.Translation][o.key]):o.type===m2.Enumeration&&(s=[m2.Enumeration,o.key],a[m2.Enumeration]||(a[m2.Enumeration]={...a[m2.Enumeration],[o.key]:r}),a=a[m2.Enumeration][o.key]);if(l&&s.length>0){for(const o of s.slice(0,-1))l=l[o];typeof r>"u"?delete l[s[s.length-1]]:l[s[s.length-1]]=r}return e},je=(e,t)=>{let r=JSON.parse(JSON.stringify(e??{}));for(const a of t)a.type===m2.Object||a.type===m2.Array?r=r==null?void 0:r[a.key]:a.type===m2.Translation?r=r==null?void 0:r[m2.Translation][a.key]:a.type===m2.Enumeration&&(r=r==null?void 0:r[m2.Enumeration][a.key]);return r},Qy=Symbol.for("react.element"),Xy=e=>typeof e=="object"&&e!==null&&e.$$typeof===Qy,f6=e=>typeof e=="string"?m2.Text:(e==null?void 0:e.nodeType)===m2.Translation?m2.Translation:(e==null?void 0:e.nodeType)===m2.Enumeration?m2.Enumeration:Array.isArray(e)?m2.Array:Xy(e)?m2.ReactNode:m2.Object,ek=(e,t,r)=>{let a=e,l=null,s=null;for(const o of r)l=a,o.type===m2.Object||o.type===m2.Array?(s=o.key,a=a[o.key]):o.type===m2.Translation?(s=m2.Translation,a=a[m2.Translation][o.key]):o.type===m2.Enumeration&&(s=m2.Enumeration,a=a[m2.Enumeration][o.key]);if(l&&s!==null)if(Array.isArray(l))l[s]=a;else{const o={};for(const u of Object.keys(l))u===s?o[t]=a:o[u]=l[u];Object.keys(l).forEach(u=>delete l[u]),Object.assign(l,o)}return e},Kp=E.createContext(void 0),Wp=E.createContext(void 0),tk=()=>ar("INTLAYER_EDITED_CONTENT_CHANGED",void 0,{emit:!0,receive:!1}),rk=({children:e})=>{const{localeDictionaries:t}=Pp(),[r,a]=ar("INTLAYER_EDITED_CONTENT_CHANGED",void 0,{emit:!0,receive:!0}),l=(A,g)=>{a(_=>({..._,[A]:{..._==null?void 0:_[A],content:g}}))},s=(A,g,_=[],N=!0)=>{a(S=>{var w,D;const y=(w=t[A])==null?void 0:w.content,C=((D=S==null?void 0:S[A])==null?void 0:D.content)||JSON.parse(JSON.stringify(y));let M=_;if(!N){let L=0;const K=_.slice(0,-1),$=_[_.length-1];let W=$.key;for(;typeof je(C,M)<"u";)L++,W=L===0?$.key:`${$.key} (${L})`,M=[...K,{...$,key:W}]}const x=Zh(C,M,g);return{...S,[A]:{...S==null?void 0:S[A],content:x}}})},o=(A,g,_=[])=>{a(N=>{var M,x;const S=(M=t[A])==null?void 0:M.content,y=((x=N==null?void 0:N[A])==null?void 0:x.content)||JSON.parse(JSON.stringify(S)),C=ek(y,g,_);return{...N,[A]:{...N==null?void 0:N[A],content:C}}})},u=(A,g)=>{a(_=>{var M,x;const N=(M=t[A])==null?void 0:M.content,S=((x=_==null?void 0:_[A])==null?void 0:x.content)||JSON.parse(JSON.stringify(N)),y=je(N,g),C=Zh(S,g,y);return{..._,[A]:{..._==null?void 0:_[A],content:C}}})},d=A=>{a(g=>{const _={...g};return delete _[A],_})},f=A=>{a(g=>Object.entries(g).reduce((N,[S,y])=>S===A?N:{...N,[S]:y},{}))},m=()=>{a({})},v=(A,g)=>{var N;const _=((N=r==null?void 0:r[A])==null?void 0:N.content)??{};return je(_,g)};return G.jsx(Kp.Provider,{value:{editedContent:r},children:G.jsx(Wp.Provider,{value:{setEditedContentState:a,setEditedContent:l,addEditedContent:s,renameEditedContent:o,removeEditedContent:u,restoreEditedContent:d,clearEditedDictionaryContent:f,clearEditedContent:m,getEditedContentValue:v},children:e})})},Ea=()=>{const e=E.useContext(Wp);if(!e)throw new Error("useEditedContent must be used within an EditedContentProvider");return e},me=()=>{const e=E.useContext(Kp),t=Ea();if(!e)throw new Error("useEditedContent must be used within an EditedContentProvider");return{...e,...t}},Yp=E.createContext(void 0),$p=E.createContext(void 0),nk=({children:e})=>{const[t,r]=ar("INTLAYER_FOCUSED_CONTENT_CHANGED",null),a=l=>{r(s=>s&&{...s,keyPath:l})};return G.jsx(Yp.Provider,{value:{focusedContent:t},children:G.jsx($p.Provider,{value:{setFocusedContent:r,setFocusedContentKeyPath:a},children:e})})},ak=()=>{const e=E.useContext($p);if(e===void 0)throw new Error("useFocusDictionaryActions must be used within a FocusDictionaryProvider");return e},ct=()=>{const e=ak(),t=E.useContext(Yp);if(t===void 0)throw new Error("useFocusDictionaryState must be used within a FocusDictionaryProvider");return{...t,...e}},Zp=E.createContext(void 0),qp=e=>ar("INTLAYER_EDITOR_ENABLED",!1,e),lk=({children:e})=>{const[t]=qp({emit:!1,receive:!0});return G.jsx(Zp.Provider,{value:{enabled:t},children:e})},Jp=()=>{const e=E.useContext(Zp);if(!e)throw new Error("useEditorEnabled must be used within a EnabledProvider");return e},ik=({mode:e,children:t})=>{const{enabled:r}=Jp();return r||e==="editor"?G.jsx(vy,{children:G.jsx(rk,{children:G.jsx(nk,{children:t})})}):t},sk=({children:e,mode:t,configuration:r,...a})=>G.jsx(fy,{...a,children:G.jsx(lk,{children:G.jsx(py,{configuration:r,children:G.jsx(ik,{mode:t,children:e})})})}),ck=(e,t)=>{const r=ar("INTLAYER_URL_CHANGE",e,t),[a,l]=r;return E.useEffect(()=>{const s=history.pushState,o=history.replaceState,u=f=>function(...m){f.apply(this,m),window.dispatchEvent(new Event("locationchange"))};history.pushState=u(s),history.replaceState=u(o);const d=()=>{l(window.location.pathname)};return window.addEventListener("locationchange",d),window.addEventListener("popstate",d),window.addEventListener("hashchange",d),window.addEventListener("load",d),d(),()=>{window.removeEventListener("locationchange",d),window.removeEventListener("popstate",d),window.removeEventListener("hashchange",d),window.removeEventListener("load",d),history.pushState=s,history.replaceState=o}},[l]),r},ok=e=>{const t=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window}),r=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});Object.assign(r,{iframeData:e}),Object.assign(t,{iframeData:e}),window.dispatchEvent(r),window.dispatchEvent(t)},uk=()=>l5("INTLAYER_IFRAME_CLICKED",ok),qh={method:"GET",headers:{"Content-Type":"application/json"}},dk=e=>(Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e),Xl=e=>e.reduce((t,r)=>{const a=t??{},l=dk(r??{});return typeof a=="object"&&typeof l=="object"?{...a,...l}:l??a},{}),F2=async(e,...t)=>{const{signal:r}=new AbortController;let a="",l;const s=t.map(({body:g,params:_,headers:N,...S})=>S),o=Xl([qh,...s]),u=Xl([qh.headers,...t.map(g=>g.headers)]),d=Xl(t.map(g=>g.params)),f=o.method;if(f!=="GET"&&f!=="HEAD"){const g=Xl(t.map(_=>_.body));(u==null?void 0:u["Content-Type"])==="application/x-www-form-urlencoded"?l=new URLSearchParams(g).toString():l=JSON.stringify(g)}Object.entries(d).length>0&&(a=`?${new URLSearchParams(d).toString()}`);const m={...o,headers:u,body:l,signal:r},v=`${e}${a}`,A=await fetch(v,m);if(!A.ok){const g=await A.json();throw console.error(g),new Error(JSON.stringify(g.error)??"An error occurred")}return await A.json()},Qp=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/ai`;return{auditContentDeclaration:async(f,m={})=>await F2(`${a}/audit/content-declaration`,e,m,{method:"POST",body:f}),auditContentDeclarationField:async(f,m={})=>await F2(`${a}/audit/content-declaration/field`,e,m,{method:"POST",body:f}),auditContentDeclarationMetadata:async(f,m={})=>await F2(`${a}/audit/content-declaration/metadata`,e,m,{method:"POST",body:f}),auditTag:async(f,m={})=>await F2(`${a}/audit/tag`,e,m,{method:"POST",body:f}),askDocQuestion:async(f,m={})=>await F2(`${a}/ask`,e,m,{method:"POST",body:f})}};Qp();const Xp=(e={},t)=>{const{backendURL:r,clientId:a,clientSecret:l}=(t??h0()).editor,s=`${r}/api/auth`;return{login:async(w,D={})=>await F2(`${s}/login`,e,D,{method:"POST",body:w}),getLoginWithGitHubURL:w=>{const D=new URLSearchParams(w);return`${s}/login/github?${D.toString()}`},getLoginWithGoogleURL:w=>{const D=new URLSearchParams(w);return`${s}/login/google?${D.toString()}`},register:async(w,D={},L={})=>await F2(`${s}/register`,e,L,{method:"POST",body:w,params:D}),logout:async(w={})=>await F2(`${s}/logout`,e,w,{method:"POST"}),resetPassword:async(w,D={})=>await F2(`${s}/password/reset`,e,D,{params:w,method:"POST"}),askResetPassword:async(w,D={})=>await F2(`${s}/password/reset`,e,D,{method:"POST",body:{email:w}}),checkIfUserHasPassword:async(w={})=>await F2(`${s}/password/has`,e,w,{method:"GET"}),verifyEmail:async({userId:w,secret:D},L={})=>await F2(`${s}/active/${w}/${D}`,e,L,{method:"PUT"}),getVerifyEmailStatusURL:w=>`${s}/verify-email-status/${String(w)}`,changePassword:async(w,D={})=>await F2(`${s}/password`,e,D,{method:"PUT",body:w}),createSession:async(w,D={})=>await F2(`${s}/session`,e,D,{method:"POST",body:w}),getSession:async(w,D={})=>await F2(`${r}/session`,e,D,{params:{session_token:w}}),getCSRFToken:async(w={})=>await F2(`${r}/csrf-token`,e,w),getOAuth2AccessToken:async(w={})=>await F2(`${r}/oauth2/token`,e,w,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{grant_type:"client_credentials",client_id:a,client_secret:l}})}};Xp();const ev=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/dictionary`;return{getDictionaries:async(v,A={})=>await F2(a,e,A,{params:v}),getDictionariesKeys:async(v={})=>await F2(`${a}/keys`,e,v),getDictionary:async(v,A,g={})=>await F2(`${a}/${v}`,e,g,{params:A?{version:A.toString()}:void 0}),pushDictionaries:async(v,A={})=>await F2(`${a}`,e,A,{method:"PATCH",body:{dictionaries:v}}),addDictionary:async(v,A={})=>await F2(`${a}`,e,A,{method:"POST",body:v}),updateDictionary:async(v,A,g={})=>await F2(`${a}/${v}`,e,g,{method:"PUT",body:A}),deleteDictionary:async(v,A={})=>await F2(`${a}`,e,A,{method:"DELETE",body:{id:v}})}};ev();const tv=(e={},t)=>{const{editorURL:r}=(t??h0()).editor,a=`${r}/api`;return{getConfiguration:async(o={})=>(await F2(`${a}/config`,e,o)).data,writeDictionary:async(o,u={})=>{await F2(`${a}/dictionary`,e,u,{method:"POST",body:o})}}};tv();const rv=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/organization`;return{getOrganizations:async(g,_={})=>await F2(a,e,_,{params:g}),getOrganization:async(g,_={})=>await F2(`${a}/${String(g)}`,e,_),addOrganization:async(g,_={})=>await F2(a,e,_,{method:"POST",body:g}),addOrganizationMember:async(g,_={})=>F2(`${a}/member`,e,_,{method:"POST",body:g}),updateOrganization:async(g,_={})=>F2(a,e,_,{method:"PUT",body:g}),updateOrganizationMembers:async(g,_={})=>F2(`${a}/members`,e,_,{method:"PUT",body:g}),deleteOrganization:async(g={})=>await F2(a,e,g,{method:"DELETE"}),selectOrganization:async(g,_={})=>await F2(`${a}/${String(g)}`,e,_,{method:"PUT"}),unselectOrganization:async(g={})=>await F2(`${a}/logout`,e,g,{method:"POST"})}};rv();const nv=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/project`;return{getProjects:async(N,S={})=>await F2(a,e,S,{params:N}),addProject:async(N,S={})=>await F2(`${a}`,e,S,{method:"POST",body:N}),updateProject:async(N,S={})=>await F2(`${a}`,e,S,{method:"PUT",body:N}),updateProjectMembers:async(N,S={})=>await F2(`${a}/members`,e,S,{method:"PUT",body:N}),pushProjectConfiguration:async(N,S={})=>await F2(`${a}/configuration`,e,S,{method:"PUT",body:N}),deleteProject:async(N={})=>await F2(`${a}`,e,N,{method:"DELETE"}),selectProject:async(N,S={})=>await F2(`${a}/${String(N)}`,e,S,{method:"PUT"}),unselectProject:async(N={})=>await F2(`${a}/logout`,e,N,{method:"POST"}),addNewAccessKey:async(N,S={})=>await F2(`${a}/access_key`,e,S,{method:"POST",body:N}),deleteAccessKey:async(N,S={})=>await F2(`${a}/access_key`,e,S,{method:"DELETE",body:{clientId:N}}),refreshAccessKey:async(N,S={})=>await F2(`${a}/access_key`,e,S,{method:"PATCH",body:{clientId:N}})}};nv();const hk=(e={},t)=>{const a=`${(t??h0()).editor.backendURL}/api/stripe`;return{getSubscription:async(o,u={})=>await F2(`${a}/create-subscription`,e,u,{method:"POST",body:o}),cancelSubscription:async(o={})=>await F2(`${a}/cancel-subscription`,e,o,{method:"POST"})}},av=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/tag`;return{getTags:async(d,f={})=>await F2(a,e,f,{params:d}),addTag:async(d,f={})=>await F2(`${a}`,e,f,{method:"POST",body:d}),updateTag:async(d,f,m={})=>await F2(`${a}/${d}`,e,m,{method:"PUT",body:f}),deleteTag:async(d,f={})=>await F2(`${a}/${d}`,e,f,{method:"DELETE"})}};av();const lv=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/user`;return{createUser:async(v,A={})=>await F2(`${a}/`,e,A,{method:"POST",body:v}),getUsers:async(v,A={})=>await F2(a,e,A,{params:v}),getUserById:async(v,A={})=>await F2(`${a}/${v}`,e,A),getUserByAccount:async(v,A,g={})=>await F2(`${a}/account/${A}/${v}`,e,g),getUserByEmail:async(v,A={})=>await F2(`${a}/email/${v}`,e,A),updateUser:async(v,A={})=>await F2(`${a}`,e,A,{method:"PUT",body:v}),deleteUser:async(v,A={})=>await F2(`${a}/${v}`,e,A,{method:"DELETE"})}};lv();const Ia=(e={},t)=>({organization:rv(e,t),project:nv(e,t),user:lv(e,t),auth:Xp(e,t),dictionary:ev(e,t),stripe:hk(e,t),ai:Qp(e,t),tag:av(e,t),editor:tv(e,t)});Ia();const fk=e=>{var o;const t=e??h0(),r=Ia(void 0,t),{data:a,isFetched:l}=ga("getCSRFToken",r.auth.getCSRFToken,{cache:!0,autoFetch:!0});return{csrfToken:(o=a==null?void 0:a.data)==null?void 0:o.csrf_token,csrfTokenFetched:l}},mk=(e,t)=>{const r=t??h0(),a=Ia(void 0,r),{data:l}=ga("getOAuth2AccessToken",()=>a.auth.getOAuth2AccessToken({body:{csrf_token:e}}),{cache:!0,autoFetch:!0,enable:!!(r.editor.clientId&&r.editor.clientSecret&&e)});return{oAuth2AccessToken:l==null?void 0:l.data}},pk=(e,t)=>{const r=t??h0(),a=Ia(void 0,r),{getSession:l,revalidate:s,data:o,setData:u,isFetched:d}=ga("getSession",async()=>{try{const m=await a.auth.getSession();if(m.data){const{user:v,organization:A,project:g}=m.data;return{user:v,organization:A,isOrganizationAdmin:(v&&((A==null?void 0:A.adminsIds)??[]).includes(v._id))??!1,project:g,isProjectAdmin:(v&&((g==null?void 0:g.adminsIds)??[]).includes(v._id))??!1}}}catch(m){console.error(m)}return null},{cache:!0,store:!0,autoFetch:!0,enable:!e,invalidateQueries:["getOrganizations","getProjects","getUsers","getDictionaries"]});return{session:E.useMemo(()=>o??(d?null:void 0),[o,d]),fetchSession:l,revalidateSession:s,setSession:u}},ks=({session:e,intlayerConfiguration:t}={})=>{const{csrfToken:r,csrfTokenFetched:a}=fk(t),{session:l,fetchSession:s,revalidateSession:o,setSession:u}=pk(e,t),{oAuth2AccessToken:d}=mk(r,t);return E.useMemo(()=>({session:l,fetchSession:s,setSession:u,revalidateSession:o,csrfToken:r,csrfTokenFetched:a,oAuth2AccessToken:d,isProjectAdmin:l==null?void 0:l.isProjectAdmin,isOrganizationAdmin:l==null?void 0:l.isOrganizationAdmin}),[l,u,s,o,r,a,d])};function p0(e,t,{checkForDefaultPrevented:r=!0}={}){return function(l){if(e==null||e(l),r===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function Jh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iv(...e){return t=>{let r=!1;const a=e.map(l=>{const s=Jh(l,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let l=0;l<a.length;l++){const s=a[l];typeof s=="function"?s():Jh(e[l],null)}}}}function U0(...e){return E.useCallback(iv(...e),e)}function vk(e,t){const r=E.createContext(t),a=s=>{const{children:o,...u}=s,d=E.useMemo(()=>u,Object.values(u));return G.jsx(r.Provider,{value:d,children:o})};a.displayName=e+"Provider";function l(s){const o=E.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[a,l]}function _a(e,t=[]){let r=[];function a(s,o){const u=E.createContext(o),d=r.length;r=[...r,o];const f=v=>{var y;const{scope:A,children:g,..._}=v,N=((y=A==null?void 0:A[e])==null?void 0:y[d])||u,S=E.useMemo(()=>_,Object.values(_));return G.jsx(N.Provider,{value:S,children:g})};f.displayName=s+"Provider";function m(v,A){var N;const g=((N=A==null?void 0:A[e])==null?void 0:N[d])||u,_=E.useContext(g);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${v}\` must be used within \`${s}\``)}return[f,m]}const l=()=>{const s=r.map(o=>E.createContext(o));return function(u){const d=(u==null?void 0:u[e])||s;return E.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return l.scopeName=e,[a,Ak(l,...t)]}function Ak(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(s){const o=a.reduce((u,{useScope:d,scopeName:f})=>{const v=d(s)[`__scope${f}`];return{...u,...v}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Wt=E.forwardRef((e,t)=>{const{children:r,...a}=e,l=E.Children.toArray(r),s=l.find(Ek);if(s){const o=s.props.children,u=l.map(d=>d===s?E.Children.count(o)>1?E.Children.only(null):E.isValidElement(o)?o.props.children:null:d);return G.jsx(i5,{...a,ref:t,children:E.isValidElement(o)?E.cloneElement(o,void 0,u):null})}return G.jsx(i5,{...a,ref:t,children:r})});Wt.displayName="Slot";var i5=E.forwardRef((e,t)=>{const{children:r,...a}=e;if(E.isValidElement(r)){const l=_k(r);return E.cloneElement(r,{...Ik(a,r.props),ref:t?iv(t,l):l})}return E.Children.count(r)>1?E.Children.only(null):null});i5.displayName="SlotClone";var gk=({children:e})=>G.jsx(G.Fragment,{children:e});function Ek(e){return E.isValidElement(e)&&e.type===gk}function Ik(e,t){const r={...t};for(const a in t){const l=e[a],s=t[a];/^on[A-Z]/.test(a)?l&&s?r[a]=(...u)=>{s(...u),l(...u)}:l&&(r[a]=l):a==="style"?r[a]={...l,...s}:a==="className"&&(r[a]=[l,s].filter(Boolean).join(" "))}return{...e,...r}}function _k(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function sv(e){const t=e+"CollectionProvider",[r,a]=_a(t),[l,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:_,children:N}=g,S=J2.useRef(null),y=J2.useRef(new Map).current;return G.jsx(l,{scope:_,itemMap:y,collectionRef:S,children:N})};o.displayName=t;const u=e+"CollectionSlot",d=J2.forwardRef((g,_)=>{const{scope:N,children:S}=g,y=s(u,N),C=U0(_,y.collectionRef);return G.jsx(Wt,{ref:C,children:S})});d.displayName=u;const f=e+"CollectionItemSlot",m="data-radix-collection-item",v=J2.forwardRef((g,_)=>{const{scope:N,children:S,...y}=g,C=J2.useRef(null),M=U0(_,C),x=s(f,N);return J2.useEffect(()=>(x.itemMap.set(C,{ref:C,...y}),()=>void x.itemMap.delete(C))),G.jsx(Wt,{[m]:"",ref:M,children:S})});v.displayName=f;function A(g){const _=s(e+"CollectionConsumer",g);return J2.useCallback(()=>{const S=_.collectionRef.current;if(!S)return[];const y=Array.from(S.querySelectorAll(`[${m}]`));return Array.from(_.itemMap.values()).sort((x,w)=>y.indexOf(x.ref.current)-y.indexOf(w.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},A,a]}var Nk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],u0=Nk.reduce((e,t)=>{const r=E.forwardRef((a,l)=>{const{asChild:s,...o}=a,u=s?Wt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),G.jsx(u,{...o,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cv(e,t){e&&nr.flushSync(()=>e.dispatchEvent(t))}function X1(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[])}function Sk(e,t=globalThis==null?void 0:globalThis.document){const r=X1(e);E.useEffect(()=>{const a=l=>{l.key==="Escape"&&r(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[r,t])}var zk="DismissableLayer",s5="dismissableLayer.update",Ck="dismissableLayer.pointerDownOutside",yk="dismissableLayer.focusOutside",Qh,ov=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ms=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:s,onInteractOutside:o,onDismiss:u,...d}=e,f=E.useContext(ov),[m,v]=E.useState(null),A=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=E.useState({}),_=U0(t,L=>v(L)),N=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),y=N.indexOf(S),C=m?N.indexOf(m):-1,M=f.layersWithOutsidePointerEventsDisabled.size>0,x=C>=y,w=Mk(L=>{const K=L.target,$=[...f.branches].some(W=>W.contains(K));!x||$||(l==null||l(L),o==null||o(L),L.defaultPrevented||u==null||u())},A),D=Rk(L=>{const K=L.target;[...f.branches].some(W=>W.contains(K))||(s==null||s(L),o==null||o(L),L.defaultPrevented||u==null||u())},A);return Sk(L=>{C===f.layers.size-1&&(a==null||a(L),!L.defaultPrevented&&u&&(L.preventDefault(),u()))},A),E.useEffect(()=>{if(m)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Qh=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),Xh(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(A.body.style.pointerEvents=Qh)}},[m,A,r,f]),E.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),Xh())},[m,f]),E.useEffect(()=>{const L=()=>g({});return document.addEventListener(s5,L),()=>document.removeEventListener(s5,L)},[]),G.jsx(u0.div,{...d,ref:_,style:{pointerEvents:M?x?"auto":"none":void 0,...e.style},onFocusCapture:p0(e.onFocusCapture,D.onFocusCapture),onBlurCapture:p0(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:p0(e.onPointerDownCapture,w.onPointerDownCapture)})});Ms.displayName=zk;var kk="DismissableLayerBranch",uv=E.forwardRef((e,t)=>{const r=E.useContext(ov),a=E.useRef(null),l=U0(t,a);return E.useEffect(()=>{const s=a.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),G.jsx(u0.div,{...e,ref:l})});uv.displayName=kk;function Mk(e,t=globalThis==null?void 0:globalThis.document){const r=X1(e),a=E.useRef(!1),l=E.useRef(()=>{});return E.useEffect(()=>{const s=u=>{if(u.target&&!a.current){let d=function(){dv(Ck,r,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=d,t.addEventListener("click",l.current,{once:!0})):d()}else t.removeEventListener("click",l.current);a.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",l.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}function Rk(e,t=globalThis==null?void 0:globalThis.document){const r=X1(e),a=E.useRef(!1);return E.useEffect(()=>{const l=s=>{s.target&&!a.current&&dv(yk,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Xh(){const e=new CustomEvent(s5);document.dispatchEvent(e)}function dv(e,t,r,{discrete:a}){const l=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),a?cv(l,s):l.dispatchEvent(s)}var wk=Ms,xk=uv,N1=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},Tk="Portal",Rs=E.forwardRef((e,t)=>{var u;const{container:r,...a}=e,[l,s]=E.useState(!1);N1(()=>s(!0),[]);const o=r||l&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return o?LC.createPortal(G.jsx(u0.div,{...a,ref:t}),o):null});Rs.displayName=Tk;function Dk(e,t){return E.useReducer((r,a)=>t[r][a]??r,e)}var Na=e=>{const{present:t,children:r}=e,a=bk(t),l=typeof r=="function"?r({present:a.isPresent}):E.Children.only(r),s=U0(a.ref,Lk(l));return typeof r=="function"||a.isPresent?E.cloneElement(l,{ref:s}):null};Na.displayName="Presence";function bk(e){const[t,r]=E.useState(),a=E.useRef({}),l=E.useRef(e),s=E.useRef("none"),o=e?"mounted":"unmounted",[u,d]=Dk(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const f=ei(a.current);s.current=u==="mounted"?f:"none"},[u]),N1(()=>{const f=a.current,m=l.current;if(m!==e){const A=s.current,g=ei(f);e?d("MOUNT"):g==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(m&&A!==g?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,d]),N1(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,v=g=>{const N=ei(a.current).includes(g.animationName);if(g.target===t&&N&&(d("ANIMATION_END"),!l.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},A=g=>{g.target===t&&(s.current=ei(a.current))};return t.addEventListener("animationstart",A),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",A),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:E.useCallback(f=>{f&&(a.current=getComputedStyle(f)),r(f)},[])}}function ei(e){return(e==null?void 0:e.animationName)||"none"}function Lk(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Bi({prop:e,defaultProp:t,onChange:r=()=>{}}){const[a,l]=Bk({defaultProp:t,onChange:r}),s=e!==void 0,o=s?e:a,u=X1(r),d=E.useCallback(f=>{if(s){const v=typeof f=="function"?f(e):f;v!==e&&u(v)}else l(f)},[s,e,l,u]);return[o,d]}function Bk({defaultProp:e,onChange:t}){const r=E.useState(e),[a]=r,l=E.useRef(a),s=X1(t);return E.useEffect(()=>{l.current!==a&&(s(a),l.current=a)},[a,l,s]),r}var Fk="VisuallyHidden",ws=E.forwardRef((e,t)=>G.jsx(u0.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ws.displayName=Fk;var Ok="ToastProvider",[hv,Pk,Hk]=sv("Toast"),[fv,sY]=_a("Toast",[Hk]),[cY,xs]=fv(Ok),mv="ToastViewport",Uk=["F8"],c5="toast.viewportPause",o5="toast.viewportResume",pv=E.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:a=Uk,label:l="Notifications ({hotkey})",...s}=e,o=xs(mv,r),u=Pk(r),d=E.useRef(null),f=E.useRef(null),m=E.useRef(null),v=E.useRef(null),A=U0(t,v,o.onViewportChange),g=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;E.useEffect(()=>{const S=y=>{var M;a.length!==0&&a.every(x=>y[x]||y.code===x)&&((M=v.current)==null||M.focus())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[a]),E.useEffect(()=>{const S=d.current,y=v.current;if(_&&S&&y){const C=()=>{if(!o.isClosePausedRef.current){const D=new CustomEvent(c5);y.dispatchEvent(D),o.isClosePausedRef.current=!0}},M=()=>{if(o.isClosePausedRef.current){const D=new CustomEvent(o5);y.dispatchEvent(D),o.isClosePausedRef.current=!1}},x=D=>{!S.contains(D.relatedTarget)&&M()},w=()=>{S.contains(document.activeElement)||M()};return S.addEventListener("focusin",C),S.addEventListener("focusout",x),S.addEventListener("pointermove",C),S.addEventListener("pointerleave",w),window.addEventListener("blur",C),window.addEventListener("focus",M),()=>{S.removeEventListener("focusin",C),S.removeEventListener("focusout",x),S.removeEventListener("pointermove",C),S.removeEventListener("pointerleave",w),window.removeEventListener("blur",C),window.removeEventListener("focus",M)}}},[_,o.isClosePausedRef]);const N=E.useCallback(({tabbingDirection:S})=>{const C=u().map(M=>{const x=M.ref.current,w=[x,...eM(x)];return S==="forwards"?w:w.reverse()});return(S==="forwards"?C.reverse():C).flat()},[u]);return E.useEffect(()=>{const S=v.current;if(S){const y=C=>{var w,D,L;const M=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!M){const K=document.activeElement,$=C.shiftKey;if(C.target===S&&$){(w=f.current)==null||w.focus();return}const Q=N({tabbingDirection:$?"backwards":"forwards"}),i2=Q.findIndex(j=>j===K);lu(Q.slice(i2+1))?C.preventDefault():$?(D=f.current)==null||D.focus():(L=m.current)==null||L.focus()}};return S.addEventListener("keydown",y),()=>S.removeEventListener("keydown",y)}},[u,N]),G.jsxs(xk,{ref:d,role:"region","aria-label":l.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&G.jsx(u5,{ref:f,onFocusFromOutsideViewport:()=>{const S=N({tabbingDirection:"forwards"});lu(S)}}),G.jsx(hv.Slot,{scope:r,children:G.jsx(u0.ol,{tabIndex:-1,...s,ref:A})}),_&&G.jsx(u5,{ref:m,onFocusFromOutsideViewport:()=>{const S=N({tabbingDirection:"backwards"});lu(S)}})]})});pv.displayName=mv;var vv="ToastFocusProxy",u5=E.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:a,...l}=e,s=xs(vv,r);return G.jsx(ws,{"aria-hidden":!0,tabIndex:0,...l,ref:t,style:{position:"fixed"},onFocus:o=>{var f;const u=o.relatedTarget;!((f=s.viewport)!=null&&f.contains(u))&&a()}})});u5.displayName=vv;var Ts="Toast",Vk="toast.swipeStart",Gk="toast.swipeMove",jk="toast.swipeCancel",Kk="toast.swipeEnd",Av=E.forwardRef((e,t)=>{const{forceMount:r,open:a,defaultOpen:l,onOpenChange:s,...o}=e,[u=!0,d]=Bi({prop:a,defaultProp:l,onChange:s});return G.jsx(Na,{present:r||u,children:G.jsx($k,{open:u,...o,ref:t,onClose:()=>d(!1),onPause:X1(e.onPause),onResume:X1(e.onResume),onSwipeStart:p0(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:p0(e.onSwipeMove,f=>{const{x:m,y:v}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${v}px`)}),onSwipeCancel:p0(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:p0(e.onSwipeEnd,f=>{const{x:m,y:v}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${v}px`),d(!1)})})})});Av.displayName=Ts;var[Wk,Yk]=fv(Ts,{onClose(){}}),$k=E.forwardRef((e,t)=>{const{__scopeToast:r,type:a="foreground",duration:l,open:s,onClose:o,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:m,onSwipeMove:v,onSwipeCancel:A,onSwipeEnd:g,..._}=e,N=xs(Ts,r),[S,y]=E.useState(null),C=U0(t,j=>y(j)),M=E.useRef(null),x=E.useRef(null),w=l||N.duration,D=E.useRef(0),L=E.useRef(w),K=E.useRef(0),{onToastAdd:$,onToastRemove:W}=N,h2=X1(()=>{var X;(S==null?void 0:S.contains(document.activeElement))&&((X=N.viewport)==null||X.focus()),o()}),Q=E.useCallback(j=>{!j||j===1/0||(window.clearTimeout(K.current),D.current=new Date().getTime(),K.current=window.setTimeout(h2,j))},[h2]);E.useEffect(()=>{const j=N.viewport;if(j){const X=()=>{Q(L.current),f==null||f()},r2=()=>{const l2=new Date().getTime()-D.current;L.current=L.current-l2,window.clearTimeout(K.current),d==null||d()};return j.addEventListener(c5,r2),j.addEventListener(o5,X),()=>{j.removeEventListener(c5,r2),j.removeEventListener(o5,X)}}},[N.viewport,w,d,f,Q]),E.useEffect(()=>{s&&!N.isClosePausedRef.current&&Q(w)},[s,w,N.isClosePausedRef,Q]),E.useEffect(()=>($(),()=>W()),[$,W]);const i2=E.useMemo(()=>S?zv(S):null,[S]);return N.viewport?G.jsxs(G.Fragment,{children:[i2&&G.jsx(Zk,{__scopeToast:r,role:"status","aria-live":a==="foreground"?"assertive":"polite","aria-atomic":!0,children:i2}),G.jsx(Wk,{scope:r,onClose:h2,children:nr.createPortal(G.jsx(hv.ItemSlot,{scope:r,children:G.jsx(wk,{asChild:!0,onEscapeKeyDown:p0(u,()=>{N.isFocusedToastEscapeKeyDownRef.current||h2(),N.isFocusedToastEscapeKeyDownRef.current=!1}),children:G.jsx(u0.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":N.swipeDirection,..._,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:p0(e.onKeyDown,j=>{j.key==="Escape"&&(u==null||u(j.nativeEvent),j.nativeEvent.defaultPrevented||(N.isFocusedToastEscapeKeyDownRef.current=!0,h2()))}),onPointerDown:p0(e.onPointerDown,j=>{j.button===0&&(M.current={x:j.clientX,y:j.clientY})}),onPointerMove:p0(e.onPointerMove,j=>{if(!M.current)return;const X=j.clientX-M.current.x,r2=j.clientY-M.current.y,l2=!!x.current,Z=["left","right"].includes(N.swipeDirection),s2=["left","up"].includes(N.swipeDirection)?Math.min:Math.max,u2=Z?s2(0,X):0,b=Z?0:s2(0,r2),F=j.pointerType==="touch"?10:2,t2={x:u2,y:b},o2={originalEvent:j,delta:t2};l2?(x.current=t2,ti(Gk,v,o2,{discrete:!1})):ef(t2,N.swipeDirection,F)?(x.current=t2,ti(Vk,m,o2,{discrete:!1}),j.target.setPointerCapture(j.pointerId)):(Math.abs(X)>F||Math.abs(r2)>F)&&(M.current=null)}),onPointerUp:p0(e.onPointerUp,j=>{const X=x.current,r2=j.target;if(r2.hasPointerCapture(j.pointerId)&&r2.releasePointerCapture(j.pointerId),x.current=null,M.current=null,X){const l2=j.currentTarget,Z={originalEvent:j,delta:X};ef(X,N.swipeDirection,N.swipeThreshold)?ti(Kk,g,Z,{discrete:!0}):ti(jk,A,Z,{discrete:!0}),l2.addEventListener("click",s2=>s2.preventDefault(),{once:!0})}})})})}),N.viewport)})]}):null}),Zk=e=>{const{__scopeToast:t,children:r,...a}=e,l=xs(Ts,t),[s,o]=E.useState(!1),[u,d]=E.useState(!1);return Qk(()=>o(!0)),E.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:G.jsx(Rs,{asChild:!0,children:G.jsx(ws,{...a,children:s&&G.jsxs(G.Fragment,{children:[l.label," ",r]})})})},qk="ToastTitle",gv=E.forwardRef((e,t)=>{const{__scopeToast:r,...a}=e;return G.jsx(u0.div,{...a,ref:t})});gv.displayName=qk;var Jk="ToastDescription",Ev=E.forwardRef((e,t)=>{const{__scopeToast:r,...a}=e;return G.jsx(u0.div,{...a,ref:t})});Ev.displayName=Jk;var Iv="ToastAction",_v=E.forwardRef((e,t)=>{const{altText:r,...a}=e;return r.trim()?G.jsx(Sv,{altText:r,asChild:!0,children:G.jsx(m6,{...a,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Iv}\`. Expected non-empty \`string\`.`),null)});_v.displayName=Iv;var Nv="ToastClose",m6=E.forwardRef((e,t)=>{const{__scopeToast:r,...a}=e,l=Yk(Nv,r);return G.jsx(Sv,{asChild:!0,children:G.jsx(u0.button,{type:"button",...a,ref:t,onClick:p0(e.onClick,l.onClose)})})});m6.displayName=Nv;var Sv=E.forwardRef((e,t)=>{const{__scopeToast:r,altText:a,...l}=e;return G.jsx(u0.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...l,ref:t})});function zv(e){const t=[];return Array.from(e.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&t.push(a.textContent),Xk(a)){const l=a.ariaHidden||a.hidden||a.style.display==="none",s=a.dataset.radixToastAnnounceExclude==="";if(!l)if(s){const o=a.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...zv(a))}}),t}function ti(e,t,r,{discrete:a}){const l=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),a?cv(l,s):l.dispatchEvent(s)}var ef=(e,t,r=0)=>{const a=Math.abs(e.x),l=Math.abs(e.y),s=a>l;return t==="left"||t==="right"?s&&a>r:!s&&l>r};function Qk(e=()=>{}){const t=X1(e);N1(()=>{let r=0,a=0;return r=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(a)}},[t])}function Xk(e){return e.nodeType===e.ELEMENT_NODE}function eM(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function lu(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Cv=pv,yv=Av,kv=gv,Mv=Ev,Rv=_v,wv=m6;function xv(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=xv(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Ds(){for(var e,t,r=0,a="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=xv(e))&&(a&&(a+=" "),a+=t);return a}const tf=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rf=Ds,te=(e,t)=>r=>{var a;if((t==null?void 0:t.variants)==null)return rf(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:l,defaultVariants:s}=t,o=Object.keys(l).map(f=>{const m=r==null?void 0:r[f],v=s==null?void 0:s[f];if(m===null)return null;const A=tf(m)||tf(v);return l[f][A]}),u=r&&Object.entries(r).reduce((f,m)=>{let[v,A]=m;return A===void 0||(f[v]=A),f},{}),d=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((f,m)=>{let{class:v,className:A,...g}=m;return Object.entries(g).every(_=>{let[N,S]=_;return Array.isArray(S)?S.includes({...s,...u}[N]):{...s,...u}[N]===S})?[...f,v,A]:f},[]);return rf(e,o,d,r==null?void 0:r.class,r==null?void 0:r.className)};/**
103
+ */var $h;function By(){if($h)return $l.exports;$h=1;var e=Ty(),t=Dy(),r=by(),a=Ly();$l.exports=l,$l.exports.Negotiator=l;function l(s){if(!(this instanceof l))return new l(s);this.request=s}return l.prototype.charset=function(o){var u=this.charsets(o);return u&&u[0]},l.prototype.charsets=function(o){return e(this.request.headers["accept-charset"],o)},l.prototype.encoding=function(o,u){var d=this.encodings(o,u);return d&&d[0]},l.prototype.encodings=function(o,u){var d=u||{};return t(this.request.headers["accept-encoding"],o,d.preferred)},l.prototype.language=function(o){var u=this.languages(o);return u&&u[0]},l.prototype.languages=function(o){return r(this.request.headers["accept-language"],o)},l.prototype.mediaType=function(o){var u=this.mediaTypes(o);return u&&u[0]},l.prototype.mediaTypes=function(o){return a(this.request.headers.accept,o)},l.prototype.preferredCharset=l.prototype.charset,l.prototype.preferredCharsets=l.prototype.charsets,l.prototype.preferredEncoding=l.prototype.encoding,l.prototype.preferredEncodings=l.prototype.encodings,l.prototype.preferredLanguage=l.prototype.language,l.prototype.preferredLanguages=l.prototype.languages,l.prototype.preferredMediaType=l.prototype.mediaType,l.prototype.preferredMediaTypes=l.prototype.mediaTypes,$l.exports}By();h0().internationalization;const jp=e=>/^[a-zA-Z][a-zA-Z\d+\-.]*:/.test(e),{internationalization:Fy}=h0(),{locales:Oy}=Fy,Py=(e,t=Oy)=>{const r=jp(e),a=r?new URL(e):new URL(e,"http://example.com"),l=a.pathname;l.startsWith("/")||(a.pathname=`/${l}`);const s=l.split("/"),o=s[1];if(t.includes(o)){s.splice(1,1);const u=s.join("/")??"/";a.pathname=u}return r?a.toString():a.toString().replace("http://example.com","")},{internationalization:Hy,middleware:Uy}=h0(),{locales:Vy,defaultLocale:Gy}=Hy,{prefixDefault:jy}=Uy,Ky=(e,t=Vy,r=Gy,a=jy)=>{const l=Py(e,t),s=jp(l),o=s?new URL(l):new URL(l,"http://example.com");let u=o.pathname;u.startsWith("/")||(u=`/${u}`);const d=s?`${o.protocol}//${o.host}`:"";return t.reduce((m,v)=>{const A=v.toString()===r.toString();let _=a||!A?`/${v}${u}`:u;_.length>1&&_.endsWith("/")&&(_=_.slice(0,-1));const N=s?`${d}${_}${o.search}${o.hash}`:`${_}${o.search}${o.hash}`;return m[v]=N,m},{})},{internationalization:Wy,middleware:Yy}=h0(),{locales:$y,defaultLocale:Zy}=Wy,{prefixDefault:qy}=Yy,Jy=(e,t,r=$y,a=Zy,l=qy)=>Ky(e,r,a,l)[t],Zh=(e,t,r)=>{let a=e,l=null,s=[];for(const o of t)l=a,o.type===m2.Object?(s=[o.key],a[o.key]||(a={...a,[o.key]:{}}),a=a[o.key]):o.type===m2.Array?(s=[o.key],a[o.key]||(a[o.key]={}),a=a[o.key]):o.type===m2.Translation?(s=[m2.Translation,o.key],a[m2.Translation]||(a[m2.Translation]={...a[m2.Translation],[o.key]:r}),a=a[m2.Translation][o.key]):o.type===m2.Enumeration&&(s=[m2.Enumeration,o.key],a[m2.Enumeration]||(a[m2.Enumeration]={...a[m2.Enumeration],[o.key]:r}),a=a[m2.Enumeration][o.key]);if(l&&s.length>0){for(const o of s.slice(0,-1))l=l[o];typeof r>"u"?delete l[s[s.length-1]]:l[s[s.length-1]]=r}return e},je=(e,t)=>{let r=JSON.parse(JSON.stringify(e??{}));for(const a of t)a.type===m2.Object||a.type===m2.Array?r=r==null?void 0:r[a.key]:a.type===m2.Translation?r=r==null?void 0:r[m2.Translation][a.key]:a.type===m2.Enumeration&&(r=r==null?void 0:r[m2.Enumeration][a.key]);return r},Qy=Symbol.for("react.element"),Xy=e=>typeof e=="object"&&e!==null&&e.$$typeof===Qy,f6=e=>typeof e=="string"?m2.Text:(e==null?void 0:e.nodeType)===m2.Translation?m2.Translation:(e==null?void 0:e.nodeType)===m2.Enumeration?m2.Enumeration:Array.isArray(e)?m2.Array:Xy(e)?m2.ReactNode:m2.Object,ek=(e,t,r)=>{let a=e,l=null,s=null;for(const o of r)l=a,o.type===m2.Object||o.type===m2.Array?(s=o.key,a=a[o.key]):o.type===m2.Translation?(s=m2.Translation,a=a[m2.Translation][o.key]):o.type===m2.Enumeration&&(s=m2.Enumeration,a=a[m2.Enumeration][o.key]);if(l&&s!==null)if(Array.isArray(l))l[s]=a;else{const o={};for(const u of Object.keys(l))u===s?o[t]=a:o[u]=l[u];Object.keys(l).forEach(u=>delete l[u]),Object.assign(l,o)}return e},Kp=E.createContext(void 0),Wp=E.createContext(void 0),tk=()=>ar("INTLAYER_EDITED_CONTENT_CHANGED",void 0,{emit:!0,receive:!1}),rk=({children:e})=>{const{localeDictionaries:t}=Pp(),[r,a]=ar("INTLAYER_EDITED_CONTENT_CHANGED",void 0,{emit:!0,receive:!0}),l=(A,g)=>{a(_=>({..._,[A]:{..._==null?void 0:_[A],content:g}}))},s=(A,g,_=[],N=!0)=>{a(S=>{var w,D;const y=(w=t[A])==null?void 0:w.content,C=((D=S==null?void 0:S[A])==null?void 0:D.content)||JSON.parse(JSON.stringify(y));let M=_;if(!N){let L=0;const K=_.slice(0,-1),$=_[_.length-1];let W=$.key;for(;typeof je(C,M)<"u";)L++,W=L===0?$.key:`${$.key} (${L})`,M=[...K,{...$,key:W}]}const x=Zh(C,M,g);return{...S,[A]:{...S==null?void 0:S[A],content:x}}})},o=(A,g,_=[])=>{a(N=>{var M,x;const S=(M=t[A])==null?void 0:M.content,y=((x=N==null?void 0:N[A])==null?void 0:x.content)||JSON.parse(JSON.stringify(S)),C=ek(y,g,_);return{...N,[A]:{...N==null?void 0:N[A],content:C}}})},u=(A,g)=>{a(_=>{var M,x;const N=(M=t[A])==null?void 0:M.content,S=((x=_==null?void 0:_[A])==null?void 0:x.content)||JSON.parse(JSON.stringify(N)),y=je(N,g),C=Zh(S,g,y);return{..._,[A]:{..._==null?void 0:_[A],content:C}}})},d=A=>{a(g=>{const _={...g};return delete _[A],_})},f=A=>{a(g=>Object.entries(g).reduce((N,[S,y])=>S===A?N:{...N,[S]:y},{}))},m=()=>{a({})},v=(A,g)=>{var N;const _=((N=r==null?void 0:r[A])==null?void 0:N.content)??{};return je(_,g)};return G.jsx(Kp.Provider,{value:{editedContent:r},children:G.jsx(Wp.Provider,{value:{setEditedContentState:a,setEditedContent:l,addEditedContent:s,renameEditedContent:o,removeEditedContent:u,restoreEditedContent:d,clearEditedDictionaryContent:f,clearEditedContent:m,getEditedContentValue:v},children:e})})},Ea=()=>{const e=E.useContext(Wp);if(!e)throw new Error("useEditedContent must be used within an EditedContentProvider");return e},me=()=>{const e=E.useContext(Kp),t=Ea();if(!e)throw new Error("useEditedContent must be used within an EditedContentProvider");return{...e,...t}},Yp=E.createContext(void 0),$p=E.createContext(void 0),nk=({children:e})=>{const[t,r]=ar("INTLAYER_FOCUSED_CONTENT_CHANGED",null),a=l=>{r(s=>s&&{...s,keyPath:l})};return G.jsx(Yp.Provider,{value:{focusedContent:t},children:G.jsx($p.Provider,{value:{setFocusedContent:r,setFocusedContentKeyPath:a},children:e})})},ak=()=>{const e=E.useContext($p);if(e===void 0)throw new Error("useFocusDictionaryActions must be used within a FocusDictionaryProvider");return e},ct=()=>{const e=ak(),t=E.useContext(Yp);if(t===void 0)throw new Error("useFocusDictionaryState must be used within a FocusDictionaryProvider");return{...t,...e}},Zp=E.createContext(void 0),qp=e=>ar("INTLAYER_EDITOR_ENABLED",!1,e),lk=({children:e})=>{const[t]=qp({emit:!1,receive:!0});return G.jsx(Zp.Provider,{value:{enabled:t},children:e})},Jp=()=>{const e=E.useContext(Zp);if(!e)throw new Error("useEditorEnabled must be used within a EnabledProvider");return e},ik=({mode:e,children:t})=>{const{enabled:r}=Jp();return r||e==="editor"?G.jsx(vy,{children:G.jsx(rk,{children:G.jsx(nk,{children:t})})}):t},sk=({children:e,mode:t,configuration:r,...a})=>G.jsx(fy,{...a,children:G.jsx(lk,{children:G.jsx(py,{configuration:r,children:G.jsx(ik,{mode:t,children:e})})})}),ck=(e,t)=>{const r=ar("INTLAYER_URL_CHANGE",e,t),[a,l]=r;return E.useEffect(()=>{const s=history.pushState,o=history.replaceState,u=f=>function(...m){f.apply(this,m),window.dispatchEvent(new Event("locationchange"))};history.pushState=u(s),history.replaceState=u(o);const d=()=>{l(window.location.pathname)};return window.addEventListener("locationchange",d),window.addEventListener("popstate",d),window.addEventListener("hashchange",d),window.addEventListener("load",d),d(),()=>{window.removeEventListener("locationchange",d),window.removeEventListener("popstate",d),window.removeEventListener("hashchange",d),window.removeEventListener("load",d),history.pushState=s,history.replaceState=o}},[l]),r},ok=e=>{const t=new MouseEvent("mousedown",{bubbles:!0,cancelable:!0,view:window}),r=new MouseEvent("click",{bubbles:!0,cancelable:!0,view:window});Object.assign(r,{iframeData:e}),Object.assign(t,{iframeData:e}),window.dispatchEvent(r),window.dispatchEvent(t)},uk=()=>l5("INTLAYER_IFRAME_CLICKED",ok);E.createContext(void 0);E.createContext(void 0);const qh={method:"GET",headers:{"Content-Type":"application/json"}},dk=e=>(Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e),Xl=e=>e.reduce((t,r)=>{const a=t??{},l=dk(r??{});return typeof a=="object"&&typeof l=="object"?{...a,...l}:l??a},{}),F2=async(e,...t)=>{const{signal:r}=new AbortController;let a="",l;const s=t.map(({body:g,params:_,headers:N,...S})=>S),o=Xl([qh,...s]),u=Xl([qh.headers,...t.map(g=>g.headers)]),d=Xl(t.map(g=>g.params)),f=o.method;if(f!=="GET"&&f!=="HEAD"){const g=Xl(t.map(_=>_.body));(u==null?void 0:u["Content-Type"])==="application/x-www-form-urlencoded"?l=new URLSearchParams(g).toString():l=JSON.stringify(g)}Object.entries(d).length>0&&(a=`?${new URLSearchParams(d).toString()}`);const m={...o,headers:u,body:l,signal:r},v=`${e}${a}`,A=await fetch(v,m);if(!A.ok){const g=await A.json();throw console.error(g),new Error(JSON.stringify(g.error)??"An error occurred")}return await A.json()},Qp=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/ai`;return{auditContentDeclaration:async(f,m={})=>await F2(`${a}/audit/content-declaration`,e,m,{method:"POST",body:f}),auditContentDeclarationField:async(f,m={})=>await F2(`${a}/audit/content-declaration/field`,e,m,{method:"POST",body:f}),auditContentDeclarationMetadata:async(f,m={})=>await F2(`${a}/audit/content-declaration/metadata`,e,m,{method:"POST",body:f}),auditTag:async(f,m={})=>await F2(`${a}/audit/tag`,e,m,{method:"POST",body:f}),askDocQuestion:async(f,m={})=>await F2(`${a}/ask`,e,m,{method:"POST",body:f})}};Qp();const Xp=(e={},t)=>{const{backendURL:r,clientId:a,clientSecret:l}=(t??h0()).editor,s=`${r}/api/auth`;return{login:async(w,D={})=>await F2(`${s}/login`,e,D,{method:"POST",body:w}),getLoginWithGitHubURL:w=>{const D=new URLSearchParams(w);return`${s}/login/github?${D.toString()}`},getLoginWithGoogleURL:w=>{const D=new URLSearchParams(w);return`${s}/login/google?${D.toString()}`},register:async(w,D={},L={})=>await F2(`${s}/register`,e,L,{method:"POST",body:w,params:D}),logout:async(w={})=>await F2(`${s}/logout`,e,w,{method:"POST"}),resetPassword:async(w,D={})=>await F2(`${s}/password/reset`,e,D,{params:w,method:"POST"}),askResetPassword:async(w,D={})=>await F2(`${s}/password/reset`,e,D,{method:"POST",body:{email:w}}),checkIfUserHasPassword:async(w={})=>await F2(`${s}/password/has`,e,w,{method:"GET"}),verifyEmail:async({userId:w,secret:D},L={})=>await F2(`${s}/active/${w}/${D}`,e,L,{method:"PUT"}),getVerifyEmailStatusURL:w=>`${s}/verify-email-status/${String(w)}`,changePassword:async(w,D={})=>await F2(`${s}/password`,e,D,{method:"PUT",body:w}),createSession:async(w,D={})=>await F2(`${s}/session`,e,D,{method:"POST",body:w}),getSession:async(w,D={})=>await F2(`${r}/session`,e,D,{params:{session_token:w}}),getCSRFToken:async(w={})=>await F2(`${r}/csrf-token`,e,w),getOAuth2AccessToken:async(w={})=>await F2(`${r}/oauth2/token`,e,w,{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:{grant_type:"client_credentials",client_id:a,client_secret:l}})}};Xp();const ev=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/dictionary`;return{getDictionaries:async(v,A={})=>await F2(a,e,A,{params:v}),getDictionariesKeys:async(v={})=>await F2(`${a}/keys`,e,v),getDictionary:async(v,A,g={})=>await F2(`${a}/${v}`,e,g,{params:A?{version:A.toString()}:void 0}),pushDictionaries:async(v,A={})=>await F2(`${a}`,e,A,{method:"PATCH",body:{dictionaries:v}}),addDictionary:async(v,A={})=>await F2(`${a}`,e,A,{method:"POST",body:v}),updateDictionary:async(v,A,g={})=>await F2(`${a}/${v}`,e,g,{method:"PUT",body:A}),deleteDictionary:async(v,A={})=>await F2(`${a}`,e,A,{method:"DELETE",body:{id:v}})}};ev();const tv=(e={},t)=>{const{editorURL:r}=(t??h0()).editor,a=`${r}/api`;return{getConfiguration:async(o={})=>(await F2(`${a}/config`,e,o)).data,writeDictionary:async(o,u={})=>{await F2(`${a}/dictionary`,e,u,{method:"POST",body:o})}}};tv();const rv=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/organization`;return{getOrganizations:async(g,_={})=>await F2(a,e,_,{params:g}),getOrganization:async(g,_={})=>await F2(`${a}/${String(g)}`,e,_),addOrganization:async(g,_={})=>await F2(a,e,_,{method:"POST",body:g}),addOrganizationMember:async(g,_={})=>F2(`${a}/member`,e,_,{method:"POST",body:g}),updateOrganization:async(g,_={})=>F2(a,e,_,{method:"PUT",body:g}),updateOrganizationMembers:async(g,_={})=>F2(`${a}/members`,e,_,{method:"PUT",body:g}),deleteOrganization:async(g={})=>await F2(a,e,g,{method:"DELETE"}),selectOrganization:async(g,_={})=>await F2(`${a}/${String(g)}`,e,_,{method:"PUT"}),unselectOrganization:async(g={})=>await F2(`${a}/logout`,e,g,{method:"POST"})}};rv();const nv=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/project`;return{getProjects:async(N,S={})=>await F2(a,e,S,{params:N}),addProject:async(N,S={})=>await F2(`${a}`,e,S,{method:"POST",body:N}),updateProject:async(N,S={})=>await F2(`${a}`,e,S,{method:"PUT",body:N}),updateProjectMembers:async(N,S={})=>await F2(`${a}/members`,e,S,{method:"PUT",body:N}),pushProjectConfiguration:async(N,S={})=>await F2(`${a}/configuration`,e,S,{method:"PUT",body:N}),deleteProject:async(N={})=>await F2(`${a}`,e,N,{method:"DELETE"}),selectProject:async(N,S={})=>await F2(`${a}/${String(N)}`,e,S,{method:"PUT"}),unselectProject:async(N={})=>await F2(`${a}/logout`,e,N,{method:"POST"}),addNewAccessKey:async(N,S={})=>await F2(`${a}/access_key`,e,S,{method:"POST",body:N}),deleteAccessKey:async(N,S={})=>await F2(`${a}/access_key`,e,S,{method:"DELETE",body:{clientId:N}}),refreshAccessKey:async(N,S={})=>await F2(`${a}/access_key`,e,S,{method:"PATCH",body:{clientId:N}})}};nv();const hk=(e={},t)=>{const a=`${(t??h0()).editor.backendURL}/api/stripe`;return{getSubscription:async(o,u={})=>await F2(`${a}/create-subscription`,e,u,{method:"POST",body:o}),cancelSubscription:async(o={})=>await F2(`${a}/cancel-subscription`,e,o,{method:"POST"})}},av=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/tag`;return{getTags:async(d,f={})=>await F2(a,e,f,{params:d}),addTag:async(d,f={})=>await F2(`${a}`,e,f,{method:"POST",body:d}),updateTag:async(d,f,m={})=>await F2(`${a}/${d}`,e,m,{method:"PUT",body:f}),deleteTag:async(d,f={})=>await F2(`${a}/${d}`,e,f,{method:"DELETE"})}};av();const lv=(e={},t)=>{const{backendURL:r}=(t??h0()).editor,a=`${r}/api/user`;return{createUser:async(v,A={})=>await F2(`${a}/`,e,A,{method:"POST",body:v}),getUsers:async(v,A={})=>await F2(a,e,A,{params:v}),getUserById:async(v,A={})=>await F2(`${a}/${v}`,e,A),getUserByAccount:async(v,A,g={})=>await F2(`${a}/account/${A}/${v}`,e,g),getUserByEmail:async(v,A={})=>await F2(`${a}/email/${v}`,e,A),updateUser:async(v,A={})=>await F2(`${a}`,e,A,{method:"PUT",body:v}),deleteUser:async(v,A={})=>await F2(`${a}/${v}`,e,A,{method:"DELETE"})}};lv();const Ia=(e={},t)=>({organization:rv(e,t),project:nv(e,t),user:lv(e,t),auth:Xp(e,t),dictionary:ev(e,t),stripe:hk(e,t),ai:Qp(e,t),tag:av(e,t),editor:tv(e,t)});Ia();const fk=e=>{var o;const t=e??h0(),r=Ia(void 0,t),{data:a,isFetched:l}=ga("getCSRFToken",r.auth.getCSRFToken,{cache:!0,autoFetch:!0});return{csrfToken:(o=a==null?void 0:a.data)==null?void 0:o.csrf_token,csrfTokenFetched:l}},mk=(e,t)=>{const r=t??h0(),a=Ia(void 0,r),{data:l}=ga("getOAuth2AccessToken",()=>a.auth.getOAuth2AccessToken({body:{csrf_token:e}}),{cache:!0,autoFetch:!0,enable:!!(r.editor.clientId&&r.editor.clientSecret&&e)});return{oAuth2AccessToken:l==null?void 0:l.data}},pk=(e,t)=>{const r=t??h0(),a=Ia(void 0,r),{getSession:l,revalidate:s,data:o,setData:u,isFetched:d}=ga("getSession",async()=>{try{const m=await a.auth.getSession();if(m.data){const{user:v,organization:A,project:g}=m.data;return{user:v,organization:A,isOrganizationAdmin:(v&&((A==null?void 0:A.adminsIds)??[]).includes(v._id))??!1,project:g,isProjectAdmin:(v&&((g==null?void 0:g.adminsIds)??[]).includes(v._id))??!1}}}catch(m){console.error(m)}return null},{cache:!0,store:!0,autoFetch:!0,enable:!e,invalidateQueries:["getOrganizations","getProjects","getUsers","getDictionaries"]});return{session:E.useMemo(()=>o??(d?null:void 0),[o,d]),fetchSession:l,revalidateSession:s,setSession:u}},ks=({session:e,intlayerConfiguration:t}={})=>{const{csrfToken:r,csrfTokenFetched:a}=fk(t),{session:l,fetchSession:s,revalidateSession:o,setSession:u}=pk(e,t),{oAuth2AccessToken:d}=mk(r,t);return E.useMemo(()=>({session:l,fetchSession:s,setSession:u,revalidateSession:o,csrfToken:r,csrfTokenFetched:a,oAuth2AccessToken:d,isProjectAdmin:l==null?void 0:l.isProjectAdmin,isOrganizationAdmin:l==null?void 0:l.isOrganizationAdmin}),[l,u,s,o,r,a,d])};function p0(e,t,{checkForDefaultPrevented:r=!0}={}){return function(l){if(e==null||e(l),r===!1||!l.defaultPrevented)return t==null?void 0:t(l)}}function Jh(e,t){if(typeof e=="function")return e(t);e!=null&&(e.current=t)}function iv(...e){return t=>{let r=!1;const a=e.map(l=>{const s=Jh(l,t);return!r&&typeof s=="function"&&(r=!0),s});if(r)return()=>{for(let l=0;l<a.length;l++){const s=a[l];typeof s=="function"?s():Jh(e[l],null)}}}}function U0(...e){return E.useCallback(iv(...e),e)}function vk(e,t){const r=E.createContext(t),a=s=>{const{children:o,...u}=s,d=E.useMemo(()=>u,Object.values(u));return G.jsx(r.Provider,{value:d,children:o})};a.displayName=e+"Provider";function l(s){const o=E.useContext(r);if(o)return o;if(t!==void 0)return t;throw new Error(`\`${s}\` must be used within \`${e}\``)}return[a,l]}function _a(e,t=[]){let r=[];function a(s,o){const u=E.createContext(o),d=r.length;r=[...r,o];const f=v=>{var y;const{scope:A,children:g,..._}=v,N=((y=A==null?void 0:A[e])==null?void 0:y[d])||u,S=E.useMemo(()=>_,Object.values(_));return G.jsx(N.Provider,{value:S,children:g})};f.displayName=s+"Provider";function m(v,A){var N;const g=((N=A==null?void 0:A[e])==null?void 0:N[d])||u,_=E.useContext(g);if(_)return _;if(o!==void 0)return o;throw new Error(`\`${v}\` must be used within \`${s}\``)}return[f,m]}const l=()=>{const s=r.map(o=>E.createContext(o));return function(u){const d=(u==null?void 0:u[e])||s;return E.useMemo(()=>({[`__scope${e}`]:{...u,[e]:d}}),[u,d])}};return l.scopeName=e,[a,Ak(l,...t)]}function Ak(...e){const t=e[0];if(e.length===1)return t;const r=()=>{const a=e.map(l=>({useScope:l(),scopeName:l.scopeName}));return function(s){const o=a.reduce((u,{useScope:d,scopeName:f})=>{const v=d(s)[`__scope${f}`];return{...u,...v}},{});return E.useMemo(()=>({[`__scope${t.scopeName}`]:o}),[o])}};return r.scopeName=t.scopeName,r}var Wt=E.forwardRef((e,t)=>{const{children:r,...a}=e,l=E.Children.toArray(r),s=l.find(Ek);if(s){const o=s.props.children,u=l.map(d=>d===s?E.Children.count(o)>1?E.Children.only(null):E.isValidElement(o)?o.props.children:null:d);return G.jsx(i5,{...a,ref:t,children:E.isValidElement(o)?E.cloneElement(o,void 0,u):null})}return G.jsx(i5,{...a,ref:t,children:r})});Wt.displayName="Slot";var i5=E.forwardRef((e,t)=>{const{children:r,...a}=e;if(E.isValidElement(r)){const l=_k(r);return E.cloneElement(r,{...Ik(a,r.props),ref:t?iv(t,l):l})}return E.Children.count(r)>1?E.Children.only(null):null});i5.displayName="SlotClone";var gk=({children:e})=>G.jsx(G.Fragment,{children:e});function Ek(e){return E.isValidElement(e)&&e.type===gk}function Ik(e,t){const r={...t};for(const a in t){const l=e[a],s=t[a];/^on[A-Z]/.test(a)?l&&s?r[a]=(...u)=>{s(...u),l(...u)}:l&&(r[a]=l):a==="style"?r[a]={...l,...s}:a==="className"&&(r[a]=[l,s].filter(Boolean).join(" "))}return{...e,...r}}function _k(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function sv(e){const t=e+"CollectionProvider",[r,a]=_a(t),[l,s]=r(t,{collectionRef:{current:null},itemMap:new Map}),o=g=>{const{scope:_,children:N}=g,S=J2.useRef(null),y=J2.useRef(new Map).current;return G.jsx(l,{scope:_,itemMap:y,collectionRef:S,children:N})};o.displayName=t;const u=e+"CollectionSlot",d=J2.forwardRef((g,_)=>{const{scope:N,children:S}=g,y=s(u,N),C=U0(_,y.collectionRef);return G.jsx(Wt,{ref:C,children:S})});d.displayName=u;const f=e+"CollectionItemSlot",m="data-radix-collection-item",v=J2.forwardRef((g,_)=>{const{scope:N,children:S,...y}=g,C=J2.useRef(null),M=U0(_,C),x=s(f,N);return J2.useEffect(()=>(x.itemMap.set(C,{ref:C,...y}),()=>void x.itemMap.delete(C))),G.jsx(Wt,{[m]:"",ref:M,children:S})});v.displayName=f;function A(g){const _=s(e+"CollectionConsumer",g);return J2.useCallback(()=>{const S=_.collectionRef.current;if(!S)return[];const y=Array.from(S.querySelectorAll(`[${m}]`));return Array.from(_.itemMap.values()).sort((x,w)=>y.indexOf(x.ref.current)-y.indexOf(w.ref.current))},[_.collectionRef,_.itemMap])}return[{Provider:o,Slot:d,ItemSlot:v},A,a]}var Nk=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],u0=Nk.reduce((e,t)=>{const r=E.forwardRef((a,l)=>{const{asChild:s,...o}=a,u=s?Wt:t;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),G.jsx(u,{...o,ref:l})});return r.displayName=`Primitive.${t}`,{...e,[t]:r}},{});function cv(e,t){e&&nr.flushSync(()=>e.dispatchEvent(t))}function X1(e){const t=E.useRef(e);return E.useEffect(()=>{t.current=e}),E.useMemo(()=>(...r)=>{var a;return(a=t.current)==null?void 0:a.call(t,...r)},[])}function Sk(e,t=globalThis==null?void 0:globalThis.document){const r=X1(e);E.useEffect(()=>{const a=l=>{l.key==="Escape"&&r(l)};return t.addEventListener("keydown",a,{capture:!0}),()=>t.removeEventListener("keydown",a,{capture:!0})},[r,t])}var zk="DismissableLayer",s5="dismissableLayer.update",Ck="dismissableLayer.pointerDownOutside",yk="dismissableLayer.focusOutside",Qh,ov=E.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),Ms=E.forwardRef((e,t)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:s,onInteractOutside:o,onDismiss:u,...d}=e,f=E.useContext(ov),[m,v]=E.useState(null),A=(m==null?void 0:m.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=E.useState({}),_=U0(t,L=>v(L)),N=Array.from(f.layers),[S]=[...f.layersWithOutsidePointerEventsDisabled].slice(-1),y=N.indexOf(S),C=m?N.indexOf(m):-1,M=f.layersWithOutsidePointerEventsDisabled.size>0,x=C>=y,w=Mk(L=>{const K=L.target,$=[...f.branches].some(W=>W.contains(K));!x||$||(l==null||l(L),o==null||o(L),L.defaultPrevented||u==null||u())},A),D=Rk(L=>{const K=L.target;[...f.branches].some(W=>W.contains(K))||(s==null||s(L),o==null||o(L),L.defaultPrevented||u==null||u())},A);return Sk(L=>{C===f.layers.size-1&&(a==null||a(L),!L.defaultPrevented&&u&&(L.preventDefault(),u()))},A),E.useEffect(()=>{if(m)return r&&(f.layersWithOutsidePointerEventsDisabled.size===0&&(Qh=A.body.style.pointerEvents,A.body.style.pointerEvents="none"),f.layersWithOutsidePointerEventsDisabled.add(m)),f.layers.add(m),Xh(),()=>{r&&f.layersWithOutsidePointerEventsDisabled.size===1&&(A.body.style.pointerEvents=Qh)}},[m,A,r,f]),E.useEffect(()=>()=>{m&&(f.layers.delete(m),f.layersWithOutsidePointerEventsDisabled.delete(m),Xh())},[m,f]),E.useEffect(()=>{const L=()=>g({});return document.addEventListener(s5,L),()=>document.removeEventListener(s5,L)},[]),G.jsx(u0.div,{...d,ref:_,style:{pointerEvents:M?x?"auto":"none":void 0,...e.style},onFocusCapture:p0(e.onFocusCapture,D.onFocusCapture),onBlurCapture:p0(e.onBlurCapture,D.onBlurCapture),onPointerDownCapture:p0(e.onPointerDownCapture,w.onPointerDownCapture)})});Ms.displayName=zk;var kk="DismissableLayerBranch",uv=E.forwardRef((e,t)=>{const r=E.useContext(ov),a=E.useRef(null),l=U0(t,a);return E.useEffect(()=>{const s=a.current;if(s)return r.branches.add(s),()=>{r.branches.delete(s)}},[r.branches]),G.jsx(u0.div,{...e,ref:l})});uv.displayName=kk;function Mk(e,t=globalThis==null?void 0:globalThis.document){const r=X1(e),a=E.useRef(!1),l=E.useRef(()=>{});return E.useEffect(()=>{const s=u=>{if(u.target&&!a.current){let d=function(){dv(Ck,r,f,{discrete:!0})};const f={originalEvent:u};u.pointerType==="touch"?(t.removeEventListener("click",l.current),l.current=d,t.addEventListener("click",l.current,{once:!0})):d()}else t.removeEventListener("click",l.current);a.current=!1},o=window.setTimeout(()=>{t.addEventListener("pointerdown",s)},0);return()=>{window.clearTimeout(o),t.removeEventListener("pointerdown",s),t.removeEventListener("click",l.current)}},[t,r]),{onPointerDownCapture:()=>a.current=!0}}function Rk(e,t=globalThis==null?void 0:globalThis.document){const r=X1(e),a=E.useRef(!1);return E.useEffect(()=>{const l=s=>{s.target&&!a.current&&dv(yk,r,{originalEvent:s},{discrete:!1})};return t.addEventListener("focusin",l),()=>t.removeEventListener("focusin",l)},[t,r]),{onFocusCapture:()=>a.current=!0,onBlurCapture:()=>a.current=!1}}function Xh(){const e=new CustomEvent(s5);document.dispatchEvent(e)}function dv(e,t,r,{discrete:a}){const l=r.originalEvent.target,s=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),a?cv(l,s):l.dispatchEvent(s)}var wk=Ms,xk=uv,N1=globalThis!=null&&globalThis.document?E.useLayoutEffect:()=>{},Tk="Portal",Rs=E.forwardRef((e,t)=>{var u;const{container:r,...a}=e,[l,s]=E.useState(!1);N1(()=>s(!0),[]);const o=r||l&&((u=globalThis==null?void 0:globalThis.document)==null?void 0:u.body);return o?LC.createPortal(G.jsx(u0.div,{...a,ref:t}),o):null});Rs.displayName=Tk;function Dk(e,t){return E.useReducer((r,a)=>t[r][a]??r,e)}var Na=e=>{const{present:t,children:r}=e,a=bk(t),l=typeof r=="function"?r({present:a.isPresent}):E.Children.only(r),s=U0(a.ref,Lk(l));return typeof r=="function"||a.isPresent?E.cloneElement(l,{ref:s}):null};Na.displayName="Presence";function bk(e){const[t,r]=E.useState(),a=E.useRef({}),l=E.useRef(e),s=E.useRef("none"),o=e?"mounted":"unmounted",[u,d]=Dk(o,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return E.useEffect(()=>{const f=ei(a.current);s.current=u==="mounted"?f:"none"},[u]),N1(()=>{const f=a.current,m=l.current;if(m!==e){const A=s.current,g=ei(f);e?d("MOUNT"):g==="none"||(f==null?void 0:f.display)==="none"?d("UNMOUNT"):d(m&&A!==g?"ANIMATION_OUT":"UNMOUNT"),l.current=e}},[e,d]),N1(()=>{if(t){let f;const m=t.ownerDocument.defaultView??window,v=g=>{const N=ei(a.current).includes(g.animationName);if(g.target===t&&N&&(d("ANIMATION_END"),!l.current)){const S=t.style.animationFillMode;t.style.animationFillMode="forwards",f=m.setTimeout(()=>{t.style.animationFillMode==="forwards"&&(t.style.animationFillMode=S)})}},A=g=>{g.target===t&&(s.current=ei(a.current))};return t.addEventListener("animationstart",A),t.addEventListener("animationcancel",v),t.addEventListener("animationend",v),()=>{m.clearTimeout(f),t.removeEventListener("animationstart",A),t.removeEventListener("animationcancel",v),t.removeEventListener("animationend",v)}}else d("ANIMATION_END")},[t,d]),{isPresent:["mounted","unmountSuspended"].includes(u),ref:E.useCallback(f=>{f&&(a.current=getComputedStyle(f)),r(f)},[])}}function ei(e){return(e==null?void 0:e.animationName)||"none"}function Lk(e){var a,l;let t=(a=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:a.get,r=t&&"isReactWarning"in t&&t.isReactWarning;return r?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,r=t&&"isReactWarning"in t&&t.isReactWarning,r?e.props.ref:e.props.ref||e.ref)}function Bi({prop:e,defaultProp:t,onChange:r=()=>{}}){const[a,l]=Bk({defaultProp:t,onChange:r}),s=e!==void 0,o=s?e:a,u=X1(r),d=E.useCallback(f=>{if(s){const v=typeof f=="function"?f(e):f;v!==e&&u(v)}else l(f)},[s,e,l,u]);return[o,d]}function Bk({defaultProp:e,onChange:t}){const r=E.useState(e),[a]=r,l=E.useRef(a),s=X1(t);return E.useEffect(()=>{l.current!==a&&(s(a),l.current=a)},[a,l,s]),r}var Fk="VisuallyHidden",ws=E.forwardRef((e,t)=>G.jsx(u0.span,{...e,ref:t,style:{position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal",...e.style}}));ws.displayName=Fk;var Ok="ToastProvider",[hv,Pk,Hk]=sv("Toast"),[fv,sY]=_a("Toast",[Hk]),[cY,xs]=fv(Ok),mv="ToastViewport",Uk=["F8"],c5="toast.viewportPause",o5="toast.viewportResume",pv=E.forwardRef((e,t)=>{const{__scopeToast:r,hotkey:a=Uk,label:l="Notifications ({hotkey})",...s}=e,o=xs(mv,r),u=Pk(r),d=E.useRef(null),f=E.useRef(null),m=E.useRef(null),v=E.useRef(null),A=U0(t,v,o.onViewportChange),g=a.join("+").replace(/Key/g,"").replace(/Digit/g,""),_=o.toastCount>0;E.useEffect(()=>{const S=y=>{var M;a.length!==0&&a.every(x=>y[x]||y.code===x)&&((M=v.current)==null||M.focus())};return document.addEventListener("keydown",S),()=>document.removeEventListener("keydown",S)},[a]),E.useEffect(()=>{const S=d.current,y=v.current;if(_&&S&&y){const C=()=>{if(!o.isClosePausedRef.current){const D=new CustomEvent(c5);y.dispatchEvent(D),o.isClosePausedRef.current=!0}},M=()=>{if(o.isClosePausedRef.current){const D=new CustomEvent(o5);y.dispatchEvent(D),o.isClosePausedRef.current=!1}},x=D=>{!S.contains(D.relatedTarget)&&M()},w=()=>{S.contains(document.activeElement)||M()};return S.addEventListener("focusin",C),S.addEventListener("focusout",x),S.addEventListener("pointermove",C),S.addEventListener("pointerleave",w),window.addEventListener("blur",C),window.addEventListener("focus",M),()=>{S.removeEventListener("focusin",C),S.removeEventListener("focusout",x),S.removeEventListener("pointermove",C),S.removeEventListener("pointerleave",w),window.removeEventListener("blur",C),window.removeEventListener("focus",M)}}},[_,o.isClosePausedRef]);const N=E.useCallback(({tabbingDirection:S})=>{const C=u().map(M=>{const x=M.ref.current,w=[x,...eM(x)];return S==="forwards"?w:w.reverse()});return(S==="forwards"?C.reverse():C).flat()},[u]);return E.useEffect(()=>{const S=v.current;if(S){const y=C=>{var w,D,L;const M=C.altKey||C.ctrlKey||C.metaKey;if(C.key==="Tab"&&!M){const K=document.activeElement,$=C.shiftKey;if(C.target===S&&$){(w=f.current)==null||w.focus();return}const Q=N({tabbingDirection:$?"backwards":"forwards"}),i2=Q.findIndex(j=>j===K);lu(Q.slice(i2+1))?C.preventDefault():$?(D=f.current)==null||D.focus():(L=m.current)==null||L.focus()}};return S.addEventListener("keydown",y),()=>S.removeEventListener("keydown",y)}},[u,N]),G.jsxs(xk,{ref:d,role:"region","aria-label":l.replace("{hotkey}",g),tabIndex:-1,style:{pointerEvents:_?void 0:"none"},children:[_&&G.jsx(u5,{ref:f,onFocusFromOutsideViewport:()=>{const S=N({tabbingDirection:"forwards"});lu(S)}}),G.jsx(hv.Slot,{scope:r,children:G.jsx(u0.ol,{tabIndex:-1,...s,ref:A})}),_&&G.jsx(u5,{ref:m,onFocusFromOutsideViewport:()=>{const S=N({tabbingDirection:"backwards"});lu(S)}})]})});pv.displayName=mv;var vv="ToastFocusProxy",u5=E.forwardRef((e,t)=>{const{__scopeToast:r,onFocusFromOutsideViewport:a,...l}=e,s=xs(vv,r);return G.jsx(ws,{"aria-hidden":!0,tabIndex:0,...l,ref:t,style:{position:"fixed"},onFocus:o=>{var f;const u=o.relatedTarget;!((f=s.viewport)!=null&&f.contains(u))&&a()}})});u5.displayName=vv;var Ts="Toast",Vk="toast.swipeStart",Gk="toast.swipeMove",jk="toast.swipeCancel",Kk="toast.swipeEnd",Av=E.forwardRef((e,t)=>{const{forceMount:r,open:a,defaultOpen:l,onOpenChange:s,...o}=e,[u=!0,d]=Bi({prop:a,defaultProp:l,onChange:s});return G.jsx(Na,{present:r||u,children:G.jsx($k,{open:u,...o,ref:t,onClose:()=>d(!1),onPause:X1(e.onPause),onResume:X1(e.onResume),onSwipeStart:p0(e.onSwipeStart,f=>{f.currentTarget.setAttribute("data-swipe","start")}),onSwipeMove:p0(e.onSwipeMove,f=>{const{x:m,y:v}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","move"),f.currentTarget.style.setProperty("--radix-toast-swipe-move-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-move-y",`${v}px`)}),onSwipeCancel:p0(e.onSwipeCancel,f=>{f.currentTarget.setAttribute("data-swipe","cancel"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-end-y")}),onSwipeEnd:p0(e.onSwipeEnd,f=>{const{x:m,y:v}=f.detail.delta;f.currentTarget.setAttribute("data-swipe","end"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-x"),f.currentTarget.style.removeProperty("--radix-toast-swipe-move-y"),f.currentTarget.style.setProperty("--radix-toast-swipe-end-x",`${m}px`),f.currentTarget.style.setProperty("--radix-toast-swipe-end-y",`${v}px`),d(!1)})})})});Av.displayName=Ts;var[Wk,Yk]=fv(Ts,{onClose(){}}),$k=E.forwardRef((e,t)=>{const{__scopeToast:r,type:a="foreground",duration:l,open:s,onClose:o,onEscapeKeyDown:u,onPause:d,onResume:f,onSwipeStart:m,onSwipeMove:v,onSwipeCancel:A,onSwipeEnd:g,..._}=e,N=xs(Ts,r),[S,y]=E.useState(null),C=U0(t,j=>y(j)),M=E.useRef(null),x=E.useRef(null),w=l||N.duration,D=E.useRef(0),L=E.useRef(w),K=E.useRef(0),{onToastAdd:$,onToastRemove:W}=N,h2=X1(()=>{var X;(S==null?void 0:S.contains(document.activeElement))&&((X=N.viewport)==null||X.focus()),o()}),Q=E.useCallback(j=>{!j||j===1/0||(window.clearTimeout(K.current),D.current=new Date().getTime(),K.current=window.setTimeout(h2,j))},[h2]);E.useEffect(()=>{const j=N.viewport;if(j){const X=()=>{Q(L.current),f==null||f()},r2=()=>{const l2=new Date().getTime()-D.current;L.current=L.current-l2,window.clearTimeout(K.current),d==null||d()};return j.addEventListener(c5,r2),j.addEventListener(o5,X),()=>{j.removeEventListener(c5,r2),j.removeEventListener(o5,X)}}},[N.viewport,w,d,f,Q]),E.useEffect(()=>{s&&!N.isClosePausedRef.current&&Q(w)},[s,w,N.isClosePausedRef,Q]),E.useEffect(()=>($(),()=>W()),[$,W]);const i2=E.useMemo(()=>S?zv(S):null,[S]);return N.viewport?G.jsxs(G.Fragment,{children:[i2&&G.jsx(Zk,{__scopeToast:r,role:"status","aria-live":a==="foreground"?"assertive":"polite","aria-atomic":!0,children:i2}),G.jsx(Wk,{scope:r,onClose:h2,children:nr.createPortal(G.jsx(hv.ItemSlot,{scope:r,children:G.jsx(wk,{asChild:!0,onEscapeKeyDown:p0(u,()=>{N.isFocusedToastEscapeKeyDownRef.current||h2(),N.isFocusedToastEscapeKeyDownRef.current=!1}),children:G.jsx(u0.li,{role:"status","aria-live":"off","aria-atomic":!0,tabIndex:0,"data-state":s?"open":"closed","data-swipe-direction":N.swipeDirection,..._,ref:C,style:{userSelect:"none",touchAction:"none",...e.style},onKeyDown:p0(e.onKeyDown,j=>{j.key==="Escape"&&(u==null||u(j.nativeEvent),j.nativeEvent.defaultPrevented||(N.isFocusedToastEscapeKeyDownRef.current=!0,h2()))}),onPointerDown:p0(e.onPointerDown,j=>{j.button===0&&(M.current={x:j.clientX,y:j.clientY})}),onPointerMove:p0(e.onPointerMove,j=>{if(!M.current)return;const X=j.clientX-M.current.x,r2=j.clientY-M.current.y,l2=!!x.current,Z=["left","right"].includes(N.swipeDirection),s2=["left","up"].includes(N.swipeDirection)?Math.min:Math.max,u2=Z?s2(0,X):0,b=Z?0:s2(0,r2),F=j.pointerType==="touch"?10:2,t2={x:u2,y:b},o2={originalEvent:j,delta:t2};l2?(x.current=t2,ti(Gk,v,o2,{discrete:!1})):ef(t2,N.swipeDirection,F)?(x.current=t2,ti(Vk,m,o2,{discrete:!1}),j.target.setPointerCapture(j.pointerId)):(Math.abs(X)>F||Math.abs(r2)>F)&&(M.current=null)}),onPointerUp:p0(e.onPointerUp,j=>{const X=x.current,r2=j.target;if(r2.hasPointerCapture(j.pointerId)&&r2.releasePointerCapture(j.pointerId),x.current=null,M.current=null,X){const l2=j.currentTarget,Z={originalEvent:j,delta:X};ef(X,N.swipeDirection,N.swipeThreshold)?ti(Kk,g,Z,{discrete:!0}):ti(jk,A,Z,{discrete:!0}),l2.addEventListener("click",s2=>s2.preventDefault(),{once:!0})}})})})}),N.viewport)})]}):null}),Zk=e=>{const{__scopeToast:t,children:r,...a}=e,l=xs(Ts,t),[s,o]=E.useState(!1),[u,d]=E.useState(!1);return Qk(()=>o(!0)),E.useEffect(()=>{const f=window.setTimeout(()=>d(!0),1e3);return()=>window.clearTimeout(f)},[]),u?null:G.jsx(Rs,{asChild:!0,children:G.jsx(ws,{...a,children:s&&G.jsxs(G.Fragment,{children:[l.label," ",r]})})})},qk="ToastTitle",gv=E.forwardRef((e,t)=>{const{__scopeToast:r,...a}=e;return G.jsx(u0.div,{...a,ref:t})});gv.displayName=qk;var Jk="ToastDescription",Ev=E.forwardRef((e,t)=>{const{__scopeToast:r,...a}=e;return G.jsx(u0.div,{...a,ref:t})});Ev.displayName=Jk;var Iv="ToastAction",_v=E.forwardRef((e,t)=>{const{altText:r,...a}=e;return r.trim()?G.jsx(Sv,{altText:r,asChild:!0,children:G.jsx(m6,{...a,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${Iv}\`. Expected non-empty \`string\`.`),null)});_v.displayName=Iv;var Nv="ToastClose",m6=E.forwardRef((e,t)=>{const{__scopeToast:r,...a}=e,l=Yk(Nv,r);return G.jsx(Sv,{asChild:!0,children:G.jsx(u0.button,{type:"button",...a,ref:t,onClick:p0(e.onClick,l.onClose)})})});m6.displayName=Nv;var Sv=E.forwardRef((e,t)=>{const{__scopeToast:r,altText:a,...l}=e;return G.jsx(u0.div,{"data-radix-toast-announce-exclude":"","data-radix-toast-announce-alt":a||void 0,...l,ref:t})});function zv(e){const t=[];return Array.from(e.childNodes).forEach(a=>{if(a.nodeType===a.TEXT_NODE&&a.textContent&&t.push(a.textContent),Xk(a)){const l=a.ariaHidden||a.hidden||a.style.display==="none",s=a.dataset.radixToastAnnounceExclude==="";if(!l)if(s){const o=a.dataset.radixToastAnnounceAlt;o&&t.push(o)}else t.push(...zv(a))}}),t}function ti(e,t,r,{discrete:a}){const l=r.originalEvent.currentTarget,s=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:r});t&&l.addEventListener(e,t,{once:!0}),a?cv(l,s):l.dispatchEvent(s)}var ef=(e,t,r=0)=>{const a=Math.abs(e.x),l=Math.abs(e.y),s=a>l;return t==="left"||t==="right"?s&&a>r:!s&&l>r};function Qk(e=()=>{}){const t=X1(e);N1(()=>{let r=0,a=0;return r=window.requestAnimationFrame(()=>a=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(r),window.cancelAnimationFrame(a)}},[t])}function Xk(e){return e.nodeType===e.ELEMENT_NODE}function eM(e){const t=[],r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:a=>{const l=a.tagName==="INPUT"&&a.type==="hidden";return a.disabled||a.hidden||l?NodeFilter.FILTER_SKIP:a.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;r.nextNode();)t.push(r.currentNode);return t}function lu(e){const t=document.activeElement;return e.some(r=>r===t?!0:(r.focus(),document.activeElement!==t))}var Cv=pv,yv=Av,kv=gv,Mv=Ev,Rv=_v,wv=m6;function xv(e){var t,r,a="";if(typeof e=="string"||typeof e=="number")a+=e;else if(typeof e=="object")if(Array.isArray(e)){var l=e.length;for(t=0;t<l;t++)e[t]&&(r=xv(e[t]))&&(a&&(a+=" "),a+=r)}else for(r in e)e[r]&&(a&&(a+=" "),a+=r);return a}function Ds(){for(var e,t,r=0,a="",l=arguments.length;r<l;r++)(e=arguments[r])&&(t=xv(e))&&(a&&(a+=" "),a+=t);return a}const tf=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,rf=Ds,te=(e,t)=>r=>{var a;if((t==null?void 0:t.variants)==null)return rf(e,r==null?void 0:r.class,r==null?void 0:r.className);const{variants:l,defaultVariants:s}=t,o=Object.keys(l).map(f=>{const m=r==null?void 0:r[f],v=s==null?void 0:s[f];if(m===null)return null;const A=tf(m)||tf(v);return l[f][A]}),u=r&&Object.entries(r).reduce((f,m)=>{let[v,A]=m;return A===void 0||(f[v]=A),f},{}),d=t==null||(a=t.compoundVariants)===null||a===void 0?void 0:a.reduce((f,m)=>{let{class:v,className:A,...g}=m;return Object.entries(g).every(_=>{let[N,S]=_;return Array.isArray(S)?S.includes({...s,...u}[N]):{...s,...u}[N]===S})?[...f,v,A]:f},[]);return rf(e,o,d,r==null?void 0:r.class,r==null?void 0:r.className)};/**
104
104
  * @license lucide-react v0.471.2 - ISC
105
105
  *
106
106
  * This source code is licensed under the ISC license.
@@ -5,7 +5,7 @@
5
5
  <link rel="icon" type="image/svg+xml" href="/vite.svg" />
6
6
  <meta name="viewport" content="width=device-width, initial-scale=1.0" />
7
7
  <title>Intlayer Editor</title>
8
- <script type="module" crossorigin src="/assets/index-Cn5-a120.js"></script>
8
+ <script type="module" crossorigin src="/assets/index-CChGVJkC.js"></script>
9
9
  <link rel="stylesheet" crossorigin href="/assets/index-neFUT_SC.css">
10
10
  </head>
11
11
  <body>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "intlayer-editor",
3
- "version": "4.1.9",
3
+ "version": "4.1.10",
4
4
  "private": false,
5
5
  "description": "Integrate the Intlayer visual editor into your Intlayer projects, enabling CMS-like content management with multilingual support.",
6
6
  "keywords": [
@@ -72,14 +72,14 @@
72
72
  "react-dom": "^18.3.1",
73
73
  "react-router-dom": "^7.1.1",
74
74
  "rimraf": "^6.0.1",
75
- "@intlayer/api": "4.1.9",
76
- "@intlayer/config": "4.1.9",
77
- "@intlayer/design-system": "4.1.9",
78
- "@intlayer/core": "4.1.9",
79
- "@intlayer/editor": "4.1.9",
80
- "@intlayer/editor-react": "4.1.9",
81
- "react-intlayer": "^4.1.9",
82
- "vite-intlayer": "^4.1.9"
75
+ "@intlayer/core": "4.1.10",
76
+ "@intlayer/design-system": "4.1.10",
77
+ "@intlayer/editor": "4.1.10",
78
+ "@intlayer/config": "4.1.10",
79
+ "@intlayer/editor-react": "4.1.10",
80
+ "react-intlayer": "^4.1.10",
81
+ "@intlayer/api": "4.1.10",
82
+ "vite-intlayer": "^4.1.10"
83
83
  },
84
84
  "devDependencies": {
85
85
  "@types/cors": "^2.8.17",
@@ -99,7 +99,7 @@
99
99
  "typescript-eslint": "^8.18.2",
100
100
  "vite": "^6.0.11",
101
101
  "vitest": "^2.1.8",
102
- "@intlayer/backend": "4.1.9"
102
+ "@intlayer/backend": "4.1.10"
103
103
  },
104
104
  "peerDependencies": {
105
105
  "@types/compression": "^1.7.5",
@@ -110,14 +110,14 @@
110
110
  "react-dom": ">=16.0.0",
111
111
  "react-router-dom": ">=6.0.0",
112
112
  "tailwind-merge": "^2.6.0",
113
- "@intlayer/config": "4.1.9",
114
- "@intlayer/core": "4.1.9",
115
- "intlayer": "4.1.9",
116
- "react-intlayer": "^4.1.9",
117
- "@intlayer/design-system": "4.1.9",
118
- "vite-intlayer": "^4.1.9",
119
- "@intlayer/editor-react": "4.1.9",
120
- "@intlayer/editor": "4.1.9"
113
+ "@intlayer/config": "4.1.10",
114
+ "@intlayer/core": "4.1.10",
115
+ "@intlayer/design-system": "4.1.10",
116
+ "@intlayer/editor": "4.1.10",
117
+ "@intlayer/editor-react": "4.1.10",
118
+ "intlayer": "4.1.10",
119
+ "vite-intlayer": "^4.1.10",
120
+ "react-intlayer": "^4.1.10"
121
121
  },
122
122
  "engines": {
123
123
  "node": ">=14.18"