intlayer-editor 9.5.2 → 9.5.3
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.
- package/client/dist/assets/{CodeBlockShiki-D9ogZ6jz.js → CodeBlockShiki-D7zTJXzX.js} +2 -2
- package/client/dist/assets/{MarkDownRender-CwIf8kif.js → MarkDownRender-13fWMurT.js} +5 -5
- package/client/dist/assets/MarkDownRender-D3kXJ_Ol.js +1 -0
- package/client/dist/assets/{MarkdownEditor-BtOw7ct6.js → MarkdownEditor-DeEk15uV.js} +5 -5
- package/client/dist/assets/dynamic-D0kyHp6d.js +41 -0
- package/client/dist/assets/index-Dl8Djuia.js +113 -0
- package/client/dist/assets/{shikiBundle-BfcDyQbG.js → shikiBundle-CnnFdFOD.js} +1 -1
- package/client/dist/index.html +2 -2
- package/package.json +15 -15
- package/client/dist/assets/MarkDownRender-C_B1qnYV.js +0 -1
- package/client/dist/assets/dynamic-CXUUIfkV.js +0 -41
- package/client/dist/assets/index-DlM7HfMI.js +0 -113
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/MarkDownRender-C_B1qnYV.js","assets/MarkDownRender-CwIf8kif.js","assets/rolldown-runtime-hePW80VL.js","assets/react-Cvdyeg_0.js","assets/dynamic-CXUUIfkV.js","assets/dist-CcmWBeAo.js","assets/MarkdownEditor-BtOw7ct6.js","assets/shikiBundle-BfcDyQbG.js","assets/dist-BHukwvnD.js"])))=>i.map(i=>d[i]);
|
|
2
|
-
import{n as e,r as t,t as n}from"./rolldown-runtime-hePW80VL.js";import{t as r}from"./react-Cvdyeg_0.js";import{$ as i,$t as a,A as o,At as s,B as c,Bt as l,Ct as u,D as d,Dt as f,Et as p,F as m,Ft as h,G as g,Gt as _,H as v,Ht as y,I as b,It as x,J as S,Jt as C,K as w,Kt as T,L as E,Lt as D,M as O,Mt as k,N as ee,Nt as A,O as te,Ot as ne,P as j,Pt as re,Q as ie,Qt as ae,R as oe,Rt as se,St as ce,Tt as le,U as ue,Ut as de,V as fe,Vt as pe,W as me,Wt as he,X as ge,Xt as M,Y as N,Yt as _e,Z as ve,Zt as ye,_t as be,at as xe,bt as P,ct as Se,d as Ce,dt as we,en as Te,et as Ee,f as De,ft as Oe,g as ke,gt as Ae,h as je,ht as Me,i as Ne,it as Pe,j as Fe,jt as Ie,k as Le,kt as Re,lt as ze,m as F,mt as Be,n as Ve,ot as He,p as Ue,pt as We,q as Ge,qt as Ke,r as qe,rt as Je,s as Ye,st as Xe,t as Ze,tn as Qe,tt as $e,ut as et,vt as tt,wt as nt,xt as rt,yt as it,z as at,zt as ot}from"./dynamic-CXUUIfkV.js";import{n as st,t as I}from"./dist-CcmWBeAo.js";(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var ct=n((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,O());else{var t=n(l);t!==null&&A(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function E(){return g?!0:!(e.unstable_now()-T<w)}function D(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&E());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&A(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?O():S=!1}}}var O;if(typeof y==`function`)O=function(){y(D)};else if(typeof MessageChannel<`u`){var k=new MessageChannel,ee=k.port2;k.port1.onmessage=D,O=function(){ee.postMessage(null)}}else O=function(){_(D,0)};function A(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,A(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,O()))),r},e.unstable_shouldYield=E,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),lt=n(((e,t)=>{t.exports=ct()})),ut=n((e=>{var t=lt(),n=r(),i=Qe();function a(e){var t=`https://react.dev/errors/`+e;if(1<arguments.length){t+=`?args[]=`+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+=`&args[]=`+encodeURIComponent(arguments[n])}return`Minified React error #`+e+`; visit `+t+` for the full message or use the non-minified dev environment for full errors and additional helpful warnings.`}function o(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function s(e){for(var t=e,n=t;n&&!n.alternate;)t=n,t.flags&4098&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function c(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function l(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function u(e){if(s(e)!==e)throw Error(a(188))}function d(e){var t=e.alternate;if(!t){if(t=s(e),t===null)throw Error(a(188));return t===e?e:null}for(var n=e,r=t;;){var i=n.return;if(i===null)break;var o=i.alternate;if(o===null){if(r=i.return,r!==null){n=r;continue}break}if(i.child===o.child){for(o=i.child;o;){if(o===n)return u(i),e;if(o===r)return u(i),t;o=o.sibling}throw Error(a(188))}if(n.return!==r.return)n=i,r=o;else{for(var c=!1,l=i.child;l;){if(l===n){c=!0,n=i,r=o;break}if(l===r){c=!0,r=i,n=o;break}l=l.sibling}if(!c){for(l=o.child;l;){if(l===n){c=!0,n=o,r=i;break}if(l===r){c=!0,r=o,n=i;break}l=l.sibling}if(!c)throw Error(a(189))}}if(n.alternate!==r)throw Error(a(190))}if(n.tag!==3)throw Error(a(188));return n.stateNode.current===n?e:t}function f(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=f(e),t!==null)return t;e=e.sibling}return null}function p(e,t,n,r,i,a){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,r,i,a)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&p(e.child,t,n,r,i,a))return!0;e=e.sibling}return!1}function m(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function h(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),e.tag!==3&&e.tag!==5&&e.tag!==27);)e=e.return;return t}function g(e){var t=[null,null],n=m(e);return n===null||_(t,e,n.child,{foundSelf:!1}),t}function _(e,t,n,r){for(;n!==null;){if(n===t)r.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(r.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&_(e,t,n.child,r))return!0;n=n.sibling}return!1}function v(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(a(559))}}var y=null,b=null;function x(e,t,n){return e===n||e===t&&(y=e,!0)}function S(e,t,n){return e===n?(b=e,!1):e===t&&(b!==null&&(y=e),!0)}function C(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function w(e,t,n){for(var r=0,i=e;i;i=n(i))r++;i=0;for(var a=t;a;a=n(a))i++;for(;0<r-i;)e=n(e),r--;for(;0<i-r;)t=n(t),i--;for(;r--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var T=Object.assign,E=Symbol.for(`react.element`),D=Symbol.for(`react.transitional.element`),O=Symbol.for(`react.portal`),k=Symbol.for(`react.fragment`),ee=Symbol.for(`react.strict_mode`),A=Symbol.for(`react.profiler`),te=Symbol.for(`react.consumer`),ne=Symbol.for(`react.context`),j=Symbol.for(`react.forward_ref`),re=Symbol.for(`react.suspense`),ie=Symbol.for(`react.suspense_list`),ae=Symbol.for(`react.memo`),oe=Symbol.for(`react.lazy`),se=Symbol.for(`react.activity`),ce=Symbol.for(`react.legacy_hidden`),le=Symbol.for(`react.memo_cache_sentinel`),ue=Symbol.for(`react.view_transition`),de=Symbol.for(`react.recoverable`),fe=Symbol.iterator;function pe(e){return typeof e!=`object`||!e?null:(e=fe&&e[fe]||e[`@@iterator`],typeof e==`function`?e:null)}var me=Symbol.for(`react.client.reference`);function he(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===me?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case k:return`Fragment`;case A:return`Profiler`;case ee:return`StrictMode`;case re:return`Suspense`;case ie:return`SuspenseList`;case se:return`Activity`;case ue:return`ViewTransition`}if(typeof e==`object`)switch(e.$$typeof){case O:return`Portal`;case ne:return e.displayName||`Context`;case te:return(e._context.displayName||`Context`)+`.Consumer`;case j:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case ae:return t=e.displayName||null,t===null?he(e.type)||`Memo`:t;case oe:t=e._payload,e=e._init;try{return he(e(t))}catch{}}return null}var ge=Array.isArray,M=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,N=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,_e={pending:!1,data:null,method:null,action:null},ve=[],ye=-1;function be(e){return{current:e}}function xe(e){0>ye||(e.current=ve[ye],ve[ye]=null,ye--)}function P(e,t){ye++,ve[ye]=e.current,e.current=t}var Se=be(null),Ce=be(null),we=be(null),Te=be(null);function Ee(e,t){switch(P(we,t),P(Ce,e),P(Se,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?gp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=gp(t),e=_p(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}xe(Se),P(Se,e)}function De(){xe(Se),xe(Ce),xe(we)}function Oe(e){var t=e.memoizedState;t!==null&&(ph._currentValue=t.memoizedState,P(Te,e)),t=Se.current;var n=_p(t,e.type);t!==n&&(P(Ce,e),P(Se,n))}function ke(e){Ce.current===e&&(xe(Se),xe(Ce)),Te.current===e&&(xe(Te),ph._currentValue=_e)}var Ae,je;function Me(e){if(Ae===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||``,je=-1<e.stack.indexOf(`
|
|
3
|
-
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
|
|
4
|
-
`+Ae+e+je}var Ne=!1;function Pe(e,t){if(!e||Ne)return``;Ne=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}n=!1;try{var i=Object.getOwnPropertyDescriptor(e.prototype,`props`);Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),n=!0,new e}finally{n&&(i===void 0?delete e.prototype.props:Object.defineProperty(e.prototype,"props",i))}}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
|
|
5
|
-
`),l=s.split(`
|
|
6
|
-
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
|
|
7
|
-
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ne=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Me(n):``}function Fe(e,t){switch(e.tag){case 26:case 27:case 5:return Me(e.type);case 16:return Me(`Lazy`);case 13:return e.child!==t&&t!==null?Me(`Suspense Fallback`):Me(`Suspense`);case 19:return Me(`SuspenseList`);case 0:case 15:return Pe(e.type,!1);case 11:return Pe(e.type.render,!1);case 1:return Pe(e.type,!0);case 31:return Me(`Activity`);case 30:return Me(`ViewTransition`);default:return``}}function Ie(e){try{var t=``,n=null;do t+=Fe(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
|
|
8
|
-
Error generating stack: `+e.message+`
|
|
9
|
-
`+e.stack}}var Le=Object.prototype.hasOwnProperty,Re=t.unstable_scheduleCallback,ze=t.unstable_cancelCallback,F=t.unstable_shouldYield,Be=t.unstable_requestPaint,Ve=t.unstable_now,He=t.unstable_getCurrentPriorityLevel,Ue=t.unstable_ImmediatePriority,We=t.unstable_UserBlockingPriority,Ge=t.unstable_NormalPriority,Ke=t.unstable_LowPriority,qe=t.unstable_IdlePriority,Je=t.log,Ye=t.unstable_setDisableYieldValue,Xe=null,Ze=null;function $e(e){if(typeof Je==`function`&&Ye(e),Ze&&typeof Ze.setStrictMode==`function`)try{Ze.setStrictMode(Xe,e)}catch{}}var et=Math.clz32?Math.clz32:rt,tt=Math.log,nt=Math.LN2;function rt(e){return e>>>=0,e===0?32:31-(tt(e)/nt|0)|0}var it=256,at=262144,ot=4194304;function st(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&-e;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function I(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=st(n))):i=st(o):i=st(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=st(n))):i=st(o)):i=st(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function ct(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function ut(e,t){t&8&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var r=31-et(n),i=1<<r;t|=e[r],n&=~i}return t}function dt(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ft(){var e=ot;return ot<<=1,!(ot&62914560)&&(ot=4194304),e}function pt(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function mt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ht(e,t,n,r,i,a){var o=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-et(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&>(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function gt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-et(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function _t(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-et(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function vt(e,t){var n=t&-t;return n=n&42?1:yt(n),(n&(e.suspendedLanes|t))===0?n:0}function yt(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function bt(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function xt(){var e=N.p;return e===0?(e=window.event,e===void 0?32:kh(e.type)):e}function St(e,t){var n=N.p;try{return N.p=e,t()}finally{N.p=n}}var Ct=Math.random().toString(36).slice(2),wt=`__reactFiber$`+Ct,Tt=`__reactProps$`+Ct,Et=`__reactContainer$`+Ct,Dt=`__reactEvents$`+Ct,Ot=`__reactListeners$`+Ct,kt=`__reactHandles$`+Ct,At=`__reactResources$`+Ct,jt=`__reactMarker$`+Ct,Mt=`__reactLoad$`+Ct;function Nt(e){delete e[wt],delete e[Tt],delete e[Ot],delete e[kt]}function Pt(e){var t;if(t=e[wt])return t;for(var n=e.parentNode;n;){if(t=n[Et]||n[wt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=vm(e);e!==null;){if(n=e[wt])return n;e=vm(e)}return t}e=n,n=e.parentNode}return null}function Ft(e){if(e=e[wt]||e[Et]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function It(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(a(33))}function Lt(e){var t=e[At];return t||=e[At]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Rt(e){e[jt]=!0}function zt(e){e[Mt]=void 0}var Bt=new Set,Vt={};function Ht(e,t){Ut(e,t),Ut(e+`Capture`,t)}function Ut(e,t){for(Vt[e]=t,e=0;e<t.length;e++)Bt.add(t[e])}var L=RegExp(`^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$`),Wt={},Gt={};function Kt(e){return Le.call(Gt,e)?!0:Le.call(Wt,e)?!1:L.test(e)?Gt[e]=!0:(Wt[e]=!0,!1)}var R=!1;function qt(){var e=R;return R=!1,e}function Jt(e,t,n){if(Kt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,n)}}}function Yt(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(t);return}e.setAttribute(t,n)}}function Xt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,r)}}function Zt(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function Qt(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function $t(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function en(e){if(!e._valueTracker){var t=Qt(e)?`checked`:`value`;e._valueTracker=$t(e,t,``+e[t])}}function tn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=Qt(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}var nn=/[\n"\\]/g;function rn(e){return e.replace(nn,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function an(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Zt(t)):e.value!==``+Zt(t)&&(e.value=``+Zt(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):sn(e,Zt(n)):o===`number`&&e.value==t?sn(e,Zt(e.value)):sn(e,Zt(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Zt(s):e.removeAttribute(`name`)}function on(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){en(e);return}n=n==null?``:``+Zt(n),t=t==null?n:``+Zt(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),en(e)}function sn(e,t){e.defaultValue!==``+t&&(e.defaultValue=``+t)}function cn(e,t,n,r){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t[`$`+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty(`$`+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Zt(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function ln(e,t,n){if(t!=null&&(t=``+Zt(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Zt(n)}function un(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(a(92));if(ge(r)){if(1<r.length)throw Error(a(93));r=r[0]}n=r}n??=``,t=n}n=Zt(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),en(e)}function dn(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var fn=new Set(`animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp`.split(` `));function pn(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||fn.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function mn(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(a(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``,R=!0);for(var i in t)r=t[i],t.hasOwnProperty(i)&&n[i]!==r&&(pn(e,i,r),R=!0)}else for(var o in t)t.hasOwnProperty(o)&&pn(e,o,t[o])}function hn(e){if(e.indexOf(`-`)===-1)return!1;switch(e){case`annotation-xml`:case`color-profile`:case`font-face`:case`font-face-src`:case`font-face-uri`:case`font-face-format`:case`font-face-name`:case`missing-glyph`:return!1;default:return!0}}var gn=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`maskType`,`mask-type`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),_n=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function vn(e){return _n.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function yn(){}var bn=null;function xn(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Sn=null,Cn=null;function wn(e){var t=Ft(e);if(t&&(e=t.stateNode)){var n=e[Tt]||null;a:switch(e=t.stateNode,t.type){case`input`:if(an(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type===`radio`&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll(`input[name="`+rn(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var i=r[Tt]||null;if(!i)throw Error(a(90));an(r,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&tn(r)}break a;case`textarea`:ln(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&cn(e,!!n.multiple,t,!1)}}}var Tn=!1;function En(e,t,n){if(Tn)return e(t,n);Tn=!0;try{return e(t)}finally{if(Tn=!1,(Sn!==null||Cn!==null)&&(Wd(),Sn&&(t=Sn,e=Cn,Cn=Sn=null,wn(t),e)))for(t=0;t<e.length;t++)wn(e[t])}}function Dn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[Tt]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(a(231,t,typeof n));return n}var On=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),kn=!1;if(On)try{var An={};Object.defineProperty(An,"passive",{get:function(){kn=!0}}),window.addEventListener(`test`,An,An),window.removeEventListener(`test`,An,An)}catch{kn=!1}var jn=null,Mn=null,Nn=null;function Pn(){if(Nn)return Nn;var e,t=Mn,n=t.length,r,i=`value`in jn?jn.value:jn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return Nn=i.slice(e,1<r?1-r:void 0)}function Fn(e){var t=e.keyCode;return`charCode`in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function In(){return!0}function Ln(){return!1}function Rn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?In:Ln,this.isPropagationStopped=Ln,this}return T(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=In)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=In)},persist:function(){},isPersistent:In}),t}var zn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bn=Rn(zn),Vn=T({},zn,{view:0,detail:0}),Hn=Rn(Vn),Un,Wn,Gn,Kn=T({},Vn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:rr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return`movementX`in e?e.movementX:(e!==Gn&&(Gn&&e.type===`mousemove`?(Un=e.screenX-Gn.screenX,Wn=e.screenY-Gn.screenY):Wn=Un=0,Gn=e),Un)},movementY:function(e){return`movementY`in e?e.movementY:Wn}}),qn=Rn(Kn),Jn=Rn(T({},Kn,{dataTransfer:0})),Yn=Rn(T({},Vn,{relatedTarget:0})),Xn=Rn(T({},zn,{animationName:0,elapsedTime:0,pseudoElement:0})),Zn=Rn(T({},zn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Qn=Rn(T({},zn,{data:0})),$n={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},er={8:`Backspace`,9:`Tab`,12:`Clear`,13:`Enter`,16:`Shift`,17:`Control`,18:`Alt`,19:`Pause`,20:`CapsLock`,27:`Escape`,32:` `,33:`PageUp`,34:`PageDown`,35:`End`,36:`Home`,37:`ArrowLeft`,38:`ArrowUp`,39:`ArrowRight`,40:`ArrowDown`,45:`Insert`,46:`Delete`,112:`F1`,113:`F2`,114:`F3`,115:`F4`,116:`F5`,117:`F6`,118:`F7`,119:`F8`,120:`F9`,121:`F10`,122:`F11`,123:`F12`,144:`NumLock`,145:`ScrollLock`,224:`Meta`},tr={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function nr(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=tr[e])?!!t[e]:!1}function rr(){return nr}var ir=Rn(T({},Vn,{key:function(e){if(e.key){var t=$n[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=Fn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?er[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:rr,charCode:function(e){return e.type===`keypress`?Fn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?Fn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),ar=Rn(T({},Kn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),or=Rn(T({},zn,{submitter:0})),sr=Rn(T({},Vn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:rr})),cr=Rn(T({},zn,{propertyName:0,elapsedTime:0,pseudoElement:0})),lr=Rn(T({},Kn,{deltaX:function(e){return`deltaX`in e?e.deltaX:`wheelDeltaX`in e?-e.wheelDeltaX:0},deltaY:function(e){return`deltaY`in e?e.deltaY:`wheelDeltaY`in e?-e.wheelDeltaY:`wheelDelta`in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0})),ur=Rn(T({},zn,{newState:0,oldState:0,source:0})),dr=[9,13,27,32],fr=On&&`CompositionEvent`in window,pr=null;On&&`documentMode`in document&&(pr=document.documentMode);var mr=On&&`TextEvent`in window&&!pr,hr=On&&(!fr||pr&&8<pr&&11>=pr),gr=` `,_r=!1;function vr(e,t){switch(e){case`keyup`:return dr.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function yr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var br=!1;function xr(e,t){switch(e){case`compositionend`:return yr(t);case`keypress`:return t.which===32?(_r=!0,gr):null;case`textInput`:return e=t.data,e===gr&&_r?null:e;default:return null}}function Sr(e,t){if(br)return e===`compositionend`||!fr&&vr(e,t)?(e=Pn(),Nn=Mn=jn=null,br=!1,e):null;switch(e){case`paste`:return null;case`keypress`:if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case`compositionend`:return hr&&t.locale!==`ko`?null:t.data;default:return null}}var Cr={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function wr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!Cr[e.type]:t===`textarea`}function Tr(e,t,n,r){Sn?Cn?Cn.push(r):Cn=[r]:Sn=r,t=$f(t,`onChange`),0<t.length&&(n=new Bn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var Er=null,Dr=null;function Or(e){Kf(e,0)}function kr(e){if(tn(It(e)))return e}function Ar(e,t){if(e===`change`)return t}var jr=!1;if(On){var Mr;if(On){var Nr=`oninput`in document;if(!Nr){var Pr=document.createElement(`div`);Pr.setAttribute(`oninput`,`return;`),Nr=typeof Pr.oninput==`function`}Mr=Nr}else Mr=!1;jr=Mr&&(!document.documentMode||9<document.documentMode)}function Fr(){Er&&(Er.detachEvent(`onpropertychange`,Ir),Dr=Er=null)}function Ir(e){if(e.propertyName===`value`&&kr(Dr)){var t=[];Tr(t,Dr,e,xn(e)),En(Or,t)}}function Lr(e,t,n){e===`focusin`?(Fr(),Er=t,Dr=n,Er.attachEvent(`onpropertychange`,Ir)):e===`focusout`&&Fr()}function Rr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return kr(Dr)}function zr(e,t){if(e===`click`)return kr(t)}function Br(e,t){if(e===`input`||e===`change`)return kr(t)}function Vr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Hr=typeof Object.is==`function`?Object.is:Vr;function Ur(e,t){if(Hr(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!Le.call(t,i)||!Hr(e[i],t[i]))return!1}return!0}function Wr(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}function Gr(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Kr(e,t){var n=Gr(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Gr(n)}}function qr(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?qr(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Wr(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href==`string`}catch{n=!1}if(n)e=t.contentWindow;else break;t=Wr(e.document)}return t}function Yr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t===`input`&&(e.type===`text`||e.type===`search`||e.type===`tel`||e.type===`url`||e.type===`password`)||t===`textarea`||e.contentEditable===`true`)}var Xr=On&&`documentMode`in document&&11>=document.documentMode,Zr=null,Qr=null,$r=null,ei=!1;function ti(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;ei||Zr==null||Zr!==Wr(r)||(r=Zr,`selectionStart`in r&&Yr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),$r&&Ur($r,r)||($r=r,r=$f(Qr,`onSelect`),0<r.length&&(t=new Bn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Zr)))}function ni(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var ri={animationend:ni(`Animation`,`AnimationEnd`),animationiteration:ni(`Animation`,`AnimationIteration`),animationstart:ni(`Animation`,`AnimationStart`),transitionrun:ni(`Transition`,`TransitionRun`),transitionstart:ni(`Transition`,`TransitionStart`),transitioncancel:ni(`Transition`,`TransitionCancel`),transitionend:ni(`Transition`,`TransitionEnd`)},ii={},ai={};On&&(ai=document.createElement(`div`).style,`AnimationEvent`in window||(delete ri.animationend.animation,delete ri.animationiteration.animation,delete ri.animationstart.animation),`TransitionEvent`in window||delete ri.transitionend.transition);function oi(e){if(ii[e])return ii[e];if(!ri[e])return e;var t=ri[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ai)return ii[e]=t[n];return e}var si=oi(`animationend`),ci=oi(`animationiteration`),li=oi(`animationstart`),ui=oi(`transitionrun`),di=oi(`transitionstart`),fi=oi(`transitioncancel`),pi=oi(`transitionend`),mi=new Map,hi=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);hi.push(`scrollEnd`);function gi(e,t){mi.set(e,t),Ht(t,[e])}var _i=0;function vi(e,t){if(e.name!=null&&e.name!==`auto`)return e.name;if(t.autoName!==null)return t.autoName;e=Td.identifierPrefix;var n=_i++;return e=`_`+e+`t_`+n.toString(32)+`_`,t.autoName=e}function yi(e){if(e==null||typeof e==`string`)return e;var t=null,n=Nd;if(n!==null)for(var r=0;r<n.length;r++){var i=e[n[r]];if(i!=null){if(i===`none`)return`none`;t=t==null?i:t+(` `+i)}}return t??e.default}function bi(e,t){return e=yi(e),t=yi(t),t==null?e===`auto`?null:e:t===`auto`?null:t}var xi=typeof reportError==`function`?reportError:function(e){if(typeof window==`object`&&typeof window.ErrorEvent==`function`){var t=new window.ErrorEvent(`error`,{bubbles:!0,cancelable:!0,message:typeof e==`object`&&e&&typeof e.message==`string`?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process==`object`&&typeof process.emit==`function`){process.emit(`uncaughtException`,e);return}console.error(e)},Si=[],Ci=0,wi=0;function Ti(){for(var e=Ci,t=wi=Ci=0;t<e;){var n=Si[t];Si[t++]=null;var r=Si[t];Si[t++]=null;var i=Si[t];Si[t++]=null;var a=Si[t];if(Si[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&ki(n,i,a)}}function Ei(e,t,n,r){Si[Ci++]=e,Si[Ci++]=t,Si[Ci++]=n,Si[Ci++]=r,wi|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function Di(e,t,n,r){return Ei(e,t,n,r),Ai(e)}function Oi(e,t){return Ei(e,null,null,t),Ai(e)}function ki(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-et(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function Ai(e){if(50<Pd)throw Pd=0,Fd=null,Error(a(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ji={};function Mi(e,t,n,r){this.tag=e,this.key=n,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Ni(e,t,n,r){return new Mi(e,t,n,r)}function Pi(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Fi(e,t){var n=e.alternate;return n===null?(n=Ni(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Ii(e,t){e.flags&=1206910978;var n=e.alternate;return n===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Li(e,t,n,r,i,o){var s=0;if(r=e,typeof r==`function`)Pi(r)&&(s=1);else if(typeof r==`string`)s=$m(e,n,Se.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(r){case se:return e=Ni(31,n,t,i),e.elementType=se,e.lanes=o,e;case k:return Ri(n.children,i,o,t);case ee:s=8,i|=24;break;case A:return e=Ni(12,n,t,i|2),e.elementType=A,e.lanes=o,e;case re:return e=Ni(13,n,t,i),e.elementType=re,e.lanes=o,e;case ie:return e=Ni(19,n,t,i),e.elementType=ie,e.lanes=o,e;case ce:case ue:return e=i|32,e=Ni(30,n,t,e),e.elementType=ue,e.lanes=o,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof r==`object`&&r)switch(r.$$typeof){case ne:s=10;break a;case te:s=9;break a;case j:s=11;break a;case ae:s=14;break a;case oe:s=16,r=null;break a}s=29,n=Error(a(130,e===null?`null`:typeof e,``)),r=null}return t=Ni(s,n,t,i),t.elementType=e,t.type=r,t.lanes=o,t}function Ri(e,t,n,r){return e=Ni(7,e,r,t),e.lanes=n,e}function zi(e,t,n){return e=Ni(6,e,null,t),e.lanes=n,e}function Bi(e){var t=Ni(18,null,null,0);return t.stateNode=e,t}function Vi(e,t,n){return t=Ni(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Hi=new WeakMap;function Ui(e,t){if(typeof e==`object`&&e){var n=Hi.get(e);return n===void 0?(t={value:e,source:t,stack:Ie(t)},Hi.set(e,t),t):n}return{value:e,source:t,stack:Ie(t)}}var z=[],Wi=0,Gi=null,Ki=0,qi=[],Ji=0,Yi=null,Xi=1,Zi=``;function Qi(e,t){z[Wi++]=Ki,z[Wi++]=Gi,Gi=e,Ki=t}function $i(e,t,n){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Yi=e;var r=Xi;e=Zi;var i=32-et(r)-1;r&=~(1<<i),n+=1;var a=32-et(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Xi=1<<32-et(t)+i|n<<i|r,Zi=a+e}else Xi=1<<a|n<<i|r,Zi=e}function ea(e){e.return!==null&&(Qi(e,1),$i(e,1,0))}function ta(e){for(;e===Gi;)Gi=z[--Wi],z[Wi]=null,Ki=z[--Wi],z[Wi]=null;for(;e===Yi;)Yi=qi[--Ji],qi[Ji]=null,Zi=qi[--Ji],qi[Ji]=null,Xi=qi[--Ji],qi[Ji]=null}function na(e,t){qi[Ji++]=Xi,qi[Ji++]=Zi,qi[Ji++]=Yi,Xi=t.id,Zi=t.overflow,Yi=e}var ra=null,ia=null,B=!1,aa=null,oa=!1,sa=Error(a(519));function ca(e){throw ma(Ui(Error(a(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),sa}function la(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[wt]=e,t[Tt]=r,n){case`dialog`:q(`cancel`,t),q(`close`,t);break;case`iframe`:case`object`:case`embed`:q(`load`,t);break;case`video`:case`audio`:for(n=0;n<Wf.length;n++)q(Wf[n],t);break;case`source`:q(`error`,t);break;case`img`:case`image`:case`link`:q(`error`,t),q(`load`,t);break;case`details`:q(`toggle`,t);break;case`input`:q(`invalid`,t),on(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:q(`invalid`,t);break;case`textarea`:q(`invalid`,t),un(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||ap(t.textContent,n)?(r.popover!=null&&(q(`beforetoggle`,t),q(`toggle`,t)),r.onScroll!=null&&q(`scroll`,t),r.onScrollEnd!=null&&q(`scrollend`,t),r.onClick!=null&&(t.onclick=yn),t=!0):t=!1,t||ca(e,!0)}function ua(e){for(ra=e.return;ra;)switch(ra.tag){case 5:case 31:case 13:oa=!1;return;case 27:case 3:oa=!0;return;default:ra=ra.return}}function da(e){if(e!==ra)return!1;if(!B)return ua(e),B=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||yp(e.type,e.memoizedProps)),n=!n),n&&ia&&ca(e),ua(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ia=_m(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(317));ia=_m(e)}else t===27?(t=ia,Op(e.type)?(e=gm,gm=null,ia=e):ia=t):ia=ra?hm(e.stateNode.nextSibling):null;return!0}function fa(){ia=ra=null,B=!1}function pa(){var e=aa;return e!==null&&(_d===null?_d=e:_d.push.apply(_d,e),aa=null),e}function ma(e){aa===null?aa=[e]:aa.push(e)}var ha=be(null),ga=null,_a=null;function va(e,t,n){P(ha,t._currentValue),t._currentValue=n}function ya(e){e._currentValue=ha.current,xe(ha)}function ba(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function xa(e,t,n,r){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var o=i.dependencies;if(o!==null){var s=i.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=i;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),ba(o.return,n,e),r||(s=null);break a}o=c.next}}else if(i.tag===18){if(s=i.return,s===null)throw Error(a(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),ba(s,n,e),s=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,s=i.alternate,s!==null&&(s.lanes|=n),ba(i.return,n,e),s=i.child,s=s===null?null:s.sibling):s=i.child;if(s!==null)s.return=i;else for(s=i;s!==null;){if(s===e){s=null;break}if(i=s.sibling,i!==null){i.return=s.return,s=i;break}s=s.return}i=s}}function Sa(e,t,n,r){e=null;for(var i=t,o=!1;i!==null;){if(!o){if(i.flags&524288)o=!0;else if(i.flags&262144)break}if(i.tag===10){var s=i.alternate;if(s===null)throw Error(a(387));if(s=s.memoizedProps,s!==null){var c=i.type;Hr(i.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(i===Te.current){if(s=i.alternate,s===null)throw Error(a(387));s.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e===null?e=[ph]:e.push(ph))}i=i.return}return e!==null&&xa(t,e,n,r),t.flags|=262144,e!==null}function Ca(e){for(e=e.firstContext;e!==null;){if(!Hr(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function wa(e){ga=e,_a=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ta(e){return Da(ga,e)}function Ea(e,t){return ga===null&&wa(e),Da(e,t)}function Da(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},_a===null){if(e===null)throw Error(a(308));_a=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else _a=_a.next=t;return n}var Oa=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},ka=t.unstable_scheduleCallback,Aa=t.unstable_NormalPriority,ja={$$typeof:ne,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Ma(){return{controller:new Oa,data:new Map,refCount:0}}function Na(e){e.refCount--,e.refCount===0&&ka(Aa,function(){e.controller.abort()})}function Pa(e,t){if(e.pendingLanes&4194048){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var r=t[e];n.indexOf(r)===-1&&n.push(r)}}}var Fa=null;function Ia(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var La=null,Ra=0,za=0,Ba=null;function Va(e,t){if(La===null){var n=La=[];Ra=0,za=zf(),Ba={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return Ra++,t.then(Ha,Ha),t}function Ha(){if(--Ra===0&&(Fa=null,La!==null)){Ba!==null&&(Ba.status=`fulfilled`);var e=La;La=null,za=0,Ba=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Ua(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var Wa=M.S;M.S=function(e,t){if(bd=Ve(),typeof t==`object`&&t&&typeof t.then==`function`&&Va(e,t),Fa!==null)for(var n=Tf;n!==null;)Pa(n,Fa),n=n.next;if(n=e.types,n!==null){for(var r=Tf;r!==null;)Pa(r,n),r=r.next;if(za!==0){r=Fa,r===null&&(r=Fa=[]);for(var i=0;i<n.length;i++){var a=n[i];r.indexOf(a)===-1&&r.push(a)}}}Wa!==null&&Wa(e,t)};var Ga=be(null);function Ka(){var e=Ga.current;return e===null?id.pooledCache:e}function qa(e,t){t===null?P(Ga,Ga.current):P(Ga,t.pool)}function Ja(){var e=Ka();return e===null?null:{parent:ja._currentValue,pool:e}}var Ya=Error(a(460)),Xa=Error(a(474)),Za=Error(a(542)),Qa={then:function(){}};function $a(e){return e=e.status,e===`fulfilled`||e===`rejected`}function eo(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(yn,yn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e===void 0&&!(`reason`in t)?Error(a(600)):e;default:if(typeof t.status==`string`)t.then(yn,yn);else{if(e=id,e!==null&&100<e.shellSuspendCounter)throw Error(a(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,io(e),e}throw no=t,Ya}}function to(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(no=e,Ya):e}}var no=null;function ro(){if(no===null)throw Error(a(459));var e=no;return no=null,e}function io(e){if(e===Ya||e===Za)throw Error(a(483))}var ao=null,oo=0;function so(e){var t=oo;return oo+=1,ao===null&&(ao=[]),eo(ao,e,t)}function co(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function lo(e,t){throw t.$$typeof===E?Error(a(525)):(e=Object.prototype.toString.call(t),Error(a(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function uo(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function i(e,t){return e=Fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=134217730,n):(r=r.index,r<n?(t.flags|=2,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=134217730),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=zi(n,e.mode,r),t.return=e,t):(t=i(t,n),t.return=e,t)}function l(e,t,n,r){var a=n.type;return a===k?(e=d(e,t,n.props.children,r,n.key),co(e,n),e):t!==null&&(t.elementType===a||typeof a==`object`&&a&&a.$$typeof===oe&&to(a)===t.type)?(t=i(t,n.props),co(t,n),t.return=e,t):(t=Li(n.type,n.key,n.props,null,e.mode,r),co(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=Vi(n,e.mode,r),t.return=e,t):(t=i(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,a){return t===null||t.tag!==7?(t=Ri(n,e.mode,r,a),t.return=e,t):(t=i(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=zi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case D:return n=Li(t.type,t.key,t.props,null,e.mode,n),co(n,t),n.return=e,n;case O:return t=Vi(t,e.mode,n),t.return=e,t;case oe:return t=to(t),f(e,t,n)}if(ge(t)||pe(t))return t=Ri(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,so(t),n);if(t.$$typeof===ne)return f(e,Ea(e,t),n);lo(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case D:return n.key===i?l(e,t,n,r):null;case O:return n.key===i?u(e,t,n,r):null;case oe:return n=to(n),p(e,t,n,r)}if(ge(n)||pe(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,so(n),r);if(n.$$typeof===ne)return p(e,t,Ea(e,n),r);lo(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case D:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case O:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case oe:return r=to(r),m(e,t,n,r,i)}if(ge(r)||pe(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,so(r),i);if(r.$$typeof===ne)return m(e,t,n,Ea(t,r),i);lo(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),B&&Qi(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return B&&Qi(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&(_=g.alternate,_!==null&&d.delete(_.key===null?h:_.key)),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),B&&Qi(i,h),l}function g(i,s,c,l){if(c==null)throw Error(a(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(i,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(i,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(i,h),B&&Qi(i,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(i,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return B&&Qi(i,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,i,g,v.value,l),v!==null&&(e&&(_=v.alternate,_!==null&&h.delete(_.key===null?g:_.key)),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(i,e)}),B&&Qi(i,g),u}function _(e,r,o,c){if(typeof o==`object`&&o&&o.type===k&&o.key===null&&o.props.ref===void 0&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case D:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===k){if(r.tag===7){n(e,r.sibling),c=i(r,o.props.children),co(c,o),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===oe&&to(l)===r.type){n(e,r.sibling),c=i(r,o.props),co(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===k?(c=Ri(o.props.children,e.mode,c,o.key),co(c,o),c.return=e,e=c):(c=Li(o.type,o.key,o.props,null,e.mode,c),co(c,o),c.return=e,e=c)}return s(e);case O:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=i(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=Vi(o,e.mode,c),c.return=e,e=c}return s(e);case oe:return o=to(o),_(e,r,o,c)}if(ge(o))return h(e,r,o,c);if(pe(o)){if(l=pe(o),typeof l!=`function`)throw Error(a(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return _(e,r,so(o),c);if(o.$$typeof===ne)return _(e,r,Ea(e,o),c);lo(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=i(r,o),c.return=e,e=c):(n(e,r),c=zi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{oo=0;var i=_(e,t,n,r);return ao=null,i}catch(t){if(t===Ya||t===Za)throw t;var a=Ni(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var fo=uo(!0),po=uo(!1),mo=!1;function ho(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function go(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function _o(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function vo(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,H&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=Ai(e),ki(e,null,n),t}return Ei(e,r,t,n),Ai(e)}function yo(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}function bo(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var xo=!1;function So(){if(xo){var e=Ba;if(e!==null)throw e}}function Co(e,t,n,r){xo=!1;var i=e.updateQueue;mo=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(W&f)===f:(r&f)===f){f!==0&&f===za&&(xo=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,h=s;f=t;var g=n;switch(h.tag){case 1:if(m=h.payload,typeof m==`function`){d=m.call(g,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=h.payload,f=typeof m==`function`?m.call(g,d,f):m,f==null)break a;d=T({},d,f);break a;case 2:mo=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),dd|=o,e.lanes=o,e.memoizedState=d}}function wo(e,t){if(typeof e!=`function`)throw Error(a(191,e));e.call(t)}function To(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)wo(n[e],t)}var Eo=be(null),Do=be(0);function Oo(e,t){e=ld,P(Do,e),P(Eo,t),ld=e|t.baseLanes}function ko(){P(Do,ld),P(Eo,Eo.current)}function Ao(){ld=Do.current,xe(Eo),xe(Do)}var jo=be(null),Mo=null;function No(e){var t=e.alternate;P(Ro,Ro.current&1),P(jo,e),Mo===null&&(t===null||Eo.current!==null||t.memoizedState!==null)&&(Mo=e)}function Po(e){P(Ro,Ro.current),P(jo,e),Mo===null&&(Mo=e)}function Fo(e){e.tag===22?(P(Ro,Ro.current),P(jo,e),Mo===null&&(Mo=e)):Io()}function Io(){P(Ro,Ro.current),P(jo,jo.current)}function Lo(e){xe(jo),Mo===e&&(Mo=null),xe(Ro)}var Ro=be(0);function zo(e,t){P(jo,jo.current),P(Ro,t)}function Bo(e){xe(Ro),xe(jo),Mo===e&&(Mo=null)}function Vo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fm(n)||pm(n)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!==`independent`){if(t.flags&128)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Ho=0,V=null,Uo=null,Wo=null,Go=!1,Ko=!1,qo=!1,Jo=0,Yo=0,Xo=null,Zo=0;function Qo(){throw Error(a(321))}function $o(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Hr(e[n],t[n]))return!1;return!0}function es(e,t,n,r,i,a){return Ho=a,V=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,M.H=e===null||e.memoizedState===null?_c:vc,qo=!1,a=n(r,i),qo=!1,Ko&&(a=ns(t,n,r,i)),ts(e),a}function ts(e){M.H=gc;var t=Uo!==null&&Uo.next!==null;if(Ho=0,Wo=Uo=V=null,Go=!1,Yo=0,Xo=null,t)throw Error(a(300));e===null||Fc||(e=e.dependencies,e!==null&&Ca(e)&&(Fc=!0))}function ns(e,t,n,r){V=e;var i=0;do{if(Ko&&(Xo=null),Yo=0,Ko=!1,25<=i)throw Error(a(301));if(i+=1,Wo=Uo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}M.H=yc,o=t(n,r)}while(Ko);return o}function rs(){var e=M.H,t=e.useState()[0];return t=typeof t.then==`function`?us(t):t,e=e.useState()[0],(Uo===null?null:Uo.memoizedState)!==e&&(V.flags|=1024),t}function is(){var e=Jo!==0;return Jo=0,e}function as(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function os(e){if(Go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Go=!1}Ho=0,Wo=Uo=V=null,Ko=!1,Yo=Jo=0,Xo=null}function ss(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Wo===null?V.memoizedState=Wo=e:Wo=Wo.next=e,Wo}function cs(){if(Uo===null){var e=V.alternate;e=e===null?null:e.memoizedState}else e=Uo.next;var t=Wo===null?V.memoizedState:Wo.next;if(t!==null)Wo=t,Uo=e;else{if(e===null)throw V.alternate===null?Error(a(467)):Error(a(310));Uo=e,e={memoizedState:Uo.memoizedState,baseState:Uo.baseState,baseQueue:Uo.baseQueue,queue:Uo.queue,next:null},Wo===null?V.memoizedState=Wo=e:Wo=Wo.next=e}return Wo}function ls(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function us(e){var t=Yo;return Yo+=1,Xo===null&&(Xo=[]),e=eo(Xo,e,t),t=V,(Wo===null?t.memoizedState:Wo.next)===null&&(t=t.alternate,M.H=t===null||t.memoizedState===null?_c:vc),e}function ds(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return us(e);if(e.$$typeof===de)return;if(e.$$typeof===ne)return Ta(e)}throw Error(a(438,String(e)))}function fs(e){var t=null,n=V.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=V.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=ls(),V.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=le;return t.index++,n}function ps(e,t){return typeof t==`function`?t(e):t}function ms(e){return hs(cs(),Uo,e)}function hs(e,t,n){var r=e.queue;if(r===null)throw Error(a(311));r.lastRenderedReducer=n;var i=e.baseQueue,o=r.pending;if(o!==null){if(i!==null){var s=i.next;i.next=o.next,o.next=s}t.baseQueue=i=o,r.pending=null}if(o=e.baseState,i===null)e.memoizedState=o;else{t=i.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(Ho&f)===f:(W&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===za&&(d=!0);else if((Ho&p)===p){u=u.next,p===za&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,V.lanes|=p,dd|=p;f=u.action,qo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,V.lanes|=f,dd|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Hr(o,e.memoizedState)&&(Fc=!0,d&&(n=Ba,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return i===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function gs(e){var t=cs(),n=t.queue;if(n===null)throw Error(a(311));n.lastRenderedReducer=e;var r=n.dispatch,i=n.pending,o=t.memoizedState;if(i!==null){n.pending=null;var s=i=i.next;do o=e(o,s.action),s=s.next;while(s!==i);Hr(o,t.memoizedState)||(Fc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function _s(e,t,n){var r=V,i=cs(),o=B;if(o){if(n===void 0)throw Error(a(407));n=n()}else n=t();var s=!Hr((Uo||i).memoizedState,n);if(s&&(i.memoizedState=n,Fc=!0),i=i.queue,Hs(bs.bind(null,r,i,e),[e]),e=i.getSnapshot!==t||s||Wo!==null&&!!(Wo.memoizedState.tag&1),Ls(e?9:8,{destroy:void 0},ys.bind(null,r,i,n,t),null),e){if(r.flags|=2048,id===null)throw Error(a(349));o||Ho&127||vs(r,t,n)}return n}function vs(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=V.updateQueue,t===null?(t=ls(),V.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function ys(e,t,n,r){t.value=n,t.getSnapshot=r,xs(t)&&Ss(e)}function bs(e,t,n){return n(function(){xs(t)&&Ss(e)})}function xs(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Hr(e,n)}catch{return!0}}function Ss(e){var t=Oi(e,2);t!==null&&zd(t,e,2)}function Cs(e){var t=ss();if(typeof e==`function`){var n=e;if(e=n(),qo){$e(!0);try{n()}finally{$e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:e},t}function ws(e,t,n,r){return e.baseState=n,hs(e,Uo,typeof r==`function`?r:ps)}function Ts(e,t,n,r,i){if(pc(e))throw Error(a(485));if(e=t.action,e!==null){var o={payload:i,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};M.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Es(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Es(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=M.T,o={};o.types=a===null?null:a.types,M.T=o;try{var s=n(i,r),c=M.S;c!==null&&c(o,s),Ds(e,t,s)}catch(n){ks(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),M.T=a}}else try{a=n(i,r),Ds(e,t,a)}catch(n){ks(e,t,n)}}function Ds(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){Os(e,t,n)},function(n){return ks(e,t,n)}):Os(e,t,n)}function Os(e,t,n){t.status=`fulfilled`,t.value=n,As(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Es(e,n)))}function ks(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,As(t),t=t.next;while(t!==r)}e.action=null}function As(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function js(e,t){return t}function Ms(e,t){if(B){var n=id.formState;if(n!==null){a:{var r=V;if(B){if(ia){b:{for(var i=ia,a=oa;i.nodeType!==8;){if(!a){i=null;break b}if(i=hm(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){ia=hm(i.nextSibling),r=i.data===`F!`;break a}}ca(r)}r=!1}r&&(t=n[0])}}return n=ss(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:js,lastRenderedState:t},n.queue=r,n=uc.bind(null,V,r),r.dispatch=n,r=Cs(!1),a=fc.bind(null,V,!1,r.queue),r=ss(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Ts.bind(null,V,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function Ns(e){return Ps(cs(),Uo,e)}function Ps(e,t,n){if(t=hs(e,t,js)[0],e=ms(ps)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=us(t)}catch(e){throw e===Ya?Za:e}else r=t;t=cs();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(V.flags|=2048,Ls(9,{destroy:void 0},Fs.bind(null,i,n),null)),[r,a,e]}function Fs(e,t){e.action=t}function Is(e){var t=cs(),n=Uo;if(n!==null)return Ps(t,n,e);cs(),t=t.memoizedState,n=cs();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function Ls(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=V.updateQueue,t===null&&(t=ls(),V.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function Rs(){return cs().memoizedState}function zs(e,t,n,r){var i=ss();V.flags|=e,i.memoizedState=Ls(1|t,{destroy:void 0},n,r===void 0?null:r)}function Bs(e,t,n,r){var i=cs();r=r===void 0?null:r;var a=i.memoizedState.inst;Uo!==null&&r!==null&&$o(r,Uo.memoizedState.deps)?i.memoizedState=Ls(t,a,n,r):(V.flags|=e,i.memoizedState=Ls(1|t,a,n,r))}function Vs(e,t){zs(8390656,8,e,t)}function Hs(e,t){Bs(2048,8,e,t)}function Us(e){V.flags|=4;var t=V.updateQueue;if(t===null)t=ls(),V.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function Ws(e){var t=cs().memoizedState;return Us({ref:t,nextImpl:e}),function(){if(H&2)throw Error(a(440));return t.impl.apply(void 0,arguments)}}function Gs(e,t){return Bs(4,2,e,t)}function Ks(e,t){return Bs(4,4,e,t)}function qs(e,t){if(typeof t==`function`){e=e();var n=t(e);return function(){typeof n==`function`?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function Js(e,t,n){n=n==null?null:n.concat([e]),Bs(4,4,qs.bind(null,t,e),n)}function Ys(){}function Xs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&$o(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Zs(e,t){var n=cs();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&$o(t,r[1]))return r[0];if(r=e(),qo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r}function Qs(e,t,n){return n===void 0||Ho&1073741824&&!(W&261930)?e.memoizedState=t:(e.memoizedState=n,e=Ld(),V.lanes|=e,dd|=e,n)}function $s(e,t,n,r){return Hr(n,t)?n:Eo.current===null?!(Ho&106)||Ho&1073741824&&!(W&261930)?(Fc=!0,e.memoizedState=n):(e=Ld(),V.lanes|=e,dd|=e,t):(e=Qs(e,n,r),Hr(e,t)||(Fc=!0),e)}function ec(e,t,n,r,i){var a=N.p;N.p=a!==0&&8>a?a:8;var o=M.T,s={};s.types=o===null?null:o.types,M.T=s,fc(e,!1,t,n);try{var c=i(),l=M.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?dc(e,t,Ua(c,r),Id(e)):dc(e,t,r,Id(e))}catch(n){dc(e,t,{then:function(){},status:`rejected`,reason:n},Id())}finally{N.p=a,o!==null&&s.types!==null&&(o.types=s.types),M.T=o}}function tc(){}function nc(e,t,n,r){if(e.tag!==5)throw Error(a(476));var i=rc(e).queue;ec(e,i,t,_e,n===null?tc:function(){return ic(e),n(r)})}function rc(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:_e,baseState:_e,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:_e},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ps,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ic(e){var t=rc(e);t.next===null&&(t=e.alternate.memoizedState),dc(e,t.next.queue,{},Id())}function ac(){return Ta(ph)}function oc(){return cs().memoizedState}function sc(){return cs().memoizedState}function cc(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=Id();e=_o(n);var r=vo(t,e,n);r!==null&&(zd(r,t,n),yo(r,t,n)),t={cache:Ma()},e.payload=t;return}t=t.return}}function lc(e,t,n){var r=Id();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},pc(e)?mc(t,n):(n=Di(e,t,n,r),n!==null&&(zd(n,e,r),hc(n,t,r)))}function uc(e,t,n){dc(e,t,n,Id())}function dc(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(pc(e))mc(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Hr(s,o))return Ei(e,t,i,0),id===null&&Ti(),!1}catch{}if(n=Di(e,t,i,r),n!==null)return zd(n,e,r),hc(n,t,r),!0}return!1}function fc(e,t,n,r){if(r={lane:2,revertLane:zf(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},pc(e)){if(t)throw Error(a(479))}else t=Di(e,n,r,2),t!==null&&zd(t,e,2)}function pc(e){var t=e.alternate;return e===V||t!==null&&t===V}function mc(e,t){Ko=Go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function hc(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,_t(e,n)}}var gc={readContext:Ta,use:ds,useCallback:Qo,useContext:Qo,useEffect:Qo,useImperativeHandle:Qo,useLayoutEffect:Qo,useInsertionEffect:Qo,useMemo:Qo,useReducer:Qo,useRef:Qo,useState:Qo,useDebugValue:Qo,useDeferredValue:Qo,useTransition:Qo,useSyncExternalStore:Qo,useId:Qo,useHostTransitionStatus:Qo,useFormState:Qo,useActionState:Qo,useOptimistic:Qo,useMemoCache:Qo,useCacheRefresh:Qo,useEffectEvent:Qo},_c={readContext:Ta,use:ds,useCallback:function(e,t){return ss().memoizedState=[e,t===void 0?null:t],e},useContext:Ta,useEffect:Vs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),zs(4194308,4,qs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return zs(4194308,4,e,t)},useInsertionEffect:function(e,t){zs(4,2,e,t)},useMemo:function(e,t){var n=ss();t=t===void 0?null:t;var r=e();if(qo){$e(!0);try{e()}finally{$e(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=ss();if(n!==void 0){var i=n(t);if(qo){$e(!0);try{n(t)}finally{$e(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=lc.bind(null,V,e),[r.memoizedState,e]},useRef:function(e){var t=ss();return e={current:e},t.memoizedState=e},useState:function(e){e=Cs(e);var t=e.queue,n=uc.bind(null,V,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:Ys,useDeferredValue:function(e,t){return Qs(ss(),e,t)},useTransition:function(){var e=Cs(!1);return e=ec.bind(null,V,e.queue,!0,!1),ss().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=V,i=ss();if(B){if(n===void 0)throw Error(a(407));n=n()}else{if(n=t(),id===null)throw Error(a(349));W&127||vs(r,t,n)}i.memoizedState=n;var o={value:n,getSnapshot:t};return i.queue=o,Vs(bs.bind(null,r,o,e),[e]),r.flags|=2048,Ls(9,{destroy:void 0},ys.bind(null,r,o,n,t),null),n},useId:function(){var e=ss(),t=id.identifierPrefix;if(B){var n=Zi,r=Xi;n=(r&~(1<<32-et(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=Jo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=Zo++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:ac,useFormState:Ms,useActionState:Ms,useOptimistic:function(e){var t=ss();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=fc.bind(null,V,!0,n),n.dispatch=t,[e,t]},useMemoCache:fs,useCacheRefresh:function(){return ss().memoizedState=cc.bind(null,V)},useEffectEvent:function(e){var t=ss(),n={impl:e};return t.memoizedState=n,function(){if(H&2)throw Error(a(440));return n.impl.apply(void 0,arguments)}}},vc={readContext:Ta,use:ds,useCallback:Xs,useContext:Ta,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:ms,useRef:Rs,useState:function(){return ms(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){return $s(cs(),Uo.memoizedState,e,t)},useTransition:function(){var e=ms(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Ns,useActionState:Ns,useOptimistic:function(e,t){return ws(cs(),Uo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws},yc={readContext:Ta,use:ds,useCallback:Xs,useContext:Ta,useEffect:Hs,useImperativeHandle:Js,useInsertionEffect:Gs,useLayoutEffect:Ks,useMemo:Zs,useReducer:gs,useRef:Rs,useState:function(){return gs(ps)},useDebugValue:Ys,useDeferredValue:function(e,t){var n=cs();return Uo===null?Qs(n,e,t):$s(n,Uo.memoizedState,e,t)},useTransition:function(){var e=gs(ps)[0],t=cs().memoizedState;return[typeof e==`boolean`?e:us(e),t]},useSyncExternalStore:_s,useId:oc,useHostTransitionStatus:ac,useFormState:Is,useActionState:Is,useOptimistic:function(e,t){var n=cs();return Uo===null?(n.baseState=e,[e,n.queue.dispatch]):ws(n,Uo,e,t)},useMemoCache:fs,useCacheRefresh:sc,useEffectEvent:Ws};function bc(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:T({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var xc={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=Id(),i=_o(r);i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(zd(t,e,r),yo(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=Id(),i=_o(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=vo(e,i,r),t!==null&&(zd(t,e,r),yo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=Id(),r=_o(n);r.tag=2,t!=null&&(r.callback=t),t=vo(e,r,n),t!==null&&(zd(t,e,n),yo(t,e,n))}};function Sc(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Ur(n,r)||!Ur(i,a):!0}function Cc(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&xc.enqueueReplaceState(t,t.state,null)}function wc(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=T({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Tc(e){xi(e)}function Ec(e){console.error(e)}function Dc(e){xi(e)}function Oc(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function kc(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function Ac(e,t,n){return n=_o(n),n.tag=3,n.payload={element:null},n.callback=function(){Oc(e,t)},n}function jc(e){return e=_o(e),e.tag=3,e}function Mc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){kc(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){kc(t,n,r),typeof i!=`function`&&(Cd===null?Cd=new Set([this]):Cd.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function Nc(e,t,n,r,i){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Sa(t,n,i,!0),n=jo.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Mo===null?Xd():n.alternate===null&&ud===0&&(ud=3),n.flags&=-257,n.flags|=65536,n.lanes=i,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),yf(e,r,i)),!1;case 22:return n.flags|=65536,r===Qa?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),yf(e,r,i)),!1}throw Error(a(435,n.tag))}return yf(e,r,i),Xd(),!1}if(B)return t=jo.current,t===null?(r!==sa&&(t=Error(a(423),{cause:r}),ma(Ui(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,r=Ui(r,n),i=Ac(e.stateNode,r,i),bo(e,i),ud!==4&&(ud=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=i,r!==sa&&(e=Error(a(422),{cause:r}),ma(Ui(e,n)))),!1;var o=Error(a(520),{cause:r});if(o=Ui(o,n),gd===null?gd=[o]:gd.push(o),ud!==4&&(ud=2),t===null)return!0;r=Ui(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=Ac(n.stateNode,r,e),bo(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(Cd===null||!Cd.has(o))))return n.flags|=65536,i&=-i,n.lanes|=i,i=jc(i),Mc(i,e,n,r),bo(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var Pc=Error(a(461)),Fc=!1;function Ic(e,t,n,r){t.child=e===null?po(t,null,n,r):fo(t,e.child,n,r)}function Lc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return wa(t),r=es(e,t,n,o,a,i),s=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(B&&s&&ea(t),t.flags|=1,Ic(e,t,r,i),t.child)}function Rc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!Pi(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,zc(e,t,a,r,i)):(e=Li(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!fl(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Ur:n,n(o,r)&&e.ref===t.ref)return dl(e,t,i)}return t.flags|=1,e=Fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function zc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Ur(a,r)&&e.ref===t.ref){if(Fc=!1,t.pendingProps=r=a,fl(e,i))e.flags&131072&&(Fc=!0);else return t.lanes=e.lanes,dl(e,t,i)}}return qc(e,t,n,r,i)}function Bc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return Hc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&qa(t,a===null?null:a.cachePool),a===null?ko():Oo(t,a),Fo(t);else return r=t.lanes=536870912,Hc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&qa(t,null),ko(),Io()):(qa(t,a.cachePool),Oo(t,a),Io(),t.memoizedState=null);return Ic(e,t,i,n),t.child}function Vc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Hc(e,t,n,r,i){var a=Ka();return a=a===null?null:{parent:ja._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&qa(t,null),ko(),Fo(t),e!==null&&Sa(e,t,r,!0),t.childLanes=i,null}function Uc(e,t){return t=nl({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Wc(e,t,n){return fo(t,e.child,null,n),e=Uc(t,t.pendingProps),e.flags|=2,Lo(t),t.memoizedState=null,e}function Gc(e,t,n){var r=t.pendingProps,i=!!(t.flags&128);if(t.flags&=-129,e===null){if(B){if(r.mode===`hidden`)return e=Uc(t,r),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Vc(null,e);if(Po(t),(e=ia)?(e=dm(e,oa),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw ca(t);return t.lanes=536870912,null}return Uc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(Po(t),i){if(t.flags&256)t.flags&=-257,t=Wc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(a(558))}else if(Fc||Sa(e,t,n,!1),i=(n&e.childLanes)!==0,Fc||i){if(Eo.current===null){if(r=id,r!==null&&(s=vt(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,Oi(e,s),zd(r,e,s),Pc;Xd()}t=Wc(e,t,n)}else e=o.treeContext,ia=hm(s.nextSibling),ra=t,B=!0,aa=null,oa=!1,e!==null&&na(t,e),t=Uc(t,r),t.flags|=134221824;return t}return e=Fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Kc(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!=`function`&&typeof n!=`object`)throw Error(a(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function qc(e,t,n,r,i){return wa(t),n=es(e,t,n,r,void 0,i),r=is(),e!==null&&!Fc?(as(e,t,i),dl(e,t,i)):(B&&r&&ea(t),t.flags|=1,Ic(e,t,n,i),t.child)}function Jc(e,t,n,r,i,a){return wa(t),t.updateQueue=null,n=ns(t,r,n,i),ts(e),r=is(),e!==null&&!Fc?(as(e,t,a),dl(e,t,a)):(B&&r&&ea(t),t.flags|=1,Ic(e,t,n,a),t.child)}function Yc(e,t,n,r,i){if(wa(t),t.stateNode===null){var a=ji,o=n.contextType;typeof o==`object`&&o&&(a=Ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=xc,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},ho(t),o=n.contextType,a.context=typeof o==`object`&&o?Ta(o):ji,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(bc(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&xc.enqueueReplaceState(a,a.state,null),Co(t,r,a,i),So(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=wc(n,s);a.props=c;var l=a.context,u=n.contextType;o=ji,typeof u==`object`&&u&&(o=Ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Cc(t,a,r,o),mo=!1;var f=t.memoizedState;a.state=f,Co(t,r,a,i),So(),l=t.memoizedState,s||f!==l||mo?(typeof d==`function`&&(bc(t,n,d,r),l=t.memoizedState),(c=mo||Sc(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,go(e,t),o=t.memoizedProps,u=wc(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ji,typeof l==`object`&&l&&(c=Ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Cc(t,a,r,c),mo=!1,f=t.memoizedState,a.state=f,Co(t,r,a,i),So();var p=t.memoizedState;o!==d||f!==p||mo||e!==null&&e.dependencies!==null&&Ca(e.dependencies)?(typeof s==`function`&&(bc(t,n,s,r),p=t.memoizedState),(u=mo||Sc(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&Ca(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,Kc(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=fo(t,e.child,null,i),t.child=fo(t,null,n,i)):Ic(e,t,n,i),t.memoizedState=a.state,e=t.child):e=dl(e,t,i),e}function Xc(e,t,n,r){return fa(),t.flags|=256,Ic(e,t,n,r),t.child}var Zc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Qc(e){return{baseLanes:e,cachePool:Ja()}}function $c(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=md),e}function el(e,t,n){var r=t.pendingProps,i=!1,a=!!(t.flags&128),o;if((o=a)||(o=e!==null&&e.memoizedState===null?!1:!!(Ro.current&2)),o&&(i=!0,t.flags&=-129),o=!!(t.flags&32),t.flags&=-33,e===null){if(B){if(i?No(t):Io(),(e=ia)?(e=dm(e,oa),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Yi===null?null:{id:Xi,overflow:Zi},retryLane:536870912,hydrationErrors:null},n=Bi(e),n.return=t,t.child=n,ra=t,ia=null)):e=null,e===null)throw ca(t);return t.lanes=pm(e)?32:536870912,null}return a=r.children,r=r.fallback,i?(Io(),i=t.mode,a=nl({mode:`hidden`,children:a},i),r=Ri(r,i,n,null),a.return=t,r.return=t,a.sibling=r,t.child=a,r=t.child,r.memoizedState=Qc(n),r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(null,r)):(No(t),tl(t,a))}var s=e.memoizedState;if(s!==null){var c=s.dehydrated;if(c!==null)return il(e,t,a,o,r,c,s,n)}return i?(Io(),i=r.fallback,a=t.mode,s=e.child,c=s.sibling,r=Fi(s,{mode:`hidden`,children:r.children}),r.subtreeFlags=s.subtreeFlags&1206910976,c===null?(i=Ri(i,a,n,null),i.flags|=2):i=Fi(c,i),i.return=t,r.return=t,r.sibling=i,t.child=r,Vc(null,r),r=t.child,i=e.child.memoizedState,i===null?i=Qc(n):(a=i.cachePool,a===null?a=Ja():(s=ja._currentValue,a=a.parent===s?a:{parent:s,pool:s}),i={baseLanes:i.baseLanes|n,cachePool:a}),r.memoizedState=i,r.childLanes=$c(e,o,n),t.memoizedState=Zc,Vc(e.child,r)):(No(t),n=e.child,e=n.sibling,n=Fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(o=t.deletions,o===null?(t.deletions=[e],t.flags|=16):o.push(e)),t.child=n,t.memoizedState=null,n)}function tl(e,t){return t=nl({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function nl(e,t){return e=Ni(22,e,null,t),e.lanes=0,e}function rl(e,t,n){return fo(t,e.child,null,n),e=tl(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function il(e,t,n,r,i,o,s,c){if(n)return t.flags&256?(No(t),t.flags&=-257,rl(e,t,c)):t.memoizedState===null?(Io(),o=i.fallback,s=t.mode,i=nl({mode:`visible`,children:i.children},s),o=Ri(o,s,c,null),o.flags|=2,i.return=t,o.return=t,i.sibling=o,t.child=i,fo(t,e.child,null,c),i=t.child,i.memoizedState=Qc(c),i.childLanes=$c(e,r,c),t.memoizedState=Zc,Vc(null,i)):(Io(),t.child=e.child,t.flags|=128,null);if(No(t),pm(o)){if(r=o.nextSibling&&o.nextSibling.dataset,r)var l=r.dgst;return r=l,r!==``&&(i=Error(a(419)),i.stack=``,i.digest=r,ma({value:i,source:null,stack:null})),rl(e,t,c)}if(Fc||Sa(e,t,c,!1),r=(c&e.childLanes)!==0,Fc||r){if(Eo.current!==null)return rl(e,t,c);if(r=id,r!==null&&(i=vt(r,c),i!==0&&i!==s.retryLane))throw s.retryLane=i,Oi(e,i),zd(r,e,i),Pc;return fm(o)||Xd(),rl(e,t,c)}return fm(o)?(t.flags|=192,t.child=e.child,null):(e=s.treeContext,ia=hm(o.nextSibling),ra=t,B=!0,aa=null,oa=!1,e!==null&&na(t,e),t=tl(t,i.children),t.flags|=134221824,t)}function al(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),ba(e.return,t,n)}function ol(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Vo(n)===null&&(t=e),e=e.sibling}return t}function sl(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function cl(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function ll(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=Ro.current;if(t.flags&128)return zo(t,o),null;var s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,zo(t,o),i===`backwards`&&e!==null?(cl(e),Ic(e,t,r,n),cl(e)):Ic(e,t,r,n),r=B?Ki:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&al(e,n,t);else if(e.tag===19)al(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`backwards`:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,cl(t)),sl(t,!0,i,null,a,r);break;case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Vo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}sl(t,!0,n,null,a,r);break;case`together`:sl(t,!1,null,null,void 0,r);break;case`independent`:t.memoizedState=null;break;default:n=ol(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),sl(t,!1,i,n,a,r)}return t.child}function ul(e,t,n){var r=t.pendingProps;return va(t,t.type,r.value),Ic(e,t,r.children,n),t.child}function dl(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),dd|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Sa(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(a(153));if(t.child!==null){for(e=t.child,n=Fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=Fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function fl(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&Ca(e)))}function pl(e,t,n){switch(t.tag){case 3:Ee(t,t.stateNode.containerInfo),va(t,ja,e.memoizedState.cache),fa();break;case 27:case 5:Oe(t);break;case 4:Ee(t,t.stateNode.containerInfo);break;case 10:va(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Po(t),null;break;case 13:var r=t.memoizedState;if(r!==null){if(r.dehydrated!==null)return No(t),t.flags|=128,null;r=Sa(e,t,n,!1);var i=t.child.childLanes;return r||(n&i)!==0?el(e,t,n):(No(t),e=dl(e,t,n),e===null?null:e.sibling)}No(t);break;case 19:if(t.flags&128)return ll(e,t,n);if(i=!!(e.flags&128),r=(n&t.childLanes)!==0,r||=(Sa(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return ll(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),zo(t,Ro.current),r)break;return null;case 22:return t.lanes=0,Bc(e,t,n,t.pendingProps);case 24:va(t,ja,e.memoizedState.cache)}return dl(e,t,n)}function ml(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)Fc=!0;else{if(!fl(e,n)&&!(t.flags&128))return Fc=!1,pl(e,t,n);Fc=!!(e.flags&131072)}}else Fc=!1,B&&t.flags&1048576&&$i(t,Ki,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=to(t.elementType),t.type=e,typeof e==`function`)Pi(e)?(r=wc(e,r),t.tag=1,t=Yc(null,t,e,r,n)):(t.tag=0,t=qc(null,t,e,r,n));else{if(e!=null){var i=e.$$typeof;if(i===j){t.tag=11,t=Lc(null,t,e,r,n);break a}if(i===ae){t.tag=14,t=Rc(null,t,e,r,n);break a}if(i===ne){t.tag=10,t.type=e,t=ul(null,t,n);break a}}throw t=he(e)||e,Error(a(306,t,``))}}return t;case 0:return qc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,i=wc(r,t.pendingProps),Yc(e,t,r,i,n);case 3:a:{if(Ee(t,t.stateNode.containerInfo),e===null)throw Error(a(387));r=t.pendingProps;var o=t.memoizedState;i=o.element,go(e,t),Co(t,r,null,n);var s=t.memoizedState;if(r=s.cache,va(t,ja,r),r!==o.cache&&xa(t,[ja],n,!0),So(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=Xc(e,t,r,n);break a}if(r!==i){i=Ui(Error(a(424)),t),ma(i),t=Xc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(ia=hm(e.firstChild),ra=t,B=!0,aa=null,oa=!0,n=po(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(fa(),r===i){t=dl(e,t,n);break a}Ic(e,t,r,n)}t=t.child}return t;case 26:return Kc(e,t),e===null?(n=zm(t.type,null,t.pendingProps,null))?t.memoizedState=n:B||(t.stateNode=vp(t.type,t.pendingProps,we.current,t)):t.memoizedState=zm(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Oe(t),e===null&&B&&(r=t.stateNode=xm(t.type,t.pendingProps,we.current),ra=t,oa=!0,i=ia,Op(t.type)?(gm=i,ia=hm(r.firstChild)):ia=i),Ic(e,t,t.pendingProps.children,n),Kc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&B&&((i=r=ia)&&(r=lm(r,t.type,t.pendingProps,oa),r===null?i=!1:(t.stateNode=r,ra=t,ia=hm(r.firstChild),oa=!1,i=!0)),i||ca(t)),Oe(t),i=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,yp(i,o)?r=null:s!==null&&yp(i,s)&&(t.flags|=32),t.memoizedState!==null&&(i=es(e,t,rs,null,null,n),ph._currentValue=i),Kc(e,t),Ic(e,t,r,n),t.child;case 6:return e===null&&B&&((e=n=ia)&&(n=um(n,t.pendingProps,oa),n===null?e=!1:(t.stateNode=n,ra=t,ia=null,e=!0)),e||ca(t)),null;case 13:return el(e,t,n);case 4:return Ee(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=fo(t,null,r,n):Ic(e,t,r,n),t.child;case 11:return Lc(e,t,t.type,t.pendingProps,n);case 7:return r=t.pendingProps,Kc(e,t),Ic(e,t,r,n),t.child;case 8:return Ic(e,t,t.pendingProps.children,n),t.child;case 12:return Ic(e,t,t.pendingProps.children,n),t.child;case 10:return ul(e,t,n);case 9:return i=t.type._context,r=t.pendingProps.children,wa(t),i=Ta(i),r=r(i),t.flags|=1,Ic(e,t,r,n),t.child;case 14:return Rc(e,t,t.type,t.pendingProps,n);case 15:return zc(e,t,t.type,t.pendingProps,n);case 19:return ll(e,t,n);case 31:return Gc(e,t,n);case 22:return Bc(e,t,n,t.pendingProps);case 24:return wa(t),r=Ta(ja),e===null?(i=Ka(),i===null&&(i=id,o=Ma(),i.pooledCache=o,o.refCount++,o!==null&&(i.pooledCacheLanes|=n),i=o),t.memoizedState={parent:r,cache:i},ho(t),va(t,ja,i)):((e.lanes&n)!==0&&(go(e,t),Co(t,null,null,n),So()),i=e.memoizedState,o=t.memoizedState,i.parent===r?(r=o.cache,va(t,ja,r),r!==i.cache&&xa(t,[ja],n,!0)):(i={parent:r,cache:r},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),va(t,ja,r))),Ic(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),r=t.pendingProps,r.name!=null&&r.name!==`auto`?t.flags|=e===null?18882560:18874368:B&&ea(t),e!==null&&e.memoizedProps.name!==r.name?t.flags|=4194816:Kc(e,t),Ic(e,t,r.children,n),t.child;case 29:throw t.pendingProps}throw Error(a(156,t.tag))}function hl(e){e.flags|=4}function gl(e,t,n,r,i){var a;if((a=!!(e.mode&32))&&(a=n===null?eh(t,r):eh(t,r)&&(r.src!==n.src||r.srcSet!==n.srcSet)),a){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(qd())e.flags|=8192;else throw no=Qa,Xa}}else e.flags&=-16777217}function _l(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!th(t)){if(qd())e.flags|=8192;else throw no=Qa,Xa}}function vl(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:ft(),e.lanes|=t,hd|=t)}function yl(e,t){if(!B)switch(e.tailMode){case`visible`:break;case`collapsed`:for(var n=e.tail,r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function bl(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&1206910976,r|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function xl(e,t,n){var r=t.pendingProps;switch(ta(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return bl(t),null;case 1:return bl(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),ya(ja),De(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(da(t)?hl(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,pa())),bl(t),null;case 26:var i=t.type,o=t.memoizedState;return e===null?(hl(t),o===null?(bl(t),gl(t,i,null,r,n)):(bl(t),_l(t,o))):o?o===e.memoizedState?(bl(t),t.flags&=-16777217):(hl(t),bl(t),_l(t,o)):(e=e.memoizedProps,e!==r&&hl(t),bl(t),gl(t,i,e,r,n)),null;case 27:if(ke(t),n=we.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return bl(t),t.subtreeFlags&=-33554433,null}e=Se.current,da(t)?la(t,e):(e=xm(i,r,n),t.stateNode=e,hl(t))}return bl(t),t.subtreeFlags&=-33554433,null;case 5:if(ke(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(!r){if(t.stateNode===null)throw Error(a(166));return bl(t),t.subtreeFlags&=-33554433,null}if(o=Se.current,da(t))la(t,o);else{var s=hp(we.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;default:switch(i){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,i);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,i);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(i,{is:r.is}):s.createElement(i)}}o[wt]=t,o[Tt]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(cp(o,i,r),i){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&hl(t)}}return bl(t),t.subtreeFlags&=-33554433,gl(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&hl(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(a(166));if(e=we.current,da(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,i=ra,i!==null)switch(i.tag){case 27:case 5:r=i.memoizedProps}e[wt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||ap(e.nodeValue,n)),e||ca(t,!0)}else e=hp(e).createTextNode(r),e[wt]=t,t.stateNode=e}return bl(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=da(t),n!==null){if(e===null){if(!r)throw Error(a(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(a(557));e[wt]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),e=!1}else n=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(Lo(t),t):(Lo(t),null);if(t.flags&128)throw Error(a(558))}return bl(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=da(t),r!==null&&r.dehydrated!==null){if(e===null){if(!i)throw Error(a(318));if(i=t.memoizedState,i=i===null?null:i.dehydrated,!i)throw Error(a(317));i[wt]=t}else fa(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;bl(t),i=!1}else i=pa(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Lo(t),t):(Lo(t),null)}return Lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,i=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(i=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==i&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),vl(t,t.updateQueue),bl(t),null);case 4:return De(),e===null&&Yf(t.stateNode.containerInfo),t.flags|=67108864,bl(t),null;case 10:return ya(t.type),bl(t),null;case 19:if(Bo(t),r=t.memoizedState,r===null)return bl(t),null;if(i=!!(t.flags&128),o=r.rendering,o===null){if(i)yl(r,!1);else{if(ud!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=Vo(e),o!==null){for(t.flags|=128,yl(r,!1),e=o.updateQueue,t.updateQueue=e,vl(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Ii(n,e),n=n.sibling;return zo(t,Ro.current&1|2),B&&Qi(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Ve()>xd&&(t.flags|=128,i=!0,yl(r,!1),t.lanes=4194304)}}else{if(!i){if(e=Vo(o),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,vl(t,e),yl(r,!0),r.tail===null&&r.tailMode!==`collapsed`&&r.tailMode!==`visible`&&!o.alternate&&!B)return bl(t),null}else 2*Ve()-r.renderingStartTime>xd&&n!==536870912&&(t.flags|=128,i=!0,yl(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}if(r.tail!==null){e=r.tail;a:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break a}n=n.sibling}n=!0}return r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Ve(),e.sibling=null,o=Ro.current,o=i?o&1|2:o&1,r.tailMode===`visible`||r.tailMode===`collapsed`||!n||B?zo(t,o):(n=o,P(jo,t),P(Ro,n),Mo===null&&(Mo=t)),B&&Qi(t,r.treeForkCount),e}return bl(t),null;case 22:case 23:return Lo(t),Ao(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(bl(t),t.subtreeFlags&6&&(t.flags|=8192)):bl(t),n=t.updateQueue,n!==null&&vl(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&xe(Ga),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ya(ja),bl(t),null;case 25:return null;case 30:return t.flags|=33554432,bl(t),null}throw Error(a(156,t.tag))}function Sl(e,t){switch(ta(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ya(ja),De(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ke(t),null;case 31:if(t.memoizedState!==null){if(Lo(t),t.alternate===null)throw Error(a(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(a(340));fa()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Bo(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return De(),null;case 10:return ya(t.type),null;case 22:case 23:return Lo(t),Ao(),e!==null&&xe(Ga),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ya(ja),null;case 25:return null;default:return null}}function Cl(e,t){switch(ta(t),t.tag){case 3:ya(ja),De();break;case 26:case 27:case 5:ke(t);break;case 4:De();break;case 31:t.memoizedState!==null&&Lo(t);break;case 13:Lo(t);break;case 19:Bo(t);break;case 10:ya(t.type);break;case 22:case 23:Lo(t),Ao(),e!==null&&xe(Ga);break;case 24:ya(ja)}}function wl(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){vf(t,t.return,e)}}function Tl(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){vf(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){vf(t,t.return,e)}}function El(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{To(t,n)}catch(t){vf(e,e.return,t)}}}function Dl(e,t,n){n.props=wc(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){vf(e,t,n)}}function Ol(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:var i=e.stateNode,a=vi(e.memoizedProps,i);(i.ref===null||i.ref.name!==a)&&(i.ref=Bp(a)),r=i.ref;break;case 7:if(e.stateNode===null){var o=new Vp(e);p(e.child,!1,im,o,void 0,void 0),e.stateNode=o}r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){vf(e,t,n)}}function kl(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){vf(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){vf(e,t,n)}else n.current=null}}function Al(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)om(e.stateNode,t[n])}function jl(e){for(var t=e.return;t!==null&&(Pl(t)&&om(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Ml(e){for(var t=e.return;t!==null&&(Pl(t)&&sm(e.stateNode,t.stateNode),!Nl(t));)t=t.return}function Nl(e){return e.tag===5||e.tag===3||e.tag===27}function Pl(e){return e&&e.tag===7&&e.stateNode!==null}function Fl(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){vf(e,e.return,t)}}function Il(e,t,n){try{var r=e.stateNode;up(r,e.type,n,t),r[Tt]=t}catch(t){vf(e,e.return,t)}}function Ll(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Op(e.type)||e.tag===4}function Rl(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||Ll(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Op(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function zl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=yn)),Al(e,r),R=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Op(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(zl(e,t,n,r),e=e.sibling;e!==null;)zl(e,t,n,r),e=e.sibling}function Bl(e,t,n,r){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Al(e,r),R=!0;else if(i!==4&&(i===27&&(Al(e,r),r=null,Op(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Bl(e,t,n,r),e=e.sibling;e!==null;)Bl(e,t,n,r),e=e.sibling}function Vl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);cp(t,r,n),t[wt]=e,t[Tt]=n}catch(t){vf(e,e.return,t)}}var Hl=!1,Ul=null;function Wl(e){(e.tag===30||e.subtreeFlags&33554432)&&(Hl=!0)}var Gl=null;function Kl(){var e=Gl;return Gl=null,e}var ql=0;function Jl(e,t,n,r,i){return ql=0,Yl(e.child,t,n,r,i)}function Yl(e,t,n,r,i){for(var a=!1;e!==null;){if(e.tag===5){var o=e.stateNode;if(r!==null){var s=Pp(o);r.push(s),s.view&&(a=!0)}else a||Pp(o).view&&(a=!0);Hl=!0,jp(o,ql===0?t:t+`_`+ql,n),ql++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||Yl(e.child,t,n,r,i)&&(a=!0));e=e.sibling}return a}function Xl(e,t){for(;e!==null;)e.tag===5?Mp(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Xl(e.child,t)),e=e.sibling}function Zl(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Zl(e),e.tag===30&&e.flags&18874368&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name===`auto`)throw Error(a(544));var n=t.name;t=bi(t.default,t.share),t!==`none`&&(Jl(e,n,t,null,!1)||Xl(e.child,!1))}e=e.sibling}}function Ql(e,t){if(e.tag===30){var n=e.stateNode,r=e.memoizedProps,i=vi(r,n),a=bi(r.default,n.paired?r.share:r.enter);a===`none`?Zl(e):Jl(e,i,a,null,!1)?(Zl(e),n.paired||t||Rd(e,r.onEnter)):Xl(e.child,!1)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)Ql(e,t),e=e.sibling;else Zl(e)}function $l(e){if(Ul!==null&&Ul.size!==0){var t=Ul;if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var n=e.memoizedProps,r=n.name;if(r!=null&&r!==`auto`){var i=t.get(r);if(i!==void 0){var a=bi(n.default,n.share);if(a!==`none`&&(Jl(e,r,a,null,!1)?(a=e.stateNode,i.paired=a,a.paired=i,Rd(e,n.onShare)):Xl(e.child,!1)),t.delete(r),t.size===0)break}}}$l(e)}e=e.sibling}}}function eu(e){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode),r=Ul===null?void 0:Ul.get(n),i=bi(t.default,r===void 0?t.exit:t.share);i!==`none`&&(Jl(e,n,i,null,!1)?r===void 0?Rd(e,t.onExit):(i=e.stateNode,r.paired=i,i.paired=r,Ul.delete(n),Rd(e,t.onShare)):Xl(e.child,!1)),Ul!==null&&$l(e)}else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)eu(e),e=e.sibling;else Ul!==null&&$l(e)}function tu(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=vi(t,e.stateNode);t=bi(t.default,t.update),e.flags&=-5,t!==`none`&&Jl(e,n,t,e.memoizedState=[],!1)}else e.subtreeFlags&33554432&&tu(e);e=e.sibling}}function nu(e){if(e.subtreeFlags&18874368)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&e.flags&18874368){var t=e.stateNode;t.paired!==null&&(t.paired=null,Xl(e.child,!1))}nu(e)}e=e.sibling}}function ru(e){if(e.tag===30)e.stateNode.paired=null,Xl(e.child,!1),nu(e);else if(e.subtreeFlags&33554432)for(e=e.child;e!==null;)ru(e),e=e.sibling;else nu(e)}function iu(e){for(e=e.child;e!==null;)e.tag===30?Xl(e.child,!1):e.subtreeFlags&33554432&&iu(e),e=e.sibling}function au(e,t,n,r,i,a,o){for(var s=!1;t!==null;){if(t.tag===5){var c=t.stateNode;if(a!==null&&ql<a.length){var l=a[ql],u=Pp(c);(l.view||u.view)&&(s=!0);var d;if(d=!(e.flags&4)){if(u.clip)d=!0;else{d=l.rect;var f=u.rect;d=d.y!==f.y||d.x!==f.x||d.height!==f.height||d.width!==f.width}}d&&(e.flags|=4),u.abs?u=!l.abs:(l=l.rect,u=u.rect,u=l.height!==u.height||l.width!==u.width),u&&(e.flags|=32)}else e.flags|=32;e.flags&4&&jp(c,ql===0?n:n+`_`+ql,i),s&&e.flags&4||(Gl===null&&(Gl=[]),Gl.push(c,ql===0?r:r+`_`+ql,t.memoizedProps)),ql++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&o?e.flags|=t.flags&32:au(e,t.child,n,r,i,a,o)&&(s=!0));t=t.sibling}return s}function ou(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,r=e.stateNode,i=vi(n,r),a=bi(n.default,n.update);if(t){r=r.clones;var o=r===null?null:r.map(Fp)}else o=e.memoizedState,e.memoizedState=null;r=e;var s=e.child;ql=0,i=au(r,s,i,i,a,o,!1),e.flags&4&&i&&(t||Rd(e,n.onUpdate))}else e.subtreeFlags&33554432&&ou(e,t);e=e.sibling}}var su=!1,cu=!1,lu=!1,uu=!1,du=typeof WeakSet==`function`?WeakSet:Set,fu=null,pu=!1,mu=!1,hu=!1,gu=!1;function _u(e,t,n){if(e=e.containerInfo,pp=Sh,e=Jr(e),Yr(e)){if(`selectionStart`in e)var r={start:e.selectionStart,end:e.selectionEnd};else a:{r=(r=e.ownerDocument)&&r.defaultView||window;var i=r.getSelection&&r.getSelection();if(i&&i.rangeCount!==0){r=i.anchorNode;var a=i.anchorOffset,o=i.focusNode;i=i.focusOffset;try{r.nodeType,o.nodeType}catch{r=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==r||a!==0&&f.nodeType!==3||(c=s+a),f!==o||i!==0&&f.nodeType!==3||(l=s+i),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===r&&++u===a&&(c=s),p===o&&++d===i&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}r=c===-1||l===-1?null:{start:c,end:l}}else r=null}r||={start:0,end:0}}else r=null;for(mp={focusedElem:e,selectionRange:r},Sh=!1,n=(n&335544064)===n,fu=t,t=n?9270:1024;fu!==null;){if(e=fu,n&&(r=e.deletions,r!==null))for(a=0;a<r.length;a++)n&&eu(r[a]);if(e.alternate===null&&e.flags&2)n&&Wl(e),vu(n);else{if(e.tag===22){if(r=e.alternate,e.memoizedState!==null){r!==null&&r.memoizedState===null&&n&&eu(r),vu(n);continue}if(r!==null&&r.memoizedState!==null){n&&Wl(e),vu(n);continue}}r=e.child,(e.subtreeFlags&t)!==0&&r!==null?(r.return=e,fu=r):(n&&tu(e),vu(n))}}Ul=null}function vu(e){for(;fu!==null;){var t=fu,n=e,r=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if(i&1024&&r!==null){n=void 0,i=r.memoizedProps,r=r.memoizedState;var o=t.stateNode;try{var s=wc(t.type,i);n=o.getSnapshotBeforeUpdate(s,r),o.__reactInternalSnapshotBeforeUpdate=n}catch(e){vf(t,t.return,e)}}break;case 3:if(i&1024){if(r=t.stateNode.containerInfo,n=r.nodeType,n===9)cm(r);else if(n===1)switch(r.nodeName){case`HEAD`:case`HTML`:case`BODY`:cm(r);break;default:r.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&r!==null&&(n=vi(r.memoizedProps,r.stateNode),i=t.memoizedProps,i=bi(i.default,i.update),i!==`none`&&Jl(r,n,i,r.memoizedState=[],!0));break;default:if(i&1024)throw Error(a(163))}if(r=t.sibling,r!==null){r.return=t.return,fu=r;break}fu=t.return}}function yu(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:zu(e,n),r&4&&wl(5,n);break;case 1:if(zu(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){vf(n,n.return,e)}else{var i=wc(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){vf(n,n.return,e)}}}r&64&&El(n),r&512&&Ol(n,n.return);break;case 3:if(zu(e,n),r&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{To(e,t)}catch(e){vf(n,n.return,e)}}break;case 27:t===null&&r&4&&Vl(n);case 26:case 5:zu(e,n),t===null&&r&4&&Fl(n),r&512&&Ol(n,n.return);break;case 12:zu(e,n);break;case 31:zu(e,n),r&4&&Ou(e,n);break;case 13:zu(e,n),r&4&&ku(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Sf.bind(null,n),mm(e,n))));break;case 22:if(r=n.memoizedState!==null||su,!r){var a=t!==null&&t.memoizedState!==null||cu;t=su,i=cu,su=r,(cu=a)&&!i?(r=2,n.subtreeFlags&8772&&(r|=1),Vu(e,n,r)):zu(e,n),su=t,cu=i}break;case 30:zu(e,n),r&512&&Ol(n,n.return);break;case 7:r&512&&Ol(n,n.return);default:zu(e,n)}}function bu(e,t){for(e=e.child;e!==null;)xu(e,t),e=e.sibling}function xu(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var r=n.style;typeof r.setProperty==`function`?r.setProperty(`display`,`none`,`important`):r.display=`none`}else{var i=e.stateNode,a=e.memoizedProps.style,o=a!=null&&a.hasOwnProperty(`display`)?a.display:null;i.style.display=o==null||typeof o==`boolean`?``:(``+o).trim()}}catch(t){vf(e,e.return,t)}Su(e,t);break;case 6:try{e.stateNode.nodeValue=t?``:e.memoizedProps,R=!0}catch(t){vf(e,e.return,t)}break;case 18:try{var s=e.stateNode;t?Ap(s,!0):Ap(e.stateNode,!1)}catch(t){vf(e,e.return,t)}break;case 22:case 23:e.memoizedState===null&&bu(e,t);break;default:bu(e,t)}}function Su(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){a:{var n=e,r=t;switch(n.tag){case 4:xu(n,r);break a;case 22:n.memoizedState===null&&Su(n,r);break a;default:Su(n,r)}}e=e.sibling}}function Cu(e){var t=e.alternate;t!==null&&(e.alternate=null,Cu(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Nt(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var wu=null,Tu=!1;function Eu(e,t,n){for(n=n.child;n!==null;)Du(e,t,n),n=n.sibling}function Du(e,t,n){if(Ze&&typeof Ze.onCommitFiberUnmount==`function`)try{Ze.onCommitFiberUnmount(Xe,n)}catch{}switch(n.tag){case 26:cu||kl(n,t),Eu(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!cu&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:cu||kl(n,t),Ml(n);var r=wu,i=Tu;Op(n.type)&&(wu=n.stateNode,Tu=!1),Eu(e,t,n),Sm(n.stateNode,n.type,n.memoizedProps),wu=r,Tu=i;break;case 5:cu||kl(n,t),Ml(n);case 6:if(n.tag===6&&Ml(n),r=wu,i=Tu,wu=null,Eu(e,t,n),wu=r,Tu=i,wu!==null){if(Tu)try{(wu.nodeType===9?wu.body:wu.nodeName===`HTML`?wu.ownerDocument.body:wu).removeChild(n.stateNode),R=!0}catch(e){vf(n,t,e)}else try{wu.removeChild(n.stateNode),R=!0}catch(e){vf(n,t,e)}}break;case 18:wu!==null&&(Tu?(e=wu,kp(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Jh(e)):kp(wu,n.stateNode));break;case 4:r=wu,i=Tu,wu=n.stateNode.containerInfo,Tu=!0,Eu(e,t,n),wu=r,Tu=i;break;case 0:case 11:case 14:case 15:Tl(2,n,t),cu||Tl(4,n,t),Eu(e,t,n);break;case 1:cu||(kl(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Dl(n,t,r)),Eu(e,t,n);break;case 21:Eu(e,t,n);break;case 22:cu=(r=cu)||n.memoizedState!==null,Eu(e,t,n),cu=r;break;case 30:kl(n,t),Eu(e,t,n);break;case 7:cu||kl(n,t),Eu(e,t,n);break;default:Eu(e,t,n)}}function Ou(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Jh(e)}catch(e){vf(t,t.return,e)}}}function ku(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Jh(e)}catch(e){vf(t,t.return,e)}}function Au(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new du),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new du),t;default:throw Error(a(435,e.tag))}}function ju(e,t){var n=Au(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Cf.bind(null,e,t);t.then(r,r)}})}function Mu(e,t,n){var r=t.deletions;if(r!==null)for(var i=0;i<r.length;i++){var o=r[i],s=e,c=t,l=c;a:for(;l!==null;){switch(l.tag){case 27:if(Op(l.type)){wu=l.stateNode,Tu=!1;break a}break;case 5:wu=l.stateNode,Tu=!1;break a;case 3:case 4:wu=l.stateNode.containerInfo,Tu=!0;break a}l=l.return}if(wu===null)throw Error(a(160));Du(s,c,o),wu=null,Tu=!1,s=o.alternate,s!==null&&(s.return=null),o.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Pu(t,e,n),t=t.sibling}var Nu=null;function Pu(e,t,n){var r=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(r=e.updateQueue,r=r===null?null:r.events,r!==null))for(var o=0;o<r.length;o++){var s=r[o];s.ref.impl=s.nextImpl}Mu(t,e,n),Fu(e),i&4&&(Tl(3,e,e.return),wl(3,e),Tl(5,e,e.return));break;case 1:Mu(t,e,n),Fu(e),i&512&&(cu||r===null||kl(r,r.return)),i&64&&su&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(o=Nu,Mu(t,e,n),Fu(e),i&512&&(cu||r===null||kl(r,r.return)),i&4){if(i=r===null?null:r.memoizedState,n=e.memoizedState,r===null){if(n===null){if(e.stateNode===null){if(su)e.stateNode=vp(e.type,e.memoizedProps,t.containerInfo,e);else{a:{t=e.type,n=e.memoizedProps,i=o.ownerDocument||o;b:switch(t){case`title`:r=i.getElementsByTagName(`title`)[0],(!r||r[jt]||r[wt]||r.namespaceURI===`http://www.w3.org/2000/svg`||r.hasAttribute(`itemprop`))&&(r=i.createElement(t),i.head.insertBefore(r,i.querySelector(`head > title`))),cp(r,t,n),r[wt]=e,Rt(r),t=r;break a;case`link`:if(o=Zm(`link`,`href`,i).get(t+(n.href||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&r.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&r.getAttribute(`title`)===(n.title==null?null:n.title)&&r.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){o.splice(s,1);break b}}r=i.createElement(t),cp(r,t,n),i.head.appendChild(r);break;case`meta`:if(o=Zm(`meta`,`content`,i).get(t+(n.content||``))){for(s=0;s<o.length;s++)if(r=o[s],r.getAttribute(`content`)===(n.content==null?null:``+n.content)&&r.getAttribute(`name`)===(n.name==null?null:n.name)&&r.getAttribute(`property`)===(n.property==null?null:n.property)&&r.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&r.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){o.splice(s,1);break b}}r=i.createElement(t),cp(r,t,n),i.head.appendChild(r);break;default:throw Error(a(468,t))}r[wt]=e,Rt(r),t=r}e.stateNode=t}}else su||Qm(o,e.type,e.stateNode)}else e.stateNode=Km(o,n,e.memoizedProps)}else i===n?n===null&&e.stateNode!==null&&Il(e,e.memoizedProps,r.memoizedProps):(i===null?(t=r.stateNode,t===null||cu||t.parentNode.removeChild(t)):i.count--,n===null?su||Qm(o,e.type,e.stateNode):Km(o,n,e.memoizedProps))}break;case 27:Mu(t,e,n),Fu(e),i&512&&(cu||r===null||kl(r,r.return)),r!==null&&i&4&&Il(e,e.memoizedProps,r.memoizedProps);break;case 5:if(o=lu,lu=!1,Mu(t,e,n),lu=o,Fu(e),i&512&&(cu||r===null||kl(r,r.return)),e.flags&32){t=e.stateNode;try{dn(t,``),R=!0}catch(t){vf(e,e.return,t)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Il(e,t,r===null?t:r.memoizedProps)),i&1024&&(uu=!0);break;case 6:if(Mu(t,e,n),Fu(e),i&4){if(e.stateNode===null)throw Error(a(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,R=!0}catch(t){vf(e,e.return,t)}}break;case 3:if(R=!1,Xm=null,o=Nu,Nu=Em(t.containerInfo),Mu(t,e,n),Nu=o,Fu(e),i&4&&r!==null&&r.memoizedState.isDehydrated)try{Jh(t.containerInfo)}catch(t){vf(e,e.return,t)}uu&&(uu=!1,Iu(e)),R=!1;break;case 4:i=lu,lu=su,r=qt(),o=Nu,Nu=Em(e.stateNode.containerInfo),Mu(t,e,n),Fu(e),Nu=o,R&&mu&&(hu=!0),R=r,lu=i;break;case 12:Mu(t,e,n),Fu(e);break;case 31:Mu(t,e,n),Fu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 13:Mu(t,e,n),Fu(e),e.child.flags&8192&&e.memoizedState!==null!=(r!==null&&r.memoizedState!==null)&&(yd=Ve()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 22:o=e.memoizedState!==null,s=r!==null&&r.memoizedState!==null;var c=su,l=cu,u=lu;su=c||o,lu=u||o,cu=l||s,Mu(t,e,n),cu=l,lu=u,su=c,Fu(e),i&8192&&(t=e.stateNode,t._visibility=o?t._visibility&-2:t._visibility|1,!o||r===null||s||su||cu||(t=s||cu,n=su,r=cu,su=o||su,cu=t,Bu(e,2),su=n,cu=r),!o&&lu||bu(e,o)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,ju(e,n))));break;case 19:Mu(t,e,n),Fu(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,ju(e,t)));break;case 30:i&512&&(cu||r===null||kl(r,r.return)),i=qt(),o=mu,s=(n&335544064)===n,c=e.memoizedProps,mu=s&&bi(c.default,c.update)!==`none`,Mu(t,e,n),Fu(e),s&&r!==null&&R&&(e.flags|=4),mu=o,R=i;break;case 21:break;case 7:i&512&&(cu||r===null||kl(r,r.return)),r&&r.stateNode!==null&&(r.stateNode._fragmentFiber=e);default:Mu(t,e,n),Fu(e)}}function Fu(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if(Ll(r)){n=r;break}r=r.return}r=null;for(var i=e.return;i!==null;){if(Pl(i)){var o=i.stateNode;r===null?r=[o]:r.push(o)}if(Nl(i))break;i=i.return}var s=r;if(n==null)throw Error(a(160));switch(n.tag){case 27:var c=n.stateNode;Bl(e,Rl(e),c,s);break;case 5:var l=n.stateNode;n.flags&32&&(dn(l,``),n.flags&=-33),Bl(e,Rl(e),l,s);break;case 3:case 4:var u=n.stateNode.containerInfo;zl(e,Rl(e),u,s);break;default:throw Error(a(161))}}catch(t){vf(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Iu(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Iu(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Sh=!0,t.reset(),Sh=!1),e=e.sibling}}function Lu(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Ru(t,e),t=t.sibling;else ou(t,!1)}function Ru(e,t){var n=e.alternate;if(n===null)Ql(e,!1);else switch(e.tag){case 3:if(gu=pu=!1,Kl(),Lu(t,e),!pu&&!hu){if(e=Gl,e!==null)for(var r=0;r<e.length;r+=3){n=e[r];var i=e[r+1];Mp(n,e[r+2]),n=n.ownerDocument.documentElement,n!==null&&n.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(`+i+`)`})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===``&&(e.style.viewTransitionName=`none`,e.animate({opacity:[0,0],pointerEvents:[`none`,`none`]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition-group(root)`}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:`forwards`,pseudoElement:`::view-transition`})),gu=!0}Gl=null;break;case 5:Lu(t,e);break;case 4:r=pu,pu=!1,Lu(t,e),pu&&(hu=!0),pu=r;break;case 22:e.memoizedState===null&&(n.memoizedState===null?Lu(t,e):Ql(e,!1));break;case 30:r=pu,i=Kl(),pu=!1,Lu(t,e),pu&&(e.flags|=4);var a=e.memoizedProps,o=e.stateNode;t=vi(a,o),o=vi(n.memoizedProps,o);var s=bi(a.default,a.update);s===`none`?t=!1:(a=n.memoizedState,n.memoizedState=null,n=e.child,ql=0,t=au(e,n,t,o,s,a,!0),ql!==(a===null?0:a.length)&&(e.flags|=32)),e.flags&4&&t?(Rd(e,e.memoizedProps.onUpdate),Gl=i):i!==null&&(i.push.apply(i,Gl),Gl=i),pu=e.flags&32?!0:r;break;default:Lu(t,e)}}function zu(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)yu(e,t.alternate,t),t=t.sibling}function Bu(e,t){for(e=e.child;e!==null;){var n=e,r=t;switch(n.tag){case 0:case 11:case 14:case 15:Tl(4,n,n.return),Bu(n,r);break;case 1:kl(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount==`function`&&Dl(n,n.return,i),Bu(n,r);break;case 27:r&2&&Sm(n.stateNode,n.type,n.memoizedProps);case 5:kl(n,n.return),n.tag!==5&&n.tag!==27||Ml(n),Bu(n,r);break;case 6:Ml(n);break;case 26:kl(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||cu||i.parentNode.removeChild(i),Bu(n,r);break;case 22:n.memoizedState===null&&Bu(n,r);break;case 30:kl(n,n.return),Bu(n,r);break;case 7:kl(n,n.return);default:Bu(n,r)}e=e.sibling}}function Vu(e,t,n){for(n=t.subtreeFlags&8772?n:n&-2,t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags,s=!!(n&1);switch(a.tag){case 0:case 11:case 15:Vu(i,a,n),wl(4,a);break;case 1:if(Vu(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){vf(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var c=r.stateNode;try{var l=i.shared.hiddenCallbacks;if(l!==null)for(i.shared.hiddenCallbacks=null,i=0;i<l.length;i++)wo(l[i],c)}catch(e){vf(r,r.return,e)}}s&&o&64&&El(a),Ol(a,a.return);break;case 27:n&2&&Vl(a);case 5:a.tag!==5&&a.tag!==27||jl(a),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 6:jl(a);break;case 26:c=a.stateNode,a.memoizedState!==null||c===null||su||Qm(Em(c.ownerDocument),a.type,c),Vu(i,a,n),s&&r===null&&o&4&&Fl(a),Ol(a,a.return);break;case 12:Vu(i,a,n);break;case 31:Vu(i,a,n),s&&o&4&&Ou(i,a);break;case 13:Vu(i,a,n),s&&o&4&&ku(i,a);break;case 22:a.memoizedState===null&&Vu(i,a,n),Ol(a,a.return);break;case 30:Vu(i,a,n),Ol(a,a.return);break;case 7:Ol(a,a.return);default:Vu(i,a,n)}t=t.sibling}}function Hu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&Na(n))}function Uu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Na(e))}function Wu(e,t,n,r){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)Gu(e,t,n,r),t=t.sibling;else i&&iu(t)}function Gu(e,t,n,r){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&ru(t);var a=t.flags;switch(t.tag){case 0:case 11:case 15:Wu(e,t,n,r),a&2048&&wl(9,t);break;case 1:Wu(e,t,n,r);break;case 3:Wu(e,t,n,r),i&&gu&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,e.style.viewTransitionName===`root`&&(e.style.viewTransitionName=``),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===`none`&&(e.style.viewTransitionName=``)),a&2048&&(a=null,t.alternate!==null&&(a=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==a&&(t.refCount++,a!=null&&Na(a)));break;case 12:if(a&2048){Wu(e,t,n,r),a=t.stateNode;try{var o=t.memoizedProps,s=o.id,c=o.onPostCommit;typeof c==`function`&&c(s,t.alternate===null?`mount`:`update`,a.passiveEffectDuration,-0)}catch(e){vf(t,t.return,e)}}else Wu(e,t,n,r);break;case 31:Wu(e,t,n,r);break;case 13:Wu(e,t,n,r);break;case 23:break;case 22:o=t.stateNode,s=t.alternate,t.memoizedState===null?(i&&s!==null&&s.memoizedState!==null&&ru(t),o._visibility&2?Wu(e,t,n,r):(o._visibility|=2,Ku(e,t,n,r,!!(t.subtreeFlags&10256)||!1))):(i&&s!==null&&s.memoizedState===null&&ru(s),o._visibility&2?Wu(e,t,n,r):qu(e,t)),a&2048&&Hu(s,t);break;case 24:Wu(e,t,n,r),a&2048&&Uu(t.alternate,t);break;case 30:i&&(a=t.alternate,a!==null&&(Xl(a.child,!0),Xl(t.child,!0))),Wu(e,t,n,r);break;default:Wu(e,t,n,r)}}function Ku(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Ku(a,o,s,c,i),wl(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Ku(a,o,s,c,i)):u._visibility&2?Ku(a,o,s,c,i):qu(a,o),i&&l&2048&&Hu(o.alternate,o);break;case 24:Ku(a,o,s,c,i),i&&l&2048&&Uu(o.alternate,o);break;default:Ku(a,o,s,c,i)}t=t.sibling}}function qu(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:qu(n,r),i&2048&&Hu(r.alternate,r);break;case 24:qu(n,r),i&2048&&Uu(r.alternate,r);break;default:qu(n,r)}t=t.sibling}}var Ju=8192;function Yu(e,t,n){if(e.subtreeFlags&Ju)for(e=e.child;e!==null;)Xu(e,t,n),e=e.sibling}function Xu(e,t,n){switch(e.tag){case 26:Yu(e,t,n),e.flags&Ju&&(e.memoizedState===null?(e=e.stateNode,(t&335544128)===t&&rh(n,e)):ih(n,Nu,e.memoizedState,e.memoizedProps));break;case 5:Yu(e,t,n),e.flags&Ju&&(e=e.stateNode,(t&335544128)===t&&rh(n,e));break;case 3:case 4:var r=Nu;Nu=Em(e.stateNode.containerInfo),Yu(e,t,n),Nu=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=Ju,Ju=16777216,Yu(e,t,n),Ju=r):Yu(e,t,n));break;case 30:if((e.flags&Ju)!==0&&(r=e.memoizedProps.name,r!=null&&r!==`auto`)){var i=e.stateNode;i.paired=null,Ul===null&&(Ul=new Map),Ul.set(r,i)}Yu(e,t,n);break;default:Yu(e,t,n)}}function Zu(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Qu(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,td(r,e)}Zu(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)$u(e),e=e.sibling}function $u(e){switch(e.tag){case 0:case 11:case 15:Qu(e),e.flags&2048&&Tl(9,e,e.return);break;case 3:Qu(e);break;case 12:Qu(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,ed(e)):Qu(e);break;default:Qu(e)}}function ed(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];fu=r,td(r,e)}Zu(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Tl(8,t,t.return),ed(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,ed(t));break;default:ed(t)}e=e.sibling}}function td(e,t){for(;fu!==null;){var n=fu;switch(n.tag){case 0:case 11:case 15:Tl(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Na(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,fu=r;else a:for(n=e;fu!==null;){r=fu;var i=r.sibling,a=r.return;if(Cu(r),r===n){fu=null;break a}if(i!==null){i.return=a,fu=i;break a}fu=a}}}var nd={getCacheForType:function(e){var t=Ta(ja),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return Ta(ja).controller.signal}},rd=typeof WeakMap==`function`?WeakMap:Map,H=0,id=null,U=null,W=0,G=0,ad=null,od=!1,sd=!1,cd=!1,ld=0,ud=0,dd=0,fd=0,pd=0,md=0,hd=0,gd=null,_d=null,vd=!1,yd=0,bd=0,xd=1/0,Sd=null,Cd=null,wd=0,Td=null,Ed=null,Dd=0,Od=0,kd=null,Ad=null,jd=null,Md=null,Nd=null,Pd=0,Fd=null;function Id(){return H&2&&W!==0?W&-W:M.T===null?xt():zf()}function Ld(){if(md===0){if(!(W&536870912)||B){var e=at;at<<=1,!(at&3932160)&&(at=262144),md=e}else md=536870912}return e=jo.current,e!==null&&(e.flags|=32),md}function Rd(e,t){if(t!=null){var n=e.stateNode,r=n.ref;r===null&&(r=n.ref=Bp(vi(e.memoizedProps,n))),Md===null&&(Md=[]),Md.push(t.bind(null,r))}}function zd(e,t,n){(e===id&&(G===2||G===9)||e.cancelPendingCommit!==null)&&(K(e,0),Ud(e,W,md,!1)),mt(e,n),(!(H&2)||e!==id)&&(e===id&&(!(H&2)&&(fd|=n),ud===4&&Ud(e,W,md,!1)),jf(e))}function Bd(e,t,n){if(H&6)throw Error(a(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||ct(e,t),i=r?$d(e,t):Zd(e,t,!0),o=r;do{if(i===0){sd&&!r&&Ud(e,t,0,!1);break}if(n=e.current.alternate,o&&!Hd(n)){i=Zd(e,t,!1),o=!1;continue}if(i===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;i=gd;var l=c.current.memoizedState.isDehydrated;if(l&&(K(c,s).flags|=256),s=Zd(c,s,!1),s!==2&&s!==6){if(cd&&!l){c.errorRecoveryDisabledLanes|=o,fd|=o,i=4;break a}o=_d,_d=i,o!==null&&(_d===null?_d=o:_d.push.apply(_d,o))}i=s}if(o=!1,i!==2)continue}}if(i===1){K(e,0),Ud(e,t,0,!0);break}a:{switch(r=e,o=i,o){case 0:case 1:throw Error(a(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Ud(r,t,md,!od);break a;case 2:_d=null;break;case 3:case 5:break;default:throw Error(a(329))}if((t&62914560)===t&&(i=yd+300-Ve(),10<i)){if(Ud(r,t,md,!od),I(r,0,!0)!==0)break a;Dd=t,r.timeoutHandle=Sp(Vd.bind(null,r,n,_d,Sd,vd,t,md,fd,hd,od,o,`Throttled`,-0,0),i);break a}Vd(r,n,_d,Sd,vd,t,md,fd,hd,od,o,null,-0,0)}break}while(1);jf(e)}function Vd(e,t,n,r,i,a,o,s,c,l,u,d,f,p){e.timeoutHandle=-1;var m=t.subtreeFlags,h=(a&335544064)===a;if(d=null,(h||m&8192||(m&16785408)==16785408)&&(d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:yn},Ul=null,Xu(t,a,d),h&&(m=d,h=e.containerInfo,h=(h.nodeType===9?h:h.ownerDocument).__reactViewTransition,h!=null&&(m.count++,m.waitingForViewTransition=!0,m=ch.bind(m),h.finished.then(m,m))),m=(a&62914560)===a?yd-Ve():(a&4194048)===a?bd-Ve():0,m=oh(d,m),m!==null)){Dd=a,e.cancelPendingCommit=m(sf.bind(null,e,t,a,n,r,i,o,s,c,l,u,d,null,f,p)),Ud(e,a,o,!l);return}sf(e,t,a,n,r,i,o,s,c,l,u,d)}function Hd(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Hr(a(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Ud(e,t,n,r){t=ut(e,t),t&=~pd,t&=~fd,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-et(i),o=1<<a;r[a]=-1,i&=~o}n!==0&>(e,n,t)}function Wd(){return H&6?!0:(Mf(0,!1),!1)}function Gd(){if(U!==null){if(G===0)var e=U.return;else e=U,_a=ga=null,os(e),ao=null,oo=0,e=U;for(;e!==null;)Cl(e.alternate,e),e=e.return;U=null}}function K(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Cp(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),Dd=0,Gd(),id=e,U=n=Fi(e.current,null),W=t,G=0,ad=null,od=!1,sd=ct(e,t),cd=!1,hd=md=pd=fd=dd=ud=0,_d=gd=null,vd=!1,ld=ut(e,t),Ti(),n}function Kd(e,t){V=null,M.H=gc,t===Ya||t===Za?(t=ro(),G=3):t===Xa?(t=ro(),G=4):G=t===Pc?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,ad=t,U===null&&(ud=1,Oc(e,Ui(t,e.current)))}function qd(){var e=jo.current;return e===null?!0:(W&4194048)===W?Mo===null:(W&62914560)===W||W&536870912?e===Mo:!1}function Jd(){var e=M.H;return M.H=gc,e===null?gc:e}function Yd(){var e=M.A;return M.A=nd,e}function Xd(){ud=4,od||(W&4194048)!==W&&jo.current!==null||(sd=!0),!(dd&134217727)&&!(fd&134217727)||id===null||Ud(id,W,md,!1)}function Zd(e,t,n){var r=H;H|=2;var i=Jd(),a=Yd();(id!==e||W!==t)&&(Sd=null,K(e,t)),t=!1;var o=ud;a:do try{if(G!==0&&U!==null){var s=U,c=ad;switch(G){case 8:Gd(),o=6;break a;case 3:case 2:case 9:case 6:jo.current===null&&(t=!0);var l=G;if(G=0,ad=null,rf(e,s,c,l),n&&sd){o=0;break a}break;default:l=G,G=0,ad=null,rf(e,s,c,l)}}Qd(),o=ud;break}catch(t){Kd(e,t)}while(1);return t&&e.shellSuspendCounter++,_a=ga=null,H=r,M.H=i,M.A=a,U===null&&(id=null,W=0,Ti()),o}function Qd(){for(;U!==null;)tf(U)}function $d(e,t){var n=H;H|=2;var r=Jd(),i=Yd();id!==e||W!==t?(Sd=null,xd=Ve()+500,K(e,t)):sd=ct(e,t);a:do try{if(G!==0&&U!==null){t=U;var o=ad;b:switch(G){case 1:G=0,ad=null,rf(e,t,o,1);break;case 2:case 9:if($a(o)){G=0,ad=null,nf(t);break}t=function(){G!==2&&G!==9||id!==e||(G=7),jf(e)},o.then(t,t);break a;case 3:G=7;break a;case 4:G=5;break a;case 7:$a(o)?(G=0,ad=null,nf(t)):(G=0,ad=null,rf(e,t,o,7));break;case 5:var s=null;switch(U.tag){case 26:s=U.memoizedState;case 5:case 27:var c=U;if(s?th(s):c.stateNode.complete){G=0,ad=null;var l=c.sibling;if(l!==null)U=l;else{var u=c.return;u===null?U=null:(U=u,af(u))}break b}}G=0,ad=null,rf(e,t,o,5);break;case 6:G=0,ad=null,rf(e,t,o,6);break;case 8:Gd(),ud=6;break a;default:throw Error(a(462))}}ef();break}catch(t){Kd(e,t)}while(1);return _a=ga=null,M.H=r,M.A=i,H=n,U===null?(id=null,W=0,Ti(),ud):0}function ef(){for(;U!==null&&!F();)tf(U)}function tf(e){var t=ml(e.alternate,e,ld);e.memoizedProps=e.pendingProps,t===null?af(e):U=t}function nf(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Jc(n,t,t.pendingProps,t.type,void 0,W);break;case 11:t=Jc(n,t,t.pendingProps,t.type.render,t.ref,W);break;case 5:os(t);var r=t;r===ra&&(B?(ua(r),r.tag===5&&r.stateNode!=null&&(ia=r.stateNode)):(ua(r),B=!0));default:Cl(n,t),t=U=Ii(t,ld),t=ml(n,t,ld)}e.memoizedProps=e.pendingProps,t===null?af(e):U=t}function rf(e,t,n,r){_a=ga=null,os(t),ao=null,oo=0;var i=t.return;try{if(Nc(e,i,t,n,W)){ud=1,Oc(e,Ui(n,e.current)),U=null;return}}catch(t){if(i!==null)throw U=i,t;ud=1,Oc(e,Ui(n,e.current)),U=null;return}t.flags&32768?(B||r===1?e=!0:sd||W&536870912?e=!1:(od=e=!0,(r===2||r===9||r===3||r===6)&&(r=jo.current,r!==null&&r.tag===13&&(r.flags|=16384))),of(t,e)):af(t)}function af(e){var t=e;do{if(t.flags&32768){of(t,od);return}e=t.return;var n=xl(t.alternate,t,ld);if(n!==null){U=n;return}if(t=t.sibling,t!==null){U=t;return}U=t=e}while(t!==null);ud===0&&(ud=5)}function of(e,t){do{var n=Sl(e.alternate,e);if(n!==null){n.flags&=32767,U=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){U=e;return}U=e=n}while(e!==null);ud=6,U=null}function sf(e,t,n,r,i,o,s,c,l,u,d,f){e.cancelPendingCommit=null;do hf();while(wd!==0);if(H&6)throw Error(a(327));if(t!==null){if(t===e.current)throw Error(a(177));e===id&&(U=id=null,W=0),Ed=t,Td=e,Dd=n,kd=i,Ad=r,cf(e,t,n,s,c,l,f)}}function cf(e,t,n,r,i,a,o){var s=t.lanes|t.childLanes;if(Od=s,s|=wi,ht(e,n,s,r,i,a),Md=null,(n&335544064)===n?(Nd=Ia(e),r=10262):(Nd=null,r=10256),(t.subtreeFlags&r)!==0||(t.flags&r)!==0?(e.callbackNode=null,e.callbackPriority=0,wf(Ge,function(){return gf(),null})):(e.callbackNode=null,e.callbackPriority=0),Hl=!1,r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=M.T,M.T=null,i=N.p,N.p=2,a=H,H|=4;try{_u(e,t,n)}finally{H=a,N.p=i,M.T=r}}wd=1,Hl?jd=Rp(o,e.containerInfo,Nd,df,ff,uf,pf,gf,lf,null,null):(df(),ff(),pf())}function lf(e){if(wd!==0){var t=Td.onRecoverableError;t(e,{componentStack:null})}}function uf(){wd===3&&(wd=0,Ru(Ed,Td),wd=4)}function df(){if(wd===1){wd=0;var e=Td,t=Ed,n=Dd,r=!!(t.flags&13878);if(t.subtreeFlags&13878||r){r=M.T,M.T=null;var i=N.p;N.p=2;var a=H;H|=4;try{mu=hu=!1,Pu(t,e,n),n=mp;var o=Jr(e.containerInfo),s=n.focusedElem,c=n.selectionRange;if(o!==s&&s&&s.ownerDocument&&qr(s.ownerDocument.documentElement,s)){if(c!==null&&Yr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=Kr(s,h),v=Kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}Sh=!!pp,mp=pp=null}finally{H=a,N.p=i,M.T=r}}e.current=t,wd=2}}function ff(){if(wd===2){wd=0;var e=Td,t=Ed,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=M.T,M.T=null;var r=N.p;N.p=2;var i=H;H|=4;try{yu(e,t.alternate,t)}finally{H=i,N.p=r,M.T=n}}wd=3}}function pf(){if(wd===4||wd===3){wd=0;var e=jd;jd=null,Be();var t=Td,n=Ed,r=Dd,i=Ad,a=(r&335544064)===r?10262:10256;if((n.subtreeFlags&a)!==0||(n.flags&a)!==0?wd=5:(wd=0,Ed=Td=null,mf(t,t.pendingLanes)),a=t.pendingLanes,a===0&&(Cd=null),bt(r),n=n.stateNode,Ze&&typeof Ze.onCommitFiberRoot==`function`)try{Ze.onCommitFiberRoot(Xe,n,void 0,(n.current.flags&128)==128)}catch{}if(i!==null){n=M.T,a=N.p,N.p=2,M.T=null;try{for(var o=t.onRecoverableError,s=0;s<i.length;s++){var c=i[s];o(c.value,{componentStack:c.stack})}}finally{M.T=n,N.p=a}}if(i=Md,o=Nd,Nd=null,i!==null&&(Md=null,o===null&&(o=[]),e!==null))for(c=0;c<i.length;c++)n=(0,i[c])(o),n!==void 0&&e.finished.finally(n);Dd&3&&hf(),jf(t),a=t.pendingLanes,r&261930&&a&42?t===Fd?Pd++:(Pd=0,Fd=t):(Pd=0,Fd=null),Mf(0,!1)}}function mf(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Na(t)))}function hf(){return jd!==null&&(jd.skipTransition(),jd=null),df(),ff(),pf(),gf()}function gf(){if(wd!==5)return!1;var e=Td,t=Od;Od=0;var n=bt(Dd),r=M.T,i=N.p;try{N.p=32>n?32:n,M.T=null,n=kd,kd=null;var o=Td,s=Dd;if(wd=0,Ed=Td=null,Dd=0,H&6)throw Error(a(331));var c=H;if(H|=4,$u(o.current),Gu(o,o.current,s,n),H=c,Mf(0,!1),Ze&&typeof Ze.onPostCommitFiberRoot==`function`)try{Ze.onPostCommitFiberRoot(Xe,o)}catch{}return!0}finally{N.p=i,M.T=r,mf(e,t)}}function _f(e,t,n){t=Ui(n,t),t=Ac(e.stateNode,t,2),e=vo(e,t,2),e!==null&&(mt(e,2),jf(e))}function vf(e,t,n){if(e.tag===3)_f(e,e,n);else for(;t!==null;){if(t.tag===3){_f(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(Cd===null||!Cd.has(r))){e=Ui(n,e),n=jc(2),r=vo(t,n,2),r!==null&&(Mc(n,r,t,e),mt(r,2),jf(r));break}}t=t.return}}function yf(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new rd;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(cd=!0,i.add(n),e=bf.bind(null,e,t,n),t.then(e,e))}function bf(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,id===e&&(W&n)===n&&(ud===4||ud===3&&(W&62914560)===W&&300>Ve()-yd?H&2?pd|=n:K(e,0):pd|=n,hd===W&&(hd=0)),jf(e)}function xf(e,t){t===0&&(t=ft()),e=Oi(e,t),e!==null&&(mt(e,t),jf(e))}function Sf(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),xf(e,n)}function Cf(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(a(314))}r!==null&&r.delete(t),xf(e,n)}function wf(e,t){return Re(e,t)}var Tf=null,Ef=null,Df=!1,Of=!1,kf=!1,Af=0;function jf(e){e!==Ef&&e.next===null&&(Ef===null?Tf=Ef=e:Ef=Ef.next=e),Of=!0,Df||(Df=!0,Rf())}function Mf(e,t){if(!kf&&Of){kf=!0;do for(var n=!1,r=Tf;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-et(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,Lf(r,a))}else a=W,a=I(r,r===id?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||ct(r,a)||(n=!0,Lf(r,a))}r=r.next}while(n);kf=!1}}function Nf(){Pf()}function Pf(){Of=Df=!1;var e=0;Af!==0&&xp()&&(e=Af);for(var t=Ve(),n=null,r=Tf;r!==null;){var i=r.next,a=Ff(r,t);a===0?(r.next=null,n===null?Tf=i:n.next=i,i===null&&(Ef=n)):(n=r,(e!==0||a&3)&&(Of=!0)),r=i}wd!==0&&wd!==5||Mf(e,!1),Af!==0&&(Af=0)}function Ff(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-et(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=dt(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=id,n=W,n=I(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(G===2||G===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ze(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||ct(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ze(r),bt(n)){case 2:case 8:n=We;break;case 32:n=Ge;break;case 268435456:n=qe;break;default:n=Ge}return r=If.bind(null,e),n=Re(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ze(r),e.callbackPriority=2,e.callbackNode=null,2}function If(e,t){if(wd!==0&&wd!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(hf()&&e.callbackNode!==n)return null;var r=W;return r=I(e,e===id?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Bd(e,r,t),Ff(e,Ve()),e.callbackNode!=null&&e.callbackNode===n?If.bind(null,e):null)}function Lf(e,t){if(hf())return null;Bd(e,t,!0)}function Rf(){Ep(function(){H&6?Re(Ue,Nf):Pf()})}function zf(){if(Af===0){var e=za;e===0&&(e=it,it<<=1,!(it&261888)&&(it=256)),Af=e}return Af}function Bf(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:vn(e)}function Vf(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=Bf((i[Tt]||null).action),o=r.submitter;o&&(t=(t=o[Tt]||null)?Bf(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Bn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Af!==0){var e=new FormData(i,o);nc(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=new FormData(i,o),nc(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var Hf=0;Hf<hi.length;Hf++){var Uf=hi[Hf];gi(Uf.toLowerCase(),`on`+(Uf[0].toUpperCase()+Uf.slice(1)))}gi(si,`onAnimationEnd`),gi(ci,`onAnimationIteration`),gi(li,`onAnimationStart`),gi(`dblclick`,`onDoubleClick`),gi(`focusin`,`onFocus`),gi(`focusout`,`onBlur`),gi(ui,`onTransitionRun`),gi(di,`onTransitionStart`),gi(fi,`onTransitionCancel`),gi(pi,`onTransitionEnd`),Ut(`onMouseEnter`,[`mouseout`,`mouseover`]),Ut(`onMouseLeave`,[`mouseout`,`mouseover`]),Ut(`onPointerEnter`,[`pointerout`,`pointerover`]),Ut(`onPointerLeave`,[`pointerout`,`pointerover`]),Ht(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Ht(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Ht(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Ht(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Ht(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var Wf=`abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting`.split(` `),Gf=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(Wf));function Kf(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){xi(e)}i.currentTarget=null,a=c}}}}function q(e,t){var n=t[Dt];n===void 0&&(n=t[Dt]=new Set);var r=e+`__bubble`;n.has(r)||(Xf(t,e,2,!1),n.add(r))}function qf(e,t,n){var r=0;t&&(r|=4),Xf(n,e,r,t)}var Jf=`_reactListening`+Math.random().toString(36).slice(2);function Yf(e){if(!e[Jf]){e[Jf]=!0,Bt.forEach(function(t){t!==`selectionchange`&&(Gf.has(t)||qf(t,!1,e),qf(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Jf]||(t[Jf]=!0,qf(`selectionchange`,!1,t))}}function Xf(e,t,n,r){switch(kh(t)){case 2:var i=Ch;break;case 8:i=wh;break;default:i=Th}n=i.bind(null,t,n,e),i=void 0,!kn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function Zf(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var o=r.tag;if(o===3||o===4){var c=r.stateNode.containerInfo;if(c===i)break;if(o===4)for(o=r.return;o!==null;){var l=o.tag;if((l===3||l===4)&&o.stateNode.containerInfo===i)return;o=o.return}for(;c!==null;){if(o=Pt(c),o===null)return;if(l=o.tag,l===5||l===6||l===26||l===27){r=a=o;continue a}c=c.parentNode}}r=r.return}En(function(){var r=a,i=xn(n),o=[];a:{var c=mi.get(e);if(c!==void 0){var l=Bn,u=e;switch(e){case`keypress`:if(Fn(n)===0)break a;case`keydown`:case`keyup`:l=ir;break;case`focusin`:u=`focus`,l=Yn;break;case`focusout`:u=`blur`,l=Yn;break;case`beforeblur`:case`afterblur`:l=Yn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=qn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Jn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=sr;break;case si:case ci:case li:l=Xn;break;case pi:l=cr;break;case`scroll`:case`scrollend`:l=Hn;break;case`wheel`:l=lr;break;case`copy`:case`cut`:case`paste`:l=Zn;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=ar;break;case`submit`:l=or;break;case`toggle`:case`beforetoggle`:l=ur}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=Dn(m,p),g!=null&&d.push(Qf(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),o.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(l=e===`mouseover`||e===`pointerover`,c=e===`mouseout`||e===`pointerout`,l&&n!==bn&&(u=n.relatedTarget||n.fromElement)&&(Pt(u)||u[Et]))break a;(c||l)&&(u=i.window===i?i:(l=i.ownerDocument)?l.defaultView||l.parentWindow:window,c?(l=n.relatedTarget||n.toElement,c=r,l=l?Pt(l):null,l!==null&&(f=s(l),d=l.tag,l!==f||d!==5&&d!==27&&d!==6)&&(l=null)):(c=null,l=r),c!==l&&(d=qn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=ar,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=c==null?u:It(c),h=l==null?u:It(l),u=new d(g,m+`leave`,c,n,i),u.target=f,u.relatedTarget=h,g=null,Pt(i)===r&&(d=new d(p,m+`enter`,l,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,d=c&&l?w(c,l,ep):null,c!==null&&tp(o,u,c,d,!1),l!==null&&f!==null&&tp(o,f,l,d,!0)))}a:{if(c=r?It(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var _=Ar;else if(wr(c)){if(jr)_=Br;else{_=Rr;var v=Lr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&hn(r.elementType)&&(_=Ar):_=zr;if(_&&=_(e,r)){Tr(o,_,n,i);break a}v&&v(e,c,r)}switch(v=r?It(r):window,e){case`focusin`:(wr(v)||v.contentEditable===`true`)&&(Zr=v,Qr=r,$r=null);break;case`focusout`:$r=Qr=Zr=null;break;case`mousedown`:ei=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:ei=!1,ti(o,n,i);break;case`selectionchange`:if(Xr)break;case`keydown`:case`keyup`:ti(o,n,i)}var y;if(fr)b:{switch(e){case`compositionstart`:var b=`onCompositionStart`;break b;case`compositionend`:b=`onCompositionEnd`;break b;case`compositionupdate`:b=`onCompositionUpdate`;break b}b=void 0}else br?vr(e,n)&&(b=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(b=`onCompositionStart`);b&&(hr&&n.locale!==`ko`&&(br||b!==`onCompositionStart`?b===`onCompositionEnd`&&br&&(y=Pn()):(jn=i,Mn=`value`in jn?jn.value:jn.textContent,br=!0)),v=$f(r,b),0<v.length&&(b=new Qn(b,e,null,n,i),o.push({event:b,listeners:v}),y?b.data=y:(y=yr(n),y!==null&&(b.data=y)))),(y=mr?xr(e,n):Sr(e,n))&&(b=$f(r,`onBeforeInput`),0<b.length&&(v=new Qn(`onBeforeInput`,`beforeinput`,null,n,i),o.push({event:v,listeners:b}),v.data=y)),Vf(o,e,r,n,i)}Kf(o,t)})}function Qf(e,t,n){return{instance:e,listener:t,currentTarget:n}}function $f(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=Dn(e,n),i!=null&&r.unshift(Qf(e,i,a)),i=Dn(e,t),i!=null&&r.push(Qf(e,i,a))),e.tag===3)return r;e=e.return}return[]}function ep(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function tp(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=Dn(n,a),l!=null&&o.unshift(Qf(n,l,c))):i||(l=Dn(n,a),l!=null&&o.push(Qf(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var np=/\r\n?/g,rp=/\u0000|\uFFFD/g;function ip(e){return(typeof e==`string`?e:``+e).replace(np,`
|
|
10
|
-
`).replace(rp,``)}function ap(e,t){return t=ip(t),ip(e)===t}function op(e,t,n,r,i,o){switch(n){case`children`:if(typeof r==`string`)t===`body`||t===`textarea`&&r===``||dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)t!==`body`&&dn(e,``+r);else return;break;case`className`:Yt(e,`class`,r);break;case`tabIndex`:Yt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Yt(e,n,r);break;case`style`:mn(e,r,o);return;case`data`:if(t!==`object`){Yt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`function`){e.setAttribute(n,`javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')`);break}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&op(e,t,`name`,i.name,i,null),op(e,t,`formEncType`,i.formEncType,i,null),op(e,t,`formMethod`,i.formMethod,i,null),op(e,t,`formTarget`,i.formTarget,i,null)):(op(e,t,`encType`,i.encType,i,null),op(e,t,`method`,i.method,i,null),op(e,t,`target`,i.target,i,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=vn(r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=yn);return;case`onScroll`:r!=null&&q(`scroll`,e);return;case`onScrollEnd`:r!=null&&q(`scrollend`,e);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=vn(r),e.setAttributeNS(`http://www.w3.org/1999/xlink`,`xlink:href`,n);break;case`contentEditable`:case`spellCheck`:case`draggable`:case`value`:case`autoReverse`:case`externalResourcesRequired`:case`focusable`:case`preserveAlpha`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`credentialless`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:q(`beforetoggle`,e),q(`toggle`,e),Jt(e,`popover`,r);break;case`xlinkActuate`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Xt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Xt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Jt(e,`is`,r);break;case`innerText`:case`textContent`:return;default:if(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)n=gn.get(n)||n,Jt(e,n,r);else return}R=!0}function sp(e,t,n,r,i,o){switch(n){case`style`:mn(e,r,o);return;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(a(61));if(n=r.__html,n!=null){if(i.children!=null)throw Error(a(60));o?.__html!==n&&(e.innerHTML=n)}}break;case`children`:if(typeof r==`string`)dn(e,r);else if(typeof r==`number`||typeof r==`bigint`)dn(e,``+r);else return;break;case`onScroll`:r!=null&&q(`scroll`,e);return;case`onScrollEnd`:r!=null&&q(`scrollend`,e);return;case`onClick`:r!=null&&(e.onclick=yn);return;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:return;case`innerText`:case`textContent`:return;default:if(!Vt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(i=n.endsWith(`Capture`),o=n.slice(2,i?n.length-7:void 0),t=e[Tt]||null,t=t==null?null:t[n],typeof t==`function`&&e.removeEventListener(o,t,i),typeof r==`function`)){typeof t!=`function`&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(o,r,i);break a}R=!0,n in e?e[n]=r:!0===r?e.setAttribute(n,``):Jt(e,n,r)}return}R=!0}function cp(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:q(`error`,e),q(`load`,e);var r=!1,i=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:i=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:op(e,t,o,s,n,null)}}i&&op(e,t,`srcSet`,n.srcSet,n,null),r&&op(e,t,`src`,n.src,n,null);return;case`input`:q(`invalid`,e);var c=o=s=i=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:i=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(a(137,t));break;default:op(e,t,r,d,n,null)}}on(e,o,c,l,u,s,i,!1);return;case`select`:for(i in q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(i)&&(c=n[i],c!=null))switch(i){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:op(e,t,i,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&cn(e,!!r,n,!0):cn(e,!!r,t,!1);return;case`textarea`:for(s in q(`invalid`,e),o=i=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:i=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(a(91));break;default:op(e,t,s,c,n,null)}un(e,r,i,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:op(e,t,l,r,n,null)}return;case`dialog`:q(`beforetoggle`,e),q(`toggle`,e),q(`cancel`,e),q(`close`,e);break;case`iframe`:case`object`:q(`load`,e);break;case`video`:case`audio`:for(r=0;r<Wf.length;r++)q(Wf[r],e);break;case`image`:q(`error`,e),q(`load`,e);break;case`details`:q(`toggle`,e);break;case`embed`:case`source`:case`link`:q(`error`,e),q(`load`,e);case`area`:case`base`:case`br`:case`col`:case`hr`:case`keygen`:case`meta`:case`param`:case`track`:case`wbr`:case`menuitem`:for(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(a(137,t));default:op(e,t,u,r,n,null)}return;default:if(hn(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&sp(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&op(e,t,c,r,n,null))}var lp={};function up(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var i=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||op(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:m!==f&&(R=!0),o=m;break;case`name`:m!==f&&(R=!0),i=m;break;case`checked`:m!==f&&(R=!0),u=m;break;case`defaultChecked`:m!==f&&(R=!0),d=m;break;case`value`:m!==f&&(R=!0),s=m;break;case`defaultValue`:m!==f&&(R=!0),c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(a(137,t));break;default:m!==f&&op(e,t,p,m,r,f)}}an(e,s,c,l,u,d,o,i);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||op(e,t,o,null,r,l)}for(i in r)if(o=r[i],l=n[i],r.hasOwnProperty(i)&&(o!=null||l!=null))switch(i){case`value`:o!==l&&(R=!0),p=o;break;case`defaultValue`:o!==l&&(R=!0),c=o;break;case`multiple`:o!==l&&(R=!0),s=o;default:o!==l&&op(e,t,i,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?cn(e,!!n,n?[]:``,!1):cn(e,!!n,t,!0)):cn(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(i=n[c],n.hasOwnProperty(c)&&i!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:op(e,t,c,null,r,i)}for(s in r)if(i=r[s],o=n[s],r.hasOwnProperty(s)&&(i!=null||o!=null))switch(s){case`value`:i!==o&&(R=!0),p=i;break;case`defaultValue`:i!==o&&(R=!0),m=i;break;case`children`:break;case`dangerouslySetInnerHTML`:if(i!=null)throw Error(a(91));break;default:i!==o&&op(e,t,s,i,r,o)}ln(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:op(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:p!==m&&(R=!0),e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:op(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&op(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(a(137,t));break;default:op(e,t,u,p,r,m)}return;default:if(hn(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&sp(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||sp(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&op(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||op(e,t,f,p,r,m)}function dp(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function fp(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&dp(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&dp(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e==`number`)?e:5}var pp=null,mp=null;function hp(e){return e.nodeType===9?e:e.ownerDocument}function gp(e){switch(e){case`http://www.w3.org/2000/svg`:return 1;case`http://www.w3.org/1998/Math/MathML`:return 2;default:return 0}}function _p(e,t){if(e===0)switch(t){case`svg`:return 1;case`math`:return 2;default:return 0}return e===1&&t===`foreignObject`?0:e}function vp(e,t,n,r){return n=hp(n).createElement(e),n[wt]=r,n[Tt]=t,cp(n,e,t),Rt(n),n}function yp(e,t){return e===`textarea`||e===`noscript`||typeof t.children==`string`||typeof t.children==`number`||typeof t.children==`bigint`||typeof t.dangerouslySetInnerHTML==`object`&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var bp=null;function xp(){var e=window.event;return e&&e.type===`popstate`?e!==bp&&(bp=e,!0):(bp=null,!1)}var Sp=typeof setTimeout==`function`?setTimeout:void 0,Cp=typeof clearTimeout==`function`?clearTimeout:void 0,wp=typeof Promise==`function`?Promise:void 0,Tp=typeof requestAnimationFrame==`function`?requestAnimationFrame:Sp,Ep=typeof queueMicrotask==`function`?queueMicrotask:wp===void 0?Sp:function(e){return wp.resolve(null).then(e).catch(Dp)};function Dp(e){setTimeout(function(){throw e})}function Op(e){return e===`head`}function kp(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Jh(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)Cm(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,Cm(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[jt]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&Cm(e.ownerDocument.body)}n=i}while(n);Jh(t)}function Ap(e,t){var n=e;e=0;do{var r=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display=`none`):(n.style.display=n._stashedDisplay||``,n.getAttribute(`style`)===``&&n.removeAttribute(`style`)):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=``):n.nodeValue=n._stashedText||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function jp(e,t,n){if(t=CSS.escape(t)===t?t:`r-`+btoa(t).replace(/=/g,``),e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display===`inline`){if(t=e.getClientRects(),t.length===1)var r=1;else for(var i=r=0;i<t.length;i++){var a=t[i];0<a.width&&0<a.height&&r++}r===1&&(e=e.style,e.display=t.length===1?`inline-block`:`block`,e.marginTop=`-`+n.paddingTop,e.marginBottom=`-`+n.paddingBottom)}}function Mp(e,t){e=e.style,t=t.style;var n=t==null?null:t.hasOwnProperty(`viewTransitionName`)?t.viewTransitionName:t.hasOwnProperty(`view-transition-name`)?t[`view-transition-name`]:null;e.viewTransitionName=n==null||typeof n==`boolean`?``:(``+n).trim(),n=t==null?null:t.hasOwnProperty(`viewTransitionClass`)?t.viewTransitionClass:t.hasOwnProperty(`view-transition-class`)?t[`view-transition-class`]:null,e.viewTransitionClass=n==null||typeof n==`boolean`?``:(``+n).trim(),e.display===`inline-block`&&(t==null?e.display=e.margin=``:(n=t.display,e.display=n==null||typeof n==`boolean`?``:n,n=t.margin,n==null?(n=t.hasOwnProperty(`marginTop`)?t.marginTop:t[`margin-top`],e.marginTop=n==null||typeof n==`boolean`?``:n,t=t.hasOwnProperty(`marginBottom`)?t.marginBottom:t[`margin-bottom`],e.marginBottom=t==null||typeof t==`boolean`?``:t):e.margin=n))}function Np(e,t,n){return n=n.ownerDocument.defaultView,{rect:e,abs:t.position===`absolute`||t.position===`fixed`,clip:t.clipPath!==`none`||t.overflow!==`visible`||t.filter!==`none`||t.mask!==`none`||t.mask!==`none`||t.borderRadius!==`0px`,view:0<=e.bottom&&0<=e.right&&e.top<=n.innerHeight&&e.left<=n.innerWidth}}function Pp(e){return Np(e.getBoundingClientRect(),getComputedStyle(e),e)}function Fp(e){var t=e.getBoundingClientRect();t=new DOMRect(t.x+2e4,t.y+2e4,t.width,t.height);var n=getComputedStyle(e);return Np(t,n,e)}function Ip(e){return e.documentElement.clientHeight}function Lp(e){this.addEventListener(`load`,e),this.addEventListener(`error`,e)}function Rp(e,t,n,r,i,a,o,s,c){var l=t.nodeType===9?t:t.ownerDocument;try{var u=l.startViewTransition({update:function(){var t=l.defaultView,n=t.navigation&&t.navigation.transition,o=l.fonts.status;r();var s=[];if(o===`loaded`&&(Ip(l),l.fonts.status===`loading`&&s.push(l.fonts.ready)),o=s.length,e!==null)for(var c=e.suspenseyImages,u=0,d=0;d<c.length;d++){var f=c[d];if(!f.complete){var p=f.getBoundingClientRect();if(0<p.bottom&&0<p.right&&p.top<t.innerHeight&&p.left<t.innerWidth){if(u+=nh(f),u>ah){s.length=o;break}f=new Promise(Lp.bind(f)),s.push(f)}}}if(0<s.length)return t=Promise.race([Promise.all(s),new Promise(function(e){return setTimeout(e,500)})]).then(i,i),(n?Promise.allSettled([n.finished,t]):t).then(a,a);if(i(),n)return n.finished.then(a,a);a()},types:n});l.__reactViewTransition=u;var d=[];return u.ready.then(function(){for(var e=l.documentElement.getAnimations({subtree:!0}),t=0;t<e.length;t++){var n=e[t],r=n.effect,i=r.pseudoElement;if(i!=null&&i.startsWith(`::view-transition`)){d.push(n),n=r.getKeyframes();for(var a=i=void 0,s=!0,c=0;c<n.length;c++){var u=n[c],f=u.width;if(i===void 0)i=f;else if(i!==f){s=!1;break}if(f=u.height,a===void 0)a=f;else if(a!==f){s=!1;break}delete u.width,delete u.height,u.transform===`none`&&delete u.transform}s&&i!==void 0&&a!==void 0&&(r.setKeyframes(n),s=getComputedStyle(r.target,r.pseudoElement),s.width!==i||s.height!==a)&&(s=n[0],s.width=i,s.height=a,s=n[n.length-1],s.width=i,s.height=a,r.setKeyframes(n))}}o()},function(e){l.__reactViewTransition===u&&(l.__reactViewTransition=null);try{if(typeof e==`object`&&e)switch(e.name){case`InvalidStateError`:(e.message===`View transition was skipped because document visibility state is hidden.`||e.message===`Skipping view transition because document visibility state has become hidden.`||e.message===`Skipping view transition because viewport size changed.`||e.message===`Transition was aborted because of invalid state`)&&(e=null)}e!==null&&c(e)}finally{r(),i(),o()}}),u.finished.finally(function(){for(var e=0;e<d.length;e++)d[e].cancel();l.__reactViewTransition===u&&(l.__reactViewTransition=null),s()}),u}catch{return r(),i(),o(),null}}function zp(e,t){this._scope=document.documentElement,this._selector=`::view-transition-`+e+`(`+t+`)`}zp.prototype.animate=function(e,t){return t=typeof t==`number`?{duration:t}:T({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},zp.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),r=[],i=0;i<n.length;i++){var a=n[i].effect;a!==null&&a.target===e&&a.pseudoElement===t&&r.push(n[i])}return r},zp.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function Bp(e){return{name:e,group:new zp(`group`,e),imagePair:new zp(`image-pair`,e),old:new zp(`old`,e),new:new zp(`new`,e)}}function Vp(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}Vp.prototype.addEventListener=function(e,t,n){var r=null,i=null;if(!(n!=null&&typeof n!=`boolean`&&(r=n.signal||null,r!==null&&r.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var a=this._eventListeners;if(Kp(a,e,t,n)===-1){var o=this,s=t;n!=null&&typeof n!=`boolean`&&!0===n.once&&(s=function(r){o.removeEventListener(e,t,n),typeof t==`function`?t.call(this,r):t.handleEvent(r)}),r!==null&&(i=o.removeEventListener.bind(o,e,t,n),r.addEventListener(`abort`,i,{once:!0}),i=r.removeEventListener.bind(r,`abort`,i)),r=Wp(n),a.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:s,cleanup:i}),p(this._fragmentFiber.child,!1,Hp,e,s,r)}this._eventListeners=a}};function Hp(e,t,n,r){return v(e).addEventListener(t,n,r),!1}Vp.prototype.removeEventListener=function(e,t,n){var r=this._eventListeners;if(r!==null&&(t=Kp(r,e,t,n),t!==-1)){var i=r[t];n=i.attachedListener;var a=i.cleanup;i=Wp(i.optionsOrUseCapture),p(this._fragmentFiber.child,!1,Up,e,n,i),r.splice(t,1),a!==null&&a()}};function Up(e,t,n,r){return v(e).removeEventListener(t,n,r),!1}function Wp(e){return e!=null&&typeof e!=`boolean`&&(!0===e.once||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Gp(e){return e==null?`c=0`:typeof e==`boolean`?`c=`+(e?`1`:`0`):`c=`+(e.capture?`1`:`0`)}function Kp(e,t,n,r){if(e.length===0)return-1;r=Gp(r);for(var i=0;i<e.length;i++){var a=e[i];if(a.type===t&&a.listener===n&&Gp(a.optionsOrUseCapture)===r)return i}return-1}Vp.prototype.dispatchEvent=function(e){var t=m(this._fragmentFiber);if(t===null)return!0;t=v(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var r=t.nodeType===9?t.createComment(``):document.createTextNode(``);if(n)for(var i=0;i<n.length;i++){var a=n[i];r.addEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture))}if(t.appendChild(r),e=r.dispatchEvent(e),n)for(i=0;i<n.length;i++)a=n[i],r.removeEventListener(a.type,a.attachedListener,Wp(a.optionsOrUseCapture));return t.removeChild(r),e}return t.dispatchEvent(e)},Vp.prototype.focus=function(e){p(this._fragmentFiber.child,!0,qp,e,void 0,void 0)};function qp(e,t){return e.tag!==6&&(e=v(e),ym(e,t))}Vp.prototype.focusLast=function(e){var t=[];p(this._fragmentFiber.child,!0,Jp,t,void 0,void 0);for(var n=t.length-1;0<=n&&!qp(t[n],e);n--);};function Jp(e,t){return t.push(e),!1}Vp.prototype.blur=function(){var e=m(this._fragmentFiber);e!==null&&(e=v(e),e=hp(e).activeElement,e!==null&&p(this._fragmentFiber.child,!1,Yp,e,void 0,void 0))};function Yp(e,t){return e.tag!==6&&(e=v(e),e===t||e.contains(t)?(t.blur(),!0):!1)}Vp.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),p(this._fragmentFiber.child,!1,Xp,e,void 0,void 0)};function Xp(e,t){return e.tag!==6&&(e=v(e),t.observe(e),!1)}Vp.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),p(this._fragmentFiber.child,!1,Zp,e,void 0,void 0);for(var n=t=0;n<Qp.length;n++){var r=Qp[n];r.fragmentInstance===this&&r.observer===e?e.unobserve(r.instance):Qp[t++]=r}Qp.length=t}};function Zp(e,t){return e.tag!==6&&(e=v(e),t.unobserve(e),!1)}var Qp=[],$p=!1;function em(e,t,n){Qp.push({fragmentInstance:e,observer:t,instance:n}),$p||($p=!0,bm(function(){$p=!1;var e=Qp;Qp=[];for(var t=0;t<e.length;t++){var n=e[t];n.observer.unobserve(n.instance)}}))}Vp.prototype.getClientRects=function(){var e=[];return p(this._fragmentFiber.child,!1,tm,e,void 0,void 0),e};function tm(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=v(e),t.push.apply(t,e.getClientRects());return!1}Vp.prototype.getRootNode=function(e){var t=m(this._fragmentFiber);return t===null?this:v(t).getRootNode(e)},Vp.prototype.compareDocumentPosition=function(e){var t=m(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];p(this._fragmentFiber.child,!1,Jp,n,void 0,void 0);var r=v(t);if(n.length===0){if(n=r,h(this._fragmentFiber)){a:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break a}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(n=t)}t=this._fragmentFiber;var i=r=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:r&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=g(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=v(n).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=v(n[0]),i=v(n[n.length-1]);var a=h(this._fragmentFiber)?t.parentElement:r;if(a==null)return Node.DOCUMENT_POSITION_DISCONNECTED;r=a.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,a=a.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var o=t.compareDocumentPosition(e),s=i.compareDocumentPosition(e),c=o&Node.DOCUMENT_POSITION_CONTAINED_BY||s&Node.DOCUMENT_POSITION_CONTAINED_BY;return s=r&&a&&o&Node.DOCUMENT_POSITION_FOLLOWING&&s&Node.DOCUMENT_POSITION_PRECEDING,t=r&&t===e||a&&i===e||c||s?Node.DOCUMENT_POSITION_CONTAINED_BY:!r&&t===e||!a&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:o,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||nm(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function nm(e,t,n,r,i){var a=Pt(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!a)a:{for(;a!==null;){if(a.tag===7&&(a===t||a.alternate===t)){n=!0;break a}a=a.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(a===null)return a=i.ownerDocument,i===a||i===a.documentElement||i===a.body;a:{for(a=t,t=m(t);a!==null;){if(!(a.tag!==5&&a.tag!==3&&a.tag!==27||a!==t&&a.alternate!==t)){a=!0;break a}a=a.return}a=!1}return a}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!a)&&!(t=a===n)&&(t=w(n,a,C),t===null?t=!1:(p(t,!0,x,a,n),a=y,y=null,t=a!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!a)&&!(t=a===r)&&(t=w(r,a,C),t===null?t=!1:(p(t,!0,S,a,r),a=y,b=y=null,t=a!==null)),t):!1}function rm(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}Vp.prototype.scrollIntoView=function(e){if(typeof e==`object`)throw Error(a(566));var t=[];p(this._fragmentFiber.child,!1,Jp,t,void 0,void 0);var n=!1!==e;if(t.length===0){var r=g(this._fragmentFiber);if(r=n?r[1]||r[0]||m(this._fragmentFiber):r[0]||r[1],r===null)return;if(r.tag===6){e=v(r),rm(e,n);return}if(r=v(r),r.nodeType!==9){if(r.nodeType===11){n=`host`in r?r.host:null,n!==null&&n.scrollIntoView(e);return}r.scrollIntoView(e)}}for(r=n?t.length-1:0;r!==(n?-1:t.length);){var i=t[r];i.tag===6?(i=v(i),rm(i,n)):v(i).scrollIntoView(e),r+=n?-1:1}};function im(e,t){return e=v(e),am(e,t),!1}function am(e,t){e.reactFragments??=new Set,e.reactFragments.add(t)}function om(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.addEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){for(var r=0,i=0;i<Qp.length;i++){var a=Qp[i];(a.fragmentInstance!==t||a.observer!==n||a.instance!==e)&&(Qp[r++]=a)}Qp.length=r,n.observe(e)}),am(e,t))}function sm(e,t){var n=t._eventListeners;if(n!==null)for(var r=0;r<n.length;r++){var i=n[r];e.removeEventListener(i.type,i.attachedListener,Wp(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(n){typeof n.rootMargin==`string`?em(t,n,e):n.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function cm(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case`HTML`:case`HEAD`:case`BODY`:cm(n),Nt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function lm(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[jt])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==i.rel||e.getAttribute(`href`)!==(i.href==null||i.href===``?null:i.href)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute(`title`)!==(i.title==null?null:i.title))break;return e;case`style`:if(e.hasAttribute(`data-precedence`))break;return e;case`script`:if(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=hm(e.nextSibling),e===null)break}return null}function um(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=hm(e.nextSibling),e===null))return null;return e}function dm(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=hm(e.nextSibling),e===null))return null;return e}function fm(e){return e.data===`$?`||e.data===`$~`}function pm(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function mm(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function hm(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t===`$`||t===`$!`||t===`$?`||t===`$~`||t===`&`||t===`F!`||t===`F`)break;if(t===`/$`||t===`/&`)return null}}return e}var gm=null;function _m(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return hm(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function vm(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`$`||n===`$!`||n===`$?`||n===`$~`||n===`&`){if(t===0)return e;t--}else n!==`/$`&&n!==`/&`||t++}e=e.previousSibling}return null}function ym(e,t){function n(){r=!0}if(e.ownerDocument.activeElement===e)return!0;var r=!1;try{e.ownerDocument.addEventListener(`focus`,n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener(`focus`,n,!0)}return r}function bm(e){Tp(function(){Tp(function(t){return e(t)})})}function xm(e,t,n){switch(t=hp(n),e){case`html`:if(e=t.documentElement,!e)throw Error(a(452));return e;case`head`:if(e=t.head,!e)throw Error(a(453));return e;case`body`:if(e=t.body,!e)throw Error(a(454));return e;default:throw Error(a(451))}}function Sm(e,t,n){for(var r in n){var i=n[r];n.hasOwnProperty(r)&&i!=null&&op(e,t,r,null,lp,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=``),e.onclick===yn&&(e.onclick=null),Nt(e)}function Cm(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Nt(e)}var wm=new Map,Tm=new Set;function Em(e){if(typeof e.getRootNode==`function`){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var Dm=N.d;N.d={f:Om,r:km,D:Mm,C:Nm,L:Pm,m:Fm,X:Lm,S:Im,M:Rm};function Om(){var e=Dm.f(),t=Wd();return e||t}function km(e){var t=Ft(e);t!==null&&t.tag===5&&t.type===`form`?ic(t):Dm.r(e)}var Am=typeof document>`u`?null:document;function jm(e,t,n){var r=Am;if(r&&typeof t==`string`&&t){var i=rn(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),Tm.has(i)||(Tm.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),cp(t,`link`,e),Rt(t),r.head.appendChild(t)))}}function Mm(e){Dm.D(e),jm(`dns-prefetch`,e,null)}function Nm(e,t){Dm.C(e,t),jm(`preconnect`,e,t)}function Pm(e,t,n){Dm.L(e,t,n);var r=Am;if(r&&e&&t){var i=`link[rel="preload"][as="`+rn(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+rn(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+rn(n.imageSizes)+`"]`)):i+=`[href="`+rn(e)+`"]`;var a=i;switch(t){case`style`:a=Bm(e);break;case`script`:a=Wm(e)}if(!(wm.has(a)||(e=T({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),wm.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(Vm(a))||t===`script`&&r.querySelector(Gm(a))))){var o=r.createElement(`link`);cp(o,`link`,e),t===`style`&&(o[Mt]=!0,o.onload=o.onerror=function(){zt(o)}),Rt(o),r.head.appendChild(o)}}}function Fm(e,t){Dm.m(e,t);var n=Am;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+rn(r)+`"][href="`+rn(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Wm(e)}if(!wm.has(a)&&(e=T({rel:`modulepreload`,href:e},t),wm.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Gm(a)))return}r=n.createElement(`link`),cp(r,`link`,e),Rt(r),n.head.appendChild(r)}}}function Im(e,t,n){Dm.S(e,t,n);var r=Am;if(r&&e){var i=Lt(r).hoistableStyles,a=Bm(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(Vm(a)))s.loading=5;else{e=T({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=wm.get(a))&&Jm(e,n);var c=o=r.createElement(`link`);Rt(c),cp(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,qm(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Lm(e,t){Dm.X(e,t);var n=Am;if(n&&e){var r=Lt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Rt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Rm(e,t){Dm.M(e,t);var n=Am;if(n&&e){var r=Lt(n).hoistableScripts,i=Wm(e),a=r.get(i);a||(a=n.querySelector(Gm(i)),a||(e=T({src:e,async:!0,type:`module`},t),(t=wm.get(i))&&Ym(e,t),a=n.createElement(`script`),Rt(a),cp(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function zm(e,t,n,r){var i=(i=we.current)?Em(i):null;if(!i)throw Error(a(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(n=Bm(n.href),t=Lt(i).hoistableStyles,r=t.get(n),r||(r={type:`style`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Bm(n.href);var o=Lt(i).hoistableStyles,s=o.get(e);if(s||(i=i.ownerDocument||i,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=i.querySelector(Vm(e)))?o._p||(s.instance=o,s.state.loading=5):(o=wm.get(e),o||(o={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},wm.set(e,o)),Um(i,e,o,s.state))),t&&r===null)throw Error(a(528,``));return s}if(t&&r!==null)throw Error(a(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(n=Wm(n),t=Lt(i).hoistableScripts,r=t.get(n),r||(r={type:`script`,instance:null,count:0,state:null},t.set(n,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(a(444,e))}}function Bm(e){return`href="`+rn(e)+`"`}function Vm(e){return`link[rel="stylesheet"][`+e+`]`}function Hm(e){return T({},e,{"data-precedence":e.precedence,precedence:null})}function Um(e,t,n,r){if(t=e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)){if(!0!==t[Mt]){r.loading=1;return}}else t=e.createElement(`link`),t[Mt]=!0,t.onload=t.onerror=zt.bind(null,t),cp(t,`link`,n),Rt(t),e.head.appendChild(t);r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2})}function Wm(e){return`[src="`+rn(e)+`"]`}function Gm(e){return`script[async]`+e}function Km(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+rn(n.href)+`"]`);if(r)return t.instance=r,Rt(r),r;var i=T({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Rt(r),cp(r,`style`,i),qm(r,n.precedence,e),t.instance=r;case`stylesheet`:i=Bm(n.href);var o=e.querySelector(Vm(i));if(o)return t.state.loading|=4,t.instance=o,Rt(o),o;r=Hm(n),(i=wm.get(i))&&Jm(r,i),o=(e.ownerDocument||e).createElement(`link`),Rt(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),cp(o,`link`,r),t.state.loading|=4,qm(o,n.precedence,e),t.instance=o;case`script`:return o=Wm(n.src),(i=e.querySelector(Gm(o)))?(t.instance=i,Rt(i),i):(r=n,(i=wm.get(o))&&(r=T({},n),Ym(r,i)),e=e.ownerDocument||e,i=e.createElement(`script`),Rt(i),cp(i,`link`,r),e.head.appendChild(i),t.instance=i);case`void`:return null;default:throw Error(a(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,qm(r,n.precedence,e));return t.instance}function qm(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Jm(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function Ym(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Xm=null;function Zm(e,t,n){if(Xm===null){var r=new Map,i=Xm=new Map;i.set(n,r)}else i=Xm,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[jt]||a[wt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Qm(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function $m(e,t,n){if(n===1||t.itemProp!=null)return!1;switch(e){case`meta`:case`title`:return!0;case`style`:if(typeof t.precedence!=`string`||typeof t.href!=`string`||t.href===``)break;return!0;case`link`:if(typeof t.rel!=`string`||typeof t.href!=`string`||t.href===``||t.onLoad||t.onError)break;switch(t.rel){case`stylesheet`:return e=t.disabled,typeof t.precedence==`string`&&e==null;default:return!0}case`script`:if(t.async&&typeof t.async!=`function`&&typeof t.async!=`symbol`&&!t.onLoad&&!t.onError&&t.src&&typeof t.src==`string`)return!0}return!1}function eh(e,t){return e===`img`&&t.src!=null&&t.src!==``&&t.onLoad==null&&t.loading!==`lazy`}function th(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function nh(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio==`number`?devicePixelRatio:1)*.25}function rh(e,t){typeof t.decode==`function`&&(e.imgCount++,t.complete||(e.imgBytes+=nh(t),e.suspenseyImages.push(t)),e=lh.bind(e),t.decode().then(e,e))}function ih(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Bm(r.href),a=t.querySelector(Vm(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=ch.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Rt(a);return}a=t.ownerDocument||t,r=Hm(r),(i=wm.get(i))&&Jm(r,i),a=a.createElement(`link`),Rt(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),cp(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=ch.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var ah=0;function oh(e,t){return e.stylesheets&&e.count===0&&dh(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&ah===0&&(ah=62500*fp());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&dh(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>ah?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function sh(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)dh(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function ch(){this.count--,sh(this)}function lh(){this.imgCount--,sh(this)}var uh=null;function dh(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,uh=new Map,t.forEach(fh,e),uh=null,ch.call(e))}function fh(e,t){if(!(t.state.loading&4)){var n=uh.get(e);if(n)var r=n.get(null);else{n=new Map,uh.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=ch.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ph={$$typeof:ne,Provider:null,Consumer:null,_currentValue:_e,_currentValue2:_e,_threadCount:0};function mh(e,t,n,r,i,a,o,s,c){this.tag=1,this.containerInfo=e,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=pt(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=pt(0),this.hiddenUpdates=pt(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.transitionTypes=null,this.incompleteTransitions=new Map}function hh(e,t,n,r,i,a,o,s,c,l,u,d){return e=new mh(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=Ni(3,null,null,t),e.current=a,a.stateNode=e,t=Ma(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},ho(a),e}function gh(e){return e?(e=ji,e):ji}function _h(e,t,n,r,i,a){i=gh(i),r.context===null?r.context=i:r.pendingContext=i,r=_o(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=vo(e,r,t),n!==null&&(zd(n,e,t),yo(n,e,t))}function vh(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function yh(e,t){vh(e,t),(e=e.alternate)&&vh(e,t)}function bh(e){if(e.tag===13||e.tag===31){var t=Oi(e,67108864);t!==null&&zd(t,e,67108864),yh(e,67108864)}}function xh(e){if(e.tag===13||e.tag===31){var t=Id();t=yt(t);var n=Oi(e,t);n!==null&&zd(n,e,t),yh(e,t)}}var Sh=!0;function Ch(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=2,Th(e,t,n,r)}finally{N.p=a,M.T=i}}function wh(e,t,n,r){var i=M.T;M.T=null;var a=N.p;try{N.p=8,Th(e,t,n,r)}finally{N.p=a,M.T=i}}function Th(e,t,n,r){if(Sh){var i=Eh(r);if(i===null)Zf(e,t,r,Dh,n),Rh(e,r);else if(Bh(i,e,t,n,r))r.stopPropagation();else if(Rh(e,r),t&4&&-1<Lh.indexOf(e)){for(;i!==null;){var a=Ft(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=st(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-et(o);s.entanglements[1]|=c,o&=~c}jf(a),!(H&6)&&(xd=Ve()+500,Mf(0,!1))}}break;case 31:case 13:s=Oi(a,2),s!==null&&zd(s,a,2),Wd(),yh(a,2)}if(a=Eh(r),a===null&&Zf(e,t,r,Dh,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else Zf(e,t,r,null,n)}}function Eh(e){return e=xn(e),Oh(e)}var Dh=null;function Oh(e){if(Dh=null,e=Pt(e),e!==null){var t=s(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=c(t),e!==null)return e;e=null}else if(n===31){if(e=l(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Dh=e,null}function kh(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`fullscreenerror`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`resize`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(He()){case Ue:return 2;case We:return 8;case Ge:case Ke:return 32;case qe:return 268435456;default:return 32}default:return 32}}var Ah=!1,jh=null,Mh=null,Nh=null,Ph=new Map,Fh=new Map,Ih=[],Lh=`mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset`.split(` `);function Rh(e,t){switch(e){case`focusin`:case`focusout`:jh=null;break;case`dragenter`:case`dragleave`:Mh=null;break;case`mouseover`:case`mouseout`:Nh=null;break;case`pointerover`:case`pointerout`:Ph.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:Fh.delete(t.pointerId)}}function zh(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=Ft(t),t!==null&&bh(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Bh(e,t,n,r,i){switch(t){case`focusin`:return jh=zh(jh,e,t,n,r,i),!0;case`dragenter`:return Mh=zh(Mh,e,t,n,r,i),!0;case`mouseover`:return Nh=zh(Nh,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return Ph.set(a,zh(Ph.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,Fh.set(a,zh(Fh.get(a)||null,e,t,n,r,i)),!0}return!1}function Vh(e){var t=Pt(e.target);if(t!==null){var n=s(t);if(n!==null){if(t=n.tag,t===13){if(t=c(n),t!==null){e.blockedOn=t,St(e.priority,function(){xh(n)});return}}else if(t===31){if(t=l(n),t!==null){e.blockedOn=t,St(e.priority,function(){xh(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Hh(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=Eh(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);bn=r,n.target.dispatchEvent(r),bn=null}else return t=Ft(n),t!==null&&bh(t),e.blockedOn=n,!1;t.shift()}return!0}function Uh(e,t,n){Hh(e)&&n.delete(t)}function Wh(){Ah=!1,jh!==null&&Hh(jh)&&(jh=null),Mh!==null&&Hh(Mh)&&(Mh=null),Nh!==null&&Hh(Nh)&&(Nh=null),Ph.forEach(Uh),Fh.forEach(Uh)}function Gh(e,n){e.blockedOn===n&&(e.blockedOn=null,Ah||(Ah=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,Wh)))}var Kh=null;function qh(e){Kh!==e&&(Kh=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){Kh===e&&(Kh=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(Oh(r||n)===null)continue;break}var a=Ft(n);a!==null&&(e.splice(t,3),t-=3,nc(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Jh(e){function t(t){return Gh(t,e)}jh!==null&&Gh(jh,e),Mh!==null&&Gh(Mh,e),Nh!==null&&Gh(Nh,e),Ph.forEach(t),Fh.forEach(t);for(var n=0;n<Ih.length;n++){var r=Ih[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ih.length&&(n=Ih[0],n.blockedOn===null);)Vh(n),n.blockedOn===null&&Ih.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[Tt]||null;if(typeof a==`function`)o||qh(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[Tt]||null)s=o.formAction;else if(Oh(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),qh(n)}}}function Yh(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Xh(e){this._internalRoot=e}Zh.prototype.render=Xh.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(a(409));var n=t.current;_h(n,Id(),e,t,null,null)},Zh.prototype.unmount=Xh.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;_h(e.current,2,null,e,null,null),Wd(),t[Et]=null}};function Zh(e){this._internalRoot=e}Zh.prototype.unstable_scheduleHydration=function(e){if(e){var t=xt();e={blockedOn:null,target:e,priority:t};for(var n=0;n<Ih.length&&t!==0&&t<Ih[n].priority;n++);Ih.splice(n,0,e),n===0&&Vh(e)}};var Qh=n.version;if(Qh!==`19.3.0`)throw Error(a(527,Qh,`19.3.0`));N.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(a(188)):(e=Object.keys(e).join(`,`),Error(a(268,e)));return e=d(t),e=e===null?null:f(e),e=e===null?null:e.stateNode,e};var $h={bundleType:0,version:`19.3.0`,rendererPackageName:`react-dom`,currentDispatcherRef:M,reconcilerVersion:`19.3.0`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var eg=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!eg.isDisabled&&eg.supportsFiber)try{Xe=eg.inject($h),Ze=eg}catch{}}e.createRoot=function(e,t){if(!o(e))throw Error(a(299));var n=!1,r=``,i=Tc,s=Ec,c=Dc;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=hh(e,1,!1,null,null,n,r,null,i,s,c,Yh),e[Et]=t.current,Yf(e),new Xh(t)}})),dt=n(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=ut()})),ft=n((e=>{var t=r().__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;e.c=function(e){return t.H.useMemoCache(e)}})),pt=n(((e,t)=>{t.exports=ft()})),mt=50,ht=new Map,gt=new Set,_t=e=>{gt.has(e)||(gt.add(e),console.warn(`[intlayer] \`Intl.${e}\` is not available in this JavaScript engine. A degraded fallback is used instead. On React Native, load a polyfill (e.g. \`@formatjs/intl-${e.toLowerCase()}/polyfill\`) before rendering your app.`))},vt={DisplayNames:class{of(e){return e}},ListFormat:class{format(e){return Array.from(e).join(`, `)}formatToParts(e){return Array.from(e).flatMap((e,t)=>t===0?[{type:`element`,value:e}]:[{type:`literal`,value:`, `},{type:`element`,value:e}])}},Segmenter:class{segment(e){let t=0;return Array.from(e).map(e=>{let n=t;return t+=e.length,{segment:e,index:n}})}}},yt=e=>{let t=Intl[e];return typeof t==`function`?t:(_t(e),vt[e])};function bt(e,t,n){let r=t??Te?.defaultLocale,i=`${r}|${n?JSON.stringify(n):``}`,a=e,o=ht.get(a);o||(o=new Map,ht.set(a,o));let s=o.get(i);if(!s){let t=typeof e==`string`?yt(e):e;if(typeof t!=`function`)throw Error(`[intlayer] \`Intl.${String(e)}\` is not available in this JavaScript engine and has no fallback. Load the matching polyfill before formatting.`);o.size>mt&&o.clear(),s=new t(r,n),o.set(i,s)}return s}var xt={Collator:function(e,t){return bt(`Collator`,e,t)},DateTimeFormat:function(e,t){return bt(`DateTimeFormat`,e,t)},DisplayNames:function(e,t){return bt(`DisplayNames`,e,t)},ListFormat:function(e,t){return bt(`ListFormat`,e,t)},NumberFormat:function(e,t){return bt(`NumberFormat`,e,t)},PluralRules:function(e,t){return bt(`PluralRules`,e,t)},RelativeTimeFormat:function(e,t){return bt(`RelativeTimeFormat`,e,t)},Segmenter:function(e,t){return bt(`Segmenter`,e,t)}},St=`https://back.intlayer.org`,Ct=`modulepreload`,wt=function(e){return`/`+e},Tt={},Et=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=function(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))},i=function(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href},a=document.getElementsByTagName(`link`),o=document.querySelector(`meta[property=csp-nonce]`),s=o?.nonce||o?.getAttribute(`nonce`);r=e(t.map(e=>{if(e=wt(e,n),e=i(e),e in Tt)return;Tt[e]=!0;let t=e.endsWith(`.css`);for(let n=a.length-1;n>=0;n--){let r=a[n];if(r.href===e&&(!t||r.rel===`stylesheet`))return}let r=document.createElement(`link`);if(r.rel=t?`stylesheet`:Ct,t||(r.as=`script`),r.crossOrigin=``,r.href=e,s&&r.setAttribute(`nonce`,s),document.head.appendChild(r),t)return new Promise((t,n)=>{r.addEventListener(`load`,t),r.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${e}`)))})}).filter(e=>e!==void 0))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},Dt=(e,t)=>{let n=typeof t==`object`&&t?t.locale:t;return f(e,t,p(n))},Ot=e=>typeof e==`object`&&e?.key!==void 0&&e?.props!==void 0,kt=(e,t)=>e.every((e,n)=>t[n]&&t[n].key===e.key&&t[n].type===e.type),At=e=>{if(!e||typeof e!=`string`)return``;let t=e.replace(/([a-z])([A-Z])/g,`$1 $2`).replace(/([A-Z]+)([A-Z][a-z])/g,`$1 $2`);return t.charAt(0).toUpperCase()+t.slice(1).toLowerCase()},jt=[`Arab`,`Hebr`,`Thaa`,`Syrc`,`Mand`,`Adlm`,`Rohg`,`Nkoo`],Mt=e=>{if(!e)return`ltr`;try{let t=new Intl.Locale(e);if(`getTextInfo`in t)return t.getTextInfo().direction;if(`textInfo`in t)return t.textInfo.direction;let n=t.maximize();return jt.includes(n.script??``)?`rtl`:`ltr`}catch{return`ltr`}},Nt=(e,t=e)=>new xt.DisplayNames(t,{type:`language`}).of(e)??`Unknown locale`,Pt=(e,t,n)=>{let r=e,i=null,a=[];if(t.length===0)return n;try{for(let e=0;e<t.length;e++){let o=t[e];if(i=r,(o?.type===`object`||o?.type===`array`)&&(a=[o.key],(!r[o.key]||typeof r[o.key]!=`object`)&&(r[o.key]={}),r=r[o.key]),(o?.type===`translation`||o?.type===`enumeration`||o?.type===`plural`||o?.type===`gender`||o?.type===`select`)&&(a=[o.type,o.key],(!r[o.type]||typeof r[o.type]!=`object`)&&(r[o.type]={}),(!r[o.type][o.key]||typeof r[o.type][o.key]!=`object`)&&(r[o.type][o.key]={}),r=r[o.type][o.key]),(o?.type===`enumeration`||o?.type===`plural`||o?.type===`condition`)&&o.type!==`enumeration`&&o.type!==`plural`&&(a=[o.type,o.key],r=r[o.type][o.key]),(o?.type===`markdown`||o?.type===`html`||o?.type===`insertion`)&&(a=[o.type],r[o.type]??(r[o.type]=``),r=r[o.type]),o?.type===`file`&&(a=[`content`],r=r.content),e===t.length-1&&i&&a.length>0){let e=i;for(let t of a.slice(0,-1))e=e[t];let t=a[a.length-1];if(n===void 0){if(Array.isArray(e)){let n=Number(t);!Number.isNaN(n)&&n>=0&&n<e.length&&e.splice(n,1)}else delete e[t]}else e[t]=n}}return e}catch(r){return console.error(`Cannot edit dictionary by key path`,{dictionaryContent:e,keyPath:t,newValue:n},r),e}},Ft=(e,t,n)=>{let r=structuredClone(e);for(let e of t)n&&r?.nodeType===`translation`&&(r=r?.[ye]?.[n]),(e.type===`object`||e.type===`array`)&&(r=r?.[e.key]),(e.type===`translation`||e.type===`condition`||e.type===`enumeration`||e.type===`plural`||e.type===`gender`||e.type===`select`)&&(r=r?.[e.type]?.[e.key]),(e.type===`markdown`||e.type===`html`||e.type===`insertion`||e.type===`file`)&&(r=r?.[e.type]);return r},It=(e,t,n)=>{let r=structuredClone(n);switch(e){case ye:return{nodeType:ye,[ye]:Object.assign({},...t.map(e=>({[e]:structuredClone(r)??``})))};case h:return{nodeType:h,[h]:{1:r??``}};case _:return{nodeType:_,[_]:{one:r??``,other:r??``}};case re:return{nodeType:re,[re]:{true:r??``,false:r??``}};case D:return{nodeType:D,[D]:{male:r??``,female:r??``,fallback:r??``}};case C:return{nodeType:C,[C]:{case1:r??``,fallback:r??``}};case ot:return{nodeType:ot,[ot]:{insertion:r??``}};case pe:return{nodeType:pe,[pe]:{dictionaryKey:``}};case l:return{nodeType:l,[l]:r??``};case se:return{nodeType:se,[se]:r??``,customComponents:[]};case x:return{nodeType:x,[x]:r??``};case he:return{newKey:r??``};case k:return[r??``];case M:return r??``;case de:return r??0;case A:return r??!0;default:return r??``}},Lt=e=>{if(typeof e==`string`)return``;if(typeof e==`number`)return 0;if(typeof e==`boolean`)return!0;if(typeof e?.nodeType==`string`){let t=e,n=t[t.nodeType];return t.nodeType===`translation`||t.nodeType===`enumeration`||t.nodeType===`plural`||t.nodeType===`condition`||t.nodeType===`insertion`||t.nodeType===`gender`||t.nodeType===`select`||t.nodeType===`html`?Lt(n):t.nodeType===`nested`?`dictionary-key`:t.nodeType===`file`?`file/path`:t.nodeType===`markdown`?Lt(n):n}if(!e||typeof e!=`object`)return e;if(Array.isArray(e))return e.map(Lt);let t=Object.entries(e).map(([e,t])=>[e,Lt(t)]);return Object.fromEntries(t)},Rt=e=>{if(typeof e==`string`||typeof e==`number`||typeof e==`boolean`)return e;if(typeof e?.nodeType==`string`){let t=e,n=t[t.nodeType];return t.nodeType===`markdown`||t.nodeType===`html`?n:t.nodeType===`translation`||t.nodeType===`enumeration`||t.nodeType===`plural`||t.nodeType===`condition`||t.nodeType===`insertion`||t.nodeType===`gender`||t.nodeType===`select`||t.nodeType===`file`?n[Object.keys(n)[0]]:t.nodeType===`nested`?void 0:n}return!e||typeof e!=`object`?e:Array.isArray(e)?e[0]:e},zt=e=>typeof e==`object`&&!!e&&`nodeType`in e&&typeof e.nodeType==`string`,Bt={[ye]:!0,[h]:!0,[_]:!0,[re]:!0,[ot]:!0,[x]:!0,[he]:!0,[k]:!0,[pe]:!0,[Ke]:!0,[T]:!0,[_e]:!0,[l]:!0,[se]:!0,[M]:!0,[de]:!0,[A]:!0,[D]:!0,[C]:!0,[y]:!0,[ae]:!0},Vt=e=>Object.hasOwn(Bt,e),Ht=e=>{if(typeof e==`string`)return M;if(zt(e)){let t=e.nodeType;return Vt(t)?t:ae}return Array.isArray(e)?k:Ot(e)?Ke:typeof e==`number`?de:typeof e==`boolean`?A:e&&typeof e==`object`?he:e===null?y:ae},Ut=(e,t,n)=>{let r=e,i=null,a=null;for(let e of n)i=r,(e.type===`object`||e.type===`array`)&&(a=e.key,r=r[e.key]),(e.type===`translation`||e.type===`enumeration`||e.type===`plural`||e.type===`condition`||e.type===`gender`||e.type===`select`)&&(a=e.type,r=r[e.type][e.key]),(e.type===`markdown`||e.type===`reactNode`||e.type===`html`||e.type===`insertion`||e.type===`file`)&&(a=e.type,r=r[e.type]);if(i&&a!==null){if(Array.isArray(i))i[a]=r;else{let e={};for(let n of Object.keys(i))n===a&&t!==void 0?e[t]=r:e[n]=i[n];Object.keys(i).forEach(e=>{delete i[e]}),Object.assign(i,e)}}return e},L=t(r(),1),Wt=(e,t)=>{let{locale:n,variant:r}=(0,L.useContext)(u)??{},i=t??n,a=typeof i==`object`&&i?`${i.locale??``}|${Ie(i)}`:i;return(0,L.useMemo)(()=>Dt(e,i),[e.key,a])},{defaultLocale:Gt,locales:Kt}=Te??{},R=({isCookieEnabled:e,onLocaleChange:t}={})=>{let{locale:n,setLocale:r,isCookieEnabled:i}=(0,L.useContext)(u)??{};return{locale:n,defaultLocale:Gt,availableLocales:Kt,setLocale:(0,L.useCallback)(n=>{if(!Kt?.map(String).includes(n)){console.error(`Locale ${n} is not available`);return}r(n),le(n,e??i??!0),t?.(n)},[Kt,t,r,e])}},qt=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Jt=/^[\\/]{2}/;function Yt(e,t){return t+e.replace(/\\/g,`/`)}var Xt=`popstate`;function Zt(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function Qt(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return rn(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:an(t)}return sn(t,n,null,e)}function $t(e,t){if(e===!1||e==null)throw Error(t)}function en(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function tn(){return Math.random().toString(36).substring(2,10)}function nn(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function rn(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?on(t):t,state:n,key:t&&t.key||r||tn(),mask:i}}function an({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function on(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function sn(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=Zt(e)?e:rn(h.location,e,t);n&&n(r,e),l=u()+1;let d=nn(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=Zt(e)?e:rn(h.location,e,t);n&&n(r,e),l=u();let i=nn(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return cn(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(Xt,d),c=e,()=>{i.removeEventListener(Xt,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function cn(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),$t(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:an(t);return i=i.replace(/ $/,`%20`),!n&&Jt.test(i)&&(i=r+i),new URL(i,r)}function ln(e,t,n=`/`){return un(e,t,n,!1)}function un(e,t,n,r,i){let a=kn((typeof t==`string`?on(t):t).pathname||`/`,n);if(a==null)return null;let o=i??dn(e),s=null,c=On(a);for(let e=0;s==null&&e<o.length;++e)s=wn(o[e],c,r);return s}function dn(e){let t=fn(e);return mn(t),t}function fn(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;$t(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ln([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&($t(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),fn(e.children,t,u,l,o)),(e.path!=null||e.index)&&t.push({path:l,score:Sn(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Dn(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of pn(e.path))a(e,t,!0,n)}),t}function pn(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=pn(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function mn(e){e.sort((e,t)=>e.score===t.score?Cn(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var hn=/^:[\w-]+$/,gn=3,_n=2,vn=1,yn=10,bn=-2,xn=e=>e===`*`;function Sn(e,t){let n=e.split(`/`),r=n.length;return n.some(xn)&&(r+=bn),t&&(r+=_n),n.filter(e=>!xn(e)).reduce((e,t)=>e+(hn.test(t)?gn:t===``?vn:yn),r)}function Cn(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function wn(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?En(u,l,s.matcher,s.compiledParams):Tn(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=Tn({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Ln([a,d.pathname]),pathnameBase:zn(Ln([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Ln([a,d.pathnameBase]))}return o}function Tn(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Dn(e.path,e.caseSensitive,e.end);return En(e,t,n,r)}function En(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=Rn(a,1),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=Rn(a.slice(0,a.length-e.length),1)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Dn(e,t=!1,n=!0){en(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function On(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return en(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function kn(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function An(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?on(e):e,a;return n?(n=In(n),a=n.startsWith(`/`)||n.startsWith(`\\`)?jn(n.substring(1),`/`):jn(n,t)):a=t,{pathname:a,search:Bn(r),hash:Vn(i)}}function jn(e,t){let n=Rn(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Mn(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function Nn(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Pn(e){let t=Nn(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function Fn(e,t,n,r=!1){let i;typeof e==`string`?i=on(e):(i={...e},$t(!i.pathname||!i.pathname.includes(`?`),Mn(`?`,`pathname`,`search`,i)),$t(!i.pathname||!i.pathname.includes(`#`),Mn(`#`,`pathname`,`hash`,i)),$t(!i.search||!i.search.includes(`#`),Mn(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=An(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var In=e=>e.replace(/[\\/]{2,}/g,`/`),Ln=e=>In(e.join(`/`));function Rn(e,t=0){let n=e.length;for(;n>t&&e.charCodeAt(n-1)===47;)n--;return n===e.length?e:e.slice(0,n)}var zn=e=>Rn(e).replace(/^\/*/,`/`),Bn=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Vn=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Hn=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Un(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function Wn(e){return Ln(e.map(e=>e.route.path).filter(Boolean))||`/`}var Gn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Kn(e,t){let n=e;if(typeof n!=`string`||!qt.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Gn)try{let e=new URL(window.location.href),r=Jt.test(n)?new URL(Yt(n,e.protocol)):new URL(n),a=kn(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{en(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var qn=new URL(`http://localhost`);function Jn(e){if(e.createURL)return e.createURL(`/`);try{return new URL(e.createHref(`/`),qn)}catch{return qn}}function Yn(e,t){return e.origin===t.origin&&(e.origin!==`null`||e.protocol===t.protocol&&e.host===t.host)}function Xn(e,t){if(e.startsWith(`//`))return!0;let n=t.protocol.toLowerCase();return e.toLowerCase().startsWith(n)?t.host===``||e.slice(n.length).startsWith(`//`):!1}function Zn(e,t,n,r){let i=null;try{i=e==null?null:new URL(e,n)}catch{}let a=new URL(t,n),o=i!=null&&!Yn(i,n),s=!Yn(a,n);if(r===`reject`){if(o||s)throw Error(`External navigation is not allowed`)}else if(s&&(i==null||!Xn(e,i)||!Yn(i,a)))throw Error(`External navigation is not allowed`)}var Qn=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(Qn);var $n=[`GET`,...Qn];new Set($n);var er=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function tr(e){try{return er.includes(new URL(e).protocol)}catch{return!1}}var nr=L.createContext(null);nr.displayName=`DataRouter`;var rr=L.createContext(null);rr.displayName=`DataRouterState`;var ir=L.createContext(!1);function ar(){return L.useContext(ir)}var or=L.createContext({isTransitioning:!1});or.displayName=`ViewTransition`;var sr=L.createContext(new Map);sr.displayName=`Fetchers`;var cr=L.createContext(null);cr.displayName=`Await`;var lr=L.createContext(null);lr.displayName=`Navigation`;var ur=L.createContext(null);ur.displayName=`Location`;var dr=L.createContext({outlet:null,matches:[],isDataRoute:!1});dr.displayName=`Route`;var fr=L.createContext(null);fr.displayName=`RouteError`;var pr=`REACT_ROUTER_ERROR`,mr=`REDIRECT`,hr=`ROUTE_ERROR_RESPONSE`;function gr(e){if(e.startsWith(`${pr}:${mr}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function _r(e){if(e.startsWith(`${pr}:${hr}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Hn(t.status,t.statusText,t.data)}catch{}}function vr(e,{relative:t}={}){$t(yr(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=L.useContext(lr),{hash:i,pathname:a,search:o}=Tr(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ln([n,a])),r.createHref({pathname:s,search:o,hash:i})}function yr(){return L.useContext(ur)!=null}function br(){return $t(yr(),`useLocation() may be used only in the context of a <Router> component.`),L.useContext(ur).location}var xr=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function Sr(e){L.useContext(lr).static||L.useLayoutEffect(e)}function Cr(){let{isDataRoute:e}=L.useContext(dr);return e?Hr():wr()}function wr(){$t(yr(),`useNavigate() may be used only in the context of a <Router> component.`);let e=L.useContext(nr),{basename:t,navigator:n}=L.useContext(lr),{matches:r}=L.useContext(dr),{pathname:i}=br(),a=JSON.stringify(Pn(r)),o=L.useRef(!1);return Sr(()=>{o.current=!0}),L.useCallback((r,s={})=>{if(en(o.current,xr),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=Fn(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ln([t,c.pathname])),Zn(typeof r==`string`?r:an(r),n.createHref(c),Jn(n),`reject`),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}L.createContext(null);function Tr(e,{relative:t}={}){let{matches:n}=L.useContext(dr),{pathname:r}=br(),i=JSON.stringify(Pn(n));return L.useMemo(()=>Fn(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function Er(e,t){return Dr(e,t)}function Dr(e,t,n){$t(yr(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=L.useContext(lr),{matches:i}=L.useContext(dr),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Wr(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
11
|
-
|
|
12
|
-
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=br(),d;if(t){let e=typeof t==`string`?on(t):t;$t(c===`/`||e.pathname?.startsWith(c),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):ln(e,{pathname:p});en(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),en(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let h=Pr(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ln([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ln([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?L.createElement(ur.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function Or(){let e=Vr(),t=Un(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=L.createElement(L.Fragment,null,L.createElement(`p`,null,`💿 Hey developer 👋`),L.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,L.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,L.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),L.createElement(L.Fragment,null,L.createElement(`h2`,null,`Unexpected Application Error!`),L.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?L.createElement(`pre`,{style:i},n):null,o)}var kr=L.createElement(Or,null),Ar=class extends L.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=_r(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:L.createElement(dr.Provider,{value:this.props.routeContext},L.createElement(fr.Provider,{value:e,children:this.props.component}));return this.context?L.createElement(Mr,{error:e},t):t}};Ar.contextType=ir;var jr=new WeakMap;function Mr({children:e,error:t}){let{basename:n,navigator:r}=L.useContext(lr);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=gr(t.digest);if(e){let i=jr.get(t);if(i)throw i;let a=Kn(e.location,n),o=a.absoluteURL||a.to;if(Zn(e.location,o,Jn(r),`allow-explicit`),tr(o))throw Error(`Invalid redirect location`);if(Gn&&!jr.get(t)){if(a.isExternal||e.reloadDocument)window.location.href=o;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(a.to,{replace:e.replace}));throw jr.set(t,n),n}}return L.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${o}`})}}return e}function Nr({routeContext:e,match:t,children:n}){let r=L.useContext(nr);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),L.createElement(dr.Provider,{value:e},n)}function Pr(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);$t(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:Wn(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||kr,o&&(s<0&&c===0?(Wr(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?L.createElement(n.route.Component,null):n.route.element?n.route.element:e,L.createElement(Nr,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?L.createElement(Ar,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Fr(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Ir(e){let t=L.useContext(nr);return $t(t,Fr(e)),t}function Lr(e){let t=L.useContext(rr);return $t(t,Fr(e)),t}function Rr(e){let t=L.useContext(dr);return $t(t,Fr(e)),t}function zr(e){let t=Rr(e),n=t.matches[t.matches.length-1];return $t(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function Br(){return zr(`useRouteId`)}function Vr(){let e=L.useContext(fr),t=Lr(`useRouteError`),n=zr(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Hr(){let{router:e}=Ir(`useNavigate`),t=zr(`useNavigate`),n=L.useRef(!1);return Sr(()=>{n.current=!0}),L.useCallback(async(r,i={})=>{en(n.current,xr),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Ur={};function Wr(e,t,n){!t&&!Ur[e]&&(Ur[e]=!0,en(!1,n))}L.memo(Gr);function Gr({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return Dr(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Kr(e){$t(!1,`A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.`)}function qr({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){$t(!yr(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=L.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=on(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=L.useMemo(()=>{let e=kn(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return en(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:L.createElement(lr.Provider,{value:c},L.createElement(ur.Provider,{children:t,value:h}))}function Jr({children:e,location:t}){return Er(Yr(e),t)}L.Component;function Yr(e,t=[]){let n=[];return L.Children.forEach(e,(e,r)=>{if(!L.isValidElement(e))return;let i=[...t,r];if(e.type===L.Fragment){n.push.apply(n,Yr(e.props.children,i));return}$t(e.type===Kr,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),$t(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Yr(e.props.children,i)),n.push(a)}),n}var Xr=`get`,Zr=`application/x-www-form-urlencoded`;function Qr(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function $r(e){return Qr(e)&&e.tagName.toLowerCase()===`button`}function ei(e){return Qr(e)&&e.tagName.toLowerCase()===`form`}function ti(e){return Qr(e)&&e.tagName.toLowerCase()===`input`}function ni(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function ri(e,t){return e.button===0&&(!t||t===`_self`)&&!ni(e)}var ii=null;function ai(){if(ii===null)try{new FormData(document.createElement(`form`),0),ii=!1}catch{ii=!0}return ii}var oi=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function si(e){return e!=null&&!oi.has(e)?(en(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Zr}"`),null):e}function ci(e,t){let n,r,i,a,o;if(ei(e)){let o=e.getAttribute(`action`);r=o?kn(o,t):null,n=e.getAttribute(`method`)||Xr,i=si(e.getAttribute(`enctype`))||Zr,a=new FormData(e)}else if($r(e)||ti(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?kn(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Xr,i=si(e.getAttribute(`formenctype`))||si(o.getAttribute(`enctype`))||Zr,a=new FormData(o,e),!ai()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Qr(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Xr,r=null,i=Zr,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function li(e,t){if(e===!1||e==null)throw Error(t)}function ui(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&kn(i.pathname,t)===`/`?`${Rn(t)}/_root.${r}`:`${Rn(i.pathname)}.${r}`,i}async function di(e,t){if(e.id in t)return t[e.id];try{let n=await Et(()=>import(e.module),[]);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function fi(e){return e!=null&&typeof e.page==`string`}function pi(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function mi(e,t,n){return yi((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await di(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(pi).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function hi(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function gi(e,t,{includeHydrateFallback:n}={}){return _i(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function _i(e){return[...new Set(e)]}function vi(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function yi(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!fi(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(vi(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function bi(){let e=L.useContext(nr);return li(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function xi(){let e=L.useContext(rr);return li(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var Si=L.createContext(void 0);Si.displayName=`FrameworkContext`;function Ci(){let e=L.useContext(Si);return li(e,`You must render this element inside a <HydratedRouter> element`),e}function wi(e,t){let n=L.useContext(Si),[r,i]=L.useState(!1),[a,o]=L.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=L.useRef(null);L.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),L.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:Ti(s,p),onBlur:Ti(c,m),onMouseEnter:Ti(l,p),onMouseLeave:Ti(u,m),onTouchStart:Ti(d,p)}]:[a,f,{}]:[!1,f,{}]}function Ti(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Ei({page:e,...t}){let n=ar(),{nonce:r}=Ci(),{router:i}=bi(),a=L.useMemo(()=>ln(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?L.createElement(Oi,{page:e,matches:a,...t}):L.createElement(ki,{page:e,matches:a,...t})):null}function Di(e){let{manifest:t,routeModules:n}=Ci(),[r,i]=L.useState([]);return L.useEffect(()=>{let r=!1;return mi(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function Oi({page:e,matches:t,...n}){let r=br(),{future:i}=Ci(),{basename:a}=bi(),o=L.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=ui(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return L.createElement(L.Fragment,null,o.map(e=>L.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function ki({page:e,matches:t,...n}){let r=br(),{future:i,manifest:a,routeModules:o}=Ci(),{basename:s}=bi(),{loaderData:c,matches:l}=xi(),u=L.useMemo(()=>hi(e,t,l,a,r,`data`),[e,t,l,a,r]),d=L.useMemo(()=>hi(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=L.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];t&&t.hasLoader&&(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=ui(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=L.useMemo(()=>gi(d,a),[d,a]),m=Di(d);return L.createElement(L.Fragment,null,f.map(e=>L.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>L.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>L.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function Ai(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}L.Component;var ji=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{ji&&(window.__reactRouterVersion=`7.18.3`)}catch{}function Mi({basename:e,children:t,useTransitions:n,window:r}){let i=L.useRef();i.current??=Qt({window:r,v5Compat:!0});let a=i.current,[o,s]=L.useState({action:a.action,location:a.location}),c=L.useCallback(e=>{n===!1?s(e):L.startTransition(()=>s(e))},[n]);return L.useLayoutEffect(()=>a.listen(c),[a,c]),L.createElement(qr,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var Ni=L.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=L.useContext(lr),v=typeof l==`string`&&qt.test(l),y=Kn(l,h);l=y.to;let b=vr(l,{relative:r}),x=br(),S=null;if(o){let e=Fn(o,[],x.mask?x.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Ln([h,e.pathname])),S=g.createHref(e)}let[C,w,T]=wi(n,p),E=Ri(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let O=!(y.isExternal||i),k=L.createElement(`a`,{...p,...T,href:(O?S:void 0)||y.absoluteURL||b,onClick:O?D:e,ref:Ai(m,w),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return C&&!v?L.createElement(L.Fragment,null,k,L.createElement(Ei,{page:b})):k});Ni.displayName=`Link`;var Pi=L.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=Tr(a,{relative:c.relative}),d=br(),f=L.useContext(rr),{navigator:p,basename:m}=L.useContext(lr),h=f!=null&&Ui(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=kn(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,x=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),S={isActive:b,isPending:x,isTransitioning:h},C=b?e:void 0,w;w=typeof n==`function`?n(S):[n,b?`active`:null,x?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let T=typeof i==`function`?i(S):i;return L.createElement(Ni,{...c,"aria-current":C,className:w,ref:l,style:T,to:a,viewTransition:o},typeof s==`function`?s(S):s)});Pi.displayName=`NavLink`;var Fi=L.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Xr,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=L.useContext(lr),g=Vi(),_=Hi(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&qt.test(s);return L.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?L.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});Fi.displayName=`Form`;function Ii(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Li(e){let t=L.useContext(nr);return $t(t,Ii(e)),t}function Ri(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=Cr(),d=br(),f=Tr(e,{relative:o});return L.useCallback(p=>{if(ri(p,t)){p.preventDefault();let t=n===void 0?an(d)===an(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?L.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}var zi=0,Bi=()=>`__${String(++zi)}__`;function Vi(){let{router:e}=Li(`useSubmit`),{basename:t}=L.useContext(lr),n=Br(),r=e.fetch,i=e.navigate;return L.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=ci(e,t);if(a.navigate===!1){let e=a.fetcherKey||Bi();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function Hi(e,{relative:t}={}){let{basename:n}=L.useContext(lr),r=L.useContext(dr);$t(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={...Tr(e||`.`,{relative:t})},o=br();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ln([n,a.pathname])),an(a)}function Ui(e,{relative:t}={}){let n=L.useContext(or);$t(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Li(`useViewTransitionState`),i=Tr(e,{relative:t});if(!n.isTransitioning)return!1;let a=kn(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=kn(n.nextLocation.pathname,r)||n.nextLocation.pathname;return Tn(i.pathname,o)!=null||Tn(i.pathname,a)!=null}var z=st(),Wi=(0,L.createContext)(!0),Gi=()=>(0,L.useContext)(Wi),Ki=1,qi=9e5,Ji=0,Yi=()=>(Ji=(Ji+1)%(2**53-1),Ji.toString()),Xi=new Map,Zi=e=>{if(Xi.has(e))return;let t=setTimeout(()=>{Xi.delete(e),ta({type:`REMOVE_TOAST`,toastId:e})},qi);Xi.set(e,t)},Qi=(e,t)=>{switch(t.type){case`ADD_TOAST`:return{...e,toasts:[t.toast,...e.toasts].slice(0,Ki)};case`UPDATE_TOAST`:return{...e,toasts:e.toasts.map(e=>e.id===t.toast.id?{...e,...t.toast}:e)};case`DISMISS_TOAST`:{let{toastId:n}=t;return n?Zi(n):e.toasts.forEach(e=>{Zi(e.id)}),{...e,toasts:e.toasts.map(e=>e.id===n||n===void 0?{...e,open:!1}:e)}}case`REMOVE_TOAST`:return t.toastId===void 0?{...e,toasts:[]}:{...e,toasts:e.toasts.filter(e=>e.id!==t.toastId)}}},$i=[],ea={toasts:[]},ta=e=>{ea=Qi(ea,e),$i.forEach(e=>{e(ea)})},na=({...e})=>{let t=Yi(),n=e=>ta({type:`UPDATE_TOAST`,toast:{...e,id:t}}),r=()=>ta({type:`DISMISS_TOAST`,toastId:t});return ta({type:`ADD_TOAST`,toast:{...e,id:t,open:!0,onOpenChange:e=>{e||r()}}}),{id:t,dismiss:r,update:n}},ra=()=>{let[e,t]=(0,L.useState)(ea);return(0,L.useEffect)(()=>($i.push(t),()=>{let e=$i.indexOf(t);e>-1&&$i.splice(e,1)}),[e]),{...e,toast:na,dismiss:e=>ta({type:`DISMISS_TOAST`,toastId:e})}};function ia(){}var B={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},aa=new class{#e=B;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function oa(e){setTimeout(e,0)}var sa=typeof window>`u`||`Deno`in globalThis;function ca(){}function la(e,t){return typeof e==`function`?e(t):e}function ua(e){return typeof e==`number`&&e>=0&&e!==1/0}function da(e,t){return Math.max(e+(t||0)-Date.now(),0)}function fa(e,t){return typeof e==`function`?e(t):e}function pa(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==ha(o,t.options))return!1}else if(!_a(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function ma(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(ga(t.options.mutationKey)!==ga(a))return!1}else if(!_a(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function ha(e,t){return(t?.queryKeyHashFn||ga)(e)}function ga(e){return JSON.stringify(e,(e,t)=>Sa(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function _a(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!_a(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!_a(e[r],t[r]))return!1;return!0}return!1}var va=Object.prototype.hasOwnProperty;function ya(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=xa(e)&&xa(t);if(!r&&!(Sa(e)&&Sa(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:va.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ya(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function ba(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function xa(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Sa(e){if(!Ca(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!Ca(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function Ca(e){return Object.prototype.toString.call(e)===`[object Object]`}function wa(e){return new Promise(t=>{aa.setTimeout(t,e)})}function Ta(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ya(e,t)}function Ea(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function Da(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var Oa=Symbol();function ka(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===Oa?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function Aa(e,t){return typeof e==`function`?e(...t):!!e}function ja(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var Ma=()=>sa,Na=()=>Ma(),Pa=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Fa=new class extends Pa{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}};function Ia(e){let t;if(e.then(e=>(t=e,e),ca)?.catch?.(ca),t!==void 0)return{data:t}}function La(e){return{mutationKey:e.options.mutationKey,state:e.state,...e.options.scope&&{scope:e.options.scope},...e.meta&&{meta:e.meta}}}function Ra(e,t,n){let r=e.promise?.then(t).catch(e=>n?.(e)===!1?Promise.reject(e):Promise.reject(Error(`redacted`)));return r?.catch(ca),r}function za(e,t,n){return{dehydratedAt:Date.now(),state:{...e.state,...e.state.data!==void 0&&{data:t?t(e.state.data):e.state.data}},queryKey:e.queryKey,queryHash:e.queryHash,...e.state.status===`pending`&&{promise:Ra(e,t,n)},...e.meta&&{meta:e.meta},...e.queryType&&{queryType:e.queryType}}}function Ba(e){return e.state.isPaused}function Va(e){return e.state.status===`success`}function Ha(e,t={}){let n=t.shouldDehydrateMutation??e.getDefaultOptions().dehydrate?.shouldDehydrateMutation??Ba,r=e.getMutationCache().getAll().flatMap(e=>n(e)?[La(e)]:[]),i=t.shouldDehydrateQuery??e.getDefaultOptions().dehydrate?.shouldDehydrateQuery??Va,a=t.shouldRedactErrors??e.getDefaultOptions().dehydrate?.shouldRedactErrors,o=t.serializeData??e.getDefaultOptions().dehydrate?.serializeData;return{mutations:r,queries:e.getQueryCache().getAll().flatMap(e=>i(e)?[za(e,o,a)]:[])}}function Ua(e,t,n){let r=e.getMutationCache(),i=e.getQueryCache(),a=n?.defaultOptions?.deserializeData??e.getDefaultOptions().hydrate?.deserializeData;t.mutations?.forEach(({state:t,...i})=>{r.build(e,{...e.getDefaultOptions().hydrate?.mutations,...n?.defaultOptions?.mutations,...i},t)}),t.queries?.forEach(({queryKey:t,state:r,queryHash:o,meta:s,promise:c,dehydratedAt:l,queryType:u})=>{let d=c?Ia(c):void 0,f=r.data===void 0?d?.data:r.data,p=f===void 0?f:a?a(f):f,m=i.get(o),h=m?.state.status===`pending`,g=m?.state.fetchStatus===`fetching`;if(m){let e=d&&l!==void 0&&l>m.state.dataUpdatedAt;if(r.dataUpdatedAt>m.state.dataUpdatedAt||e){let{fetchStatus:e,...t}=r;m.setState({...t,data:p,...r.status===`pending`&&p!==void 0&&{status:`success`,dataUpdatedAt:l??Date.now(),...!g&&{fetchStatus:`idle`}}})}}else m=i.build(e,{...e.getDefaultOptions().hydrate?.queries,...n?.defaultOptions?.queries,queryKey:t,queryHash:o,meta:s,_type:u},{...r,data:p,fetchStatus:`idle`,status:r.status===`pending`&&p!==void 0?`success`:r.status,...r.status===`pending`&&p!==void 0&&{dataUpdatedAt:l??Date.now()}});c&&!d&&!h&&!g&&(l===void 0||l>m.state.dataUpdatedAt)&&m.fetch(void 0,{initialPromise:Promise.resolve(c).then(a)}).catch(ca)})}var Wa=oa;function Ga(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=Wa,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Ka=Ga(),qa=new class extends Pa{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function Ja(e){return Math.min(1e3*2**e,3e4)}function Ya(e){return(e??`online`)!==`online`||qa.isOnline()}var Xa=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Za(e){let t=!1,n=0,r,i=`pending`,a,o,s=new Promise((e,t)=>{a=e,o=t});s.catch(ca);let c=()=>i!==`pending`,l=t=>{if(!c()){let n=new Xa(t);h(n),e.onCancel?.(n)}},u=()=>{t=!0},d=()=>{t=!1},f=()=>Fa.isFocused()&&(e.networkMode===`always`||qa.isOnline())&&e.canRun(),p=()=>Ya(e.networkMode)&&e.canRun(),m=e=>{c()||(r?.(),i=`resolved`,a(e))},h=e=>{c()||(r?.(),i=`rejected`,o(e))},g=()=>new Promise(t=>{r=e=>{(c()||f())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,c()||e.onContinue?.()}),_=()=>{if(c())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(m).catch(r=>{if(c())return;let i=e.retry??(Na()?0:3),a=e.retryDelay??Ja,o=typeof a==`function`?a(n,r):a,s=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!s){h(r);return}n++,e.onFail?.(n,r),wa(o).then(()=>f()?void 0:g()).then(()=>{t?h(r):_()})})};return{promise:s,status:()=>i,cancel:l,continue:()=>(r?.(),s),cancelRetry:u,continueRetry:d,canStart:p,start:()=>(p()?_():g().then(_),s)}}var Qa=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),ua(this.gcTime)&&(this.#e=aa.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(Na()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(aa.clearTimeout(this.#e),this.#e=void 0)}};function $a(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{ja(e,()=>t.signal,()=>n=!0)},u=ka(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?Da:Ea;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?to:eo,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:eo(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function eo(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function to(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var no=class extends Qa{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=ao(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=ao(this.options);e.data!==void 0&&(this.setState(io(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=Ta(this.state.data,e,this.options);return this.#c({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#c({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(ca).catch(ca):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>fa(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Oa||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>fa(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!da(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){let t=this.observers.indexOf(e);t!==-1&&(this.observers.splice(t,1),this.observers.length||(this.#a&&(this.#s||this.state.fetchStatus===`paused`&&this.state.status===`pending`?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||this.#c({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=ka(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?$a(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#c({type:`fetch`,meta:a.fetchOptions?.meta});let o=this.#a=Za({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Xa&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#c({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#c({type:`pause`})},onContinue:()=>{this.#c({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await o.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Xa){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#c({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.#a===o&&(this.#a=void 0),this.scheduleGc()}}#c(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...ro(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...io(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Ka.batch(()=>{this.observers.slice().forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function ro(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Ya(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function io(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function ao(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var oo=class extends Pa{#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p=new Set;constructor(e,t){super(),this.options=t,this.#e=e,this.#o=null,this.bindMethods(),this.setOptions(t)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),co(this.#t,this.options)?this.#m():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return lo(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return lo(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof fa(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!ba(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&uo(this.#t,n,this.options,t)&&this.#m(),this.updateResult(),r&&(this.#t!==n||fa(this.options.enabled,this.#t)!==fa(t.enabled,this.#t)||fa(this.options.staleTime,this.#t)!==fa(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||fa(this.options.enabled,this.#t)!==fa(t.enabled,this.#t)||i!==this.#f)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return ba(this.getCurrentResult(),n)||(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),Reflect.get(e,n))})}trackProp(e){this.#p.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t),r=()=>{},i,a=new Promise(e=>{i=e,r=this.#e.getQueryCache().subscribe(i=>{i.type===`updated`&&i.query.queryHash===n.queryHash&&n.state.data!==void 0&&(r(),e(this.createResult(n,t)))})});return Promise.race([n.fetch().then(()=>{let e=this.createResult(n,t);return i?.(e),e}).finally(()=>{r()}),a])}fetch(e){return this.#m({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#m(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(ca)),t}#h(e){return!Na()&&fa(this.options.enabled,this.#t)!==!1&&ua(e)}#g(){this.#b();let e=fa(this.options.staleTime,this.#t);if(this.#r.isStale||!this.#h(e))return;let t=da(this.#r.dataUpdatedAt,e)+1;this.#u=aa.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#f=e,this.#f!==0&&this.#h(this.#f)&&(this.#d=aa.setInterval(()=>{(this.options.refetchIntervalInBackground||Fa.isFocused())&&this.#m()},this.#f))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#u!==void 0&&(aa.clearTimeout(this.#u),this.#u=void 0)}#x(){this.#d!==void 0&&(aa.clearInterval(this.#d),this.#d=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&co(e,t),o=i&&uo(e,n,t,r);(a||o)&&(l={...l,...ro(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#l?.state.data,this.#l):t.placeholderData,e!==void 0&&(m=`success`,d=Ta(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#s)d=this.#c;else try{this.#s=t.select,d=t.select(d),d=Ta(i?.data,d,t),this.#c=d,this.#o=null}catch(e){this.#o=e}}else d===void 0&&(this.#o=null);this.#o&&(f=this.#o,d=this.#c,p=Date.now(),m=`error`,u=!1);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0;return{status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:fo(e,t),refetch:this.refetch,isEnabled:fa(t.enabled,e)!==!1}}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);if(this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#l=this.#t),ba(t,e))return;this.#r=t;let n=(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#p.size)return!0;let r=new Set(n??this.#p);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})();Ka.batch(()=>{n&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}};function so(e,t){return fa(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||fa(t.retryOnMount,e)!==!1)}function co(e,t){return so(e,t)||e.state.data!==void 0&&lo(e,t,t.refetchOnMount)}function lo(e,t,n){if(fa(t.enabled,e)!==!1&&fa(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&fo(e,t)}return!1}function uo(e,t,n,r){return(e!==t||fa(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&fo(e,n)}function fo(e,t){return fa(t.enabled,e)!==!1&&e.isStaleByTime(fa(t.staleTime,e))}var po=class extends Qa{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||mo(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??(this.state.status===`pending`?this.execute(this.state.variables):Promise.resolve())}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey},r=this.#r=Za({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)}),i=this.state.status===`pending`,a=!r.canStart();try{if(i)t();else{this.#i({type:`pending`,variables:e,isPaused:a}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:a})}let o=await r.start();return await this.#n.config.onSuccess?.(o,e,this.state.context,this,n),await this.options.onSuccess?.(o,e,this.state.context,n),await this.#n.config.onSettled?.(o,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(o,null,e,this.state.context,n),this.#i({type:`success`,data:o}),o}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#r===r&&(this.#r=void 0),this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Ka.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function mo(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var ho=class extends Pa{#e;#t;#n;constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}build(e,t,n){let r=new po({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=go(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=go(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=go(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=go(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Ka.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>ma(t,e))}findAll(e={}){return this.getAll().filter(t=>ma(e,t))}notify(e){Ka.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Ka.batch(()=>Promise.all(e.map(e=>e.continue().catch(ca))))}};function go(e){return e.options.scope?.id}var _o=class extends Pa{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),ba(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&ga(t.mutationKey)!==ga(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onSubscribe(){this.listeners.size===1&&this.#n&&(this.#n.addObserver(this),this.#i())}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??mo();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Ka.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},vo=class extends Pa{#e;constructor(e={}){super(),this.config=e,this.#e=new Map}build(e,t,n){let r=t.queryKey,i=t.queryHash??ha(r,t),a=this.get(i);return a||(a=new no({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Ka.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>pa(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>pa(e,t)):t}notify(e){Ka.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Ka.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Ka.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},yo=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new vo,this.#t=e.mutationCache||new ho,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Fa.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=qa.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(fa(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=la(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Ka.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Ka.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Ka.batch(()=>{let r=n.findAll(e),i=new Set(r);return r.forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,predicate:e=>i.has(e)},t)})}cancelQueries(e,t={}){let n={revert:!0,...t},r=Ka.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(ca).catch(ca)}invalidateQueries(e,t={}){return Ka.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Ka.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(ca)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(ca)}async query(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t),r=n.isStaleByTime(fa(t.staleTime,n))?await n.fetch(t):n.state.data,i=t.select;return i?i(r):r}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(fa(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(ca).catch(ca)}infiniteQuery(e){return e._type=`infinite`,this.query(e)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(ca).catch(ca)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return qa.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(ga(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{_a(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(ga(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{_a(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=ha(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===Oa&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}};function bo(e,{interval:t=1e3,onError:n=ia}={}){if(typeof e!=`function`)throw Error(`argument is not function.`);let r=0,i=null,a=!1,o=!1;return async(...s)=>{if(i=s,!o){for(o=!0;a;)await new Promise(e=>aa.setTimeout(e,t));for(;Date.now()<r;)await new Promise(e=>aa.setTimeout(e,r-Date.now()));o=!1,a=!0;try{await e(...i)}catch(e){try{n(e)}catch{}}r=Date.now()+t,a=!1}}}var xo=({storage:e,key:t=`REACT_QUERY_OFFLINE_CACHE`,throttleTime:n=1e3,serialize:r=JSON.stringify,deserialize:i=JSON.parse,retry:a})=>{if(e){let o=async n=>{try{let i=await r(n);await e.setItem(t,i);return}catch(e){return e}};return{persistClient:bo(async e=>{let t=e,n=await o(t),r=0;for(;n&&t;)r++,t=await a?.({persistedClient:t,error:n,errorCount:r}),t&&(n=await o(t))},{interval:n}),restoreClient:async()=>{let n=await e.getItem(t);if(n)return await i(n)},removeClient:()=>e.removeItem(t)}}return{persistClient:ia,restoreClient:()=>Promise.resolve(void 0),removeClient:ia}},So=L.createContext(void 0),Co=e=>{let t=L.useContext(So);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},wo=({client:e,children:t})=>(L.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,z.jsx)(So.Provider,{value:e,children:t})),To=L.createContext(!1),Eo=()=>L.useContext(To),Do=To.Provider;function Oo(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ko=L.createContext(Oo()),Ao=()=>L.useContext(ko),jo=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?Aa(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||r)&&(t.isReset()||(e.retryOnMount=!1))},Mo=e=>{L.useEffect(()=>{e.clearReset()},[e])},No=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||Aa(n,[e.error,r])),Po=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},Fo=(e,t)=>e?.suspense&&t.isPending,Io=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function Lo(e,t,n){let r=Eo(),i=Ao(),a=Co(n),o=a.defaultQueryOptions(e),s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,Po(o),jo(o,i,s),Mo(i);let[l]=L.useState(()=>new t(a,o)),u=l.getOptimisticResult(o),d=!r&&c;if(L.useSyncExternalStore(L.useCallback(e=>{let t=d?l.subscribe(Ka.batchCalls(e)):ca;return l.updateResult(),t},[l,d]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),L.useEffect(()=>{l.setOptions(o)},[o,l]),Fo(o,u))throw Io(o,l,i);if(No({result:u,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw u.error;return o.notifyOnChangeProps?u:l.trackResult(u)}function Ro(e,t){return Lo(e,oo,t)}function zo(e,t){let n=Co(t),[r]=L.useState(()=>new _o(n,e));L.useEffect(()=>{r.setOptions(e)},[r,e]);let i=L.useSyncExternalStore(L.useCallback(e=>r.subscribe(Ka.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=L.useCallback((...e)=>{r.mutate(e[0],e[1]).catch(ca)},[r]);if(i.error&&Aa(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var Bo=[`added`,`removed`,`updated`];function Vo(e){return Bo.includes(e)}async function Ho({queryClient:e,persister:t,maxAge:n=864e5,buster:r=``,hydrateOptions:i}){try{let a=await t.restoreClient();if(a){if(a.timestamp){let o=Date.now()-a.timestamp>n,s=a.buster!==r;if(o||s)return t.removeClient();Ua(e,a.clientState,i)}else return t.removeClient()}}catch(e){throw await t.removeClient(),e}}async function V({queryClient:e,persister:t,buster:n=``,dehydrateOptions:r}){let i={buster:n,timestamp:Date.now(),clientState:Ha(e,r)};await t.persistClient(i)}function Uo(e){let t=e.queryClient.getQueryCache().subscribe(t=>{Vo(t.type)&&V(e)}),n=e.queryClient.getMutationCache().subscribe(t=>{Vo(t.type)&&V(e)});return()=>{t(),n()}}var Wo=({children:e,persistOptions:t,onSuccess:n,onError:r,...i})=>{let[a,o]=L.useState(!0),s=L.useRef({persistOptions:t,onSuccess:n,onError:r}),c=L.useRef(!1);return L.useEffect(()=>{s.current={persistOptions:t,onSuccess:n,onError:r}}),L.useEffect(()=>{let e={...s.current.persistOptions,queryClient:i.client};return c.current||(c.current=!0,Ho(e).then(()=>s.current.onSuccess?.()).catch(()=>s.current.onError?.()).finally(()=>{o(!1)})),a?void 0:Uo(e)},[i.client,a]),(0,z.jsx)(wo,{...i,children:(0,z.jsx)(Do,{value:a,children:e})})},Go=864e5,Ko=`v1`;if(typeof window>`u`){let e=e=>{typeof e==`object`&&e&&`unref`in e&&typeof e.unref==`function`&&e.unref()};aa.setTimeoutProvider({setTimeout:(t,n)=>{let r=setTimeout(t,n);return e(r),r},clearTimeout:e=>clearTimeout(e),setInterval:(t,n)=>{let r=setInterval(t,n);return e(r),r},clearInterval:e=>clearInterval(e)})}var qo={queries:{retry:1,staleTime:3e4,gcTime:Go,refetchOnMount:!0,refetchOnWindowFocus:!1,refetchOnReconnect:!1},mutations:{retry:0}},Jo=xo({storage:typeof window<`u`?{getItem:e=>Promise.resolve(window.localStorage.getItem(e)),setItem:(e,t)=>Promise.resolve(window.localStorage.setItem(e,t)),removeItem:e=>Promise.resolve(window.localStorage.removeItem(e))}:{getItem:()=>Promise.resolve(null),setItem:()=>Promise.resolve(),removeItem:()=>Promise.resolve()},key:`intlayer-rq-cache`}),Yo=e=>e.split(`_`).join(` `),Xo=()=>{let{toast:e}=ra();return{onError:t=>{[(()=>{try{if(typeof t==`string`)return JSON.parse(t);if(t instanceof Error)return JSON.parse(t.message)}catch{}return t})()].flat().forEach(t=>{let n=t?.error??t;if(n?.code===`RATE_LIMIT_EXCEEDED_UNAUTHENTICATED`){e({title:n.message,variant:`error`});return}e({title:Yo(n?.title??t?.title??`Error`),description:n?.message??t?.message??String(n??`An error occurred`),variant:`error`})})},onSuccess:t=>{t?.error&&e({title:Yo(t.error.title??t.error.code??`Error`),description:t.error.message??t.error.code??`An error occurred`,variant:`error`}),t?.message&&e({title:t.message,description:t.description,variant:`success`})}}},Zo=({children:e,client:t})=>{let{onError:n,onSuccess:r}=Xo(),i=(0,L.useRef)({onSuccess:r,onError:n});i.current={onSuccess:r,onError:n};let a=(0,L.useRef)(t??null);a.current||=new yo({defaultOptions:qo,mutationCache:new ho});let o=(0,L.useRef)(!1);if(!o.current){o.current=!0;let e=a.current.getMutationCache(),t=e.config.onSuccess,n=e.config.onError;e.config.onSuccess=(e,n,r,a,o)=>{t?.(e,n,r,a,o),i.current.onSuccess?.(e,n,r,a,o)},e.config.onError=(e,t,r,a,o)=>{n?.(e,t,r,a,o),i.current.onError?.(e,t,r,a,o)},e.config.onSettled=(e,t,n,r,i)=>{i.meta?.invalidateQueries&&i.meta.invalidateQueries.forEach(e=>{a.current?.invalidateQueries({queryKey:e})}),i.meta?.resetQueries&&i.meta.resetQueries.forEach(e=>{a.current?.resetQueries({queryKey:e})})}}return t||typeof window>`u`?(0,z.jsx)(wo,{client:a.current,children:e}):(0,z.jsx)(Wo,{client:a.current,persistOptions:{persister:Jo,maxAge:Go,buster:Ko,dehydrateOptions:{shouldDehydrateQuery:e=>e.state.status===`success`}},children:e})},Qo=e({Action:()=>qs,Close:()=>Js,Description:()=>Ks,Provider:()=>Hs,Root:()=>Ws,Title:()=>Gs,Toast:()=>Cs,ToastAction:()=>js,ToastClose:()=>Ns,ToastDescription:()=>ks,ToastProvider:()=>us,ToastTitle:()=>Os,ToastViewport:()=>hs,Viewport:()=>Us,createToastScope:()=>ss}),$o=t(Qe(),1),es=Object.defineProperty,ts=(e,t)=>es(e,`name`,{value:t,configurable:!0}),ns=`ToastProvider`,[rs,is,as]=Me(`Toast`),[os,ss]=tt(`Toast`,[as]),[cs,ls]=os(ns),us=ts(e=>{let{__scopeToast:t,label:n=`Notification`,duration:r=5e3,swipeDirection:i=`right`,swipeThreshold:a=50,announcerContainer:o,children:s}=e,[c,l]=L.useState(null),[u,d]=L.useState(0),f=L.useRef(!1);return n.trim()||console.error(`Invalid prop \`label\` supplied to \`${ns}\`. Expected non-empty \`string\`.`),(0,z.jsx)(rs.Provider,{scope:t,children:(0,z.jsx)(cs,{scope:t,label:n,duration:r,swipeDirection:i,swipeThreshold:a,toastCount:u,viewport:c,onViewportChange:l,onToastAdd:L.useCallback(()=>d(e=>e+1),[]),onToastRemove:L.useCallback(()=>d(e=>e-1),[]),isClosePausedRef:f,announcerContainer:o,children:s})})},`ToastProvider`),ds=`ToastViewport`,fs=[`F8`],ps=`toast.viewportPause`,ms=`toast.viewportResume`,hs=L.forwardRef(ts(function(e,t){let{__scopeToast:n,hotkey:r=fs,label:i=`Notifications ({hotkey})`,...a}=e,o=ls(ds,n),s=is(n),c=L.useRef(null),l=L.useRef(null),u=L.useRef(null),d=L.useRef(null),f=P(t,d,o.onViewportChange),p=r.join(`+`).replace(/Key/g,``).replace(/Digit/g,``),m=o.toastCount>0;L.useEffect(()=>{let e=ts(e=>{r.length!==0&&r.every(t=>e[t]||e.code===t)&&d.current?.focus()},`handleKeyDown`);return document.addEventListener(`keydown`,e),()=>document.removeEventListener(`keydown`,e)},[r]),L.useEffect(()=>{let e=c.current,t=d.current;if(m&&e&&t){let n=ts(()=>{if(!o.isClosePausedRef.current){let e=new CustomEvent(ps);t.dispatchEvent(e),o.isClosePausedRef.current=!0}},`handlePause`),r=ts(()=>{if(o.isClosePausedRef.current){let e=new CustomEvent(ms);t.dispatchEvent(e),o.isClosePausedRef.current=!1}},`handleResume`),i=ts(t=>{e.contains(t.relatedTarget)||r()},`handleFocusOutResume`),a=ts(()=>{e.contains(document.activeElement)||r()},`handlePointerLeaveResume`);return e.addEventListener(`focusin`,n),e.addEventListener(`focusout`,i),e.addEventListener(`pointermove`,n),e.addEventListener(`pointerleave`,a),window.addEventListener(`blur`,n),window.addEventListener(`focus`,r),()=>{e.removeEventListener(`focusin`,n),e.removeEventListener(`focusout`,i),e.removeEventListener(`pointermove`,n),e.removeEventListener(`pointerleave`,a),window.removeEventListener(`blur`,n),window.removeEventListener(`focus`,r)}}},[m,o.isClosePausedRef]);let h=L.useCallback(({tabbingDirection:e})=>{let t=s().map(t=>{let n=t.ref.current,r=[n,...Bs(n)];return e===`forwards`?r:r.reverse()});return(e===`forwards`?t.reverse():t).flat()},[s]);return L.useEffect(()=>{let e=d.current;if(e){let t=ts(t=>{let n=t.altKey||t.ctrlKey||t.metaKey;if(t.key===`Tab`&&!n){let n=document.activeElement,r=t.shiftKey;if(t.target===e&&r){l.current?.focus();return}let i=h({tabbingDirection:r?`backwards`:`forwards`}),a=i.findIndex(e=>e===n);Vs(i.slice(a+1))?t.preventDefault():r?l.current?.focus():u.current?.focus()}},`handleKeyDown`);return e.addEventListener(`keydown`,t),()=>e.removeEventListener(`keydown`,t)}},[s,h]),(0,z.jsxs)(Se,{ref:c,role:`region`,"aria-label":i.replace(`{hotkey}`,p),tabIndex:-1,style:{pointerEvents:m?void 0:`none`},children:[m&&(0,z.jsx)(_s,{ref:l,onFocusFromOutsideViewport:()=>{Vs(h({tabbingDirection:`forwards`}))}}),(0,z.jsx)(rs.Slot,{scope:n,children:(0,z.jsx)(We.ol,{tabIndex:-1,...a,ref:f})}),m&&(0,z.jsx)(_s,{ref:u,onFocusFromOutsideViewport:()=>{Vs(h({tabbingDirection:`backwards`}))}})]})},`ToastViewport`)),gs=`ToastFocusProxy`,_s=L.forwardRef(ts(function(e,t){let{__scopeToast:n,onFocusFromOutsideViewport:r,...i}=e,a=ls(gs,n);return(0,z.jsx)(Je,{tabIndex:0,...i,ref:t,style:{position:`fixed`},onFocus:e=>{let t=e.relatedTarget;a.viewport?.contains(t)||r()}})},`ToastFocusProxy`)),vs=`Toast`,ys=`toast.swipeStart`,bs=`toast.swipeMove`,xs=`toast.swipeCancel`,Ss=`toast.swipeEnd`,Cs=L.forwardRef(ts(function(e,t){let{forceMount:n,open:r,defaultOpen:i,onOpenChange:a,...o}=e,[s,c]=Pe({prop:r,defaultProp:i??!0,onChange:a,caller:vs});return(0,z.jsx)(xe,{present:n||s,children:(0,z.jsx)(Es,{open:s,...o,ref:t,onClose:()=>c(!1),onPause:Oe(e.onPause),onResume:Oe(e.onResume),onSwipeStart:rt(e.onSwipeStart,e=>{e.currentTarget.setAttribute(`data-swipe`,`start`)}),onSwipeMove:rt(e.onSwipeMove,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`move`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-move-y`,`${n}px`)}),onSwipeCancel:rt(e.onSwipeCancel,e=>{e.currentTarget.setAttribute(`data-swipe`,`cancel`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-end-y`)}),onSwipeEnd:rt(e.onSwipeEnd,e=>{let{x:t,y:n}=e.detail.delta;e.currentTarget.setAttribute(`data-swipe`,`end`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-x`),e.currentTarget.style.removeProperty(`--radix-toast-swipe-move-y`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-x`,`${t}px`),e.currentTarget.style.setProperty(`--radix-toast-swipe-end-y`,`${n}px`),c(!1)})})})},`Toast`)),[ws,Ts]=os(vs,{onClose(){}}),Es=L.forwardRef(ts(function(e,t){let{__scopeToast:n,type:r=`foreground`,duration:i,open:a,onClose:o,onEscapeKeyDown:s,onPause:c,onResume:l,onSwipeStart:u,onSwipeMove:d,onSwipeCancel:f,onSwipeEnd:p,...m}=e,h=ls(vs,n),g=is(n),[_,v]=L.useState(null),y=P(t,v),b=L.useRef(null),x=L.useRef(null),S=i||h.duration,C=L.useRef(0),w=L.useRef(S),T=L.useRef(0),{onToastAdd:E,onToastRemove:D}=h,O=Oe(()=>{_?.contains(document.activeElement)&&h.viewport?.focus(),o()}),k=L.useCallback(e=>{e&&e!==1/0&&(window.clearTimeout(T.current),C.current=new Date().getTime(),T.current=window.setTimeout(O,e))},[O]);L.useEffect(()=>{let e=h.viewport;if(e){let t=ts(()=>{k(w.current),l?.()},`handleResume`),n=ts(()=>{let e=new Date().getTime()-C.current;w.current-=e,window.clearTimeout(T.current),c?.()},`handlePause`);return e.addEventListener(ps,n),e.addEventListener(ms,t),()=>{e.removeEventListener(ps,n),e.removeEventListener(ms,t)}}},[h.viewport,S,c,l,k]),L.useEffect(()=>{a&&!h.isClosePausedRef.current&&k(S)},[a,S,h.isClosePausedRef,k]),L.useEffect(()=>()=>{window.clearTimeout(T.current)},[]),L.useEffect(()=>(E(),()=>D()),[E,D]);let ee=L.useMemo(()=>_?Fs(_):null,[_]);return h.viewport?(0,z.jsxs)(z.Fragment,{children:[ee&&(0,z.jsx)(Ds,{__scopeToast:n,role:`status`,"aria-live":r===`foreground`?`assertive`:`polite`,children:ee}),(0,z.jsx)(ws,{scope:n,onClose:O,children:$o.createPortal((0,z.jsx)(rs.ItemSlot,{scope:n,children:(0,z.jsx)(et,{asChild:!0,onEscapeKeyDown:rt(s,e=>{g().some(t=>t.ref.current?.contains(e.target))||O()}),children:(0,z.jsx)(We.li,{tabIndex:0,"data-state":a?`open`:`closed`,"data-swipe-direction":h.swipeDirection,...m,ref:y,style:{userSelect:`none`,touchAction:`none`,...e.style},onKeyDown:rt(e.onKeyDown,e=>{e.key===`Escape`&&(s?.(e.nativeEvent),e.nativeEvent.defaultPrevented||O())}),onPointerDown:rt(e.onPointerDown,e=>{e.button===0&&(b.current={x:e.clientX,y:e.clientY})}),onPointerMove:rt(e.onPointerMove,e=>{if(!b.current)return;let t=e.clientX-b.current.x,n=e.clientY-b.current.y,r=!!x.current,i=[`left`,`right`].includes(h.swipeDirection),a=[`left`,`up`].includes(h.swipeDirection)?Math.min:Math.max,o=i?a(0,t):0,s=i?0:a(0,n),c=e.pointerType===`touch`?10:2,l={x:o,y:s},f={originalEvent:e,delta:l};r?(x.current=l,Is(bs,d,f,{discrete:!1})):Ls(l,h.swipeDirection,c)?(x.current=l,Is(ys,u,f,{discrete:!1}),e.target.setPointerCapture(e.pointerId)):(Math.abs(t)>c||Math.abs(n)>c)&&(b.current=null)}),onPointerUp:rt(e.onPointerUp,e=>{let t=x.current,n=e.target;if(n.hasPointerCapture(e.pointerId)&&n.releasePointerCapture(e.pointerId),x.current=null,b.current=null,t){let n=e.currentTarget,r={originalEvent:e,delta:t};Ls(t,h.swipeDirection,h.swipeThreshold)?Is(Ss,p,r,{discrete:!0}):Is(xs,f,r,{discrete:!0}),n.addEventListener(`click`,e=>e.preventDefault(),{once:!0})}})})})}),h.viewport)})]}):null},`ToastImpl`)),Ds=ts(e=>{let{__scopeToast:t,children:n,...r}=e,i=ls(vs,t),[a,o]=L.useState(!1),[s,c]=L.useState(!1);return Rs(()=>o(!0)),L.useEffect(()=>{let e=window.setTimeout(()=>c(!0),1e3);return()=>window.clearTimeout(e)},[]),s?null:(0,z.jsx)(He,{asChild:!0,container:i.announcerContainer||void 0,children:(0,z.jsx)(Je,{...r,children:a&&(0,z.jsxs)(z.Fragment,{children:[i.label,` `,n]})})})},`ToastAnnounce`),Os=L.forwardRef(ts(function(e,t){let{__scopeToast:n,...r}=e;return(0,z.jsx)(We.div,{...r,ref:t})},`ToastTitle`)),ks=L.forwardRef(ts(function(e,t){let{__scopeToast:n,...r}=e;return(0,z.jsx)(We.div,{...r,ref:t})},`ToastDescription`)),As=`ToastAction`,js=L.forwardRef(ts(function(e,t){let{altText:n,...r}=e;return n.trim()?(0,z.jsx)(Ps,{altText:n,asChild:!0,children:(0,z.jsx)(Ns,{...r,ref:t})}):(console.error(`Invalid prop \`altText\` supplied to \`${As}\`. Expected non-empty \`string\`.`),null)},`ToastAction`)),Ms=`ToastClose`,Ns=L.forwardRef(ts(function(e,t){let{__scopeToast:n,...r}=e,i=Ts(Ms,n);return(0,z.jsx)(Ps,{asChild:!0,children:(0,z.jsx)(We.button,{type:`button`,...r,ref:t,onClick:rt(e.onClick,i.onClose)})})},`ToastClose`)),Ps=L.forwardRef(ts(function(e,t){let{__scopeToast:n,altText:r,...i}=e;return(0,z.jsx)(We.div,{"data-radix-toast-announce-exclude":``,"data-radix-toast-announce-alt":r||void 0,...i,ref:t})},`ToastAnnounceExclude`));function Fs(e){let t=[];return Array.from(e.childNodes).forEach(e=>{if(e.nodeType===e.TEXT_NODE&&e.textContent&&t.push(e.textContent),zs(e)){let n=e.ariaHidden||e.hidden||e.style.display===`none`,r=e.dataset.radixToastAnnounceExclude===``;if(!n){if(r){let n=e.dataset.radixToastAnnounceAlt;n&&t.push(n)}else t.push(...Fs(e))}}}),t}ts(Fs,`getAnnounceTextContent`);function Is(e,t,n,{discrete:r}){let i=n.originalEvent.currentTarget,a=new CustomEvent(e,{bubbles:!0,cancelable:!0,detail:n});t&&i.addEventListener(e,t,{once:!0}),r?Be(i,a):i.dispatchEvent(a)}ts(Is,`handleAndDispatchCustomEvent`);var Ls=ts((e,t,n=0)=>{let r=Math.abs(e.x),i=Math.abs(e.y),a=r>i;return t===`left`||t===`right`?a&&r>n:!a&&i>n},`isDeltaInDirection`);function Rs(e=()=>{}){let t=Oe(e);Xe(()=>{let e=0,n=0;return e=window.requestAnimationFrame(()=>n=window.requestAnimationFrame(t)),()=>{window.cancelAnimationFrame(e),window.cancelAnimationFrame(n)}},[t])}ts(Rs,`useNextFrame`);function zs(e){return e.nodeType===e.ELEMENT_NODE}ts(zs,`isHTMLElement`);function Bs(e){let t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:ts(e=>{let t=e.tagName===`INPUT`&&e.type===`hidden`;return e.disabled||e.hidden||t?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP},`acceptNode`)});for(;n.nextNode();)t.push(n.currentNode);return t}ts(Bs,`getTabbableCandidates`);function Vs(e){let t=document.activeElement;return e.some(e=>e===t||(e.focus(),document.activeElement!==t))}ts(Vs,`focusFirst`);var Hs=us,Us=hs,Ws=Cs,Gs=Os,Ks=ks,qs=js,Js=Ns,Ys={name:`arrow-left`,size:24,node:[[`path`,{d:`m12 19-7-7 7-7`,key:`1l729n`}],[`path`,{d:`M19 12H5`,key:`x3x0zl`}]]};Ys.node;var Xs=Ee(Ys),Zs={name:`arrow-up-from-line`,size:24,node:[[`path`,{d:`m18 9-6-6-6 6`,key:`kcunyi`}],[`path`,{d:`M12 3v14`,key:`7cf3v8`}],[`path`,{d:`M5 21h14`,key:`11awu3`}]]};Zs.node;var Qs=Ee(Zs),$s={name:`chevron-left`,size:24,node:[[`path`,{d:`m15 18-6-6 6-6`,key:`1wnfg3`}]]};$s.node;var ec=Ee($s),tc={name:`chevron-right`,size:24,node:[[`path`,{d:`m9 18 6-6-6-6`,key:`mthhwq`}]]};tc.node;var nc=Ee(tc),rc={name:`download`,size:24,node:[[`path`,{d:`M12 15V3`,key:`m9g1x1`}],[`path`,{d:`M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4`,key:`ih7n3h`}],[`path`,{d:`m7 10 5 5 5-5`,key:`brsn70`}]]};rc.node;var ic=Ee(rc),ac={name:`ellipsis`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`1`,key:`41hilf`}],[`circle`,{cx:`19`,cy:`12`,r:`1`,key:`1wjl8i`}],[`circle`,{cx:`5`,cy:`12`,r:`1`,key:`1pcz8c`}]],aliases:[`more-horizontal`]};ac.node;var oc=Ee(ac),sc={name:`globe`,size:24,node:[[`circle`,{cx:`12`,cy:`12`,r:`10`,key:`1mglay`}],[`path`,{d:`M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20`,key:`13o1zl`}],[`path`,{d:`M2 12h20`,key:`9i4pu4`}]]};sc.node;var cc=Ee(sc),lc={name:`move-vertical`,size:24,node:[[`path`,{d:`M12 2v20`,key:`t6zp3m`}],[`path`,{d:`m8 18 4 4 4-4`,key:`bh5tu3`}],[`path`,{d:`m8 6 4-4 4 4`,key:`ybng9g`}]]};lc.node;var uc=Ee(lc),dc={name:`pencil-ruler`,size:24,node:[[`path`,{d:`M13 7 8.7 2.7a2.41 2.41 0 0 0-3.4 0L2.7 5.3a2.41 2.41 0 0 0 0 3.4L7 13`,key:`orapub`}],[`path`,{d:`m8 6 2-2`,key:`115y1s`}],[`path`,{d:`m18 16 2-2`,key:`ee94s4`}],[`path`,{d:`m17 11 4.3 4.3c.94.94.94 2.46 0 3.4l-2.6 2.6c-.94.94-2.46.94-3.4 0L11 17`,key:`cfq27r`}],[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};dc.node;var fc=Ee(dc),pc={name:`pencil`,size:24,node:[[`path`,{d:`M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z`,key:`1a8usu`}],[`path`,{d:`m15 5 4 4`,key:`1mk7zo`}]]};pc.node;var mc=Ee(pc),hc={name:`plus`,size:24,node:[[`path`,{d:`M5 12h14`,key:`1ays0h`}],[`path`,{d:`M12 5v14`,key:`s699le`}]]};hc.node;var gc=Ee(hc),_c={name:`rotate-ccw`,size:24,node:[[`path`,{d:`M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8`,key:`1357e3`}],[`path`,{d:`M3 3v5h5`,key:`1xhq8a`}]]};_c.node;var vc=Ee(_c),yc={name:`save`,size:24,node:[[`path`,{d:`M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z`,key:`1c8476`}],[`path`,{d:`M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7`,key:`1ydtos`}],[`path`,{d:`M7 3v4a1 1 0 0 0 1 1h7`,key:`t51u73`}]]};yc.node;var bc=Ee(yc),xc={name:`search`,size:24,node:[[`path`,{d:`m21 21-4.34-4.34`,key:`14j7rj`}],[`circle`,{cx:`11`,cy:`11`,r:`8`,key:`4ej97u`}]]};xc.node;var Sc=Ee(xc),Cc={name:`trash`,size:24,node:[[`path`,{d:`M10 11v6`,key:`nco0om`}],[`path`,{d:`M14 11v6`,key:`outv1u`}],[`path`,{d:`M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6`,key:`miytrc`}],[`path`,{d:`M3 6h18`,key:`d0wm0j`}],[`path`,{d:`M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2`,key:`e791ji`}]],aliases:[`trash-2`]};Cc.node;var wc=Ee(Cc),Tc={name:`wand-sparkles`,size:24,node:[[`path`,{d:`m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72`,key:`ul74o6`}],[`path`,{d:`m14 7 3 3`,key:`1r5n42`}],[`path`,{d:`M5 6v4`,key:`ilb8ba`}],[`path`,{d:`M19 14v4`,key:`blhpug`}],[`path`,{d:`M10 2v2`,key:`7u0qdc`}],[`path`,{d:`M7 8H3`,key:`zfb6yr`}],[`path`,{d:`M21 16h-4`,key:`1cnmox`}],[`path`,{d:`M11 3H9`,key:`1obp7u`}]],aliases:[`wand-2`]};Tc.node;var Ec=Ee(Tc),Dc=Qo,Oc=({className:e,...t})=>(0,z.jsx)(Us,{className:I(`fixed top-0 z-100 flex max-h-screen w-full flex-col-reverse p-4 sm:top-auto sm:right-0 sm:bottom-0 sm:flex-col md:max-w-105`,e),...t}),kc=$e(`group data-[state=closed]:fade-out-80 data-[state=closed]:slide-out-to-right-full data-[state=open]:slide-in-from-top-full data-[state=open]:sm:slide-in-from-bottom-full pointer-events-auto relative flex w-full items-center justify-between space-x-2 overflow-hidden rounded-xl p-4 pr-6 shadow-[0_0_10px_-15px_rgba(0,0,0,0.3)] backdrop-blur transition-all [corner-shape:squircle] data-[swipe=cancel]:translate-x-0 data-[swipe=end]:translate-x-[var(--radix-toast-swipe-end-x)] data-[swipe=move]:translate-x-[var(--radix-toast-swipe-move-x)] data-[state=closed]:animate-out data-[state=open]:animate-in data-[swipe=end]:animate-out data-[swipe=move]:transition-none supports-[corner-shape:squircle]:rounded-3xl`,{variants:{variant:{error:`bg-error/40 text-foreground`,success:`bg-success/30 text-foreground`,default:`bg-card/80 text-foreground`}},defaultVariants:{variant:`default`}}),Ac=({className:e,variant:t,...n})=>(0,z.jsx)(Ws,{className:I(kc({variant:t}),e),...n}),jc=({className:e,...t})=>(0,z.jsx)(Js,{className:I(`absolute top-1 right-1 rounded-md p-1 text-foreground/50 opacity-0 transition-opacity hover:text-foreground/80 focus:opacity-100 focus:outline-hidden focus:ring-1 group-hover:opacity-100 group-[.error]:text-red-300 group-[.error]:focus:ring-red-400 group-[.error]:focus:ring-offset-red-600 group-[.error]:hover:text-red-50`,e),"toast-close":``,...t,children:(0,z.jsx)(N,{className:`size-5`})}),Mc=({className:e,...t})=>(0,z.jsx)(Gs,{className:I(`font-semibold text-sm [&+div]:text-xs`,e),...t}),Nc=({className:e,...t})=>(0,z.jsx)(Ks,{className:I(`overflow-scroll text-sm opacity-90`,e),...t}),Pc=()=>{let{toasts:e}=ra();return(0,z.jsxs)(Dc.Provider,{children:[e.map(({id:e,title:t,description:n,action:r,...i})=>(0,z.jsxs)(Ac,{...i,children:[(0,z.jsxs)(`div`,{className:`grid gap-1`,children:[t&&(0,z.jsx)(Mc,{children:t}),n&&(0,z.jsx)(Nc,{children:n})]}),r,(0,z.jsx)(jc,{})]},e)),(0,z.jsx)(Oc,{})]})};function Fc(e,t){if(typeof e==`function`)return e(t);e!=null&&(e.current=t)}function Ic(...e){return t=>{let n=!1,r=e.map(e=>{let r=Fc(e,t);return!n&&typeof r==`function`&&(n=!0),r});if(n)return()=>{for(let t=0;t<r.length;t++){let n=r[t];typeof n==`function`?n():Fc(e[t],null)}}}}function Lc(...e){return L.useCallback(Ic(...e),e)}var Rc=class extends L.Component{getSnapshotBeforeUpdate(e){let t=this.props.childRef.current;if(me(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){let e=t.offsetParent,n=me(e)&&e.offsetWidth||0,r=me(e)&&e.offsetHeight||0,i=getComputedStyle(t),a=this.props.sizeRef.current;a.height=parseFloat(i.height),a.width=parseFloat(i.width),a.top=t.offsetTop,a.left=t.offsetLeft,a.right=n-a.width-a.left,a.bottom=r-a.height-a.top,a.direction=i.direction}return null}componentDidUpdate(){}render(){return this.props.children}};function zc({children:e,isPresent:t,anchorX:n,anchorY:r,root:i,pop:a}){let o=(0,L.useId)(),s=(0,L.useRef)(null),c=(0,L.useRef)({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:`ltr`}),{nonce:l}=(0,L.useContext)(ue),u=Lc(s,a===!1?void 0:e.props?.ref??e?.ref);return(0,L.useInsertionEffect)(()=>{let{width:e,height:u,top:d,left:f,right:p,bottom:m,direction:h}=c.current;if(t||a===!1||!s.current||!e||!u)return;let g=h===`rtl`,_=n===`left`?g?`right: ${p}`:`left: ${f}`:g?`left: ${f}`:`right: ${p}`,v=r===`bottom`?`bottom: ${m}`:`top: ${d}`;s.current.dataset.motionPopId=o;let y=document.createElement(`style`);l&&(y.nonce=l);let b=i??document.head;return b.appendChild(y),y.sheet&&y.sheet.insertRule(`
|
|
13
|
-
[data-motion-pop-id="${o}"] {
|
|
14
|
-
position: absolute !important;
|
|
15
|
-
width: ${e}px !important;
|
|
16
|
-
height: ${u}px !important;
|
|
17
|
-
${_}px !important;
|
|
18
|
-
${v}px !important;
|
|
19
|
-
}
|
|
20
|
-
`),()=>{s.current?.removeAttribute(`data-motion-pop-id`),b.contains(y)&&b.removeChild(y)}},[t]),(0,z.jsx)(Rc,{isPresent:t,childRef:s,sizeRef:c,pop:a,children:a===!1?e:L.cloneElement(e,{ref:u})})}var Bc=({children:e,initial:t,isPresent:n,onExitComplete:r,custom:i,presenceAffectsLayout:a,mode:o,anchorX:s,anchorY:c,root:l})=>{let u=Ge(Vc),d=(0,L.useId)(),f=(0,L.useRef)(n),p=(0,L.useRef)(r);w(()=>{f.current=n,p.current=r});let m=!0,h=(0,L.useMemo)(()=>(m=!1,{id:d,initial:t,isPresent:n,custom:i,onExitComplete:e=>{u.set(e,!0);for(let e of u.values())if(!e)return;r&&r()},register:e=>(u.set(e,!1),()=>{u.delete(e),!f.current&&!u.size&&p.current?.()})}),[n,u,r]);return a&&m&&(h={...h}),(0,L.useMemo)(()=>{u.forEach((e,t)=>u.set(t,!1))},[n]),L.useEffect(()=>{!n&&!u.size&&r&&r()},[n]),e=(0,z.jsx)(zc,{pop:o===`popLayout`,isPresent:n,anchorX:s,anchorY:c,root:l,children:e}),(0,z.jsx)(g.Provider,{value:h,children:e})};function Vc(){return new Map}var Hc=e=>e.key||``;function Uc(e){let t=[];return L.Children.forEach(e,e=>{(0,L.isValidElement)(e)&&t.push(e)}),t}var Wc=({children:e,custom:t,initial:n=!0,onExitComplete:r,presenceAffectsLayout:i=!0,mode:a=`sync`,propagate:o=!1,anchorX:s=`left`,anchorY:c=`top`,root:l})=>{let[u,d]=v(o),f=(0,L.useMemo)(()=>Uc(e),[e]),p=o&&!u?[]:f.map(Hc),m=(0,L.useRef)(!0),h=(0,L.useRef)(f),g=Ge(()=>new Map),_=(0,L.useRef)(new Set),[y,b]=(0,L.useState)(f),[x,C]=(0,L.useState)(f);w(()=>{o&&!u&&!x.length&&d?.()},[u,o,x.length,d]),w(()=>{m.current=!1,h.current=f;for(let e=0;e<x.length;e++){let t=Hc(x[e]);p.includes(t)?(g.delete(t),_.current.delete(t)):g.get(t)!==!0&&g.set(t,!1)}},[x,p.length,p.join(`-`)]);let T=[];if(f!==y){let e=[...f],t=0;for(let n of x){let r=p.indexOf(Hc(n));r===-1?(e.splice(t++,0,n),T.push(n)):t=r+T.length+1}return a===`wait`&&T.length&&(e=T),C(Uc(e)),b(f),null}let{forceRender:E}=(0,L.useContext)(S);return(0,z.jsx)(z.Fragment,{children:x.map(e=>{let v=Hc(e),y=o&&!u?!1:f===x||p.includes(v);return(0,z.jsx)(Bc,{isPresent:y,initial:!m.current||n?void 0:!1,custom:t,presenceAffectsLayout:i,mode:a,root:l,onExitComplete:y?void 0:()=>{if(_.current.has(v))return;if(g.has(v))_.current.add(v),g.set(v,!0);else return;let e=!0;g.forEach(t=>{t||(e=!1)}),e&&(E?.(),C(h.current),o&&d?.(),r&&r())},anchorX:s,anchorY:c,children:e},v)})})};function Gc({children:e,features:t,strict:n=!1}){let[,r]=(0,L.useState)(!Kc(t)),i=(0,L.useRef)(void 0);if(!Kc(t)){let{renderer:e,...n}=t;i.current=e,c(n)}return(0,L.useEffect)(()=>{Kc(t)&&t().then(({renderer:e,...t})=>{c(t),i.current=e,r(!0)})},[]),(0,z.jsx)(fe.Provider,{value:{renderer:i.current,strict:n},children:e})}function Kc(e){return typeof e==`function`}var qc={renderer:at,...oe,...E},Jc=dt(),Yc=pt(),Xc=e=>{let t=(0,Yc.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,z.jsx)(Gc,{features:qc,children:n}),t[0]=n,t[1]=r),r},Zc=e=>{let t=(0,Yc.c)(3),{children:n}=e,r;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,z.jsx)(Pc,{}),t[0]=r):r=t[0];let i;return t[1]===n?i=t[2]:(i=(0,z.jsx)(Xc,{children:(0,z.jsxs)(Zo,{children:[r,n]})}),t[1]=n,t[2]=i),i},Qc=e=>{let t=(0,Yc.c)(2),{children:n}=e,r;return t[0]===n?r=t[1]:(r=(0,z.jsx)(Mi,{children:(0,z.jsx)(Jr,{children:(0,z.jsx)(Kr,{path:`*`,element:n})})}),t[0]=n,t[1]=r),r},$c={key:`dictionary-edition-drawer`,content:{nodeType:`translation`,translation:{en:{openDictionaryEditor:{popoverContent:`Open Dictionary in Editor`,label:`Click to open the dictionary in the editor`},backButtonText:`Dictionary list`,modalTitle:`Edit dictionary`,noDictionaryFocused:`No dictionary focused`,focusedDictionaryNotFound:`Focused dictionary not found`},"en-GB":{openDictionaryEditor:{popoverContent:`Click to open the dictionary in the editor`,label:`Click to open the dictionary in the editor`},backButtonText:`Dictionary list`,modalTitle:`Edit dictionary`,noDictionaryFocused:`No dictionary focused`,focusedDictionaryNotFound:`Focused dictionary not found`},fr:{openDictionaryEditor:{popoverContent:`Ouvrir le dictionnaire dans l’éditeur`,label:`Cliquez pour ouvrir le dictionnaire dans l’éditeur`},backButtonText:`Liste des dictionnaires`,modalTitle:`Modifier le dictionnaire`,noDictionaryFocused:`Aucun dictionnaire sélectionné`,focusedDictionaryNotFound:`Dictionnaire focalisé non trouvé`},es:{openDictionaryEditor:{popoverContent:`Abrir el diccionario en el editor`,label:`Haga clic para abrir el diccionario en el editor`},backButtonText:`Lista de diccionarios`,modalTitle:`Editar el diccionario`,noDictionaryFocused:`No hay diccionario enfocado`,focusedDictionaryNotFound:`Diccionario enfocado no encontrado`},de:{openDictionaryEditor:{popoverContent:`Wörterbuch im Editor öffnen`,label:`Klicken Sie hier, um das Wörterbuch im Editor zu öffnen`},backButtonText:`Wörterbuchliste`,modalTitle:`Wörterbuch bearbeiten`,noDictionaryFocused:`Kein Wörterbuch ausgewählt`,focusedDictionaryNotFound:`Ausgewähltes Wörterbuch nicht gefunden`},ja:{openDictionaryEditor:{popoverContent:`エディターで辞書を開く`,label:`エディターで辞書を開く`},backButtonText:`辞書リスト`,modalTitle:`辞書を編集`,noDictionaryFocused:`フォーカスされた辞書がありません`,focusedDictionaryNotFound:`フォーカスされた辞書が見つかりません`},ko:{openDictionaryEditor:{popoverContent:`편집기에서 사전 열기`,label:`편집기에서 사전 열기`},backButtonText:`사전 목록`,modalTitle:`사전 편집`,noDictionaryFocused:`포커스가 있는 사전이 없습니다`,focusedDictionaryNotFound:`포커스가 있는 사전이 없습니다`},zh:{openDictionaryEditor:{popoverContent:`点击打开词典到编辑器`,label:`点击打开词典到编辑器`},backButtonText:`词典列表`,modalTitle:`编辑词典`,noDictionaryFocused:`没有聚焦的词典`,focusedDictionaryNotFound:`没有聚焦的词典`},it:{openDictionaryEditor:{popoverContent:`Apri il dizionario nell’editor`,label:`Fai clic per aprire il dizionario nell’editor`},backButtonText:`Elenco di dizionari`,modalTitle:`Modifica dizionario`,noDictionaryFocused:`Nessun dizionario selezionato`,focusedDictionaryNotFound:`Nessun dizionario selezionato`},pt:{openDictionaryEditor:{popoverContent:`Abrir o dicionário no editor`,label:`Clique para abrir o dicionário no editor`},backButtonText:`Lista de dicionários`,modalTitle:`Editar dicionário`,noDictionaryFocused:`Nenhum dicionário focalizado`,focusedDictionaryNotFound:`Nenhum dicionário focalizado`},hi:{openDictionaryEditor:{popoverContent:`एडिटर में शब्दकोश खोलने के लिए क्लिक करें`,label:`एडिटर में शब्दकोश खोलने के लिए क्लिक करें`},backButtonText:`शब्दकोश सूची`,modalTitle:`शब्दकोश संपादित करें`,noDictionaryFocused:`कोई फोकस शब्दकोश नहीं है`,focusedDictionaryNotFound:`कोई फोकस शब्दकोश नहीं है`},ar:{openDictionaryEditor:{popoverContent:`انقر لفتح قاموس في المحرر`,label:`انقر لفتح قاموس في المحرر`},backButtonText:`قائمة القوامل`,modalTitle:`تحرير قاموس`,noDictionaryFocused:`لا يوجد قاموس مرتبط`,focusedDictionaryNotFound:`لا يوجد قاموس مرتبط`},ru:{openDictionaryEditor:{popoverContent:`Нажмите, чтобы открыть словарь в редакторе`,label:`Нажмите, чтобы открыть словарь в редакторе`},backButtonText:`Список словарей`,modalTitle:`Редактировать словарь`,noDictionaryFocused:`Нет фокусированного словаря`,focusedDictionaryNotFound:`Нет фокусированного словаря`}}},location:`local`,localId:`dictionary-edition-drawer::local::client/src/components/Editor/DictionaryEditionDrawer/dictionaryEditionDrawer.content.ts`,filePath:`client/src/components/Editor/DictionaryEditionDrawer/dictionaryEditionDrawer.content.ts`};function el(e){return Object.fromEntries(Object.entries(e).map(([e,t])=>[e,{code:e,message:t,toString:()=>e}]))}var tl=el({CHALLENGE_NOT_FOUND:`Challenge not found`,YOU_ARE_NOT_ALLOWED_TO_REGISTER_THIS_PASSKEY:`You are not allowed to register this passkey`,FAILED_TO_VERIFY_REGISTRATION:`Failed to verify registration`,PASSKEY_NOT_FOUND:`Passkey not found`,AUTHENTICATION_FAILED:`Authentication failed`,UNABLE_TO_CREATE_SESSION:`Unable to create session`,USER_NOT_FOUND:`User not found`,FAILED_TO_UPDATE_PASSKEY:`Failed to update passkey`,PREVIOUSLY_REGISTERED:`Previously registered`,REGISTRATION_CANCELLED:`Registration cancelled`,AUTH_CANCELLED:`Auth cancelled`,UNKNOWN_ERROR:`Unknown error`,SESSION_REQUIRED:`Passkey registration requires an authenticated session`,RESOLVE_USER_REQUIRED:`Passkey registration requires either an authenticated session or a resolveUser callback when requireSession is false`,RESOLVED_USER_INVALID:`Resolved user is invalid`}),nl=`1.7.4`;function rl(e){let t=new Uint8Array(e),n=``;for(let e of t)n+=String.fromCharCode(e);return btoa(n).replace(/\+/g,`-`).replace(/\//g,`_`).replace(/=/g,``)}function il(e){let t=e.replace(/-/g,`+`).replace(/_/g,`/`),n=(4-t.length%4)%4,r=t.padEnd(t.length+n,`=`),i=atob(r),a=new ArrayBuffer(i.length),o=new Uint8Array(a);for(let e=0;e<i.length;e++)o[e]=i.charCodeAt(e);return a}function al(){return ol.stubThis(globalThis?.PublicKeyCredential!==void 0&&typeof globalThis.PublicKeyCredential==`function`)}var ol={stubThis:e=>e};function sl(e){let{id:t}=e;return{...e,id:il(t),transports:e.transports}}function cl(e){return e===`localhost`||/^((xn--[a-z0-9-]+|[a-z0-9]+(-[a-z0-9]+)*)\.)+([a-z]{2,}|xn--[a-z0-9-]+)$/i.test(e)}var ll=class extends Error{constructor({message:e,code:t,cause:n,name:r}){super(e,{cause:n}),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name=r??n.name,this.code=t}};function ul({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new ll({message:`Registration ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`ConstraintError`){if(n.authenticatorSelection?.requireResidentKey===!0)return new ll({message:`Discoverable credentials were required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_DISCOVERABLE_CREDENTIAL_SUPPORT`,cause:e});if(t.mediation===`conditional`&&n.authenticatorSelection?.userVerification===`required`)return new ll({message:`User verification was required during automatic registration but it could not be performed`,code:`ERROR_AUTO_REGISTER_USER_VERIFICATION_FAILURE`,cause:e});if(n.authenticatorSelection?.userVerification===`required`)return new ll({message:`User verification was required but no available authenticator supported it`,code:`ERROR_AUTHENTICATOR_MISSING_USER_VERIFICATION_SUPPORT`,cause:e})}else if(e.name===`InvalidStateError`)return new ll({message:`The authenticator was previously registered`,code:`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`,cause:e});else if(e.name===`NotAllowedError`)return new ll({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`NotSupportedError`)return n.pubKeyCredParams.filter(e=>e.type===`public-key`).length===0?new ll({message:`No entry in pubKeyCredParams was of type "public-key"`,code:`ERROR_MALFORMED_PUBKEYCREDPARAMS`,cause:e}):new ll({message:`No available authenticator supported any of the specified pubKeyCredParams algorithms`,code:`ERROR_AUTHENTICATOR_NO_SUPPORTED_PUBKEYCREDPARAMS_ALG`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!cl(t))return new ll({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rp.id!==t)return new ll({message:`The RP ID "${n.rp.id}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`TypeError`){if(n.user.id.byteLength<1||n.user.id.byteLength>64)return new ll({message:`User ID was not between 1 and 64 characters`,code:`ERROR_INVALID_USER_ID_LENGTH`,cause:e})}else if(e.name===`UnknownError`)return new ll({message:`The authenticator was unable to process the specified options, or could not create a new credential`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}var dl=new class{constructor(){Object.defineProperty(this,"controller",{enumerable:!0,configurable:!0,writable:!0,value:void 0})}createNewAbortSignal(){if(this.controller){let e=Error(`Cancelling existing WebAuthn API call for new one`);e.name=`AbortError`,this.controller.abort(e)}let e=new AbortController;return this.controller=e,e.signal}cancelCeremony(){if(this.controller){let e=Error(`Manually cancelling existing WebAuthn API call`);e.name=`AbortError`,this.controller.abort(e),this.controller=void 0}}},fl=[`cross-platform`,`platform`];function pl(e){if(e&&!(fl.indexOf(e)<0))return e}async function ml(e){!e.optionsJSON&&e.challenge&&(console.warn(`startRegistration() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useAutoRegister:n=!1}=e;if(!al())throw Error(`WebAuthn is not supported in this browser`);let r={...t,challenge:il(t.challenge),user:{...t.user,id:il(t.user.id)},excludeCredentials:t.excludeCredentials?.map(sl)},i={};n&&(i.mediation=`conditional`),i.publicKey=r,i.signal=dl.createNewAbortSignal();let a;try{a=await navigator.credentials.create(i)}catch(e){throw ul({error:e,options:i})}if(!a)throw Error(`Registration was not completed`);let{id:o,rawId:s,response:c,type:l}=a,u;typeof c.getTransports==`function`&&(u=c.getTransports());let d;if(typeof c.getPublicKeyAlgorithm==`function`)try{d=c.getPublicKeyAlgorithm()}catch(e){hl(`getPublicKeyAlgorithm()`,e)}let f;if(typeof c.getPublicKey==`function`)try{let e=c.getPublicKey();e!==null&&(f=rl(e))}catch(e){hl(`getPublicKey()`,e)}let p;if(typeof c.getAuthenticatorData==`function`)try{p=rl(c.getAuthenticatorData())}catch(e){hl(`getAuthenticatorData()`,e)}return{id:o,rawId:rl(s),response:{attestationObject:rl(c.attestationObject),clientDataJSON:rl(c.clientDataJSON),transports:u,publicKeyAlgorithm:d,publicKey:f,authenticatorData:p},type:l,clientExtensionResults:a.getClientExtensionResults(),authenticatorAttachment:pl(a.authenticatorAttachment)}}function hl(e,t){console.warn(`The browser extension that intercepted this WebAuthn API call incorrectly implemented ${e}. You should report this error to them.\n`,t)}function gl(){if(!al())return _l.stubThis(new Promise(e=>e(!1)));let e=globalThis.PublicKeyCredential;return e?.isConditionalMediationAvailable===void 0?_l.stubThis(new Promise(e=>e(!1))):_l.stubThis(e.isConditionalMediationAvailable())}var _l={stubThis:e=>e};function vl({error:e,options:t}){let{publicKey:n}=t;if(!n)throw Error(`options was missing required publicKey property`);if(e.name===`AbortError`){if(t.signal instanceof AbortSignal)return new ll({message:`Authentication ceremony was sent an abort signal`,code:`ERROR_CEREMONY_ABORTED`,cause:e})}else if(e.name===`NotAllowedError`)return new ll({message:e.message,code:`ERROR_PASSTHROUGH_SEE_CAUSE_PROPERTY`,cause:e});else if(e.name===`SecurityError`){let t=globalThis.location.hostname;if(!cl(t))return new ll({message:`${globalThis.location.hostname} is an invalid domain`,code:`ERROR_INVALID_DOMAIN`,cause:e});if(n.rpId!==t)return new ll({message:`The RP ID "${n.rpId}" is invalid for this domain`,code:`ERROR_INVALID_RP_ID`,cause:e})}else if(e.name===`UnknownError`)return new ll({message:`The authenticator was unable to process the specified options, or could not create a new assertion signature`,code:`ERROR_AUTHENTICATOR_GENERAL_ERROR`,cause:e});return e}async function yl(e){!e.optionsJSON&&e.challenge&&(console.warn(`startAuthentication() was not called correctly. It will try to continue with the provided options, but this call should be refactored to use the expected call structure instead. See https://simplewebauthn.dev/docs/packages/browser#typeerror-cannot-read-properties-of-undefined-reading-challenge for more information.`),e={optionsJSON:e});let{optionsJSON:t,useBrowserAutofill:n=!1,verifyBrowserAutofillInput:r=!0}=e;if(!al())throw Error(`WebAuthn is not supported in this browser`);let i;t.allowCredentials?.length!==0&&(i=t.allowCredentials?.map(sl));let a={...t,challenge:il(t.challenge),allowCredentials:i},o={};if(n){if(!await gl())throw Error(`Browser does not support WebAuthn autofill`);if(document.querySelectorAll(`input[autocomplete$='webauthn']`).length<1&&r)throw Error('No <input> with "webauthn" as the only or last value in its `autocomplete` attribute was detected');o.mediation=`conditional`,a.allowCredentials=[]}o.publicKey=a,o.signal=dl.createNewAbortSignal();let s;try{s=await navigator.credentials.get(o)}catch(e){throw vl({error:e,options:o})}if(!s)throw Error(`Authentication was not completed`);let{id:c,rawId:l,response:u,type:d}=s,f;return u.userHandle&&(f=rl(u.userHandle)),{id:c,rawId:rl(l),response:{authenticatorData:rl(u.authenticatorData),clientDataJSON:rl(u.clientDataJSON),signature:rl(u.signature),userHandle:f},type:d,clientExtensionResults:s.getClientExtensionResults(),authenticatorAttachment:pl(s.authenticatorAttachment)}}var bl=`1.7.4`,xl=Symbol.for(`better-auth:broadcast-channel`),Sl=()=>Math.floor(Date.now()/1e3),Cl=class{listeners=new Set;name;constructor(e=`better-auth.message`){this.name=e}subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}post(e){if(!(typeof window>`u`))try{localStorage.setItem(this.name,JSON.stringify({...e,timestamp:Sl()}))}catch{}}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=e=>{if(e.key!==this.name)return;let t=JSON.parse(e.newValue??`{}`);t?.event===`session`&&t?.data&&this.listeners.forEach(e=>e(t))};return window.addEventListener(`storage`,e),()=>{window.removeEventListener(`storage`,e)}}};function wl(e=`better-auth.message`){return globalThis[xl]||(globalThis[xl]=new Cl(e)),globalThis[xl]}var Tl=[],El=0,Dl=null,Ol=4,kl=globalThis.nanostoresGlobal||={epoch:0},Al=()=>{let e;for(El=0;El<Tl.length;El+=Ol)try{Tl[El](Tl[El+1].value,Tl[El+2],Tl[El+3])}catch(t){e=t}if(Tl.length=0,e)throw e},jl=e=>{let t=[],n={eq:Object.is,get(){return n.lc||n.listen(()=>{})(),n.value},init:e,lc:0,listen(e){return n.lc=t.push(e),()=>{for(let t=El+Ol;t<Tl.length;)Tl[t]===e?Tl.splice(t,Ol):t+=Ol;let r=t.indexOf(e);~r&&(t.splice(r,1),--n.lc||n.off())}},notify(e,r){kl.epoch++;let i=!Tl.length&&!0;for(let i of t)Dl?.has(i)||(Dl?.add(i),Tl.push(i,n,e,r));i&&Al()},off(){},set(e){let t=n.value;n.eq(t,e)||(n.value=e,n.notify(t))},subscribe(e){let t=n.listen(e);return e(n.value),t},value:e};return n},Ml=2,Nl=5,Pl=6,Fl=10,Il=(e,t,n,r)=>(e.events=e.events||{},e.events[n+Fl]||(e.events[n+Fl]=r(t=>{e.events[n].reduceRight((e,t)=>(t(e),e),{shared:{},...t})})),e.events[n]=e.events[n]||[],e.events[n].push(t),()=>{let r=e.events[n],i=r.indexOf(t);r.splice(i,1),r.length||(delete e.events[n],e.events[n+Fl](),delete e.events[n+Fl])}),Ll=(e,t)=>Il(e,t,Ml,t=>{let n=e.set,r=e.setKey;return e.setKey&&=(n,i)=>{let a;if(t({abort:()=>{a=!0},changed:n,newValue:{...e.value,[n]:i}}),!a)return r(n,i)},e.set=e=>{let r;if(t({abort:()=>{r=!0},newValue:e}),!r)return n(e)},()=>{e.set=n,e.setKey=r}}),Rl=1e3,zl=(e,t)=>Il(e,n=>{let r=t(n);r&&e.events[Pl].push(r)},Nl,t=>{let n=e.listen;e.listen=(...r)=>(!e.lc&&!e.active&&(e.active=!0,t()),n(...r));let r=e.off;return e.events[Pl]=[],e.off=()=>{r(),setTimeout(()=>{if(e.active&&!e.lc){e.active=!1;for(let t of e.events[Pl])t();e.events[Pl]=[]}},Rl)},()=>{e.listen=n,e.off=r}});function Bl(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null}function Vl(e,t){if(e===t)return!0;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(!Vl(e[n],t[n]))return!1;return!0}if(Bl(e)&&Bl(t)){let n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(let r of n)if(!(r in t)||!Vl(e[r],t[r]))return!1;return!0}return!1}function Hl(e,t){return Ll(e,({newValue:n,abort:r})=>{t(e.value,n)&&r()})}var Ul=Symbol.for(`better-auth:focus-manager`),Wl=class{listeners=new Set;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setFocused(e){this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||typeof document>`u`||window.addEventListener===void 0)return()=>{};let e=()=>{document.visibilityState===`visible`&&this.setFocused(!0)};return document.addEventListener(`visibilitychange`,e,!1),()=>{document.removeEventListener(`visibilitychange`,e,!1)}}};function Gl(){return globalThis[Ul]||(globalThis[Ul]=new Wl),globalThis[Ul]}var Kl=Symbol.for(`better-auth:online-manager`),ql=class{listeners=new Set;isOnline=typeof navigator<`u`?navigator.onLine:!0;subscribe(e){return this.listeners.add(e),()=>{this.listeners.delete(e)}}setOnline(e){this.isOnline=e,this.listeners.forEach(t=>t(e))}setup(){if(typeof window>`u`||window.addEventListener===void 0)return()=>{};let e=()=>this.setOnline(!0),t=()=>this.setOnline(!1);return window.addEventListener(`online`,e,!1),window.addEventListener(`offline`,t,!1),()=>{window.removeEventListener(`online`,e,!1),window.removeEventListener(`offline`,t,!1)}}};function Jl(){return globalThis[Kl]||(globalThis[Kl]=new ql),globalThis[Kl]}var Yl={proto:/"(?:_|\\u0{2}5[Ff]){2}(?:p|\\u0{2}70)(?:r|\\u0{2}72)(?:o|\\u0{2}6[Ff])(?:t|\\u0{2}74)(?:o|\\u0{2}6[Ff])(?:_|\\u0{2}5[Ff]){2}"\s*:/,constructor:/"(?:c|\\u0063)(?:o|\\u006[Ff])(?:n|\\u006[Ee])(?:s|\\u0073)(?:t|\\u0074)(?:r|\\u0072)(?:u|\\u0075)(?:c|\\u0063)(?:t|\\u0074)(?:o|\\u006[Ff])(?:r|\\u0072)"\s*:/,protoShort:/"__proto__"\s*:/,constructorShort:/"constructor"\s*:/},Xl=/^\s*["[{]|^\s*-?\d{1,16}(\.\d{1,17})?([Ee][+-]?\d+)?\s*$/,Zl={true:!0,false:!1,null:null,undefined:void 0,nan:NaN,infinity:1/0,"-infinity":-1/0},Ql=/^(\d{4})-(\d{2})-(\d{2})T(\d{2}):(\d{2}):(\d{2})(?:\.(\d{1,7}))?(?:Z|([+-])(\d{2}):(\d{2}))$/;function $l(e){return e instanceof Date&&!isNaN(e.getTime())}function eu(e){let t=Ql.exec(e);if(!t)return null;let[,n,r,i,a,o,s,c,l,u,d]=t,f=new Date(Date.UTC(parseInt(n,10),parseInt(r,10)-1,parseInt(i,10),parseInt(a,10),parseInt(o,10),parseInt(s,10),c?parseInt(c.padEnd(3,`0`),10):0));if(l){let e=(parseInt(u,10)*60+parseInt(d,10))*(l===`+`?-1:1);f.setUTCMinutes(f.getUTCMinutes()+e)}return $l(f)?f:null}function tu(e,t={}){let{strict:n=!1,warnings:r=!1,reviver:i,parseDates:a=!0}=t;if(typeof e!=`string`)return e;let o=e.trim(),s=o.toLowerCase();if(s.length<=9&&s in Zl)return Zl[s];if(!Xl.test(o)){if(n)throw SyntaxError(`[better-json] Invalid JSON`);return e}if(Object.entries(Yl).some(([e,t])=>{let n=t.test(o);return n&&r&&console.warn(`[better-json] Detected potential prototype pollution attempt using ${e} pattern`),n})&&n)throw Error(`[better-json] Potential prototype pollution attempt detected`);try{return JSON.parse(o,(e,t)=>{if(e===`__proto__`||e===`constructor`&&t&&typeof t==`object`&&`prototype`in t){r&&console.warn(`[better-json] Dropping "${e}" key to prevent prototype pollution`);return}if(a&&typeof t==`string`){let e=eu(t);if(e)return e}return i?i(e,t):t})}catch(t){if(n)throw t;return e}}function nu(e,t={strict:!0}){return tu(e,t)}var ru=()=>typeof window>`u`;function iu(e,t){return Vl(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}var au=(e,t,n,r)=>{let i=jl({data:null,error:null,isPending:!0,isRefetching:!1,refetch:e=>a(e)});zl(i,()=>Hl(i,iu));let a=async e=>new Promise(a=>{let o=typeof r==`function`?r({data:i.get().data,error:i.get().error,isPending:i.get().isPending}):r;n(t,{...o,query:{...o?.query,...e?.query},async onSuccess(e){let t=i.get(),n=t.data!=null&&e.data!=null&&Vl(t.data,e.data)?t.data:e.data;i.set({data:n,error:null,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onSuccess?.(e)},async onError(e){let{request:t}=e,n=typeof t.retry==`number`?t.retry:t.retry?.attempts,r=t.retryAttempt||0;if(n&&r<n)return;let a=e.error.status===401;i.set({error:e.error,data:a?null:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch}),await o?.onError?.(e)},async onRequest(e){let t=i.get();i.set({isPending:t.data===null,data:t.data,error:null,isRefetching:!0,refetch:i.value.refetch}),await o?.onRequest?.(e)}}).catch(e=>{i.set({error:e,data:i.get().data,isPending:!1,isRefetching:!1,refetch:i.value.refetch})}).finally(()=>{a(void 0)})});e=Array.isArray(e)?e:[e];let o=!1,s=!1,c=!1,l=()=>{if(o){c=!0;return}o=!0,a().finally(()=>{o=!1;let e=c&&s;c=!1,e&&l()})};return zl(i,()=>{if(ru())return;s=!0;let t=!1,n,r=e.map(e=>e.listen(()=>{t?a():(t=!0,clearTimeout(n),l())}));return n=setTimeout(()=>{t=!0,l()},0),()=>{s=!1;for(let e of r)e();clearTimeout(n)}}),i},ou=()=>Math.floor(Date.now()/1e3),su=5;function cu(e){let{fetchSession:t,shouldPollSession:n=()=>!0,sessionSignal:r,options:i={}}=e,a=i.sessionOptions?.refetchInterval??0,o=i.sessionOptions?.refetchOnWindowFocus??!0,s=i.sessionOptions?.refetchWhenOffline??!1,c={isInitialized:!1,lastSessionRequest:0},l=()=>s||Jl().isOnline,u=e=>{if(l()){if(e?.event===`storage`){t();return}if(e?.event===`poll`){c.lastSessionRequest=ou(),t();return}if(e?.event===`visibilitychange`){if(ou()-c.lastSessionRequest<su)return;c.lastSessionRequest=ou(),t();return}t()}},d=e=>{wl().post({event:`session`,data:{trigger:e},clientId:Math.random().toString(36).substring(7)})},f=()=>{a&&a>0&&(c.pollInterval=setInterval(()=>{n()&&u({event:`poll`})},a*1e3))},p=()=>{c.unsubscribeBroadcast=wl().subscribe(()=>{u({event:`storage`})})},m=()=>{o&&(c.unsubscribeFocus=Gl().subscribe(()=>{u({event:`visibilitychange`})}))},h=()=>{c.unsubscribeOnline=Jl().subscribe(e=>{e&&u({event:`visibilitychange`})})},g=()=>{c.unsubscribeSignal=r.listen(()=>{t()})};return{init:()=>{c.isInitialized||(c.isInitialized=!0,f(),p(),m(),h(),g(),c.cleanupBroadcastSetup=wl().setup(),c.cleanupFocusSetup=Gl().setup(),c.cleanupOnlineSetup=Jl().setup())},cleanup:()=>{c.isInitialized&&(c.pollInterval&&=(clearInterval(c.pollInterval),void 0),c.unsubscribeBroadcast&&=(c.unsubscribeBroadcast(),void 0),c.unsubscribeFocus&&=(c.unsubscribeFocus(),void 0),c.unsubscribeOnline&&=(c.unsubscribeOnline(),void 0),c.unsubscribeSignal&&=(c.unsubscribeSignal(),void 0),c.cleanupBroadcastSetup&&=(c.cleanupBroadcastSetup(),void 0),c.cleanupFocusSetup&&=(c.cleanupFocusSetup(),void 0),c.cleanupOnlineSetup&&=(c.cleanupOnlineSetup(),void 0),c.isInitialized=!1,c.lastSessionRequest=0)},triggerRefetch:u,broadcastSessionUpdate:d}}var lu=Object.create(null),uu=e=>({}),du=new Proxy(lu,{get(e,t){return uu()[t]??lu[t]},has(e,t){return t in uu()||t in lu},set(e,t,n){let r=uu(!0);return r[t]=n,!0},deleteProperty(e,t){if(!t)return!1;let n=uu(!0);return delete n[t],!0},ownKeys(){let e=uu(!0);return Object.keys(e)}});du.NODE_ENV;function fu(e,t){return typeof process<`u`?{}[e]??t:typeof Deno<`u`?Deno.env.get(e)??t:typeof Bun<`u`?Bun.env[e]??t:t}Object.freeze({get BETTER_AUTH_SECRET(){return fu(`BETTER_AUTH_SECRET`)},get AUTH_SECRET(){return fu(`AUTH_SECRET`)},get BETTER_AUTH_TELEMETRY(){return fu(`BETTER_AUTH_TELEMETRY`)},get BETTER_AUTH_TELEMETRY_ID(){return fu(`BETTER_AUTH_TELEMETRY_ID`)},get NODE_ENV(){return fu(`NODE_ENV`,`development`)},get PACKAGE_VERSION(){return fu(`PACKAGE_VERSION`,`0.0.0`)},get BETTER_AUTH_TELEMETRY_ENDPOINT(){return fu(`BETTER_AUTH_TELEMETRY_ENDPOINT`,``)}});function pu(){let e=Object.getOwnPropertyDescriptor(Error,`stackTraceLimit`);return e===void 0?Object.isExtensible(Error):Object.prototype.hasOwnProperty.call(e,`writable`)?e.writable:e.set!==void 0}function mu(e){let t=e.split(`
|
|
21
|
-
at `);return t.length<=1?e:(t.splice(1,1),t.join(`
|
|
22
|
-
at `))}function hu(e,t){class n extends e{#e;constructor(...e){if(pu()){let t=Error.stackTraceLimit;Error.stackTraceLimit=0,super(...e),Error.stackTraceLimit=t}else super(...e);let t=Error().stack;t&&(this.#e=mu(t.replace(/^Error/,this.name)))}get errorStack(){return this.#e}}return Object.defineProperty(n.prototype,"constructor",{get(){return t},enumerable:!1,configurable:!0}),n}var gu={OK:200,CREATED:201,ACCEPTED:202,NO_CONTENT:204,MULTIPLE_CHOICES:300,MOVED_PERMANENTLY:301,FOUND:302,SEE_OTHER:303,NOT_MODIFIED:304,TEMPORARY_REDIRECT:307,BAD_REQUEST:400,UNAUTHORIZED:401,PAYMENT_REQUIRED:402,FORBIDDEN:403,NOT_FOUND:404,METHOD_NOT_ALLOWED:405,NOT_ACCEPTABLE:406,PROXY_AUTHENTICATION_REQUIRED:407,REQUEST_TIMEOUT:408,CONFLICT:409,GONE:410,LENGTH_REQUIRED:411,PRECONDITION_FAILED:412,PAYLOAD_TOO_LARGE:413,URI_TOO_LONG:414,UNSUPPORTED_MEDIA_TYPE:415,RANGE_NOT_SATISFIABLE:416,EXPECTATION_FAILED:417,"I'M_A_TEAPOT":418,MISDIRECTED_REQUEST:421,UNPROCESSABLE_ENTITY:422,LOCKED:423,FAILED_DEPENDENCY:424,TOO_EARLY:425,UPGRADE_REQUIRED:426,PRECONDITION_REQUIRED:428,TOO_MANY_REQUESTS:429,REQUEST_HEADER_FIELDS_TOO_LARGE:431,UNAVAILABLE_FOR_LEGAL_REASONS:451,INTERNAL_SERVER_ERROR:500,NOT_IMPLEMENTED:501,BAD_GATEWAY:502,SERVICE_UNAVAILABLE:503,GATEWAY_TIMEOUT:504,HTTP_VERSION_NOT_SUPPORTED:505,VARIANT_ALSO_NEGOTIATES:506,INSUFFICIENT_STORAGE:507,LOOP_DETECTED:508,NOT_EXTENDED:510,NETWORK_AUTHENTICATION_REQUIRED:511};hu(class extends Error{status;body;headers;statusCode;constructor(e=`INTERNAL_SERVER_ERROR`,t=void 0,n={},r=typeof e==`number`?e:gu[e]){super(t?.message,t?.cause?{cause:t.cause}:void 0),this.status=e,this.body=t,this.headers=n,this.statusCode=r,this.name=`APIError`,this.status=e,this.headers=n,this.statusCode=r,this.body=t}},Error);var _u=class extends Error{constructor(e,t){super(e,t),this.name=`BetterAuthError`,this.message=e,this.stack=``}},vu=47;function yu(e){let t=e.length;for(;t>0&&e.charCodeAt(t-1)===vu;)t--;return t===e.length?e:e.slice(0,t)}function bu(e){try{return(yu(new URL(e).pathname)||`/`)!==`/`}catch{throw new _u(`Invalid base URL: ${e}. Please provide a valid base URL.`)}}function xu(e){try{let t=new URL(e);if(t.protocol!==`http:`&&t.protocol!==`https:`)throw new _u(`Invalid base URL: ${e}. URL must include 'http://' or 'https://'`)}catch(t){throw t instanceof _u?t:new _u(`Invalid base URL: ${e}. Please provide a valid base URL.`,{cause:t})}}function Su(e,t=`/api/auth`){if(xu(e),bu(e))return e;let n=yu(e);return!t||t===`/`?n:(t=t.startsWith(`/`)?t:`/${t}`,`${n}${t}`)}function Cu(e,t){return!e||e.trim()===``?!1:t===`proto`?e===`http`||e===`https`:t===`host`?[/\.\./,/\0/,/[\s]/,/^[.]/,/[<>'"]/,/javascript:/i,/file:/i,/data:/i].some(t=>t.test(e))?!1:/^[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(\.[a-zA-Z0-9]([a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*(:[0-9]{1,5})?$/.test(e)||/^(\d{1,3}\.){3}\d{1,3}(:[0-9]{1,5})?$/.test(e)||/^\[[0-9a-fA-F:]+\](:[0-9]{1,5})?$/.test(e)||/^localhost(:[0-9]{1,5})?$/i.test(e):!1}function wu(e,t,n,r,i){if(e)return Su(e,t);if(r!==!1){let e=du.BETTER_AUTH_URL||du.NEXT_PUBLIC_BETTER_AUTH_URL||du.PUBLIC_BETTER_AUTH_URL||du.NUXT_PUBLIC_BETTER_AUTH_URL||du.NUXT_PUBLIC_AUTH_URL||(du.BASE_URL===`/`?void 0:du.BASE_URL);if(e)return Su(e,t)}let a=n?.headers.get(`x-forwarded-host`),o=n?.headers.get(`x-forwarded-proto`);if(a&&o&&i&&Cu(o,`proto`)&&Cu(a,`host`))try{return Su(`${o}://${a}`,t)}catch{}if(n){let e=Tu(n.url);if(!e)throw new _u(`Could not get origin from request. Please provide a valid base URL.`);return Su(e,t)}if(typeof window<`u`&&window.location)return Su(window.location.origin,t)}function Tu(e){try{let t=new URL(e);return t.origin===`null`?null:t.origin}catch{return null}}var Eu=[`javascript:`,`data:`,`vbscript:`];function Du(e){let t;try{t=new URL(e)}catch{return!0}return!Eu.includes(t.protocol)}var Ou={id:`redirect`,name:`Redirect`,hooks:{onSuccess(e){if(e.data?.url&&e.data?.redirect&&Du(e.data.url)&&typeof window<`u`&&window.location&&window.location)try{window.location.href=e.data.url}catch{}}}},ku=()=>typeof window>`u`,Au=Rl;function ju(e,t){if(typeof window>`u`)return;let n=e.get();n.data===null&&t!==null&&e.set({...n,data:t,error:null,isPending:!1})}function Mu(e){return typeof e==`object`&&e&&`data`in e&&`error`in e?e:{data:e,error:null}}function Nu(e){return!e||e.session===null&&e.user===null?null:e}function Pu(e,t){return Vl(e.data,t.data)&&e.error===t.error&&e.isPending===t.isPending&&e.isRefetching===t.isRefetching&&e.refetch===t.refetch}function Fu(e,t){let n=jl(!1),r,i=0,a=0;n.listen(()=>{a++,i=0});let o=e=>u(e),s=jl({data:null,error:null,isPending:!0,isRefetching:!1,refetch:o});Hl(s,Pu);let c=async(t,n)=>{let r=s.value;if(s.set({...r,isPending:r.data===null,isRefetching:!0,error:null,refetch:o}),t.aborted)return`aborted`;try{let r=await e(`/get-session`,{method:`GET`,query:n?.query,signal:t});if(t.aborted)return`aborted`;let{data:i,error:a}=Mu(r),c=`fresh`;if(i?.needsRefresh)try{let n=await e(`/get-session`,{method:`POST`,signal:t});if(t.aborted)return`aborted`;({data:i,error:a}=Mu(n))}catch{if(t.aborted)return`aborted`;c=`stale`}if(a){let e=s.value,t=a?.status===401;return s.set({data:t?null:e.data,error:a,isPending:!1,isRefetching:!1,refetch:o}),`failed`}let l=Nu(i),u=s.value,d=u.data!=null&&l!=null&&Vl(u.data,l)?u.data:l;return s.set({data:d,error:null,isPending:!1,isRefetching:!1,refetch:o}),c}catch(e){if(t.aborted)return`aborted`;let n=s.value;return s.set({data:n.data,error:e,isPending:!1,isRefetching:!1,refetch:o}),`failed`}},l=()=>{let e=s.value.data?.session?.expiresAt,t=e instanceof Date?e.getTime():1/0;return Math.min(Date.now()+Au,t)},u=e=>{i=0,r?.cancel();let t=new AbortController,n={cancel:()=>t.abort(),promise:Promise.resolve().then(()=>t.signal.aborted?`aborted`:c(t.signal,e)),revision:a};r=n;let o=e=>{r===n&&(r=void 0,e===`fresh`&&n.revision===a&&(i=l()))};return n.promise.then(o,()=>o(`failed`)),n.promise.then(()=>void 0)},d=()=>r?.revision===a?r.promise.then(()=>void 0):Date.now()<i?Promise.resolve():u(),f=()=>{};return zl(s,()=>{let e;ku()||(e=setTimeout(()=>{d()},0));let r=cu({fetchSession:u,shouldPollSession:()=>s.value.data!=null,sessionSignal:n,options:t});return r.init(),f=r.broadcastSessionUpdate,()=>{e&&clearTimeout(e),r.cleanup()}}),{session:s,$sessionSignal:n,broadcastSessionUpdate:e=>f(e)}}function Iu(e){if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null||Symbol.iterator in e?!1:Symbol.toStringTag in e?Object.prototype.toString.call(e)===`[object Module]`:!0}function Lu(e,t,n=`.`,r){if(!Iu(t))return Lu(e,{},n,r);let i={...t};for(let t of Object.keys(e)){if(t===`__proto__`||t===`constructor`)continue;let a=e[t];a!=null&&(r&&r(i,t,a,n)||(i[t]=Array.isArray(a)&&Array.isArray(i[t])?[...a,...i[t]]:Iu(a)&&Iu(i[t])?Lu(a,i[t],(n?`${n}.`:``)+t.toString(),r):a))}return i}function Ru(e){return(...t)=>t.reduce((t,n)=>Lu(t,n,``,e),{})}var zu=Ru(),Bu=Object.defineProperty,Vu=Object.defineProperties,Hu=Object.getOwnPropertyDescriptors,Uu=Object.getOwnPropertySymbols,Wu=Object.prototype.hasOwnProperty,Gu=Object.prototype.propertyIsEnumerable,Ku=(e,t,n)=>t in e?Bu(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,qu=(e,t)=>{for(var n in t||={})Wu.call(t,n)&&Ku(e,n,t[n]);if(Uu)for(var n of Uu(t))Gu.call(t,n)&&Ku(e,n,t[n]);return e},Ju=(e,t)=>Vu(e,Hu(t)),Yu=class extends Error{constructor(e,t,n){super(t||e.toString(),{cause:n}),this.status=e,this.statusText=t,this.error=n,Error.captureStackTrace(this,this.constructor)}},Xu=async(e,t)=>{let n=t||{},r={onRequest:[t?.onRequest],onResponse:[t?.onResponse],onSuccess:[t?.onSuccess],onError:[t?.onError],onRetry:[t?.onRetry]};if(!t||!t?.plugins)return{url:e,options:n,hooks:r};for(let i of t?.plugins||[]){if(i.init){let r=await i.init?.call(i,e.toString(),t);n=r.options||n,e=r.url}r.onRequest.push(i.hooks?.onRequest),r.onResponse.push(i.hooks?.onResponse),r.onSuccess.push(i.hooks?.onSuccess),r.onError.push(i.hooks?.onError),r.onRetry.push(i.hooks?.onRetry)}return{url:e,options:n,hooks:r}},Zu=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(){return this.options.delay}},Qu=class{constructor(e){this.options=e}shouldAttemptRetry(e,t){return this.options.shouldRetry?Promise.resolve(e<this.options.attempts&&this.options.shouldRetry(t)):Promise.resolve(e<this.options.attempts)}getDelay(e){return Math.min(this.options.maxDelay,this.options.baseDelay*2**e)}};function $u(e){if(typeof e==`number`)return new Zu({type:`linear`,attempts:e,delay:1e3});switch(e.type){case`linear`:return new Zu(e);case`exponential`:return new Qu(e);default:throw Error(`Invalid retry strategy`)}}var ed=async e=>{let t={},n=async e=>typeof e==`function`?await e():e;if(e?.auth){if(e.auth.type===`Bearer`){let r=await n(e.auth.token);if(!r)return t;t.authorization=`Bearer ${r}`}else if(e.auth.type===`Basic`){let[r,i]=await Promise.all([n(e.auth.username),n(e.auth.password)]);if(!r||!i)return t;t.authorization=`Basic ${btoa(`${r}:${i}`)}`}else if(e.auth.type===`Custom`){let[r,i]=await Promise.all([n(e.auth.prefix),n(e.auth.value)]);if(!i)return t;t.authorization=`${r??``} ${i}`}}return t},td=/^application\/(?:[\w!#$%&*.^`~-]*\+)?json(;.+)?$/i;function nd(e){let t=e.headers.get(`content-type`),n=new Set([`image/svg`,`application/xml`,`application/xhtml`,`application/html`]);if(!t)return`json`;let r=t.split(`;`).shift()||``;return td.test(r)?`json`:n.has(r)||r.startsWith(`text/`)?`text`:`blob`}function rd(e){try{return JSON.parse(e),!0}catch{return!1}}function H(e){if(e===void 0)return!1;let t=typeof e;return t===`string`||t===`number`||t===`boolean`||t===null?!0:t===`object`?Array.isArray(e)?!0:e.buffer?!1:e.constructor&&e.constructor.name===`Object`||typeof e.toJSON==`function`:!1}function id(e){try{return JSON.parse(e)}catch{return e}}function U(e){return typeof e==`function`}function W(e){if(e?.customFetchImpl)return e.customFetchImpl;if(typeof globalThis<`u`&&U(globalThis.fetch))return globalThis.fetch;if(typeof window<`u`&&U(window.fetch))return window.fetch;throw Error(`No fetch implementation found`)}function G(...e){let t={};for(let n of e)if(n){if(n instanceof Headers)n.forEach((e,n)=>{t[n]=e});else{let e=Array.isArray(n)?n:Object.entries(n);for(let[n,r]of e)r!=null&&(t[n]=r)}}return t}async function ad(e){let t=new Headers(G(e?.headers,await ed(e)));if(!t.has(`content-type`)){let n=od(e?.body);n&&t.set(`content-type`,n)}return t}function od(e){return H(e)?`application/json`:null}function sd(e){let t=e.get(`content-type`);return t?t.split(`;`)[0].trim().toLowerCase():null}function cd(e,t){let{body:n}=e;return n?!H(n)||typeof n==`string`?n:sd(t)===`application/x-www-form-urlencoded`?new URLSearchParams(n).toString():JSON.stringify(n):null}function ld(e,t){if(t?.method)return t.method.toUpperCase();if(e.startsWith(`@`)){let n=e.split(`@`)[1]?.split(`/`)[0];return pd.includes(n)?n.toUpperCase():t?.body?`POST`:`GET`}return t?.body?`POST`:`GET`}function ud(e,t){let n;return!e?.signal&&e?.timeout&&(n=setTimeout(()=>t?.abort(),e?.timeout)),{abortTimeout:n,clearTimeout:()=>{n&&clearTimeout(n)}}}var dd=class e extends Error{constructor(t,n){super(n||JSON.stringify(t,null,2)),this.issues=t,Object.setPrototypeOf(this,e.prototype)}};async function fd(e,t){let n=await e[`~standard`].validate(t);if(n.issues)throw new dd(n.issues);return n.value}var pd=[`get`,`post`,`put`,`patch`,`delete`],md=e=>({id:`apply-schema`,name:`Apply Schema`,version:`1.0.0`,async init(t,n){let r=e.plugins?.find(e=>e.schema?.config?t.startsWith(e.schema.config.baseURL||``)||t.startsWith(e.schema.config.prefix||``):!1)?.schema||e.schema;if(r){let e=t;r.config?.prefix&&e.startsWith(r.config.prefix)&&(e=e.replace(r.config.prefix,``),r.config.baseURL&&(t=t.replace(r.config.prefix,r.config.baseURL))),r.config?.baseURL&&e.startsWith(r.config.baseURL)&&(e=e.replace(r.config.baseURL,``)),e.startsWith(`/`)&&e.charAt(1)===`@`&&(e=e.substring(1));let i=r.schema[e];if(i){let e=n?.headers;if(i.headers&&!n?.disableValidation){let t={};if(n?.headers){if(n.headers instanceof Headers)n.headers.forEach((e,n)=>{t[n.toLowerCase()]=e});else if(typeof n.headers==`object`)for(let[e,r]of Object.entries(n.headers))r!=null&&(t[e.toLowerCase()]=r)}let r=await fd(i.headers,t),a={};for(let[e,t]of Object.entries(r))a[e.toLowerCase()]=t;e=a}let r=Ju(qu({},n),{method:i.method,output:i.output,headers:e});return n?.disableValidation||(r=Ju(qu({},r),{body:i.input?await fd(i.input,n?.body):n?.body,params:i.params?await fd(i.params,n?.params):n?.params,query:i.query?await fd(i.query,n?.query):n?.query})),{url:t,options:r}}}return{url:t,options:n}}}),hd=e=>{async function t(t,n){let r=Ju(qu(qu({},e),n),{headers:G(e?.headers,n?.headers),plugins:[...e?.plugins||[],md(e||{}),...n?.plugins||[]]});if(e?.catchAllError)try{return await yd(t,r)}catch(e){return{data:null,error:{status:500,statusText:`Fetch Error`,message:`Fetch related error. Captured by catchAllError option. See error property for more details.`,error:e}}}return await yd(t,r)}return t},gd=e=>e===`.`||e===`..`;function _d(e,t){let n=e;for(let[e,r]of t)n=n.replace(e,r);if(gd(n))throw TypeError(`Path parameters cannot be reserved path segments`);return encodeURIComponent(n)}function vd(e,t){let{baseURL:n,params:r,query:i}=t||{query:{},params:{},baseURL:``},a=e.startsWith(`http`)?e.split(`/`).slice(0,3).join(`/`):n||``;if(e.startsWith(`@`)){let t=e.toString().split(`@`)[1].split(`/`)[0];pd.includes(t)&&(e=e.replace(`@${t}/`,`/`))}a.endsWith(`/`)||(a+=`/`);let[o,s]=e.replace(a,``).split(`?`),c=new URLSearchParams(s);for(let[e,t]of Object.entries(i||{})){if(t==null)continue;let n;if(typeof t==`string`)n=t;else if(Array.isArray(t)){for(let n of t)c.append(e,n);continue}else n=JSON.stringify(t);c.set(e,n)}let l=new Map;if(r){if(Array.isArray(r)){let e=o.split(`/`).filter(e=>e.startsWith(`:`));for(let[t,n]of e.entries()){let e=r[t];l.set(n,String(e))}}else for(let[e,t]of Object.entries(r))l.set(`:${e}`,String(t))}o=o.split(`/`).map(e=>_d(e,l)).join(`/`),o=o.replace(/^\/+/,``);let u=c.toString();return u=u.length>0?`?${u}`.replace(/\+/g,`%20`):``,a.startsWith(`http`)?new URL(`${o}${u}`,a):`${a}${o}${u}`}var yd=async(e,t)=>{let{hooks:n,url:r,options:i}=await Xu(e,t),a=W(i),o=new AbortController,s=i.signal??o.signal,c=vd(r,i),l=await ad(i),u=cd(i,l),d=ld(r,i),f=Ju(qu({},i),{url:c,headers:l,body:u,method:d,signal:s});for(let e of n.onRequest)if(e){let t=await e(f);typeof t==`object`&&t&&Object.assign(f,t)}(`pipeTo`in f&&typeof f.pipeTo==`function`||typeof t?.body?.pipe==`function`)&&(`duplex`in f||(f.duplex=`half`));let{clearTimeout:p}=ud(i,o),m=await a(f.url,f);p();let h={response:m,request:f};for(let e of n.onResponse)if(e){let n=await e(Ju(qu({},h),{response:t?.hookOptions?.cloneResponse?m.clone():m}));n instanceof Response?m=n:typeof n==`object`&&n&&(m=n.response)}if(m.ok){if(f.method===`HEAD`)return{data:``,error:null};let e=nd(m),r={data:null,response:m,request:f};if(e===`json`||e===`text`){let e=await m.text();r.data=await(f.jsonParser??id)(e)}else r.data=await m[e]();f?.output&&f.output&&!f.disableValidation&&(r.data=await fd(f.output,r.data));for(let e of n.onSuccess)e&&await e(Ju(qu({},r),{response:t?.hookOptions?.cloneResponse?m.clone():m}));return t?.throw?r.data:{data:r.data,error:null}}let g=t?.jsonParser??id,_=await m.text(),v=rd(_),y=v?await g(_):null,b={response:m,responseText:_,request:f,error:Ju(qu({},y),{status:m.status,statusText:m.statusText})};for(let e of n.onError)e&&await e(Ju(qu({},b),{response:t?.hookOptions?.cloneResponse?m.clone():m}));if(t?.retry){let r=$u(t.retry),i=t.retryAttempt??0;if(await r.shouldAttemptRetry(i,m)){for(let e of n.onRetry)e&&await e(h);let a=r.getDelay(i);return await new Promise(e=>setTimeout(e,a)),await yd(e,Ju(qu({},t),{retryAttempt:i+1}))}}if(t?.throw)throw new Yu(m.status,m.statusText,v?y:_);return{data:null,error:Ju(qu({},y),{status:m.status,statusText:m.statusText})}},bd=e=>{if(typeof process>`u`)return;let t=e??`/api/auth`;if({}.NEXT_PUBLIC_AUTH_URL)return{}.NEXT_PUBLIC_AUTH_URL;if(typeof window>`u`){if({}.NEXTAUTH_URL)try{return{}.NEXTAUTH_URL}catch{}if({}.VERCEL_URL)try{let e={}.VERCEL_URL.startsWith(`http`)?``:`https://`;return`${new URL(`${e}${{}.VERCEL_URL}`).origin}${t}`}catch{}}},xd=(e,t)=>{let n=`credentials`in Request.prototype,r=wu(e?.baseURL,e?.basePath,void 0,t)??bd(e?.basePath)??`/api/auth`,i=e?.plugins?.flatMap(e=>e.fetchPlugins).filter(e=>e!==void 0)||[],a={id:`lifecycle-hooks`,name:`lifecycle-hooks`,hooks:{onSuccess:e?.fetchOptions?.onSuccess,onError:e?.fetchOptions?.onError,onRequest:e?.fetchOptions?.onRequest,onResponse:e?.fetchOptions?.onResponse}},{onSuccess:o,onError:s,onRequest:c,onResponse:l,...u}=e?.fetchOptions||{},d=hd({baseURL:r,...n?{credentials:`include`}:{},method:`GET`,jsonParser(e){return e?nu(e,{strict:!1}):null},customFetchImpl:fetch,...u,plugins:[a,...u.plugins||[],...e?.disableDefaultFetchPlugins?[]:[Ou],...i]}),{$sessionSignal:f,session:p,broadcastSessionUpdate:m}=Fu(d,e),h=!1,g=e=>{h||e===null||(h=!0,ju(p,e))},_=e?.plugins||[],v={},y={$sessionSignal:f,session:p},b={"/sign-out":`POST`,"/revoke-sessions":`POST`,"/revoke-other-sessions":`POST`,"/delete-user":`POST`},x=[{signal:`$sessionSignal`,matcher(e){return e===`/sign-out`||e===`/update-user`||e===`/update-session`||e===`/sign-up/email`||e===`/sign-in/email`||e===`/delete-user`||e===`/verify-email`||e===`/revoke-sessions`||e===`/revoke-session`||e===`/revoke-other-sessions`||e===`/change-email`||e===`/change-password`},callback(e){e===`/sign-out`?m(`signout`):(e===`/update-user`||e===`/update-session`)&&m(`updateUser`)}}];for(let e of _)e.getAtoms&&Object.assign(y,e.getAtoms?.(d)),e.pathMethods&&Object.assign(b,e.pathMethods),e.atomListeners&&x.push(...e.atomListeners);let S={notify:e=>{y[e].set(!y[e].get())},listen:(e,t)=>{y[e].subscribe(t)},atoms:y};for(let t of _)t.getActions&&(v=zu(t.getActions?.(d,S,e)??{},v));return{get baseURL(){return r},pluginsActions:v,pluginsAtoms:y,pluginPathMethods:b,atomListeners:x,hydrateSession:g,$sessionSignal:f,$fetch:d,$store:S}};function Sd(e){return typeof e==`object`&&!!e&&`get`in e&&typeof e.get==`function`&&`lc`in e&&typeof e.lc==`number`}function Cd(e){return e.charAt(0).toUpperCase()+e.slice(1)}var wd=/[\p{Ll}\d]+|\p{Lu}+(?!\p{Ll})|\p{Lu}[\p{Ll}\d]+|\p{Lo}+/gu,Td=/['\u2019]/g;function Ed(e){return e.replace(Td,``).match(wd)??[]}function Dd(e){return Ed(e).map(e=>e.toLowerCase()).join(`-`)}function Od(e,t,n){let r=t[e],{fetchOptions:i,query:a,...o}=n||{};return r||(i?.method?i.method:o&&Object.keys(o).length>0?`POST`:`GET`)}function kd(e,t,n,r,i){function a(o=[]){return new Proxy(function(){},{get(t,n){if(typeof n!=`string`||n===`then`||n===`catch`||n===`finally`)return;let r=[...o,n],i=e;for(let e of r)if(i&&typeof i==`object`&&e in i)i=i[e];else{i=void 0;break}return typeof i==`function`||Sd(i)?i:a(r)},apply:async(e,a,s)=>{let c=`/`+o.map(Dd).join(`/`),l=s[0]||{},u=s[1]||{},{query:d,fetchOptions:f,...p}=l,m={...u,...f},h=Od(c,n,l);return await t(c,{...m,body:h===`GET`?void 0:{...p,...m?.body||{}},query:d||m?.query,method:h,async onSuccess(e){if(await m?.onSuccess?.(e),!i||m.disableSignal)return;let t=i.filter(e=>e.matcher(c));if(!t.length)return;let n=new Set;for(let e of t){let t=r[e.signal];if(!t)return;if(n.has(e.signal))continue;n.add(e.signal);let i=t.get();setTimeout(()=>{t.set(!i)},10),e.callback?.(c)}}})}})}return a()}function Ad(e){let{pluginPathMethods:t,pluginsActions:n,pluginsAtoms:r,hydrateSession:i,$fetch:a,atomListeners:o,$store:s}=xd(e),c={};for(let[e,t]of Object.entries(r))c[`use${Cd(e)}`]=t;return kd({...n,...c,hydrateSession:i,$fetch:a,$store:s},a,t,r,o)}var jd=(e,{$listPasskeys:t,$store:n})=>({signIn:{passkey:async(r,i)=>{let a=await e(`/passkey/generate-authenticate-options`,{method:`GET`,throw:!1});if(!a.data)return a;let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s;try{s=await yl({optionsJSON:{...a.data,extensions:o},useBrowserAutofill:r?.autoFill})}catch(e){return{data:null,error:{code:e instanceof ll?e.code:`AUTH_CANCELLED`,message:tl.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}try{let{clientExtensionResults:a,...o}=s,c=await e(`/passkey/verify-authentication`,{body:{response:o},...r?.fetchOptions,...i,method:`POST`,throw:!1});return t.set(Math.random()),n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...c,webauthn:{response:s,clientExtensionResults:a}}:c}catch(e){return console.error(`[Better Auth] Error verifying passkey`,e),{data:null,error:{code:`AUTH_CANCELLED`,message:tl.AUTH_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}}}},passkey:{addPasskey:async(r,i)=>{let a=await e(`/passkey/generate-register-options`,{method:`GET`,query:{...r?.authenticatorAttachment&&{authenticatorAttachment:r.authenticatorAttachment},...r?.name&&{name:r.name},...r?.context&&{context:r.context}},throw:!1});if(!a.data)return a;try{let o=a.data.extensions||r?.extensions?{...a.data.extensions||{},...r?.extensions||{}}:void 0,s=await ml({optionsJSON:{...a.data,extensions:o},useAutoRegister:r?.useAutoRegister}),{clientExtensionResults:c,...l}=s,u=await e(`/passkey/verify-registration`,{...r?.fetchOptions,...i,body:{response:l,name:r?.name,...r?.createSession&&{createSession:!0}},method:`POST`,throw:!1});return u.data?(t.set(Math.random()),u.data.session&&n.notify(`$sessionSignal`),r?.returnWebAuthnResponse?{...u,webauthn:{response:s,clientExtensionResults:c}}:u):u}catch(e){return e instanceof ll?e.code===`ERROR_AUTHENTICATOR_PREVIOUSLY_REGISTERED`?{data:null,error:{code:e.code,message:tl.PREVIOUSLY_REGISTERED.message,status:400,statusText:`BAD_REQUEST`}}:e.code===`ERROR_CEREMONY_ABORTED`?{data:null,error:{code:e.code,message:tl.REGISTRATION_CANCELLED.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:e.code,message:e.message,status:400,statusText:`BAD_REQUEST`}}:{data:null,error:{code:`UNKNOWN_ERROR`,message:e instanceof Error?e.message:tl.UNKNOWN_ERROR.message,status:500,statusText:`INTERNAL_SERVER_ERROR`}}}}},$Infer:{}}),Md=()=>{let e=jl();return{id:`passkey`,version:nl,$InferServerPlugin:{},getActions:(t,n)=>jd(t,{$listPasskeys:e,$store:n}),getAtoms(t){return{listPasskeys:au(e,`/passkey/list-user-passkeys`,t,{method:`GET`}),$listPasskeys:e}},pathMethods:{"/passkey/register":`POST`,"/passkey/authenticate":`POST`},atomListeners:[{matcher(e){return e===`/passkey/verify-registration`||e===`/passkey/delete-passkey`||e===`/passkey/update-passkey`||e===`/sign-out`},signal:`$listPasskeys`},{matcher:e=>e===`/passkey/verify-authentication`,signal:`$sessionSignal`}],$ERROR_CODES:tl}},Nd=`1.7.4`,Pd=e=>({id:`sso-client`,version:Nd,$InferServerPlugin:{},pathMethods:{"/sso/providers":`GET`,"/sso/get-provider":`GET`}}),Fd=()=>({id:`magic-link`,version:bl,$InferServerPlugin:{}}),Id=el({INVALID_SESSION_TOKEN:`Invalid session token`}),Ld=()=>({id:`multi-session`,version:bl,$InferServerPlugin:{},atomListeners:[{matcher(e){return e===`/multi-session/set-active`},signal:`$sessionSignal`}],$ERROR_CODES:Id}),Rd=el({OTP_NOT_ENABLED:`OTP not enabled`,OTP_NOT_CONFIGURED:`OTP is not available`,OTP_HAS_EXPIRED:`OTP has expired`,TOTP_NOT_ENABLED:`TOTP not enabled`,TOTP_ALREADY_ENABLED:`TOTP is already enabled`,TOTP_NOT_CONFIGURED:`TOTP is not available`,TWO_FACTOR_NOT_ENABLED:`Two factor isn't enabled`,BACKUP_CODES_NOT_ENABLED:`Backup codes aren't enabled`,INVALID_BACKUP_CODE:`Invalid backup code`,INVALID_CODE:`Invalid code`,TOO_MANY_ATTEMPTS_REQUEST_NEW_CODE:`Too many attempts. Please request a new code.`,ACCOUNT_TEMPORARILY_LOCKED:`Too many failed verification attempts. Your account is temporarily locked. Please try again later.`,INVALID_TWO_FACTOR_COOKIE:`Invalid two factor cookie`}),zd=e=>({id:`two-factor`,version:bl,$InferServerPlugin:{},atomListeners:[{matcher:e=>e.startsWith(`/two-factor/`),signal:`$sessionSignal`}],pathMethods:{"/two-factor/disable":`POST`,"/two-factor/enable":`POST`,"/two-factor/send-otp":`POST`,"/two-factor/generate-backup-codes":`POST`,"/two-factor/get-totp-uri":`POST`,"/two-factor/verify-totp":`POST`,"/two-factor/verify-otp":`POST`,"/two-factor/verify-backup-code":`POST`},fetchPlugins:[{id:`two-factor`,name:`two-factor`,hooks:{async onSuccess(t){if(t.data?.twoFactorRedirect){if(e?.onTwoFactorRedirect){await e.onTwoFactorRedirect({twoFactorMethods:t.data.twoFactorMethods});return}e?.twoFactorPage&&typeof window<`u`&&Du(e.twoFactorPage)&&(window.location.href=e.twoFactorPage)}}}}],$ERROR_CODES:Rd}),Bd=e=>Ad({baseURL:e,withCredentials:!0,plugins:[zd({onTwoFactorRedirect:()=>{let e=new URLSearchParams(window.location.search).get(`redirect_url`),t=e?`/auth/2fa?redirect_url=${encodeURIComponent(e)}`:`/auth/2fa`;window.location.href=t}}),Md(),Fd(),Pd(),Ld()]}),Vd=e=>{let t=e?.editor?.backendURL??a?.backendURL;t||(t=St,console.error(`Backend URL is not defined in the Intlayer configuration.`));let n=Bd(t);return{getAuthClient:()=>n,signInEmail:async(...e)=>n.signIn.email(...e),signUpEmail:async(...e)=>n.signUp.email(...e),signOut:async(...e)=>n.signOut(...e),signInSocial:async(...e)=>n.signIn.social(...e),linkSocial:async(...e)=>n.linkSocial(...e),changePasswordSession:async(...e)=>n.changePassword(...e),requestPasswordResetSession:async(...e)=>n.requestPasswordReset(...e),resetPassword:async(...e)=>n.resetPassword(...e),verifyEmailSession:async(...e)=>n.verifyEmail(...e),getSession:async(...e)=>n.getSession(...e),forgetPassword:async(...e)=>n.requestPasswordReset(...e),sendVerificationEmail:async(...e)=>n.sendVerificationEmail(...e),changeEmail:async(...e)=>n.changeEmail(...e),deleteUser:async(...e)=>n.deleteUser(...e),revokeSession:async(...e)=>n.revokeSession(...e),revokeSessions:async(...e)=>n.revokeSessions(...e),revokeOtherSessions:async(...e)=>n.revokeOtherSessions(...e),listAccounts:async(...e)=>n.listAccounts(...e),unlinkAccount:async(...e)=>n.unlinkAccount(...e),refreshToken:async(...e)=>n.refreshToken(...e),getAccessToken:async(...e)=>n.getAccessToken(...e),accountInfo:async(...e)=>n.accountInfo(...e),updateUser:async(...e)=>n.updateUser(...e),listSessions:async(...e)=>n.listSessions(...e),enableTwoFactor:async(...e)=>n.twoFactor.enable(...e),disableTwoFactor:async(...e)=>n.twoFactor.disable(...e),verifyTotp:async(...e)=>n.twoFactor.verifyTotp(...e),verifyBackupCode:async(...e)=>n.twoFactor.verifyBackupCode(...e),addPasskey:async(...e)=>n.passkey.addPasskey(...e),signInPasskey:async(...e)=>n.signIn.passkey(...e),deletePasskey:async(...e)=>n.passkey.deletePasskey(...e),listPasskeys:async()=>n.$fetch(`/passkey/list-user-passkeys`,{method:`GET`}),signInMagicLink:async(...e)=>n.signIn.magicLink(...e),signInSSO:async(...e)=>n.signIn.sso(...e),registerSSO:async(...e)=>n.sso.register(...e),listSSOProviders:async()=>({data:(await n.sso.providers())?.data?.providers??[]}),deleteSSOProvider:async e=>n.sso.deleteProvider({providerId:e.providerId}),listDeviceSessions:async(...e)=>n.multiSession.listDeviceSessions(...e),revokeDeviceSession:async(...e)=>n.multiSession.revoke(...e),setActiveSession:async(...e)=>n.multiSession.setActive(...e)}},Hd=class extends Error{status;code;data;constructor(e,t){super(e),this.name=`FetcherError`,this.status=t.status,this.code=t.code,this.data=t.data}},Ud={method:`GET`,headers:{"Content-Type":`application/json`},credentials:`include`},Wd=e=>(Object.keys(e).forEach(t=>{e[t]===void 0&&delete e[t]}),e),Gd=e=>e.reduce((e,t)=>{let n=e??{},r=Wd(t??{});return typeof n==`object`&&typeof r==`object`?{...n,...r}:r??n},{}),K=async(e,...t)=>{let{signal:n}=new AbortController,r=``,i,a=Gd([Ud,...t.map(({body:e,params:t,headers:n,...r})=>r)]),o=Gd([Ud.headers,...t.map(e=>e.headers)]),s=Gd(t.map(e=>e.params)),c=a.method;if(c!==`GET`&&c!==`HEAD`){let e=Gd(t.map(e=>e.body));i=o?.[`Content-Type`]===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}Object.entries(s).length>0&&(r=`?${new URLSearchParams(s).toString()}`);let l={...a,headers:o,body:i,signal:n},u=`${e}${r}`,d=await fetch(u,l);if(!d.ok){let e=await d.json().catch(()=>void 0);throw new Hd(JSON.stringify(e?.error)??`An error occurred`,{status:d.status,code:e?.error?.code,data:e?.error})}return await d.json()},Kd=(e={},t)=>{let n=t?.editor?.backendURL??a.backendURL,{clientId:r,clientSecret:i}=t?.editor??{};return{getOAuth2AccessToken:async(e={})=>await K(`${n}/oauth2/token`,{},e,{method:`POST`,headers:{"Content-Type":`application/x-www-form-urlencoded`},body:{grant_type:`client_credentials`,client_id:r,client_secret:i}}),createCliSessionToken:async(t={})=>await K(`${n}/api/cli-session`,e,t,{method:`POST`}),getCliSessionMe:async(t={})=>await K(`${n}/api/cli-session/me`,e,t)}},qd=(e={},t)=>{let n=`${t?.editor?.backendURL??a.backendURL}/api/ai`;return{customQuery:async(t,r={})=>await K(n,e,r,{method:`POST`,body:t}),translateJSON:async(t,r={})=>await K(`${n}/translate/json`,e,r,{method:`POST`,body:t}),auditContentDeclaration:async(t,r={})=>await K(`${n}/audit/dictionary`,e,r,{method:`POST`,body:t}),auditContentDeclarationField:async(t,r={})=>await K(`${n}/audit/dictionary/field`,e,r,{method:`POST`,body:t}),auditContentDeclarationMetadata:async(t,r={})=>await K(`${n}/audit/dictionary/metadata`,e,r,{method:`POST`,body:t}),auditTag:async(t,r={})=>await K(`${n}/audit/tag`,e,r,{method:`POST`,body:t}),askDocQuestion:async(t,r={})=>{if(!t)return;let{onMessage:i,onDone:a,...o}=t,s=new AbortController;try{let t=await fetch(`${n}/ask`,{method:`POST`,headers:{"Content-Type":`application/json`,...e.headers,...r.headers},body:JSON.stringify({...o,...e.body,...r.body}),signal:s.signal,credentials:`include`});if(!t.ok){let e=`An error occurred`;try{let n=await t.json(),r=n.error??n;e=JSON.stringify(r)??`An error occurred`}catch{try{let n=await t.text();n&&(e=n)}catch{}}throw Error(e)}let c=t.body?.getReader();if(!c)throw Error(`No reader available`);let l=new TextDecoder,u=``;for(;;){let{done:e,value:t}=await c.read();if(e)break;u+=l.decode(t,{stream:!0});let n=u.split(`
|
|
23
|
-
`);u=n.pop()??``;for(let e of n)if(e.startsWith(`data: `))try{let t=JSON.parse(e.slice(6));t.chunk&&i?.(t.chunk),t.done&&t.response&&a?.(t.response)}catch(e){console.error(`Failed to parse SSE data:`,e)}}}catch(e){throw console.error(`Error in askDocQuestion:`,e),e}},chat:async(t,r={})=>{if(!t)return;let{onMessage:i,onDone:a,onAction:o,...s}=t,c=new AbortController;try{let t=await fetch(`${n}/chat`,{method:`POST`,headers:{"Content-Type":`application/json`,...e.headers,...r.headers},body:JSON.stringify({...s,...e.body,...r.body}),signal:c.signal,credentials:`include`});if(!t.ok){let e=`An error occurred`;try{let n=await t.json(),r=n.error??n;e=JSON.stringify(r)??`An error occurred`}catch{try{let n=await t.text();n&&(e=n)}catch{}}throw Error(e)}let l=t.body?.getReader();if(!l)throw Error(`No reader available`);let u=new TextDecoder,d=``;for(;;){let{done:e,value:t}=await l.read();if(e)break;d+=u.decode(t,{stream:!0});let n=d.split(`
|
|
24
|
-
`);d=n.pop()??``;for(let e of n)if(e.startsWith(`data: `))try{let t=JSON.parse(e.slice(6));t.chunk&&i?.(t.chunk),t.action&&o?.(t.action),t.done&&t.response&&a?.(t.response)}catch(e){console.error(`Failed to parse SSE data:`,e)}}}catch(e){throw console.error(`Error in chat:`,e),e}},autocomplete:async(t,r={})=>await K(`${n}/autocomplete`,e,r,{method:`POST`,body:t}),getDiscussions:async(t,r={})=>await K(`${n}/discussions`,e,r,{method:`GET`,params:t}),getAIStats:async(t={})=>await K(`${n}/stats`,e,t,{method:`GET`})}},Jd=(e={},t)=>{let n=`${t?.editor?.backendURL??a.backendURL}/api/dictionary`;return{getDictionaries:async(t,r={})=>await K(n,e,r,{cache:`no-store`,params:t}),getDictionariesKeys:async(t={})=>await K(`${n}/keys`,e,t,{cache:`no-store`}),getDictionariesUpdateTimestamp:async(t={})=>await K(`${n}/update`,e,t,{cache:`no-store`}),getDictionary:async(t,r,i={})=>await K(`${n}/${t}`,e,i,{params:r?{version:r.toString()}:void 0}),getDictionariesByKeys:async(t,r,i={})=>await K(`${n}/by-keys`,e,i,{cache:`no-store`,params:{keys:t.join(`,`),version:r?.toString()}}),pushDictionaries:async(t,r={})=>await K(`${n}`,e,r,{method:`PATCH`,body:{dictionaries:t}}),addDictionary:async(t,r={})=>await K(`${n}`,e,r,{method:`POST`,body:t}),updateDictionary:async(t,r={})=>await K(`${n}/${t.id}`,e,r,{method:`PUT`,body:t}),deleteDictionary:async(t,r={})=>await K(`${n}/${t}`,e,r,{method:`DELETE`})}},Yd=(e={},t)=>{let n=`${t?.editor?.editorURL??a.editorURL}/api`;return{getDictionaries:async(t={})=>(await K(`${n}/dictionary`,e,t)).data,getConfiguration:async(t={})=>(await K(`${n}/config`,e,t)).data,writeDictionary:async(t,r={})=>await K(`${n}/dictionary`,e,r,{method:`POST`,body:t})}},Xd=(e={},t)=>{let n=`${t?.editor?.backendURL??a.backendURL}/api/project`;return{getProjects:async(t,r={})=>await K(n,e,r,{cache:`no-store`,params:t}),getProjectInsights:async(t={})=>await K(`${n}/insights`,e,t,{cache:`no-store`,method:`GET`}),addProject:async(t,r={})=>await K(`${n}`,e,r,{method:`POST`,body:t}),updateProject:async(t,r={})=>await K(`${n}`,e,r,{method:`PUT`,body:t}),updateProjectMembers:async(t,r={})=>await K(`${n}/members`,e,r,{method:`PUT`,body:t}),pushProjectConfiguration:async(t,r={})=>await K(`${n}/configuration`,e,r,{method:`PUT`,body:t}),deleteProject:async(t={})=>await K(`${n}`,e,t,{method:`DELETE`}),deleteProjectByIdAdmin:async(t,r={})=>K(`${n}/${t}/admin`,e,r,{method:`DELETE`}),selectProject:async(t,r={})=>await K(`${n}/${String(t)}`,e,r,{method:`PUT`}),unselectProject:async(t={})=>await K(`${n}/logout`,e,t,{method:`POST`}),addNewAccessKey:async(t,r={})=>await K(`${n}/access_key`,e,r,{method:`POST`,body:t}),deleteAccessKey:async(t,r={})=>await K(`${n}/access_key`,e,r,{method:`DELETE`,body:{clientId:t}}),refreshAccessKey:async(t,r={})=>await K(`${n}/access_key`,e,r,{method:`PATCH`,body:{clientId:t}}),triggerBuild:async(t={})=>await K(`${n}/build`,e,t,{method:`POST`}),triggerWebhook:async(t,r={})=>await K(`${n}/webhook`,e,r,{method:`POST`,body:{webhookIndex:t}}),getCIConfig:async(t={})=>await K(`${n}/ci`,e,t,{method:`GET`}),pushCIConfig:async(t={})=>await K(`${n}/ci`,e,t,{method:`POST`}),updateMemberAccess:async(t,r,i={})=>await K(`${n}/member/${t}/access`,e,i,{method:`PUT`,body:r})}},Zd=(e={},t)=>{let n=`${t?.editor?.backendURL??a.backendURL}/api/tag`;return{getTags:async(t,r={})=>await K(n,e,r,{cache:`no-store`,params:t}),addTag:async(t,r={})=>await K(`${n}`,e,r,{method:`POST`,body:t}),updateTag:async(t,r,i={})=>await K(`${n}/${t}`,e,i,{method:`PUT`,body:r}),deleteTag:async(t,r={})=>await K(`${n}/${t}`,e,r,{method:`DELETE`})}},Qd=(0,L.createContext)(null),$d=({children:e,manager:t})=>(0,z.jsx)(Qd.Provider,{value:t,children:e}),ef=()=>(0,L.useContext)(Qd),tf=(0,L.createContext)(void 0),nf=()=>{let e=ef(),t=(0,L.useContext)(tf),[n,r]=(0,L.useState)(e?.focusedContent.value??t?.focusedContent??null);return(0,L.useEffect)(()=>{if(!e){r(t?.focusedContent??null);return}let n=e=>r(e.detail);return e.focusedContent.addEventListener(`change`,n),()=>e.focusedContent.removeEventListener(`change`,n)},[e,t?.focusedContent]),{focusedContent:n,setFocusedContent:(0,L.useCallback)(n=>{t?t.setFocusedContent(n):e&&e.focusedContent.set(n)},[t,e]),setFocusedContentKeyPath:(0,L.useCallback)(n=>{t?t.setFocusedContentKeyPath(n):e&&e.setFocusedContentKeyPath(n)},[t,e])}},rf=(e,t)=>{try{let n=new URL(e),r=new URL(t);if(n.protocol!==r.protocol||n.hostname!==r.hostname||n.port!==r.port)return!1;let i=n.pathname.replace(/\/$/,``),a=r.pathname.replace(/\/$/,``);return i===``||a===``||i===a}catch(n){return console.error(`Invalid URL(s)`,n,{url1:e,url2:t}),!1}},af=function(e){return e.INTLAYER_CLIENT_READY=`INTLAYER_CLIENT_READY`,e.INTLAYER_ARE_YOU_THERE=`INTLAYER_ARE_YOU_THERE`,e.INTLAYER_EDITOR_ACTIVATE=`INTLAYER_EDITOR_ACTIVATE`,e.INTLAYER_EDITOR_ENABLED=`INTLAYER_EDITOR_ENABLED`,e.INTLAYER_CONFIGURATION=`INTLAYER_CONFIGURATION`,e.INTLAYER_CURRENT_LOCALE=`INTLAYER_CURRENT_LOCALE`,e.INTLAYER_URL_CHANGE=`INTLAYER_URL_CHANGE`,e.INTLAYER_LOCALE_DICTIONARIES_CHANGED=`INTLAYER_LOCALE_DICTIONARIES_CHANGED`,e.INTLAYER_DISTANT_DICTIONARIES_CHANGED=`INTLAYER_DISTANT_DICTIONARIES_CHANGED`,e.INTLAYER_HOVERED_CONTENT_CHANGED=`INTLAYER_HOVERED_CONTENT_CHANGED`,e.INTLAYER_FOCUSED_CONTENT_CHANGED=`INTLAYER_FOCUSED_CONTENT_CHANGED`,e.INTLAYER_EDITED_CONTENT_CHANGED=`INTLAYER_EDITED_CONTENT_CHANGED`,e.INTLAYER_IFRAME_CLICKED=`INTLAYER_IFRAME_CLICKED`,e.INTLAYER_DISPLAYED_DICTIONARY_KEYS=`INTLAYER_DISPLAYED_DICTIONARY_KEYS`,e}({}),of=e=>{let t=new MouseEvent(`mousedown`,{bubbles:!0,cancelable:!0,view:window}),n=new MouseEvent(`click`,{bubbles:!0,cancelable:!0,view:window});Object.assign(n,{iframeData:e}),Object.assign(t,{iframeData:e}),window.dispatchEvent(n),window.dispatchEvent(t)},sf=`__intlayer_editor_manager__`,cf=`__intlayer_editor_manager_events__`,lf=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[cf]||(e[cf]=new EventTarget),e[cf]},uf=()=>typeof window>`u`?null:window[sf]??null,df=e=>{if(typeof window<`u`){let t=window;t[sf]=e}lf().dispatchEvent(new CustomEvent(`change`,{detail:e}))},ff=e=>{let t=lf(),n=t=>{e(t.detail)};return t.addEventListener(`change`,n),()=>{t.removeEventListener(`change`,n)}},pf=typeof HTMLElement<`u`?HTMLElement:class{},mf=class extends pf{_keyPathJson=`[]`;_dictionaryKey=``;_editorEnabled=!1;_isInIframe=!1;_isSelected=!1;_editedValue=void 0;_renderState=null;_selector=null;_unsubManager=null;_unsubEnabled=null;_unsubFocused=null;_unsubEditedContent=null;static get observedAttributes(){return[`key-path`,`dictionary-key`]}get keyPathJson(){return this._keyPathJson}set keyPathJson(e){this._keyPathJson=e;let t=uf();t&&this._updateEditedValue(t)}get dictionaryKey(){return this._dictionaryKey}set dictionaryKey(e){this._dictionaryKey=e;let t=uf();t&&this._updateEditedValue(t)}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=`:host { display: contents; }`,e.appendChild(t)}attributeChangedCallback(e,t,n){if(e===`key-path`){this._keyPathJson=n??`[]`;let e=uf();e&&this._updateEditedValue(e)}else if(e===`dictionary-key`){this._dictionaryKey=n??``;let e=uf();e&&this._updateEditedValue(e)}}connectedCallback(){typeof window<`u`&&(this._isInIframe=window.self!==window.top),this._subscribeToManager(),this._render()}disconnectedCallback(){this._teardown()}_teardown(){this._unsubManager?.(),this._unsubEnabled?.(),this._unsubFocused?.(),this._unsubEditedContent?.(),this._unsubManager=null,this._unsubEnabled=null,this._unsubFocused=null,this._unsubEditedContent=null}_getRawKeyPath(){try{return JSON.parse(this._keyPathJson)}catch{return[]}}_getFilteredKeyPath(){return this._getRawKeyPath().filter(e=>e.type!==ye)}_updateEditedValue(e){let t=this._getFilteredKeyPath();if(!this._dictionaryKey||t.length===0){this._editedValue=void 0,this._render();return}let n=this._getRawKeyPath(),r=n[n.length-1]?.type;if(r===`markdown`||r===`html`||r===`insertion`||r===`file`){this._editedValue=void 0,this._render();return}let i=e.getContentValue(this._dictionaryKey,t);if(typeof i==`object`&&i&&i.nodeType===`translation`){let t=e.currentLocale.value;i=t?i[ye][t]:void 0}this._editedValue=i,this._render()}_updateIsSelected(e){if(!e){this._isSelected=!1,this._updateSelectorAttr();return}let t=this._getFilteredKeyPath(),n=this._isSelected;this._isSelected=e.dictionaryKey===this._dictionaryKey&&(e.keyPath?.length??0)>0&&kt(e.keyPath??[],t),this._updateSelectorAttr(),this._isSelected&&!n&&this._scrollIntoViewIfNeeded()}_scrollIntoViewIfNeeded(){try{let e;if(this._selector){let t=this._selector.shadowRoot?.querySelector(`.wrapper`);if(t){let n=t.getBoundingClientRect();(n.width>0||n.height>0)&&(e=n)}}if(!e&&this.childNodes.length>0){let t=document.createRange();t.selectNodeContents(this);let n=t.getBoundingClientRect();(n.width>0||n.height>0)&&(e=n)}e||=this.getBoundingClientRect();let t=window.innerHeight||document.documentElement.clientHeight,n=window.innerWidth||document.documentElement.clientWidth;if(!(e.width>0&&e.height>0&&e.bottom>0&&e.right>0&&e.top<t&&e.left<n)){let n=window.scrollY??document.documentElement.scrollTop,r=e.top+n-t*.25;window.scrollTo({top:Math.max(0,r),behavior:`smooth`})}}catch{}}_updateSelectorAttr(){this._selector&&(this._isSelected?this._selector.setAttribute(`is-selecting`,``):this._selector.removeAttribute(`is-selecting`))}_subscribeToManager(){let e=uf();e&&this._setupManagerSubscriptions(e),this._unsubManager=ff(e=>{this._unsubEnabled?.(),this._unsubFocused?.(),this._unsubEditedContent?.(),this._unsubEnabled=null,this._unsubFocused=null,this._unsubEditedContent=null,e?this._setupManagerSubscriptions(e):(this._editorEnabled=!1,this._isSelected=!1,this._editedValue=void 0,this._render())})}_setupManagerSubscriptions(e){this._editorEnabled=e.editorEnabled.value??!1,this._updateIsSelected(e.focusedContent.value),this._updateEditedValue(e);let t=e=>{this._editorEnabled=e.detail,this._render()},n=e=>{this._updateIsSelected(e.detail)},r=()=>{this._updateEditedValue(e)};e.editorEnabled.addEventListener(`change`,t),e.focusedContent.addEventListener(`change`,n),e.editedContent.addEventListener(`change`,r),this._unsubEnabled=()=>e.editorEnabled.removeEventListener(`change`,t),this._unsubFocused=()=>e.focusedContent.removeEventListener(`change`,n),this._unsubEditedContent=()=>e.editedContent.removeEventListener(`change`,r)}_handlePress(e){e.stopPropagation();let t=uf();t&&t.focusedContent.set({dictionaryKey:this._dictionaryKey,keyPath:this._getFilteredKeyPath()})}_handleHover(e){e.stopPropagation(),uf()?.messenger.send(`INTLAYER_HOVERED_CONTENT_CHANGED/post`,{dictionaryKey:this._dictionaryKey,keyPath:this._getFilteredKeyPath()})}_handleUnhover(e){e.stopPropagation(),uf()?.messenger.send(`INTLAYER_HOVERED_CONTENT_CHANGED/post`,null)}_render(){let e=this._isInIframe&&this._editorEnabled,t=this._editedValue,n=e?typeof t==`string`||typeof t==`number`||typeof t==`boolean`?`wrapped-text`:`wrapped-slot`:`simple`;if(this._renderState!==n){this._rebuildContent(n);return}n!==`simple`&&this._selector&&(this._updateSelectorAttr(),n===`wrapped-text`&&this._selector.firstChild?.nodeType===Node.TEXT_NODE&&(this._selector.firstChild.data=String(t)))}_rebuildContent(e){let t=this.shadowRoot;for(;t.childNodes.length>1;)t.removeChild(t.lastChild);if(this._selector=null,e===`simple`)t.appendChild(document.createElement(`slot`));else{let n=document.createElement(`intlayer-content-selector`);this._selector=n,this._isSelected&&n.setAttribute(`is-selecting`,``),n.addEventListener(`intlayer:press`,e=>this._handlePress(e)),n.addEventListener(`intlayer:hover`,e=>this._handleHover(e)),n.addEventListener(`intlayer:unhover`,e=>this._handleUnhover(e)),e===`wrapped-text`?n.appendChild(document.createTextNode(String(this._editedValue))):n.appendChild(document.createElement(`slot`)),t.appendChild(n)}this._renderState=e}},hf=()=>{typeof customElements>`u`||customElements.get(`intlayer-content-selector-wrapper`)||customElements.define(`intlayer-content-selector-wrapper`,mf)},gf=typeof HTMLElement<`u`?HTMLElement:class{},_f=class extends gf{_dictionaryKey=``;_keyPathJson=`[]`;_locale=``;_editedText=null;_unsubManager=null;_unsubEditedContent=null;_selectorWrapper;_slot;static get observedAttributes(){return[`dictionary-key`,`key-path`,`locale`]}get dictionaryKey(){return this._dictionaryKey}set dictionaryKey(e){this._dictionaryKey=e,this._selectorWrapper.setAttribute(`dictionary-key`,e)}get keyPathJson(){return this._keyPathJson}set keyPathJson(e){this._keyPathJson=e,this._selectorWrapper.setAttribute(`key-path`,e)}get locale(){return this._locale}set locale(e){this._locale=e}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=`:host { display: contents; }`,e.appendChild(t),this._selectorWrapper=document.createElement(`intlayer-content-selector-wrapper`),this._slot=document.createElement(`slot`),this._selectorWrapper.appendChild(this._slot),e.appendChild(this._selectorWrapper)}attributeChangedCallback(e,t,n){let r=n??``;e===`dictionary-key`?(this._dictionaryKey=r,this._selectorWrapper.setAttribute(`dictionary-key`,r)):e===`key-path`?(this._keyPathJson=r||`[]`,this._selectorWrapper.setAttribute(`key-path`,this._keyPathJson)):e===`locale`&&(this._locale=r)}connectedCallback(){this._subscribeToManager()}disconnectedCallback(){this._teardown()}_teardown(){this._unsubManager?.(),this._unsubEditedContent?.(),this._unsubManager=null,this._unsubEditedContent=null}_getKeyPath(){try{return JSON.parse(this._keyPathJson)}catch{return[]}}_render(){for(;this._selectorWrapper.firstChild;)this._selectorWrapper.removeChild(this._selectorWrapper.firstChild);this._editedText===null?this._selectorWrapper.appendChild(this._slot):this._selectorWrapper.appendChild(document.createTextNode(this._editedText))}_resolveEditedText(e){let t=this._getKeyPath(),n=e.getContentValue(this._dictionaryKey,t);if(n==null){this._editedText=null,this._render();return}if(typeof n==`string`||typeof n==`number`){this._editedText=String(n),this._render();return}if(typeof n==`object`){let e=this._locale||void 0,r=Re(n,{locale:e,dictionaryKey:this._dictionaryKey,keyPath:t},ne(e));typeof r==`string`||typeof r==`number`?this._editedText=String(r):(console.error(`[intlayer-edited-content] Incorrect edited content format. Expected string. Value: ${JSON.stringify(r)}`),this._editedText=null),this._render();return}this._editedText=null,this._render()}_setupManagerSubscriptions(e){this._resolveEditedText(e);let t=()=>this._resolveEditedText(e);e.editedContent.addEventListener(`change`,t),this._unsubEditedContent=()=>e.editedContent.removeEventListener(`change`,t)}_subscribeToManager(){let e=uf();e&&this._setupManagerSubscriptions(e),this._unsubManager=ff(e=>{this._unsubEditedContent?.(),this._unsubEditedContent=null,e?this._setupManagerSubscriptions(e):(this._editedText=null,this._render())})}},vf=()=>{typeof customElements>`u`||customElements.get(`intlayer-edited-content`)||customElements.define(`intlayer-edited-content`,_f)},yf=()=>Math.random().toString(36).slice(2),bf=class{senderId;_config;_subscribers=new Map;_windowHandler=null;_seenMessageIds=new Set;_warnedRejectedOrigins=new Set;constructor(e){this._config=e,this.senderId=yf()}start(){typeof window>`u`||this._windowHandler||(this._windowHandler=e=>{this._handleMessage(e)},window.addEventListener(`message`,this._windowHandler))}stop(){this._windowHandler&&=(window.removeEventListener(`message`,this._windowHandler),null)}send(e,t){let n={type:e,data:t,senderId:this.senderId,messageId:yf()};for(let e of this._config.allowedOrigins)e&&this._config.postMessageFn(n,e)}subscribe(e,t){return this._subscribers.has(e)||this._subscribers.set(e,new Set),this._subscribers.get(e).add(t),()=>{this._subscribers.get(e)?.delete(t)}}_handleMessage(e){let t=e.data;if(!t||typeof t!=`object`)return;let{type:n,data:r,senderId:i,messageId:a}=t;if(!n||typeof n!=`string`||i===this.senderId)return;if(a){if(this._seenMessageIds.has(a))return;this._seenMessageIds.add(a),this._seenMessageIds.size>200&&this._seenMessageIds.clear()}let{allowedOrigins:o}=this._config;if(!(!o||o.length===0||o.includes(`*`)||o.filter(e=>!!e&&e!==``).some(t=>rf(t,e.origin)))){n.startsWith(`INTLAYER`)&&!this._warnedRejectedOrigins.has(e.origin)&&(this._warnedRejectedOrigins.add(e.origin),console.warn(`[intlayer] Ignored editor message "${n}" from origin "${e.origin}" — not in allowed origins [${o.join(`, `)}]. Check the editor.editorURL / editor.cmsURL configuration.`));return}let s=this._subscribers.get(n);if(s)for(let e of s)e(r,i)}},xf=class extends EventTarget{_value;_key;_messenger;_options;_unsubscribers=[];constructor(e,t,n={}){super(),this._key=e,this._messenger=t,this._options={emit:n.emit??!0,receive:n.receive??!0},n.initialValue!==void 0&&(this._value=n.initialValue)}get value(){return this._value}set(e){let t=typeof e==`function`?e(this._value):e;this._value=t,this.dispatchEvent(new CustomEvent(`change`,{detail:t})),this._options.emit&&this._messenger.send(`${this._key}/post`,t)}start(){if(this._options.receive){let e=this._messenger.subscribe(`${this._key}/post`,e=>{this._value=e,this.dispatchEvent(new CustomEvent(`change`,{detail:e}))});this._unsubscribers.push(e)}if(this._options.emit){let e=this._messenger.subscribe(`${this._key}/get`,(e,t)=>{t!==this._messenger.senderId&&this._value!==void 0&&this._messenger.send(`${this._key}/post`,this._value)});this._unsubscribers.push(e)}this._options.receive&&this._value===void 0&&this._messenger.send(`${this._key}/get`)}stop(){for(let e of this._unsubscribers)e();this._unsubscribers.length=0}postCurrentValue(){this._value!==void 0&&this._messenger.send(`${this._key}/post`,this._value)}},Sf=`__intlayer_edited_content_bus__`,Cf=`__intlayer_edited_content_bus_events__`,wf=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[Cf]||(e[Cf]=new EventTarget),e[Cf]},Tf=()=>typeof window>`u`?{}:window[Sf]??{},Ef=(e,t)=>{typeof window<`u`&&(window[Sf]=e),wf().dispatchEvent(new CustomEvent(`change`,{detail:{content:e,sourceId:t}}))},Df=e=>{let t=t=>{let{content:n,sourceId:r}=t.detail;e(n,r)},n=wf();return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},Of=`__intlayer_focused_content_bus__`,kf=`__intlayer_focused_content_bus_events__`,Af=()=>{if(typeof window>`u`)return new EventTarget;let e=window;return e[kf]||(e[kf]=new EventTarget),e[kf]},jf=()=>{if(typeof window>`u`)return;let e=window;if(e.__intlayer_focused_content_bus_set__)return e[Of]??null},Mf=(e,t)=>{if(typeof window<`u`){let t=window;t[Of]=e,t.__intlayer_focused_content_bus_set__=!0}Af().dispatchEvent(new CustomEvent(`change`,{detail:{content:e,sourceId:t}}))},Nf=e=>{let t=t=>{let{content:n,sourceId:r}=t.detail;e(n,r)},n=Af();return n.addEventListener(`change`,t),()=>n.removeEventListener(`change`,t)},Pf=class{_messenger;_mousedownHandler=null;_unsubscribeMerge=null;constructor(e){this._messenger=e}startInterceptor(){typeof window>`u`||(this._mousedownHandler=()=>{this._messenger.send(`INTLAYER_IFRAME_CLICKED`)},window.addEventListener(`mousedown`,this._mousedownHandler))}startMerger(){this._unsubscribeMerge=this._messenger.subscribe(`INTLAYER_IFRAME_CLICKED`,of)}stopInterceptor(){this._mousedownHandler&&=(window.removeEventListener(`mousedown`,this._mousedownHandler),null)}stopMerger(){this._unsubscribeMerge?.(),this._unsubscribeMerge=null}},Ff=class{_messenger;_originalPushState=null;_originalReplaceState=null;_listeners=[];constructor(e){this._messenger=e}start(){if(typeof window>`u`)return;let e=()=>{this._messenger.send(`INTLAYER_URL_CHANGE/post`,window.location.pathname)};this._originalPushState=history.pushState,this._originalReplaceState=history.replaceState;let t=e=>function(...t){e.apply(this,t),window.dispatchEvent(new Event(`locationchange`))};history.pushState=t(this._originalPushState),history.replaceState=t(this._originalReplaceState);for(let t of[`locationchange`,`popstate`,`hashchange`,`load`]){let n=e;window.addEventListener(t,n),this._listeners.push([t,n])}e()}stop(){if(!(typeof window>`u`)){for(let[e,t]of this._listeners)window.removeEventListener(e,t);this._listeners=[],this._originalPushState&&=(history.pushState=this._originalPushState,null),this._originalReplaceState&&=(history.replaceState=this._originalReplaceState,null)}}},If=class{messenger;editorEnabled;focusedContent;localeDictionaries;editedContent;configuration;currentLocale;displayedDictionaryKeys;_urlManager;_iframeInterceptor;_mode;_configuration;_unsubAreYouThere=null;_unsubActivate=null;_unsubClientReady=null;_displayedKeysObserver=null;_displayedKeysTimer=null;_displayedKeysListeners=[];_editedContentFromBus=!1;_unsubGlobalEditedContent=null;_editedContentBusHandler=null;_focusedContentFromBus=!1;_unsubGlobalFocusedContent=null;_focusedContentBusHandler=null;constructor(e){this._mode=e.mode,this._configuration=e.configuration,this.messenger=new bf(e.messenger),this.editorEnabled=new xf(`INTLAYER_EDITOR_ENABLED`,this.messenger,{emit:!1,receive:!0,initialValue:!1}),this.focusedContent=new xf(`INTLAYER_FOCUSED_CONTENT_CHANGED`,this.messenger,{emit:!0,receive:!0,initialValue:null}),this.localeDictionaries=new xf(`INTLAYER_LOCALE_DICTIONARIES_CHANGED`,this.messenger),this.editedContent=new xf(`INTLAYER_EDITED_CONTENT_CHANGED`,this.messenger),this.configuration=new xf(`INTLAYER_CONFIGURATION`,this.messenger,{emit:!0,receive:!1,...e.configuration?{initialValue:e.configuration}:{}}),this.currentLocale=new xf(`INTLAYER_CURRENT_LOCALE`,this.messenger,{emit:e.mode===`client`,receive:e.mode===`editor`}),this.displayedDictionaryKeys=new xf(`INTLAYER_DISPLAYED_DICTIONARY_KEYS`,this.messenger,{emit:e.mode===`client`,receive:e.mode===`editor`,initialValue:[]}),this._urlManager=new Ff(this.messenger),this._iframeInterceptor=new Pf(this.messenger)}start(){this.messenger.start(),this.editorEnabled.start(),this.focusedContent.start(),this.localeDictionaries.start(),this.editedContent.start(),this.configuration.start(),this.currentLocale.start(),this.displayedDictionaryKeys.start(),this._startEditedContentBusSync(),this._startFocusedContentBusSync(),this._mode===`client`?(this._urlManager.start(),this._iframeInterceptor.startInterceptor(),this._loadDictionaries(),this._startDisplayedDictionariesTracking(),this.messenger.send(`INTLAYER_EDITED_CONTENT_CHANGED/get`),this._configuration?.editor?.enabled!==!1&&this._setupActivationHandshake()):(this._iframeInterceptor.startMerger(),this._setupEditorHandshake())}stop(){this._unsubAreYouThere?.(),this._unsubActivate?.(),this._unsubClientReady?.(),this._unsubAreYouThere=null,this._unsubActivate=null,this._unsubClientReady=null,this.messenger.stop(),this.editorEnabled.stop(),this.focusedContent.stop(),this.localeDictionaries.stop(),this.editedContent.stop(),this.configuration.stop(),this.currentLocale.stop(),this.displayedDictionaryKeys.stop(),this._stopDisplayedDictionariesTracking(),this._stopEditedContentBusSync(),this._stopFocusedContentBusSync(),this._urlManager.stop(),this._iframeInterceptor.stopInterceptor(),this._iframeInterceptor.stopMerger()}pingClient(){this._mode===`editor`&&this.messenger.send(`INTLAYER_ARE_YOU_THERE`)}setFocusedContentKeyPath(e){let t=e.filter(e=>e.type!==ye),n=this.focusedContent.value;n&&this.focusedContent.set({...n,keyPath:t})}setLocaleDictionary(e){if(!e.localId)return;let t=this.localeDictionaries.value??{};this.localeDictionaries.set({...t,[e.localId]:e})}setEditedDictionary(e){if(!e.localId){console.error(`setEditedDictionary: missing localId`,e);return}let t=this.editedContent.value??{};this.editedContent.set({...t,[e.localId]:e})}setEditedContent(e,t){let n=this.editedContent.value??{};this.editedContent.set({...n,[e]:{...n[e],content:t}})}addContent(e,t,n=[],r=!0){let i=this.editedContent.value??{},a=(this.localeDictionaries.value??{})[e]?.content,o=structuredClone(i[e]?.content??a),s=n;if(!r){let e=0,t=n.slice(0,-1),r=n[n.length-1],i=r.key;for(;Ft(o,s)!==void 0;)e++,i=e===0?r.key:`${r.key} (${e})`,s=[...t,{...r,key:i}]}let c=Pt(o,s,t);this.editedContent.set({...i,[e]:{...i[e],content:c}})}renameContent(e,t,n=[]){let r=this.editedContent.value??{},i=(this.localeDictionaries.value??{})[e]?.content,a=Ut(structuredClone(r[e]?.content??i),t,n);this.editedContent.set({...r,[e]:{...r[e],content:a}})}removeContent(e,t){let n=this.editedContent.value??{},r=(this.localeDictionaries.value??{})[e]?.content,i=Pt(structuredClone(n[e]?.content??r),t,Ft(r,t));this.editedContent.set({...n,[e]:{...n[e],content:i}})}restoreContent(e){let t={...this.editedContent.value??{}};delete t[e],this.editedContent.set(t)}clearContent(e){let t={...this.editedContent.value??{}};delete t[e],this.editedContent.set(t)}clearAllContent(){this.editedContent.set({})}getContentValue(e,t){let n=this.editedContent.value;if(!n)return;let r=t.filter(e=>e.type!==ye),i=this.localeDictionaries.value;if(e.includes(`:local:`)||e.includes(`:remote:`))return i&&!(e in i)?void 0:Ft(n[e]?.content??{},r,this.currentLocale.value);let a=Object.keys(n).filter(t=>t.startsWith(`${e}:`)&&(!i||t in i));for(let e of a){let t=Ft(n[e]?.content??{},r,this.currentLocale.value);if(t)return t}}_startEditedContentBusSync(){this._editedContentBusHandler=e=>{if(this._editedContentFromBus)return;let t=e.detail;Ef(t,this.messenger.senderId)},this.editedContent.addEventListener(`change`,this._editedContentBusHandler),this._unsubGlobalEditedContent=Df((e,t)=>{t!==this.messenger.senderId&&(this._editedContentFromBus=!0,this.editedContent.set(e),this._editedContentFromBus=!1)});let e=Tf();Object.keys(e).length>0&&(this._editedContentFromBus=!0,this.editedContent.set(e),this._editedContentFromBus=!1)}_stopEditedContentBusSync(){this._editedContentBusHandler&&=(this.editedContent.removeEventListener(`change`,this._editedContentBusHandler),null),this._unsubGlobalEditedContent?.(),this._unsubGlobalEditedContent=null}_startFocusedContentBusSync(){this._focusedContentBusHandler=e=>{if(this._focusedContentFromBus)return;let t=e.detail;Mf(t,this.messenger.senderId)},this.focusedContent.addEventListener(`change`,this._focusedContentBusHandler),this._unsubGlobalFocusedContent=Nf((e,t)=>{t!==this.messenger.senderId&&(this._focusedContentFromBus=!0,this.focusedContent.set(e),this._focusedContentFromBus=!1)});let e=jf();e!==void 0&&(this._focusedContentFromBus=!0,this.focusedContent.set(e),this._focusedContentFromBus=!1)}_stopFocusedContentBusSync(){this._focusedContentBusHandler&&=(this.focusedContent.removeEventListener(`change`,this._focusedContentBusHandler),null),this._unsubGlobalFocusedContent?.(),this._unsubGlobalFocusedContent=null}_scanDisplayedDictionaryKeys(){if(typeof document>`u`)return;let e=document.querySelectorAll(`intlayer-content-selector-wrapper[dictionary-key]`),t=Array.from(new Set(Array.from(e).map(e=>e.getAttribute(`dictionary-key`)??``).filter(Boolean)));this.displayedDictionaryKeys.set(t)}_startDisplayedDictionariesTracking(){if(typeof document>`u`||typeof MutationObserver>`u`)return;let e=()=>{this._displayedKeysTimer&&clearTimeout(this._displayedKeysTimer),this._displayedKeysTimer=setTimeout(()=>this._scanDisplayedDictionaryKeys(),100)};this._displayedKeysObserver=new MutationObserver(e),this._displayedKeysObserver.observe(document.body,{childList:!0,subtree:!0});for(let t of[`locationchange`,`popstate`]){let n=e;window.addEventListener(t,n),this._displayedKeysListeners.push([t,n])}this._scanDisplayedDictionaryKeys()}_stopDisplayedDictionariesTracking(){this._displayedKeysObserver?.disconnect(),this._displayedKeysObserver=null,this._displayedKeysTimer&&=(clearTimeout(this._displayedKeysTimer),null);for(let[e,t]of this._displayedKeysListeners)window.removeEventListener(e,t);this._displayedKeysListeners=[]}_setupEditorHandshake(){this._unsubClientReady=this.messenger.subscribe(`INTLAYER_CLIENT_READY`,()=>{this.editorEnabled.set(!0),this.messenger.send(`INTLAYER_EDITOR_ACTIVATE`)}),this.messenger.send(`INTLAYER_ARE_YOU_THERE`)}_setupActivationHandshake(){this.messenger.send(`INTLAYER_CLIENT_READY`),this._unsubAreYouThere=this.messenger.subscribe(`INTLAYER_ARE_YOU_THERE`,()=>{this.messenger.send(`INTLAYER_CLIENT_READY`)}),this._unsubActivate=this.messenger.subscribe(`INTLAYER_EDITOR_ACTIVATE`,()=>{this.editorEnabled.set(!0),this._broadcastData()})}_broadcastData(){let e=this.configuration.value;e&&this.messenger.send(`INTLAYER_CONFIGURATION/post`,e);let t=this.currentLocale.value;t&&this.messenger.send(`INTLAYER_CURRENT_LOCALE/post`,t);let n=this.localeDictionaries.value;n&&this.messenger.send(`INTLAYER_LOCALE_DICTIONARIES_CHANGED/post`,n)}async _loadDictionaries(){try{let e=(await Et(async()=>{let{getUnmergedDictionaries:e}=await import(`./unmerged_dictionaries-DWe4YFkq.js`);return{getUnmergedDictionaries:e}},[])).getUnmergedDictionaries(),t=Object.fromEntries(Object.values(e).flat().map(e=>[e.localId,e]));this.localeDictionaries.set(t),this.editorEnabled.value&&this._broadcastData()}catch(e){console.warn(`[intlayer] Failed to load unmerged dictionaries:`,e)}}},Lf=typeof HTMLElement<`u`?HTMLElement:class{},Rf=class extends Lf{_configuration=void 0;_locale=void 0;_initialized=!1;_unsubManager=null;static get observedAttributes(){return[`locale`]}get configuration(){return this._configuration}set configuration(e){this._configuration=e,this._initialized||this._init()}get locale(){return this._locale}set locale(e){this._locale=e,e&&this._initialized&&this._syncLocale(e)}attributeChangedCallback(e,t,n){e===`locale`&&n!==null&&(this._locale=n,this._initialized&&this._syncLocale(n))}connectedCallback(){this._init()}disconnectedCallback(){this._unsubManager?.(),this._unsubManager=null,this._initialized&&=(qf(),!1)}_init(){this._initialized||(q(),this._initialized=!0,this._locale&&this._syncLocale(this._locale))}_syncLocale(e){let t=uf();t?t.currentLocale.set(e):(this._unsubManager?.(),this._unsubManager=ff(t=>{t&&(this._unsubManager?.(),this._unsubManager=null,t.currentLocale.set(e))}))}},zf=()=>{typeof customElements>`u`||customElements.get(`intlayer-editor`)||customElements.define(`intlayer-editor`,Rf)},Bf=250,Vf=`
|
|
25
|
-
:host {
|
|
26
|
-
display: contents;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
.wrapper {
|
|
30
|
-
display: inline-block;
|
|
31
|
-
cursor: pointer;
|
|
32
|
-
user-select: none;
|
|
33
|
-
border-radius: 0.375rem;
|
|
34
|
-
outline-width: 2px;
|
|
35
|
-
outline-offset: 4px;
|
|
36
|
-
outline-style: solid;
|
|
37
|
-
outline-color: transparent;
|
|
38
|
-
transition: all 100ms 50ms ease-in-out;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
.wrapper[data-active] {
|
|
42
|
-
outline-color: inherit;
|
|
43
|
-
}
|
|
44
|
-
`,Hf=typeof HTMLElement<`u`?HTMLElement:class{},Uf=class extends Hf{_isSelecting=!1;_pressDuration=Bf;_isHovered=!1;_isSelectingState=!1;_wrapper;_pressTimer=null;_clickOutsideHandler=null;static get observedAttributes(){return[`is-selecting`,`press-duration`]}get isSelecting(){return this._isSelecting}set isSelecting(e){this._isSelecting=e,this._updateActiveState()}get pressDuration(){return this._pressDuration}set pressDuration(e){this._pressDuration=e}constructor(){super();let e=this.attachShadow({mode:`open`}),t=document.createElement(`style`);t.textContent=Vf,e.appendChild(t);let n=document.createElement(`span`);n.className=`wrapper`,n.setAttribute(`role`,`button`),n.setAttribute(`tabindex`,`0`),n.appendChild(document.createElement(`slot`)),e.appendChild(n),this._wrapper=n,n.addEventListener(`mousedown`,()=>this._handleMouseDown()),n.addEventListener(`mouseup`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`mouseleave`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`mouseenter`,()=>this._handleMouseEnter()),n.addEventListener(`click`,e=>this._handleClick(e)),n.addEventListener(`touchstart`,()=>this._handleMouseDown()),n.addEventListener(`touchend`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`touchcancel`,()=>this._handleMouseUpOrLeave()),n.addEventListener(`blur`,()=>this._handleBlur())}attributeChangedCallback(e,t,n){e===`is-selecting`?(this._isSelecting=n!==null,this._updateActiveState()):e===`press-duration`&&(this._pressDuration=n===null?Bf:parseInt(n,10))}connectedCallback(){this._clickOutsideHandler=e=>{e.composedPath().includes(this)||(this._isSelectingState=!1,this._dispatch(`intlayer:click-outside`),this._updateActiveState())},document.addEventListener(`mousedown`,this._clickOutsideHandler)}disconnectedCallback(){this._clickOutsideHandler&&=(document.removeEventListener(`mousedown`,this._clickOutsideHandler),null),this._clearPressTimer()}_updateActiveState(){this._isSelecting||this._isSelectingState||this._isHovered?this._wrapper.setAttribute(`data-active`,``):this._wrapper.removeAttribute(`data-active`)}_clearPressTimer(){this._pressTimer!==null&&(clearTimeout(this._pressTimer),this._pressTimer=null)}_dispatch(e){this.dispatchEvent(new CustomEvent(e,{bubbles:!0,composed:!0}))}_handleMouseDown(){this._clearPressTimer(),this._pressTimer=setTimeout(()=>{this._isSelectingState=!0,this._updateActiveState(),this._dispatch(`intlayer:press`)},this._pressDuration)}_handleMouseEnter(){this._isHovered=!0,this._updateActiveState(),this._dispatch(`intlayer:hover`)}_handleMouseUpOrLeave(){this._isHovered&&(this._isHovered=!1,this._dispatch(`intlayer:unhover`)),this._clearPressTimer(),this._updateActiveState()}_handleClick(e){(this._isSelecting||this._isSelectingState)&&(e.preventDefault(),e.stopPropagation())}_handleBlur(){this._isSelectingState=!1,this._updateActiveState()}},Wf=()=>{typeof customElements>`u`||(customElements.get(`intlayer-content-selector`)||customElements.define(`intlayer-content-selector`,Uf),hf(),vf(),zf())},Gf=()=>{let e=typeof window<`u`?window.location.origin:void 0;return{allowedOrigins:[...new Set([a?.editorURL,a?.cmsURL,e].filter(Boolean))],postMessageFn:(e,t)=>{typeof window>`u`||window.self!==window.top&&window.parent?.postMessage(e,t)}}},Kf=0,q=()=>{Kf++;let e=uf();if(e)return e;let t=new If({mode:`client`,messenger:Gf(),configuration:{editor:a}});return df(t),Wf(),t.start(),t},qf=()=>{Kf=Math.max(0,Kf-1),!(Kf>0)&&(uf()?.stop(),df(null))},Jf=(e,t,n)=>{let r=ef(),i=typeof t==`function`?t():t,[a,o]=(0,L.useState)(i),s=(0,L.useRef)(i),c=(0,L.useRef)(null);return(0,L.useEffect)(()=>{let{emit:t=!0,receive:a=!0}=n??{},l=new xf(e,r?.messenger,{emit:t,receive:a,initialValue:i});c.current=l;let u=e=>{let t=e.detail;s.current=t,o(t)};return l.addEventListener(`change`,u),l.start(),()=>{l.removeEventListener(`change`,u),l.stop(),c.current=null}},[e,r?.messenger,n?.emit,n?.receive]),[a,e=>{o(t=>{let n=typeof e==`function`?e(t):e;return s.current=n,c.current?.set(n),n})},()=>{c.current?.postCurrentValue()}]},Yf=(e,t)=>Jf(af.INTLAYER_URL_CHANGE,e,t),Xf=()=>{let e=ef(),[t,n]=(0,L.useState)(e?.localeDictionaries.value??{});return(0,L.useEffect)(()=>{if(!e)return;let t=e=>n(e.detail??{});return e.localeDictionaries.addEventListener(`change`,t),()=>e.localeDictionaries.removeEventListener(`change`,t)},[e]),{localeDictionaries:t,setLocaleDictionaries:(0,L.useCallback)(t=>e?.localeDictionaries.set(t),[e]),setLocaleDictionary:(0,L.useCallback)(t=>e?.setLocaleDictionary(t),[e])}},Zf=()=>{let{setLocaleDictionaries:e,setLocaleDictionary:t}=Xf();return{setLocaleDictionaries:e,setLocaleDictionary:t}},Qf=()=>{let e=ef(),[t,n]=(0,L.useState)(e?.currentLocale.value);return(0,L.useEffect)(()=>{if(!e)return;let t=e=>n(e.detail);return e.currentLocale.addEventListener(`change`,t),()=>e.currentLocale.removeEventListener(`change`,t)},[e]),t},$f=(e,t,n)=>{for(let r of t)try{if(Ft(r.content,e??[],n))return{keyPath:e,dictionaryLocalId:r.localId}}catch{}},ep=()=>{let{localeDictionaries:e}=Xf(),t=Qf(),{setFocusedContent:n,setFocusedContentKeyPath:r,focusedContent:i}=nf();return{focusedContent:(0,L.useMemo)(()=>{if(!i||!e||i.dictionaryLocalId)return i;let n=Object.values(e).filter(e=>e.key===i.dictionaryKey),r=$f(i.keyPath??[],n,t);return{...i,...r}},[i,e,t]),setFocusedContent:n,setFocusedContentKeyPath:r}},tp=({children:e,configuration:t,postMessage:n,allowedOrigins:r})=>{let i=(0,L.useRef)(null);i.current||=new If({mode:`editor`,messenger:{allowedOrigins:r,postMessageFn:n},configuration:t});let a=i.current;return(0,L.useEffect)(()=>(Wf(),df(a),a.start(),()=>{a.stop(),df(null)}),[a]),(0,L.useEffect)(()=>{a&&t&&Object.keys(t).length!==0&&a.configuration.set(t)},[a,t]),(0,z.jsx)($d,{manager:a,children:e})},np=(0,L.createContext)(void 0),rp=()=>{let e=ef(),t=(0,L.useContext)(np),[n,r]=(0,L.useState)(e?.configuration.value??t);return(0,L.useEffect)(()=>{if(!e){r(t);return}let n=e=>{let n=e.detail;r(n??t)};return e.configuration.addEventListener(`change`,n),()=>e.configuration.removeEventListener(`change`,n)},[e,t]),n??t},ip=()=>{let e=ef();return{setEditedContentState:t=>e?.editedContent.set(t),setEditedDictionary:t=>e?.setEditedDictionary(t),setEditedContent:(t,n)=>e?.setEditedContent(t,n),addEditedContent:(t,n,r,i)=>e?.addContent(t,n,r,i),renameEditedContent:(t,n,r)=>e?.renameContent(t,n,r),removeEditedContent:(t,n)=>e?.removeContent(t,n),restoreEditedContent:t=>e?.restoreContent(t),clearEditedDictionaryContent:t=>e?.clearContent(t),clearEditedContent:()=>e?.clearAllContent(),getEditedContentValue:(t,n)=>e?.getContentValue(t,n)}},ap=()=>{let e=ef(),[t,n]=(0,L.useState)(e?.editedContent.value);return(0,L.useEffect)(()=>{if(!e)return;let t=e=>n(e.detail);return e.editedContent.addEventListener(`change`,t),()=>e.editedContent.removeEventListener(`change`,t)},[e]),{editedContent:t,...ip()}},op=()=>{let e=ef(),[t,n]=(0,L.useState)(e?.editorEnabled.value??!1);return(0,L.useEffect)(()=>{if(!e)return;let t=e=>n(e.detail);return e.editorEnabled.addEventListener(`change`,t),()=>e.editorEnabled.removeEventListener(`change`,t)},[e]),{enabled:t}},sp=()=>{let e=ef();return()=>e?.pingClient()},cp=(e,t,n)=>{let r=ef();return(0,L.useEffect)(()=>{if(t)return r?.messenger.subscribe(e,t)},[r,e,n]),t=>{r?.messenger.send(e,t)}},lp=()=>{cp(af.INTLAYER_IFRAME_CLICKED,of)},up=e=>{let t=rp(),n={...e?.sessionToken&&{headers:{Authorization:`Bearer ${e.sessionToken}`}},...e?.options??{}},r=e?.intlayerConfiguration??t;return{options:n,resolvedConfig:r?.editor?r:void 0}},dp=e=>{let t=rp();return Vd(e?.intlayerConfiguration??t)},fp=e=>{let{options:t,resolvedConfig:n}=up(e);return Xd(t,n)},pp=e=>{let{options:t,resolvedConfig:n}=up(e);return Jd(t,n)},mp=e=>{let{options:t,resolvedConfig:n}=up(e);return qd(t,n)},hp=e=>{let{options:t,resolvedConfig:n}=up(e);return Zd(t,n)},gp=e=>{let{options:t,resolvedConfig:n}=up(e);return Yd(t,n)},_p=e=>{let t=zu(e,rp(),{editor:a}),n=Kd(void 0,t),r=Gi(),{data:i}=Ro({queryKey:[`oAuth2AccessToken`],queryFn:n.getOAuth2AccessToken,enabled:!!(t.editor.clientId&&t.editor.clientSecret)&&r,staleTime:0,gcTime:0,refetchOnWindowFocus:!1,refetchOnMount:!1,refetchOnReconnect:!1,refetchInterval:!1,refetchIntervalInBackground:!1});return{oAuth2AccessToken:i?.data}},vp=(e,t)=>{let n=rp(),r=t??n??{editor:a},i=Co(),o=Gi(),{data:s,isFetched:c,refetch:l}=Ro({queryKey:[`session`],queryFn:async()=>(await Vd(r).getSession()).data,staleTime:3e5,gcTime:18e5,refetchInterval:6e5,refetchIntervalInBackground:!1,refetchOnMount:!0,refetchOnWindowFocus:!0,refetchOnReconnect:!0,enabled:!e&&o}),u=s??(c?null:void 0),d=e=>{i.setQueryData([`session`],e)},f=async()=>(await l()).data;return{session:u,fetchSession:f,revalidateSession:f,setSession:d}},yp=({session:e,intlayerConfiguration:t}={})=>{let{session:n,fetchSession:r,revalidateSession:i,setSession:a}=vp(e,t),{oAuth2AccessToken:o}=_p(t);return{session:n,fetchSession:r,setSession:a,revalidateSession:i,oAuth2AccessToken:o,isAuthenticated:!!(n?.user||o)}},bp=({requireUser:e,requireProject:t,requireOrganization:n})=>{let{oAuth2AccessToken:r,session:i}=yp({intlayerConfiguration:rp()}),a=i?i.user:r?.user,o=i?i.organization:r?.organization,s=i?i.project:r?.project;return{enable:(!e||!!a)&&(!t||!!s)&&(!n||!!o)}},xp=e=>{let{requireUser:t,requireProject:n,requireOrganization:r,...i}=e,{enable:a}=bp({requireUser:t,requireProject:n,requireOrganization:r});return Ro({enabled:i?.enabled!==!1&&a,...i})},Sp=()=>{let e=mp();return zo({mutationKey:[`ai-auditContentDeclarationMetadata`],mutationFn:t=>e.auditContentDeclarationMetadata(t)})},Cp=()=>{let e=mp();return zo({mutationKey:[`ai-auditContentDeclarationField`],mutationFn:t=>e.auditContentDeclarationField(t)})},wp=()=>{let e=mp();return zo({mutationKey:[`ai-customQuery`],mutationFn:t=>e.customQuery(t)})},Tp=[[`session`],[`users`],[`organizations`],[`projects`],[`dictionaries`],[`tags`]],Ep=()=>{let e=dp(),t=Co();return zo({mutationKey:[`logout`],mutationFn:()=>e.signOut(),onSettled:()=>{Tp.forEach(e=>{t.removeQueries({queryKey:e})})}})},Dp=(e,t)=>{let n=pp();return xp({queryKey:[`dictionaries`,e],queryFn:({signal:t})=>n.getDictionaries(e,{signal:t}),requireUser:!0,requireOrganization:!0,requireProject:!0,...t})},Op=()=>{let e=pp();return zo({mutationKey:[`dictionaries`],mutationFn:t=>e.pushDictionaries(t.dictionaries),meta:{invalidateQueries:[[`dictionaries`],[`dictionary`],[`dictionariesKeys`]]}})},kp=()=>{let e=pp();return zo({mutationKey:[`dictionaries`],mutationFn:t=>e.deleteDictionary(t.dictionaryId),meta:{invalidateQueries:[[`dictionaries`],[`dictionary`],[`dictionariesKeys`]]}})},Ap=()=>{let e=gp();return Ro({queryKey:[`editor`,`dictionaries`],queryFn:()=>e.getDictionaries()})},jp=()=>{let e=gp();return zo({mutationKey:[`editor`,`dictionaries`],mutationFn:t=>e.writeDictionary(t)})},Mp=(e,t)=>{let n=fp();return xp({queryKey:[`projects`,e],queryFn:({signal:t})=>n.getProjects(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},Np=(e,t)=>{let n=hp();return xp({queryKey:[`tags`,e],queryFn:({signal:t})=>n.getTags(e,{signal:t}),requireUser:!0,requireOrganization:!0,...t})},Pp=()=>{let{session:e,revalidateSession:t,setSession:n}=yp(),{mutate:r}=Ep(),i=e?.user?`authenticated`:`unauthenticated`;return{isAuthenticated:i===`authenticated`,isUnauthenticated:i===`unauthenticated`,user:e?.user,revalidateSession:t,logout:async()=>{n(null),r()}}},Fp=({children:e,header:t,isOpen:n,defaultIsOpen:r=!1,onToggle:i,onClick:a,disabled:o=!1,contentClassName:s,headerClassName:c,contentId:l,"aria-label":u,className:d,...f})=>{let p=n!==void 0,[m,h]=(0,L.useState)(r),g=(0,L.useId)(),_=p?n:m,v=!_,y=l??`${g}-accordion-content`,b=e=>{if(o)return;let t=!_;p||h(t),i?.(t),a?.(e)};return(0,z.jsxs)(`div`,{className:I(`w-full`,d),children:[(0,z.jsx)(j,{variant:`hoverable`,color:`text`,onClick:b,onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),b(e))},disabled:o,isFullWidth:!0,className:I(`flex items-center justify-between gap-2`,c),IconRight:ie,iconClassName:I(`transform transition-transform duration-500 ease-in-out`,_?`rotate-0`:`-rotate-180`),"aria-expanded":_,"aria-controls":y,"aria-label":u,role:`button`,...f,children:t}),(0,z.jsx)(ee,{id:y,tabIndex:v?-1:void 0,isHidden:v,className:s,role:`region`,"aria-labelledby":y,children:e})]})},Ip=({level:e,title:t,description:n,children:r,rightParam:i,isSelected:a,...o})=>(0,z.jsx)(`div`,{className:I(`rounded-md p-2 transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,e===2&&`hover:bg-card/30`,e>=3&&``,a===!0&&`bg-card/40`),...o,children:(0,z.jsx)(Fp,{isOpen:a,label:t,header:(0,z.jsxs)(`div`,{className:`flex w-full`,children:[(0,z.jsxs)(`div`,{className:`flex w-full items-center justify-between`,children:[(0,z.jsx)(`span`,{className:I(e===0&&`text-lg`,e===1&&`text-md`,e===2&&`text-md`,e>=3&&`text-base`),children:t}),i&&(0,z.jsx)(`div`,{className:`flex w-auto items-center justify-between p-3`,children:i})]}),n&&(0,z.jsx)(`p`,{className:`pl-3 text-card-foreground text-sm`,children:n})]}),children:(0,z.jsx)(`div`,{className:`size-full px-2`,children:r})})}),Lp=e=>{let{keyPath:t,section:n,onFocusKeyPath:r,focusedKeyPath:i=[]}=e;return n.map((n,a)=>{let o={key:a,type:k},s=[...t,o];return(0,z.jsx)(Ip,{level:t.length,title:`${a}`,description:``,isSelected:kt(s,i),onClick:e=>{e.stopPropagation(),r(s)},children:(0,z.jsx)(mm,{...e,keyPath:s,section:n})},JSON.stringify(n))})},Rp=({choices:e=[],value:t,defaultValue:n,onChange:r,hoverable:i=!0,disabled:a=!1},o)=>{let[s,c]=(0,L.useState)(t??n??e[0].value),[l,u]=(0,L.useState)(null),d=(0,L.useRef)([]),f=(0,L.useRef)(null),{choiceIndicatorPosition:p}=O(d,{selector:e=>e?.getAttribute(`data-indicator`)===`true`,isHoverable:!1,orientation:o}),m=e.findIndex(e=>e.value===s),h=i&&l!==null?l:m;return(0,L.useEffect)(()=>{t!==void 0&&c(t)},[t]),{valueState:s,hoveredIndex:l,setHoveredIndex:u,optionsRefs:d,indicatorRef:f,choiceIndicatorPosition:p,selectedIndex:m,indicatorIndex:h,handleChange:e=>{c(e),r?.(e)},disabled:a}},zp=[{content:`Off`,value:!1},{content:`On`,value:!0}],Bp=$e(`flex h-fit w-fit cursor-pointer flex-row gap-2 rounded-full border-[1.3px] p-0.38`,{variants:{color:{neutral:`border-neutral text-neutral`,white:`border-white text-white`,black:`border-black text-black`,text:`border-foreground text-foreground`,error:`border-error text-error`},disabled:{true:`cursor-not-allowed opacity-50`,false:``}},defaultVariants:{color:`text`,disabled:!1}}),Vp=$e(`z-1 flex-1 cursor-pointer font-medium text-sm transition-all duration-300 ease-in-out aria-selected:cursor-default data-[indicator=true]:text-background motion-reduce:transition-none`,{variants:{size:{xs:`px-2 py-0.5 text-xs`,sm:`px-2 py-1 text-xs`,md:`p-2 text-sm`,lg:`p-4 text-base`}},defaultVariants:{size:`md`}}),Hp=$e(`absolute top-0 z-0 h-full w-auto rounded-full transition-all duration-300 ease-in-out motion-reduce:transition-none`,{variants:{color:{neutral:`bg-neutral data-[indicator=true]:text-white`,white:`bg-white data-[indicator=true]:text-black`,black:`bg-black data-[indicator=true]:text-white`,text:`bg-foreground data-[indicator=true]:text-background`,error:`bg-error data-[indicator=true]:text-white`}}}),Up=e=>{let{choices:t=zp,color:n=`text`,size:r=`md`,className:i,itemClassName:a}=e,{selectedIndex:o,indicatorIndex:s,handleChange:c,optionsRefs:l,indicatorRef:u,choiceIndicatorPosition:d,setHoveredIndex:f,disabled:p}=Rp({choices:t,value:e.value,defaultValue:e.defaultValue,onChange:e.onChange,hoverable:e.hoverable,disabled:e.disabled},`horizontal`);return(0,z.jsx)(`div`,{className:Bp({color:n,disabled:p,className:i}),role:`tablist`,"aria-disabled":p?`true`:void 0,children:(0,z.jsxs)(`div`,{className:`relative flex size-full flex-row items-center justify-center`,children:[t.map((e,t)=>{let{content:n,value:i,...u}=e,d=typeof i==`string`||typeof i==`number`,m=t===o,h=t===s;return(0,L.createElement)(`button`,{...u,type:`button`,className:I(Vp({size:r}),p&&`cursor-not-allowed`,a),key:d?i:t,role:`tab`,onClick:()=>c(i),"aria-selected":m?`true`:void 0,"data-indicator":h?`true`:void 0,disabled:p,tabIndex:m?0:-1,ref:e=>{l.current[t]=e},onMouseEnter:()=>!p&&f(t),onMouseLeave:()=>!p&&f(null)},n)}),d&&(0,z.jsx)(`div`,{className:I(Hp({color:n})),style:d,ref:u})]})})},Wp=({keyPath:e,section:t,editedContent:n,onContentChange:r,onFocusKeyPath:i})=>{let a=Ft(n,e,Qf());if(a!==void 0&&typeof a!=`boolean`)return(0,z.jsx)(z.Fragment,{children:`Error loading section - Edited content incoherence with the original content format`});let o=e.length,s=a??t;return(0,z.jsx)(`button`,{type:`button`,className:I(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,o===2&&`hover:bg-card/30`,o>=3&&``),onClick:t=>{t.stopPropagation(),i(e)},children:(0,z.jsx)(Up,{value:s,onChange:t=>r({keyPath:e,newValue:String(t)})})})},Gp=e=>{let{keyPath:t,section:n}=e;return(0,z.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n[re]).map(r=>{let i={type:re,key:r},a=[...t,i],o=n[re][r];return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,L.createElement)(mm,{...e,key:r,keyPath:a,section:o})]})})})},Kp=e=>{let{keyPath:t,section:n}=e;return(0,z.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n[h]).map(r=>{let i={type:h,key:r},a=[...t,i],o=n[h][r];return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,L.createElement)(mm,{...e,key:r,keyPath:a,section:o})]})})})},qp=(...e)=>e.filter(Boolean).join(` `),Jp=$e([`w-full select-text resize-none text-base shadow-none outline-none`,`transition-all duration-300 md:text-sm`,`ring-0`,`disabled:opacity-50`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`].join(` `),{variants:{variant:{default:[`text-foreground`,`bg-accent`,`ring-text/20`,`disabled:ring-0`,`hover:ring-3`,`focus-within:ring-4`,`focus-visible:outline-none focus-visible:ring-4`,`[box-shadow:none] focus:[box-shadow:none]`,`aria-invalid:border-error`].join(` `),invisible:`border-none text-inherit outline-none ring-0`},size:{sm:`px-2 py-2 text-sm md:py-1.5 md:text-xs`,md:`px-2 py-3 md:py-2`,lg:`p-4`},validationStyleEnabled:{disabled:``,enabled:`valid:border-success invalid:border-error`}},defaultVariants:{variant:`default`,size:`md`,validationStyleEnabled:`disabled`}}),Yp=({validationStyleEnabled:e=!1,variant:t,size:n,className:r,...i})=>(0,z.jsx)(`input`,{className:qp(Jp({variant:t,size:n,validationStyleEnabled:e?`enabled`:`disabled`}),r),suppressHydrationWarning:!0,...i}),Xp=({className:e,variant:t,validationStyleEnabled:n=!1,...r})=>(0,z.jsx)(`textarea`,{className:I(`resize-none`,Jp({variant:t,validationStyleEnabled:n?`enabled`:`disabled`,className:e})),...r}),Zp=24,Qp=12,$p=({className:e,autoSize:t=!0,onChange:n,maxRows:r=999,ref:i,...a})=>{let o=(0,L.useRef)(null);(0,L.useImperativeHandle)(i,()=>o.current);let s=()=>{let e=o.current;if(!e||!t)return;let n=e.style;n.height=`auto`;let i=e.scrollHeight,a=Zp*r+Qp;n.height=`${Math.max(Math.min(i,a),36)}px`};return(0,L.useLayoutEffect)(()=>{(a.value??a.defaultValue)&&s()},[a.value,a.defaultValue,t,r]),(0,z.jsx)(Xp,{ref:e=>{o.current=e},onChange:e=>{n?.(e),s()},className:I(`overflow-y-auto`,t&&`resize-none`,e),...a})},em=({value:e=``,onCancel:t,onSave:n,onClick:r,children:a,isDisabled:o,...s})=>{let[c,l]=(0,L.useState)(!1),u=(0,L.useRef)(null),d=e=>{e.stopPropagation(),l(!1),n()},f=e=>{e.stopPropagation(),l(!1),t()},p=!e||e===``?`-`:e,m=(0,L.useCallback)(e=>{let t=window.getSelection();t&&t.toString().trim()!==``||u.current&&!u.current.contains(e.target)&&(l(!1),n())},[n]);return(0,L.useEffect)(()=>(c?document.addEventListener(`click`,m):document.removeEventListener(`click`,m),()=>document.removeEventListener(`click`,m)),[m,c]),(0,z.jsxs)(`span`,{className:`group/editable-field flex gap-2`,role:`button`,tabIndex:0,onClick:e=>{l(!0),r?.(e)},ref:u,...s,children:[(0,z.jsxs)(`div`,{className:I(`flex flex-1 gap-2`,c?`display`:`hidden`),children:[a,(0,z.jsx)(j,{label:`Save`,variant:`hoverable`,size:`icon-sm`,color:`text`,Icon:i,onClick:d,disabled:o,className:`!text-current`,role:`button`,tabIndex:0,"aria-label":`Save changes`,"data-testid":`editable-field-save-button`}),(0,z.jsx)(j,{label:`Cancel`,color:`text`,variant:`hoverable`,className:`!text-current`,size:`icon-sm`,Icon:N,onClick:f,disabled:o,role:`button`,tabIndex:0,"aria-label":`Cancel changes`,"data-testid":`editable-field-cancel-button`})]},String(c)),(0,z.jsxs)(`div`,{className:I(`flex flex-1 gap-2`,c?`hidden`:`display`),children:[(0,z.jsx)(`span`,{className:`ml-2 flex w-full whitespace-pre-wrap p-1 text-sm leading-6`,children:p}),(0,z.jsx)(j,{label:`Edit`,Icon:mc,color:`text`,variant:`hoverable`,size:`icon-sm`,className:`!text-current invisible group-hover/editable-field:visible`,disabled:o,onClick:e=>{e.stopPropagation(),l(!0)}})]})]})},tm=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,L.useRef)(null);(0,L.useImperativeHandle)(n,()=>i.current);let a=()=>{e?.(i.current?.value??``)},o=()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()},s=r.value??i.current?.value??r.defaultValue??``;return(0,z.jsx)(em,{value:s,onCancel:o,onSave:a,onClick:e=>{e.preventDefault(),e.stopPropagation()},children:(0,z.jsx)($p,{className:`leading-6`,ref:i,onClick:e=>{e.preventDefault(),e.stopPropagation()},...r})})},nm=({keyPath:e,section:t,editedContent:n,editedContentValue:r,onContentChange:i,onFocusKeyPath:a,renderSection:o})=>{let s=Qf(),c=r??Ft(n,e,s);if(c&&typeof c!=`string`)return(0,z.jsx)(z.Fragment,{children:`Error loading section - Edited content Incoherence with the original content format`});let l=e.length,u=String(c??t);return(0,z.jsx)(`button`,{type:`button`,className:I(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,l===2&&`hover:bg-card/30`,l>=3&&``),onClick:t=>{t.stopPropagation(),a(e)},children:typeof o==`function`?o(u):(0,z.jsx)(tm,{"aria-label":`Editable field`,defaultValue:u,onSave:t=>i({keyPath:e,newValue:t}),onCancel:()=>null})})},rm=e=>{let{keyPath:t,section:n}=e,{addEditedContent:r}=ap(),i=Ft(e.editedContent,t),a=n[x],{content:o}=n,s=[...t,{type:x}];return(0,z.jsxs)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:[(0,z.jsxs)(`span`,{className:`text-neutral text-sm`,children:[a,` `]}),(0,z.jsx)(nm,{...e,keyPath:s,section:o,editedContentValue:i?.content,onContentChange:i=>{r(e.dictionary.localId,{...n,content:i.newValue},t)}})]})},im=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:se}],i=n[se];return(0,z.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,z.jsx)(mm,{...e,keyPath:r,section:i})})},am=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:ot}],i=n[ot];return(0,z.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,z.jsx)(mm,{...e,keyPath:r,section:i})})},om=e=>{let{keyPath:t,section:n}=e,r=[...t,{type:l}],i=n[l];return(0,z.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:(0,z.jsx)(mm,{...e,keyPath:r,section:i})})},sm=(0,L.memo)(e=>{let{keyPath:t,section:n,focusedKeyPath:r=[],onFocusKeyPath:i}=e;return(0,L.useMemo)(()=>Object.keys(n??{}).filter(e=>!pm.includes(e)),[n]).map(a=>{let o={key:a,type:he},s=[...t,o],c=kt(s,r);return(0,z.jsx)(Ip,{level:t.length,title:At(a),description:``,isSelected:c,onClick:e=>{e.stopPropagation(),i(c?[]:s)},children:(0,z.jsx)(mm,{...e,keyPath:s,section:n[a]})},a)})}),cm=({onSave:e,onCancel:t,ref:n,...r})=>{let i=(0,L.useRef)(null),a=()=>{e?.(i.current?.value??``)},o=()=>{i.current&&(i.current.value=i.current.defaultValue??``),t?.()};(0,L.useImperativeHandle)(n,()=>i.current);let s=(0,L.useMemo)(()=>r.value??i.current?.value??r.defaultValue,[r.value,r.defaultValue,i.current?.value]);return(0,z.jsx)(em,{value:s,onCancel:o,onSave:a,children:(0,z.jsx)(Yp,{ref:i,...r})})},lm=({keyPath:e,section:t,editedContent:n,onContentChange:r,onFocusKeyPath:i})=>{let a=Ft(n,e,Qf());if(a!==void 0&&typeof a!=`number`)return(0,z.jsx)(z.Fragment,{children:`Error loading section - Edited content incoherence with the original content format`});let o=e.length,s=String(a??t);return(0,z.jsx)(`button`,{type:`button`,className:I(`w-full rounded-md p-2 text-left transition`,`hover:bg-card/30 [&:has(.section:hover)]:bg-transparent`,o===2&&`hover:bg-card/30`,o>=3&&``),onClick:t=>{t.stopPropagation(),i(e)},children:(0,z.jsx)(cm,{"aria-label":`Editable number field`,type:`number`,defaultValue:s,onSave:t=>r({keyPath:e,newValue:t}),onCancel:()=>null})})},um=e=>{let{keyPath:t,section:n}=e;return(0,z.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(n).filter(e=>!pm.includes(e)).map(r=>{let i={type:_,key:r},a=[...t,i],o=n[_][r];return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`flex items-center font-bold`,children:r}),(0,L.createElement)(mm,{...e,key:r,keyPath:a,section:o})]})})})},dm=e=>{let{keyPath:t,section:n}=e,r=n[C];return(0,z.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:Object.keys(r).map(n=>{let i={type:C,key:n},a=[...t,i];return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`span`,{className:`flex items-center font-bold`,children:n}),(0,L.createElement)(mm,{...e,key:n,keyPath:a,section:r[n]})]})})})},fm=e=>{let{keyPath:t,section:n,locale:r}=e,i={type:ye,key:r},a=[...t,i],o=n[ye][r];return(0,z.jsx)(mm,{...e,keyPath:a,section:o})},pm=[`filePath`,`id`,`nodeType`],mm=(0,L.memo)(e=>{let t=Qf(),n=(0,L.useMemo)(()=>Ft(e.editedContent,e.keyPath,t)??e.section,[e.editedContent,e.keyPath,e.section]),r=(0,L.useMemo)(()=>Ht(n),[n]);if(typeof n==`object`)return r===`reactNode`?(0,z.jsx)(`span`,{className:`text-neutral text-xs`,children:`React node not editable`}):r===`nested`?(0,z.jsx)(`div`,{className:`ml-2 grid grid-cols-[auto,1fr] gap-2`,children:`[Nested] Dictionary`}):r===`markdown`?(0,z.jsx)(om,{...e,section:n}):r===`html`?(0,z.jsx)(im,{...e,section:n}):r===`translation`?(0,z.jsx)(fm,{...e,section:n}):r===`enumeration`?(0,z.jsx)(Kp,{...e,section:n}):r===`plural`?(0,z.jsx)(um,{...e,section:n}):r===`select`?(0,z.jsx)(dm,{...e,section:n}):r===`condition`?(0,z.jsx)(Gp,{...e,section:n}):r===`insertion`?(0,z.jsx)(am,{...e,section:n}):r===`array`?(0,z.jsx)(Lp,{...e,section:n}):r===`file`?(0,z.jsx)(rm,{...e,section:n}):(0,z.jsx)(sm,{...e,section:n});if(typeof n==`string`)return(0,z.jsx)(nm,{...e,section:n});if(typeof n==`number`)return(0,z.jsx)(lm,{...e,section:n});if(typeof n==`boolean`)return(0,z.jsx)(Wp,{...e,section:n})}),hm=({dictionary:e,...t})=>{let n=Qf(),{editedContent:r,addEditedContent:i}=ap(),{focusedContent:a,setFocusedContentKeyPath:o}=ep();return(0,z.jsx)(`div`,{className:`flex flex-col gap-2`,children:(0,L.createElement)(mm,{...t,keyPath:[],locale:n,dictionary:e,key:`${JSON.stringify((r?.[e.localId]??e).content)}${n}`,editedContent:r?.[e.localId]?.content,focusedKeyPath:a?.keyPath,section:e.content,onContentChange:t=>{i(e.localId,t.newValue,t.keyPath)},onFocusKeyPath:o})})},gm=({children:e,onContentChange:t,disabled:n,validate:r,additionalButtons:a,...o})=>{let[s,c]=(0,L.useState)(e),[l,u]=(0,L.useState)(0),d=s!==e,f=()=>{c(e),u(e=>e+1)},p=()=>{t(s)},m=e=>{c(e.currentTarget.value)},h=e=>{e.key===`Enter`&&!n&&g?(e.preventDefault(),p()):e.key===`Escape`&&(e.preventDefault(),f())};(0,L.useEffect)(()=>{c(e),u(e=>e+1)},[e]);let g=r?.(s)??!0;return(0,z.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor input`,children:[(0,z.jsx)(Yp,{onChange:m,onKeyDown:h,"aria-label":`Editable input value`,"aria-describedby":d||a?`content-editor-input-actions`:void 0,"aria-invalid":!g,variant:`invisible`,className:`size-full`,defaultValue:e,disabled:n,...o},l),(d||a)&&(0,z.jsxs)(`div`,{id:`content-editor-input-actions`,className:`flex w-full items-center justify-end gap-2`,role:`group`,"aria-label":`Edit actions`,children:[d&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(j,{Icon:i,label:`Save changes${g?``:` (invalid content)`}`,variant:`hoverable`,color:`text`,size:`icon-sm`,className:`cursor-pointer hover:scale-110`,disabled:n||!g,onClick:p,"aria-describedby":g?void 0:`validation-error`}),(0,z.jsx)(j,{Icon:N,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:f,disabled:n})]}),a]})]},String(e))},_m=``,vm=e=>{let t=e.querySelectorAll(`[data-line]`);return t.length===0?(e.textContent??``).split(_m).join(``):Array.from(t).map(e=>{let t=e.querySelector(`[data-editable]`)?.textContent??e.textContent??``;return t===_m?``:t.split(_m).join(``)}).join(`
|
|
45
|
-
`)},ym=e=>{let t=e.split(`
|
|
46
|
-
`);return t.length===0?[``]:t},bm=(()=>{if(typeof Intl>`u`||!(`Segmenter`in Intl))return null;let e=Intl.Segmenter;return new e(void 0,{granularity:`grapheme`})})(),xm=(e,t)=>{if(t<=0)return 0;if(bm){let n=[...bm.segment(e.slice(0,t))],r=n[n.length-1];return r?t-r.segment.length:t-1}let n=e.charCodeAt(t-1);return n>=56320&&n<=57343&&t>=2?t-2:t-1},Sm=(e,t)=>{if(t>=e.length)return e.length;if(bm){let n=[...bm.segment(e.slice(t))][0];return n?t+n.segment.length:t+1}let n=e.charCodeAt(t);return n>=55296&&n<=56319&&t+1<e.length?t+2:t+1},Cm=(e,t)=>{if(t<=0)return 0;let n=t-1;for(;n>0&&/\s/.test(e[n-1]);)n--;for(;n>0&&/\S/.test(e[n-1]);)n--;return n},wm=(e,t)=>{if(t>=e.length)return e.length;let n=t;for(;n<e.length&&/\S/.test(e[n]);)n++;for(;n<e.length&&/\s/.test(e[n]);)n++;return n},Tm=(e,t)=>e.slice(0,t).lastIndexOf(`
|
|
47
|
-
`)+1,Em=(e,t)=>{let n=e.indexOf(`
|
|
48
|
-
`,t);return n===-1?e.length:n},Dm=({value:e,defaultValue:t,onChange:n,disabled:r=!1})=>{let i=e??t??``,[a,o]=(0,L.useState)(()=>ym(i)),s=(0,L.useRef)(null),c=(0,L.useRef)(null),l=e!==void 0,u=(0,L.useRef)(a);u.current=a,(0,L.useEffect)(()=>{l&&e!==void 0&&o(ym(e))},[e,l]);let d=()=>u.current.join(`
|
|
49
|
-
`),f=()=>{let e=window.getSelection();if(!e?.rangeCount||!s.current)return null;let t=e.getRangeAt(0),n=s.current.querySelectorAll(`[data-line]`);for(let e=0;e<n.length;e++)if(n[e].contains(t.startContainer))return{line:e,offset:t.startOffset};return null},p=()=>{let e=window.getSelection();if(!e?.rangeCount||!s.current)return null;let t=e.getRangeAt(0),n=s.current.querySelectorAll(`[data-line]`),r=u.current,i=(e,t)=>{for(let i=0;i<n.length;i++)if(n[i].contains(e)){let e=0;for(let t=0;t<i;t++)e+=r[t].length+1;return e+Math.min(t,r[i]?.length??0)}return e===s.current?t===0?0:r.join(`
|
|
50
|
-
`).length:0},a=i(t.startContainer,t.startOffset),o=i(t.endContainer,t.endOffset);return{start:Math.min(a,o),end:Math.max(a,o),hasSelection:!t.collapsed}},m=e=>{if(!s.current)return;let t=s.current.querySelectorAll(`[data-line]`)[e.line];if(!t)return;let n=t.querySelector(`[data-editable]`),r=n?.firstChild??n??t.firstChild??t,i=window.getSelection();if(!i)return;let a=document.createRange(),o=Math.min(e.offset,r.textContent?.length??0);try{a.setStart(r,o),a.collapse(!0),i.removeAllRanges(),i.addRange(a)}catch{a.selectNodeContents(r),a.collapse(!1),i.removeAllRanges(),i.addRange(a)}};(0,L.useLayoutEffect)(()=>{c.current&&s.current&&(m(c.current),c.current=null)});let h=e=>{let t=u.current,n=0;for(let r=0;r<e.line;r++)n+=t[r].length+1;return n+e.offset},g=(e,t)=>{let n=e;for(let e=0;e<t.length;e++){if(n<=t[e].length)return{line:e,offset:n};n-=t[e].length+1}return{line:t.length-1,offset:t[t.length-1]?.length??0}},_=()=>{let e=f();return e?h(e):0},v=(e,t)=>{let r=ym(e);c.current=g(t,r),o(r),n?.(e)};return{lines:a,containerRef:s,getText:d,handleInput:()=>{if(c.current!==null||r||!s.current)return;let e=f(),t=vm(s.current),i=ym(t);c.current=e,o(i),n?.(t)},handleBeforeInput:e=>{if(r)return;let t=e.nativeEvent;if(t.isComposing)return;let n=t.inputType;if(n!==`insertParagraph`&&n!==`insertLineBreak`){if(n===`deleteContentBackward`||n===`deleteContentForward`){e.preventDefault();let t=p();if(!t)return;let r=u.current.join(`
|
|
51
|
-
`);if(t.hasSelection){let e=r.slice(0,t.start)+r.slice(t.end);v(e,t.start)}else if(n===`deleteContentBackward`){if(t.start===0)return;let e=xm(r,t.start),n=r.slice(0,e)+r.slice(t.start);v(n,e)}else{if(t.start>=r.length)return;let e=Sm(r,t.start),n=r.slice(0,t.start)+r.slice(e);v(n,t.start)}return}if(n===`insertReplacementText`){e.preventDefault();let n=p();if(!n)return;let r=u.current.join(`
|
|
52
|
-
`),i=t.data??t.dataTransfer?.getData(`text/plain`)??``,a=r.slice(0,n.start)+i+r.slice(n.end);v(a,n.start+i.length);return}if(n===`insertText`&&t.data){e.preventDefault();let n=p();if(!n)return;let r=u.current.join(`
|
|
53
|
-
`),i=t.data,a=r.slice(0,n.start)+i+r.slice(n.end);v(a,n.start+i.length)}}},handleKeyDown:e=>{if(r){e.preventDefault();return}if(e.nativeEvent.isComposing)return;if((e.metaKey||e.ctrlKey)&&e.key===`z`){e.preventDefault();return}let t=p();if(!t)return;let n=u.current.join(`
|
|
54
|
-
`);if(e.key===`Enter`){e.preventDefault();let r=n.slice(0,t.start)+`
|
|
55
|
-
`+n.slice(t.end);v(r,t.start+1);return}if(e.key===`Backspace`){if(e.preventDefault(),t.hasSelection){let e=n.slice(0,t.start)+n.slice(t.end);v(e,t.start)}else{if(t.start===0)return;let r;r=e.metaKey?Tm(n,t.start):e.altKey?Cm(n,t.start):xm(n,t.start);let i=n.slice(0,r)+n.slice(t.start);v(i,r)}return}if(e.key===`Delete`){if(e.preventDefault(),t.hasSelection){let e=n.slice(0,t.start)+n.slice(t.end);v(e,t.start)}else{if(t.start>=n.length)return;let r;r=e.metaKey?Em(n,t.start):e.altKey?wm(n,t.start):Sm(n,t.start);let i=n.slice(0,t.start)+n.slice(r);v(i,t.start)}return}},handleCut:e=>{if(r){e.preventDefault();return}e.preventDefault();let t=p();if(!t?.hasSelection)return;let n=u.current.join(`
|
|
56
|
-
`),i=n.slice(t.start,t.end);e.clipboardData.setData(`text/plain`,i);let a=n.slice(0,t.start)+n.slice(t.end);v(a,t.start)},handlePaste:e=>{if(r){e.preventDefault();return}e.preventDefault();let t=e.clipboardData.getData(`text/plain`);if(!t)return;let n=p();if(!n)return;let i=u.current.join(`
|
|
57
|
-
`),a=i.slice(0,n.start)+t+i.slice(n.end);v(a,n.start+t.length)},handleDrop:e=>{e.preventDefault()},handleDragOver:e=>{e.preventDefault()},getCaretPosition:f,setCaretPosition:m,getCursorOffset:_,caretFromFlatOffset:g}},Om=({index:e,text:t,isLast:n,ghostText:r})=>(0,z.jsxs)(`span`,{"data-line":e,className:`block min-h-[1.5rem]`,children:[(0,z.jsx)(`span`,{"data-editable":!0,children:t||``}),r&&(0,z.jsx)(`span`,{"data-ghost":!0,className:`pointer-events-none select-none text-neutral`,"aria-hidden":`true`,children:r}),!n&&(0,z.jsx)(`br`,{})]}),km=24,Am=12,jm=({value:e,defaultValue:t,onChange:n,placeholder:r,disabled:i=!1,minRows:a=1,maxRows:o=999,autoSize:s=!0,validationStyleEnabled:c=!1,variant:l,ghostText:u,ghostLine:d,ghostOffset:f,onClick:p,className:m,dir:h=`auto`,ref:g,..._})=>{let{lines:v,containerRef:y,getText:b,handleInput:x,handleBeforeInput:S,handleKeyDown:C,handleCut:w,handlePaste:T,handleDrop:E,handleDragOver:D,getCursorOffset:O,setCaretPosition:k,caretFromFlatOffset:ee}=Dm({value:e,defaultValue:t,onChange:n,disabled:i}),A=(0,L.useRef)(null),te=e=>{A.current=e,y.current=e};(0,L.useImperativeHandle)(g,()=>({getContainer:()=>A.current,getText:b,focus:()=>A.current?.focus(),getCursorOffset:O,setCursorAtOffset:e=>{k(ee(e,v))}})),(0,L.useLayoutEffect)(()=>{if(!s||!A.current)return;let e=A.current,t=km*o+Am,n=km*a+Am;e.style.height=`auto`;let r=e.scrollHeight;e.style.height=`${Math.max(Math.min(r,t),n)}px`,e.style.overflowY=r>t?`auto`:`hidden`},[v,s,o,a]);let ne=v.length===1&&v[0]===``,j=u&&d!==void 0&&f!==void 0;return(0,z.jsxs)(`div`,{className:`relative w-full`,children:[ne&&r&&(0,z.jsx)(`div`,{className:`pointer-events-none absolute inset-0 select-none px-2 py-3 text-base text-neutral-400 leading-[1.5rem] md:py-2 md:text-sm`,"aria-hidden":`true`,children:r}),(0,z.jsx)(`div`,{..._,ref:te,role:`textbox`,"aria-multiline":`true`,"aria-placeholder":r,"aria-disabled":i,"aria-autocomplete":j?`inline`:void 0,tabIndex:i?-1:0,contentEditable:!i,suppressContentEditableWarning:!0,dir:h,onInput:x,onBeforeInput:S,onKeyDown:C,onCut:w,onPaste:T,onDrop:E,onDragOver:D,onClick:p,className:I(`resize-none whitespace-pre-wrap break-words outline-none`,Jp({variant:l,validationStyleEnabled:c?`enabled`:`disabled`}),s&&`overflow-y-auto`,m),children:v.map((e,t)=>(0,z.jsx)(Om,{index:t,text:e,isLast:t===v.length-1,ghostText:j&&d===t?u:void 0},t))})]})},Mm=({isActive:e=!0,suggestion:t,...n})=>{let r=String(n.value??n.defaultValue??``),[i,a]=(0,L.useState)(r),[o,s]=(0,L.useState)(``),c=(0,L.useRef)(null);(0,L.useEffect)(()=>{n.value!==void 0&&a(String(n.value??n.defaultValue??``))},[n.value,n.defaultValue]);let l=()=>{let e=t??o;if(!e)return;let n=c.current?.getCursorOffset()??i.length,r=i.slice(0,n)+e+i.slice(n);a(r),s(``),setTimeout(()=>{c.current?.focus(),c.current?.setCursorAtOffset(n+e.length)},0)},u=e?t??(o||void 0):void 0,d=i.split(`
|
|
58
|
-
`),f=t?d.length-1:void 0,p=t?d[d.length-1]?.length??0:void 0;return(0,z.jsx)(jm,{ref:c,value:i,onChange:e=>{if(a(e),s(``),n.onChange){let t={target:{value:e},currentTarget:{value:e}};n.onChange(t)}},onKeyDown:e=>{e.key===`Tab`&&(t??o)&&(e.preventDefault(),l()),n.onKeyDown?.(e)},ghostText:u,ghostLine:f,ghostOffset:p,placeholder:n.placeholder,disabled:n.disabled,autoSize:n.autoSize,maxRows:n.maxRows,minRows:n.rows,variant:n.variant,validationStyleEnabled:n.validationStyleEnabled,className:n.className,dir:n.dir,"aria-label":n[`aria-label`],"aria-invalid":n[`aria-invalid`],"aria-describedby":n[`aria-describedby`],"data-testid":n[`data-testid`]})},Nm=({children:e,onContentChange:t,disabled:n,validate:r,additionalButtons:a,...o})=>{let{isAuthenticated:s}=Pp(),[c,l]=(0,L.useState)(e),[u,d]=(0,L.useState)(0),f=c!==e,p=()=>{l(e),d(e=>e+1)},m=()=>{t(c)},h=e=>l(e.currentTarget.value??``),g=e=>{e.key===`Enter`&&(e.metaKey||e.ctrlKey)&&!n&&_?(e.preventDefault(),m()):e.key===`Escape`&&(e.preventDefault(),p())};(0,L.useEffect)(()=>{l(e),d(e=>e+1)},[e]);let _=r?.(c)??!0;return(0,z.jsxs)(`div`,{className:`flex size-full flex-col items-center justify-between gap-2`,role:`group`,"aria-label":`Content editor textarea`,children:[(0,z.jsx)(Mm,{onChange:h,onKeyDown:g,variant:`invisible`,className:`size-full`,value:e,isActive:s,disabled:n,"aria-label":`Editable textarea content`,"aria-describedby":f||a?`content-editor-textarea-actions`:void 0,"aria-invalid":!_,...o},u),(f||a)&&(0,z.jsxs)(`div`,{id:`content-editor-textarea-actions`,className:`flex w-full items-center justify-end gap-2`,role:`group`,"aria-label":`Edit actions`,children:[f&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(j,{Icon:i,label:`Save changes${_?``:` (invalid content)`}`,variant:`hoverable`,color:`text`,size:`icon-sm`,className:`cursor-pointer hover:scale-110`,disabled:n||!_,onClick:m,"aria-describedby":_?void 0:`textarea-validation-error`}),(0,z.jsx)(j,{Icon:N,label:`Cancel changes`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,onClick:p,disabled:n})]}),a]})]},e)},Pm=(e,t,n)=>{let r={...e};for(let i of Object.keys(e))i===t?(r[n]=e[t],delete r[t]):r[i]=e[i];return r},Fm=({htmlFor:e,required:t=!1,disabled:n=!1,className:r,children:i,...a})=>(0,z.jsxs)(`label`,{className:I(`select-none font-medium text-sm leading-none`,`peer-disabled:cursor-not-allowed peer-disabled:opacity-70`,n&&`cursor-not-allowed text-muted-foreground opacity-70`,r),htmlFor:e,suppressHydrationWarning:!0,...a,children:[i,t&&(0,z.jsx)(`span`,{className:`ml-1 text-error`,"aria-hidden":`true`,title:`This field is required`,children:`*`})]}),Im=(0,L.createContext)({availableLocales:[],selectedLocales:[],setSelectedLocales:()=>{}}),Lm=()=>(0,L.useContext)(Im),Rm=({availableLocales:e,defaultSelectedLocales:t,children:n})=>{let{locale:r}=R(),[i,a]=o(`locale-content-selector-selected-locales`,t??[r]);return(0,L.useEffect)(()=>{if(e.length&&!i?.some(t=>e.includes(t))){let n=t?.filter(t=>e.includes(t));a(n?.length?n:[r])}},[e]),(0,z.jsx)(Im,{value:{availableLocales:e,selectedLocales:i,setSelectedLocales:a},children:n})},zm=e=>{let t,n;if(typeof e==`number`||!Number.isNaN(Number(e)))t=`=`,n=e.toString();else if(typeof e==`string`){let r=[`<=`,`>=`,`<`,`>`,`=`].find(t=>e.startsWith(t));r&&(t=r,n=e.slice(r.length))}return{comparator:t,numberValue:n}},Bm=({value:e,onChange:t})=>{let{comparator:n,numberValue:r}=(0,L.useMemo)(()=>zm(e),[e]),[i,a]=(0,L.useState)(n??null),[o,s]=(0,L.useState)(r??null);return(0,L.useEffect)(()=>{i&&o&&(i!==n||o!==r)&&t(`${i}${o}`)},[i,n,r,o,t]),(0,z.jsxs)(`div`,{className:`flex gap-1`,children:[(0,z.jsxs)(F,{onValueChange:a,defaultValue:n,children:[(0,z.jsx)(F.Trigger,{className:`w-20`,children:(0,z.jsx)(F.Value,{placeholder:`Select a comparator`})}),(0,z.jsxs)(F.Content,{children:[(0,z.jsx)(F.Item,{value:`<`,children:`<`}),(0,z.jsx)(F.Item,{value:`<=`,children:`<=`}),(0,z.jsx)(F.Item,{value:`=`,children:`=`}),(0,z.jsx)(F.Item,{value:`>=`,children:`>=`}),(0,z.jsx)(F.Item,{value:`>`,children:`>`})]})]}),(0,z.jsx)(Yp,{type:`number`,"aria-label":`Quantity`,defaultValue:o??void 0,onChange:e=>s(e.target.value),className:`min-w-4`})]})},Vm=({rawContent:e})=>{let[t,n]=(0,L.useState)(``);return(0,L.useEffect)(()=>{Et(async()=>{let{default:e}=await import(`./purify.es-7fJ1DZ6H.js`);return{default:e}},[]).then(({default:t})=>{n(t.sanitize(e))})},[e]),t?(0,z.jsx)(`div`,{dangerouslySetInnerHTML:{__html:t}}):(0,z.jsx)(`div`,{})},Hm=(0,L.lazy)(()=>Et(()=>import(`./MarkDownRender-C_B1qnYV.js`).then(e=>({default:e.MarkdownRenderer})),__vite__mapDeps([0,1,2,3,4,5]))),Um=(0,L.lazy)(()=>Et(()=>import(`./MarkdownEditor-BtOw7ct6.js`).then(e=>({default:e.MarkdownEditor})),__vite__mapDeps([6,2,3,4,5,1,7]))),Wm=(0,L.memo)(function({label:e,...t}){let[n,r]=(0,L.useState)(!1);return(0,z.jsx)(Fp,{header:e,label:e,onToggle:e=>{e&&!n&&r(!0)},children:n?(0,z.jsx)(lh,{...t}):null})}),Gm=({keyPath:e,dictionary:t,...n})=>{let{editedContent:r,addEditedContent:i}=ap(),a=rp(),{mutate:o,isPending:s}=Cp();return(0,z.jsx)(Nm,{variant:`default`,onContentChange:n=>i(t.localId,n,e),additionalButtons:(0,z.jsx)(j,{Icon:Ec,label:`Audit`,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`cursor-pointer hover:scale-110`,isLoading:s,onClick:()=>{o({fileContent:JSON.stringify({...t,...r?.[t.localId]??{}}),keyPath:e,locales:a?.internationalization.locales??[],aiOptions:{apiKey:a?.ai?.apiKey,model:a?.ai?.model,temperature:a?.ai?.temperature}},{onSuccess:n=>{if(n?.data)try{let r=n.data.fileContent;i(t.localId,r,e)}catch(e){console.error(e)}}})}}),...n})},Km=({keyPath:e,dictionary:t,...n})=>{let{addEditedContent:r}=ap();return(0,z.jsx)(gm,{variant:`default`,onContentChange:n=>r(t.localId,n,e),...n})},qm=[{content:`False`,value:!1},{content:`True`,value:!0}],Jm=({dictionary:e,keyPath:t,...n})=>{let{addEditedContent:r}=ap();return(0,z.jsx)(Up,{choices:qm,value:!0,onChange:n=>r(e.localId,n,t),color:`text`,size:`sm`,...n})},Ym=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let{locale:i,defaultLocale:a}=R(),{selectedLocales:o}=Lm(),s=e[ye];return(0,z.jsx)(`table`,{className:`w-full`,children:(0,z.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:o.map(e=>{let o=`${JSON.stringify(t)}-translation-${e}`;return(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`tr`,{className:`mt-2 w-full p-2 text-xs`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:Nt(e,i)})}),(0,z.jsx)(`tr`,{className:`flex`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(uh,{section:s[e]??Lt(s[a]),keyPath:[...t,{type:ye,key:e}],dictionary:n,renderSection:r})})})]},o)})})})},Xm=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let{addEditedContent:i}=ap(),{addNewEnumeration:a,removeEnumeration:o}=ce(`navigation-view`),s=e[h],c=Object.keys(s)[0];return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(`table`,{className:`w-full`,children:(0,z.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(e[h]).map(a=>{let l=[...t,{type:h,key:a}],u=`${JSON.stringify(t)}-enumeration-${a}`;return(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`tr`,{className:`mt-2 w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(`div`,{className:`flex flex-1`,children:(0,z.jsx)(j,{label:o.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-muted-foreground hover:text-error`,Icon:wc,onClick:()=>i(n.localId,void 0,l),children:o.text})})})}),(0,z.jsx)(`tr`,{className:`w-full p-2`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(Bm,{value:a,onChange:r=>{let o=e[h],s=Pm(o,a,r),c={...e,[h]:s};console.log(`newValue`,c),i(n.localId,c,t)}})})}),(0,z.jsx)(`tr`,{className:`block w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(lh,{section:s[a]??Lt(s[c]),keyPath:l,dictionary:n,renderSection:r})})})]},u)})})}),(0,z.jsx)(j,{label:a.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:()=>i(n.localId,Lt(s[c])??``,[...t,{type:h,key:`unknown`}]),Icon:gc,className:`m-2`,children:a.text})]})},Zm=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let{addEditedContent:i}=ap(),{addNewSelectCase:a,removeSelectCase:o}=ce(`navigation-view`),s=e[C],c=Object.keys(s)[0];return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(`table`,{className:`w-full`,children:(0,z.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:Object.keys(s).map(a=>{let l=[...t,{type:C,key:a}],u=`${JSON.stringify(t)}-select-${a}`;return(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`tr`,{className:`mt-2 w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(`div`,{className:`flex flex-1`,children:(0,z.jsx)(j,{label:o.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-muted-foreground hover:text-error`,Icon:wc,onClick:()=>i(n.localId,void 0,l),children:o.text})})})}),(0,z.jsx)(`tr`,{className:`w-full p-2`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(gm,{"aria-label":`Edit case`,type:`text`,variant:`default`,onContentChange:r=>{let o={...e,[C]:Pm(s,a,String(r))};i(n.localId,o,t)},children:a})})}),(0,z.jsx)(`tr`,{className:`block w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(lh,{section:s[a]??Lt(s[c]),keyPath:l,dictionary:n,renderSection:r})})})]},u)})})}),(0,z.jsx)(j,{label:a.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:()=>i(n.localId,Lt(s[c])??``,[...t,{type:C,key:`newCase`}]),Icon:gc,className:`m-2`,children:a.text})]})},Qm=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[re];return(0,z.jsx)(`table`,{className:`w-full`,children:(0,z.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`true`,`false`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-condition-${e}`;return(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,z.jsx)(`tr`,{className:`block w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(uh,{section:i[e]??Lt(i.true),keyPath:[...t,{type:re,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},$m=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[D];return(0,z.jsx)(`table`,{className:`w-full`,children:(0,z.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:[`male`,`female`,`fallback`].map(e=>{let a=`${JSON.stringify(t)}-gender-${e}`;return(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,z.jsx)(`tr`,{className:`block w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(uh,{section:i[e]??Lt(i.male),keyPath:[...t,{type:D,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},eh=[`zero`,`one`,`two`,`few`,`many`,`other`],th=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e[_];return(0,z.jsx)(`table`,{className:`w-full`,children:(0,z.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:eh.map(e=>{let a=`${JSON.stringify(t)}-plural-${e}`;return(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`tr`,{className:`mt-2 block w-full p-2 text-xs`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:e})}),(0,z.jsx)(`tr`,{className:`block w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(uh,{section:i[e]??Lt(i.other),keyPath:[...t,{type:_,key:e}],dictionary:n,renderSection:r})})})]},a)})})})},nh=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let{addEditedContent:i}=ap(),{addNewElement:a,removeElement:o}=ce(`navigation-view`);return(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(`table`,{className:`w-full`,children:(0,z.jsx)(`tbody`,{className:`flex w-full flex-col gap-2`,children:e.map((a,s)=>{let c=`${JSON.stringify(t)}-array-${s}`;return(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`tr`,{className:`mt-2 w-full p-2`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-2`,children:[(0,z.jsx)(`span`,{className:`text-xs`,children:String(s)}),(0,z.jsx)(j,{label:o.label.value,variant:`hoverable`,size:`sm`,color:`error`,className:`ml-auto text-muted-foreground hover:text-error`,onClick:()=>{let e=[...t,{type:k,key:s}];i(n.localId,void 0,e)},Icon:wc,children:o.text})]})})}),(0,z.jsx)(`tr`,{className:`block w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(uh,{section:a??Lt(e[0]),keyPath:[...t,{type:k,key:s}],dictionary:n,renderSection:r})})})]},c)})})}),(0,z.jsx)(j,{label:a.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,isFullWidth:!0,onClick:()=>{let r=[...t,{type:k,key:e.length}];i(n.localId,Lt(e[0])??``,r,!1)},Icon:gc,children:a.text})]})},rh=({section:e,keyPath:t,dictionary:n,renderSection:r})=>{let i=e,a=Object.keys(i)[0];return(0,z.jsx)(`table`,{className:`w-full`,children:(0,z.jsx)(`tbody`,{className:`flex flex-col gap-2`,children:Object.keys(i).map(e=>{let o=[...t,{type:he,key:e}],s=i[e]??Lt(i[a]),c=`${JSON.stringify(t)}-object-${e}`;return typeof s!=`object`||!s?(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`tr`,{className:`mt-2 p-2 text-xs`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:String(e)})}),(0,z.jsx)(`tr`,{className:`block w-full`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(lh,{section:s,keyPath:o,dictionary:n,renderSection:r})})})]},c):(0,z.jsx)(`tr`,{className:`block w-full border-neutral/10 border-t py-1`,children:(0,z.jsx)(`td`,{className:`flex w-full`,children:(0,z.jsx)(Wm,{label:At(e),section:s,keyPath:o,dictionary:n,renderSection:r})})},c)})})})},ih=({section:e,keyPath:t,dictionary:n})=>{let[r,i]=(0,L.useState)(0),a=[{content:`Edit`,value:0},{content:`Preview`,value:1}],o=[...t,{type:se}],s=e[se];return(0,z.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,z.jsx)(Up,{choices:a,value:r,onChange:i,color:`text`,size:`sm`,className:`ml-auto`}),(0,z.jsx)(uh,{section:s,keyPath:o,dictionary:n,renderSection:r===1?e=>(0,z.jsx)(Vm,{rawContent:e}):void 0})]})},ah=({section:e,keyPath:t,dictionary:n})=>{let[r,i]=(0,L.useState)(0),{addEditedContent:a}=ap(),o=[{content:`Edit`,value:0},{content:`Raw`,value:1},{content:`Preview`,value:2}],s=[...t,{type:l}],c=e.markdown??``;return(0,z.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,z.jsx)(Up,{choices:o,value:r,onChange:i,color:`text`,size:`sm`,className:`ml-auto`}),(0,z.jsx)(uh,{section:c,keyPath:s,dictionary:n,renderSection:r===0?(e,t)=>(0,z.jsx)(L.Suspense,{fallback:(0,z.jsx)(m,{}),children:(0,z.jsx)(Um,{defaultValue:e,onChange:e=>a(n.localId,e,t)},JSON.stringify(t))}):r===2?e=>(0,z.jsx)(L.Suspense,{fallback:(0,z.jsx)(m,{}),children:(0,z.jsx)(Hm,{children:e})}):void 0})]})},oh=({section:e,keyPath:t,...n})=>{let r=[...t,{type:ot}],i=e[ot];return(0,z.jsx)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:(0,z.jsx)(uh,{section:i,keyPath:r,...n})})},sh=({section:e,keyPath:t,...n})=>{let r=[...t,{type:x}],i=e[x],{content:a}=e;return(0,z.jsxs)(`div`,{className:`flex w-full flex-col justify-center gap-6 p-2`,children:[(0,z.jsxs)(`span`,{className:`text-neutral text-sm`,children:[i,` `]}),(0,z.jsx)(uh,{section:a,keyPath:r,...n})]})},ch=({keyPath:e,dictionary:t,renderSection:n,section:r,...i})=>{let{addEditedContent:a}=ap(),o=r[pe],s=[...e,{type:pe}];return(0,z.jsxs)(`div`,{className:`flex w-full flex-col gap-4 p-2`,children:[(0,z.jsx)(Fm,{children:`Dictionary key`}),(0,z.jsx)(gm,{"aria-label":`Edit field`,type:`text`,variant:`default`,...i,onContentChange:e=>{a(t.localId,{...o,dictionaryKey:String(e)},s)},children:o.dictionaryKey??``}),(0,z.jsx)(Fm,{children:`Path (optional)`}),(0,z.jsx)(gm,{"aria-label":`Edit field`,type:`text`,variant:`default`,...i,onContentChange:e=>{a(t.localId,{...o,path:e===``?void 0:e},s)},children:o.path??``})]})},lh=(0,L.memo)(function({section:e,keyPath:t,dictionary:n,renderSection:r}){let{tsxNotEditable:i}=ce(`navigation-view`),a=Ht(e);return a===`reactNode`?(0,z.jsxs)(`div`,{className:`flex w-full flex-col gap-2`,children:[(0,z.jsx)(`span`,{children:`(React Node)`}),(0,z.jsx)(`span`,{className:`flex text-muted-foreground text-xs`,children:i})]}):a===`nested`?(0,z.jsx)(ch,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`translation`?(0,z.jsx)(Ym,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`enumeration`?(0,z.jsx)(Xm,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`condition`?(0,z.jsx)(Qm,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`select`?(0,z.jsx)(Zm,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`gender`?(0,z.jsx)($m,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`plural`?(0,z.jsx)(th,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`insertion`?(0,z.jsx)(oh,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`markdown`?(0,z.jsx)(ah,{dictionary:n,keyPath:t,section:e}):a===`html`?(0,z.jsx)(ih,{dictionary:n,keyPath:t,section:e}):a===`file`?(0,z.jsx)(sh,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`array`?(0,z.jsx)(nh,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`object`?(0,z.jsx)(rh,{dictionary:n,renderSection:r,keyPath:t,section:e}):a===`number`?(0,z.jsx)(`div`,{className:`w-full p-2`,children:(0,z.jsx)(Km,{dictionary:n,keyPath:t,type:`number`,"aria-label":`Edit field`,children:e})}):a===`text`?(0,z.jsx)(`div`,{className:`w-full p-2`,children:typeof r==`function`?r(e,t):(0,z.jsx)(Gm,{variant:`default`,"aria-label":`Edit field`,keyPath:t,dictionary:n,children:e})}):a===`boolean`?(0,z.jsx)(`div`,{className:`w-full p-2`,children:(0,z.jsx)(Jm,{dictionary:n,keyPath:t,value:e})}):(0,z.jsxs)(`div`,{className:`w-full p-2`,children:[`Error. Format not supported.`,JSON.stringify(e,null,2),JSON.stringify(t,null,2),`NodeType : `,a]})}),uh=(0,L.memo)(function(e){return(0,z.jsx)(Fe,{border:!0,background:`none`,className:`top-6 flex h-full flex-1 flex-col gap-6 overflow-hidden p-2 md:sticky`,roundedSize:`2xl`,children:(0,z.jsx)(lh,{...e})})}),dh=$e(`inline-flex items-center rounded-md border px-2.5 py-0.5 font-semibold text-xs transition-colors focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2`,{variants:{color:{success:`border-success bg-success text-success hover:bg-success-500`,error:`border-error bg-error text-error hover:bg-error-500`,neutral:`border-neutral bg-neutral text-muted-foreground hover:bg-neutral-600`,light:`border-white bg-white text-white hover:bg-neutral-500`,dark:`border-neutral-800 bg-neutral-800 text-neutral-800 hover:bg-neutral-900`,text:`border-text bg-text text-foreground hover:opacity-80`,custom:``},variant:{default:`rounded-lg text-foreground-opposite`,none:`border-none bg-opacity-0 text-inherit hover:bg-opacity-0`,outline:`rounded-lg border-[1.3px] bg-opacity-0 hover:bg-opacity-30`,hoverable:`rounded-lg border-none bg-opacity-0 transition hover:bg-opacity-10`},size:{sm:`px-2 py-0.5 text-xs`,md:`px-2.5 py-0.5 text-xs`,lg:`px-3 py-1 text-sm`}},defaultVariants:{variant:`default`,color:`text`,size:`md`}}),fh=({className:e,variant:t=`default`,color:n=`text`,size:r=`md`,children:i,clickable:a=!1,dismissible:o=!1,onClick:s,onDismiss:c,role:l,tabIndex:u,"aria-label":d,...f})=>{let p=a?`button`:`span`,m=e=>{a&&s&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(e))},h=e=>{e.stopPropagation(),c?.()};return(0,z.jsxs)(p,{className:I(dh({variant:t,color:n,size:r}),a&&`cursor-pointer hover:opacity-80 focus-visible:ring-2 focus-visible:ring-offset-2`,o&&`pr-1`,e),onClick:a?s:void 0,onKeyDown:a?m:void 0,role:l||(a?`button`:`status`),tabIndex:a?u??0:u,"aria-label":d||(a?`${i} button`:void 0),...f,children:[i,o&&(0,z.jsx)(`button`,{type:`button`,className:`ml-1 inline-flex h-4 w-4 items-center justify-center rounded-full hover:bg-black/10 focus:outline-none focus:ring-1 focus:ring-offset-1`,onClick:h,"aria-label":`Remove ${i} badge`,children:(0,z.jsxs)(`svg`,{className:`size-3`,viewBox:`0 0 20 20`,fill:`currentColor`,"aria-label":`Remove badge`,children:[(0,z.jsx)(`title`,{children:`Remove badge`}),(0,z.jsx)(`path`,{fillRule:`evenodd`,d:`M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z`,clipRule:`evenodd`})]})})]})},ph=Object.defineProperty,mh=(e,t)=>ph(e,`name`,{value:t,configurable:!0}),hh=`Dialog`,[gh,_h]=tt(hh),[vh,yh]=gh(hh),bh=mh(e=>{let{__scopeDialog:t,children:n,open:r,defaultOpen:i,onOpenChange:a,modal:o=!0}=e,s=L.useRef(null),c=L.useRef(null),[l,u]=Pe({prop:r,defaultProp:i??!1,onChange:a,caller:hh}),[f,p]=L.useState(0),[m,h]=L.useState(0);return(0,z.jsx)(vh,{scope:t,triggerRef:s,contentRef:c,contentId:d(),titleId:d(),descriptionId:d(),titlePresent:f>0,descriptionPresent:m>0,setTitleCount:p,setDescriptionCount:h,open:l,onOpenChange:u,onOpenToggle:L.useCallback(()=>u(e=>!e),[u]),modal:o,children:n})},`Dialog`),xh=`DialogPortal`,[Sh,Ch]=gh(xh,{forceMount:void 0}),wh=mh(e=>{let{__scopeDialog:t,forceMount:n,children:r,container:i}=e,a=yh(xh,t);return(0,z.jsx)(Sh,{scope:t,forceMount:n,children:L.Children.map(r,e=>(0,z.jsx)(xe,{present:n||a.open,children:(0,z.jsx)(He,{asChild:!0,container:i,children:e})}))})},`DialogPortal`),Th=`DialogOverlay`,Eh=L.forwardRef(mh(function(e,t){let n=Ch(Th,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=yh(Th,e.__scopeDialog);return a.modal?(0,z.jsx)(xe,{present:r||a.open,children:(0,z.jsx)(Oh,{...i,ref:t})}):null},`DialogOverlay`)),Dh=be(`DialogOverlay.RemoveScroll`),Oh=L.forwardRef(mh(function(e,t){let{__scopeDialog:n,...r}=e,i=yh(Th,n),a=we(),o=P(t,a);return(0,z.jsx)(je,{as:Dh,allowPinchZoom:!0,shards:[i.contentRef],children:(0,z.jsx)(We.div,{"data-state":Ph(i.open),...r,ref:o,style:{pointerEvents:`auto`,...r.style}})})},`DialogOverlayImpl`)),kh=`DialogContent`,Ah=L.forwardRef(mh(function(e,t){let n=Ch(kh,e.__scopeDialog),{forceMount:r=n.forceMount,...i}=e,a=yh(kh,e.__scopeDialog);return(0,z.jsx)(xe,{present:r||a.open,children:a.modal?(0,z.jsx)(jh,{...i,ref:t}):(0,z.jsx)(Mh,{...i,ref:t})})},`DialogContent`)),jh=L.forwardRef(mh(function(e,t){let n=yh(kh,e.__scopeDialog),r=L.useRef(null),i=P(t,n.contentRef,r);return L.useEffect(()=>{let e=r.current;if(e)return ke(e)},[]),(0,z.jsx)(Nh,{...e,ref:i,trapFocus:n.open,disableOutsidePointerEvents:n.open,onCloseAutoFocus:rt(e.onCloseAutoFocus,e=>{e.preventDefault(),n.triggerRef.current?.focus()}),onPointerDownOutside:rt(e.onPointerDownOutside,e=>{let t=e.detail.originalEvent,n=t.button===0&&t.ctrlKey===!0;(t.button===2||n)&&e.preventDefault()}),onFocusOutside:rt(e.onFocusOutside,e=>e.preventDefault())})},`DialogContentModal`)),Mh=L.forwardRef(mh(function(e,t){let n=yh(kh,e.__scopeDialog),r=L.useRef(!1),i=L.useRef(!1);return(0,z.jsx)(Nh,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(r.current||n.triggerRef.current?.focus(),t.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(r.current=!0,t.detail.originalEvent.type===`pointerdown`&&(i.current=!0));let a=t.target;n.triggerRef.current?.contains(a)&&t.preventDefault(),t.detail.originalEvent.type===`focusin`&&i.current&&t.preventDefault()}})},`DialogContentNonModal`)),Nh=L.forwardRef(mh(function(e,t){let{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:a,...o}=e,s=yh(kh,n);return Le(),(0,z.jsx)(z.Fragment,{children:(0,z.jsx)(te,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:a,children:(0,z.jsx)(ze,{role:`dialog`,id:s.contentId,"aria-describedby":s.descriptionPresent?s.descriptionId:void 0,"aria-labelledby":s.titlePresent?s.titleId:void 0,"data-state":Ph(s.open),...o,ref:t,deferPointerDownOutside:!0,onDismiss:()=>s.onOpenChange(!1)})})})},`DialogContentImpl`));function Ph(e){return e?`open`:`closed`}mh(Ph,`getState`);var Fh=1,Ih=.9,Lh=.8,Rh=.17,zh=.1,Bh=.999,Vh=.9999,Hh=.99,Uh=/[\\\/_+.#"@\[\(\{&]/,Wh=/[\\\/_+.#"@\[\(\{&]/g,Gh=/[\s-]/,Kh=/[\s-]/g;function qh(e,t,n,r,i,a,o){if(a===t.length)return i===e.length?Fh:Hh;var s=`${i},${a}`;if(o[s]!==void 0)return o[s];for(var c=r.charAt(a),l=n.indexOf(c,i),u=0,d,f,p,m;l>=0;)d=qh(e,t,n,r,l+1,a+1,o),d>u&&(l===i?d*=Fh:Uh.test(e.charAt(l-1))?(d*=Lh,p=e.slice(i,l-1).match(Wh),p&&i>0&&(d*=Bh**+p.length)):Gh.test(e.charAt(l-1))?(d*=Ih,m=e.slice(i,l-1).match(Kh),m&&i>0&&(d*=Bh**+m.length)):(d*=Rh,i>0&&(d*=Bh**+(l-i))),e.charAt(l)!==t.charAt(a)&&(d*=Vh)),(d<zh&&n.charAt(l-1)===r.charAt(a+1)||r.charAt(a+1)===r.charAt(a)&&n.charAt(l-1)!==r.charAt(a))&&(f=qh(e,t,n,r,l+1,a+2,o),f*zh>d&&(d=f*zh)),d>u&&(u=d),l=n.indexOf(c,l+1);return o[s]=u,u}function Jh(e){return e.toLowerCase().replace(Kh,` `)}function Yh(e,t,n){return e=n&&n.length>0?`${e+` `+n.join(` `)}`:e,qh(e,t,Jh(e),Jh(t),0,0,{})}var Xh=`[cmdk-group=""]`,Zh=`[cmdk-group-items=""]`,Qh=`[cmdk-group-heading=""]`,$h=`[cmdk-item=""]`,eg=`${$h}:not([aria-disabled="true"])`,tg=`cmdk-item-select`,ng=`data-value`,rg=(e,t,n)=>Yh(e,t,n),ig=L.createContext(void 0),ag=()=>L.useContext(ig),og=L.createContext(void 0),sg=()=>L.useContext(og),cg=L.createContext(void 0),lg=L.forwardRef((e,t)=>{let n=Cg(()=>({search:``,value:e.value??e.defaultValue??``,selectedItemId:void 0,filtered:{count:0,items:new Map,groups:new Set}})),r=Cg(()=>new Set),i=Cg(()=>new Map),a=Cg(()=>new Map),o=Cg(()=>new Set),s=xg(e),{label:c,children:l,value:u,onValueChange:f,filter:p,shouldFilter:m,loop:h,disablePointerSelection:g=!1,vimBindings:_=!0,...v}=e,y=d(),b=d(),x=d(),S=L.useRef(null),C=Eg();Sg(()=>{if(u!==void 0){let e=u.trim();n.current.value=e,w.emit()}},[u]),Sg(()=>{C(6,ee)},[]);let w=L.useMemo(()=>({subscribe:e=>(o.current.add(e),()=>o.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var i,a,o;if(!Object.is(n.current[e],t)){if(n.current[e]=t,e===`search`)k(),D(),C(1,O);else if(e===`value`){if(document.activeElement.hasAttribute(`cmdk-input`)||document.activeElement.hasAttribute(`cmdk-root`)){let e=document.getElementById(x);e?e.focus():(i=document.getElementById(y))==null||i.focus()}if(C(7,()=>{n.current.selectedItemId=A()?.id,w.emit()}),r||C(5,ee),s.current?.value!==void 0){let e=t??``;(o=(a=s.current).onValueChange)==null||o.call(a,e);return}}w.emit()}},emit:()=>{o.current.forEach(e=>e())}}),[]),T=L.useMemo(()=>({value:(e,t,r)=>{t!==a.current.get(e)?.value&&(a.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,E(t,r)),C(2,()=>{D(),w.emit()}))},item:(e,t)=>(r.current.add(e),t&&(i.current.has(t)?i.current.get(t).add(e):i.current.set(t,new Set([e]))),C(3,()=>{k(),D(),n.current.value||O(),w.emit()}),()=>{a.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=A();C(4,()=>{k(),t?.getAttribute(`id`)===e&&O(),w.emit()})}),group:e=>(i.current.has(e)||i.current.set(e,new Set),()=>{a.current.delete(e),i.current.delete(e)}),filter:()=>s.current.shouldFilter,label:c||e[`aria-label`],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:y,inputId:x,labelId:b,listInnerRef:S}),[]);function E(e,t){let r=s.current?.filter??rg;return e?r(e,n.current.search,t):0}function D(){if(!n.current.search||s.current.shouldFilter===!1)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach(n=>{let r=i.current.get(n),a=0;r.forEach(t=>{let n=e.get(t);a=Math.max(n,a)}),t.push([n,a])});let r=S.current;te().sort((t,n)=>{let r=t.getAttribute(`id`),i=n.getAttribute(`id`);return(e.get(i)??0)-(e.get(r)??0)}).forEach(e=>{let t=e.closest(Zh);t?t.appendChild(e.parentElement===t?e:e.closest(`${Zh} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${Zh} > *`))}),t.sort((e,t)=>t[1]-e[1]).forEach(e=>{let t=S.current?.querySelector(`${Xh}[${ng}="${encodeURIComponent(e[0])}"]`);t?.parentElement.appendChild(t)})}function O(){let e=te().find(e=>e.getAttribute(`aria-disabled`)!==`true`)?.getAttribute(ng);w.setState(`value`,e||void 0)}function k(){if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let e=0;for(let t of r.current){let r=E(a.current.get(t)?.value??``,a.current.get(t)?.keywords??[]);n.current.filtered.items.set(t,r),r>0&&e++}for(let[e,t]of i.current)for(let r of t)if(n.current.filtered.items.get(r)>0){n.current.filtered.groups.add(e);break}n.current.filtered.count=e}function ee(){var e;let t=A();t&&(t.parentElement?.firstChild===t&&((e=t.closest(Xh)?.querySelector(Qh))==null||e.scrollIntoView({block:`nearest`})),t.scrollIntoView({block:`nearest`}))}function A(){return S.current?.querySelector(`${$h}[aria-selected="true"]`)}function te(){return Array.from(S.current?.querySelectorAll(eg)||[])}function ne(e){let t=te()[e];t&&w.setState(`value`,t.getAttribute(ng))}function j(e){var t;let n=A(),r=te(),i=r.findIndex(e=>e===n),a=r[i+e];(t=s.current)!=null&&t.loop&&(a=i+e<0?r[r.length-1]:i+e===r.length?r[0]:r[i+e]),a&&w.setState(`value`,a.getAttribute(ng))}function re(e){let t=A()?.closest(Xh),n;for(;t&&!n;)t=e>0?yg(t,Xh):bg(t,Xh),n=t?.querySelector(eg);n?w.setState(`value`,n.getAttribute(ng)):j(e)}let ie=()=>ne(te().length-1),ae=e=>{e.preventDefault(),e.metaKey?ie():e.altKey?re(1):j(1)},oe=e=>{e.preventDefault(),e.metaKey?ne(0):e.altKey?re(-1):j(-1)};return L.createElement(We.div,{ref:t,tabIndex:-1,...v,"cmdk-root":``,onKeyDown:e=>{var t;(t=v.onKeyDown)==null||t.call(v,e);let n=e.nativeEvent.isComposing||e.keyCode===229;if(!(e.defaultPrevented||n))switch(e.key){case`n`:case`j`:_&&e.ctrlKey&&ae(e);break;case`ArrowDown`:ae(e);break;case`p`:case`k`:_&&e.ctrlKey&&oe(e);break;case`ArrowUp`:oe(e);break;case`Home`:e.preventDefault(),ne(0);break;case`End`:e.preventDefault(),ie();break;case`Enter`:{e.preventDefault();let t=A();if(t){let e=new Event(tg);t.dispatchEvent(e)}}}}},L.createElement(`label`,{"cmdk-label":``,htmlFor:T.inputId,id:T.labelId,style:kg},c),Og(e,e=>L.createElement(og.Provider,{value:w},L.createElement(ig.Provider,{value:T},e))))}),ug=L.forwardRef((e,t)=>{let n=d(),r=L.useRef(null),i=L.useContext(cg),a=ag(),o=xg(e),s=o.current?.forceMount??i?.forceMount;Sg(()=>{if(!s)return a.item(n,i?.id)},[s]);let c=Tg(n,r,[e.value,e.children,r],e.keywords),l=sg(),u=wg(e=>e.value&&e.value===c.current),f=wg(e=>s||a.filter()===!1?!0:!e.search||e.filtered.items.get(n)>0);L.useEffect(()=>{let t=r.current;if(t&&!e.disabled)return t.addEventListener(tg,p),()=>t.removeEventListener(tg,p)},[f,e.onSelect,e.disabled]);function p(){var e,t;m(),(t=(e=o.current).onSelect)==null||t.call(e,c.current)}function m(){l.setState(`value`,c.current,!0)}if(!f)return null;let{disabled:h,value:g,onSelect:_,forceMount:v,keywords:y,...b}=e;return L.createElement(We.div,{ref:it(r,t),...b,id:n,"cmdk-item":``,role:`option`,"aria-disabled":!!h,"aria-selected":!!u,"data-disabled":!!h,"data-selected":!!u,onPointerMove:h||a.getDisablePointerSelection()?void 0:m,onClick:h?void 0:p},e.children)}),dg=L.forwardRef((e,t)=>{let{heading:n,children:r,forceMount:i,...a}=e,o=d(),s=L.useRef(null),c=L.useRef(null),l=d(),u=ag(),f=wg(e=>i||u.filter()===!1?!0:!e.search||e.filtered.groups.has(o));Sg(()=>u.group(o),[]),Tg(o,s,[e.value,e.heading,c]);let p=L.useMemo(()=>({id:o,forceMount:i}),[i]);return L.createElement(We.div,{ref:it(s,t),...a,"cmdk-group":``,role:`presentation`,hidden:!f||void 0},n&&L.createElement(`div`,{ref:c,"cmdk-group-heading":``,"aria-hidden":!0,id:l},n),Og(e,e=>L.createElement(`div`,{"cmdk-group-items":``,role:`group`,"aria-labelledby":n?l:void 0},L.createElement(cg.Provider,{value:p},e))))}),fg=L.forwardRef((e,t)=>{let{alwaysRender:n,...r}=e,i=L.useRef(null),a=wg(e=>!e.search);return!n&&!a?null:L.createElement(We.div,{ref:it(i,t),...r,"cmdk-separator":``,role:`separator`})}),pg=L.forwardRef((e,t)=>{let{onValueChange:n,...r}=e,i=e.value!=null,a=sg(),o=wg(e=>e.search),s=wg(e=>e.selectedItemId),c=ag();return L.useEffect(()=>{e.value!=null&&a.setState(`search`,e.value)},[e.value]),L.createElement(We.input,{ref:t,...r,"cmdk-input":``,autoComplete:`off`,autoCorrect:`off`,spellCheck:!1,"aria-autocomplete":`list`,role:`combobox`,"aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":s,id:c.inputId,type:`text`,value:i?e.value:o,onChange:e=>{i||a.setState(`search`,e.target.value),n?.(e.target.value)}})}),mg=L.forwardRef((e,t)=>{let{children:n,label:r=`Suggestions`,...i}=e,a=L.useRef(null),o=L.useRef(null),s=wg(e=>e.selectedItemId),c=ag();return L.useEffect(()=>{if(o.current&&a.current){let e=o.current,t=a.current,n,r=new ResizeObserver(()=>{n=requestAnimationFrame(()=>{let n=e.offsetHeight;t.style.setProperty(`--cmdk-list-height`,n.toFixed(1)+`px`)})});return r.observe(e),()=>{cancelAnimationFrame(n),r.unobserve(e)}}},[]),L.createElement(We.div,{ref:it(a,t),...i,"cmdk-list":``,role:`listbox`,tabIndex:-1,"aria-activedescendant":s,"aria-label":r,id:c.listId},Og(e,e=>L.createElement(`div`,{ref:it(o,c.listInnerRef),"cmdk-list-sizer":``},e)))}),hg=L.forwardRef((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:a,container:o,...s}=e;return L.createElement(bh,{open:n,onOpenChange:r},L.createElement(wh,{container:o},L.createElement(Eh,{"cmdk-overlay":``,className:i}),L.createElement(Ah,{"aria-label":e.label,"cmdk-dialog":``,className:a},L.createElement(lg,{ref:t,...s}))))}),gg=L.forwardRef((e,t)=>wg(e=>e.filtered.count===0)?L.createElement(We.div,{ref:t,...e,"cmdk-empty":``,role:`presentation`}):null),_g=L.forwardRef((e,t)=>{let{progress:n,children:r,label:i=`Loading...`,...a}=e;return L.createElement(We.div,{ref:t,...a,"cmdk-loading":``,role:`progressbar`,"aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},Og(e,e=>L.createElement(`div`,{"aria-hidden":!0},e)))}),vg=Object.assign(lg,{List:mg,Item:ug,Input:pg,Group:dg,Separator:fg,Dialog:hg,Empty:gg,Loading:_g});function yg(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function bg(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function xg(e){let t=L.useRef(e);return Sg(()=>{t.current=e}),t}var Sg=typeof window>`u`?L.useEffect:L.useLayoutEffect;function Cg(e){let t=L.useRef();return t.current===void 0&&(t.current=e()),t}function wg(e){let t=sg(),n=()=>e(t.snapshot());return L.useSyncExternalStore(t.subscribe,n,n)}function Tg(e,t,n,r=[]){let i=L.useRef(),a=ag();return Sg(()=>{var o;let s=(()=>{for(let e of n){if(typeof e==`string`)return e.trim();if(typeof e==`object`&&`current`in e)return e.current?e.current.textContent?.trim():i.current}})(),c=r.map(e=>e.trim());a.value(e,s,c),(o=t.current)==null||o.setAttribute(ng,s),i.current=s}),i}var Eg=()=>{let[e,t]=L.useState(),n=Cg(()=>new Map);return Sg(()=>{n.current.forEach(e=>e()),n.current=new Map},[e]),(e,r)=>{n.current.set(e,r),t({})}};function Dg(e){let t=e.type;return typeof t==`function`?t(e.props):`render`in t?t.render(e.props):e}function Og({asChild:e,children:t},n){return e&&L.isValidElement(t)?L.cloneElement(Dg(t),{ref:t.ref},n(t.props.children)):n(t)}var kg={position:`absolute`,width:`1px`,height:`1px`,padding:`0`,margin:`-1px`,overflow:`hidden`,clip:`rect(0, 0, 0, 0)`,whiteSpace:`nowrap`,borderWidth:`0`},Ag=({className:e,...t})=>(0,z.jsx)(vg,{className:I(`flex flex-col overflow-hidden rounded-md px-3 py-2`,e),...t}),jg=({children:e,...t})=>(0,z.jsx)(bh,{...t,children:(0,z.jsx)(Ah,{className:`overflow-hidden p-0`,children:(0,z.jsx)(Ag,{className:`[&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group]:not([hidden])_~[cmdk-group]]:pt-0 [&_[cmdk-group]]:px-2 [&_[cmdk-input-wrapper]_svg]:size-5 [&_[cmdk-input]]:h-12 [&_[cmdk-item]]:px-2 [&_[cmdk-item]_svg]:size-5`,children:e})})}),Mg=({className:e,...t})=>(0,z.jsxs)(`div`,{className:I(`flex flex-1 items-center gap-2 px-3 py-2`,`rounded-2xl supports-[corner-shape:squircle]:rounded-4xl`,`bg-neutral-50 dark:bg-neutral-950`,`ring-1 ring-neutral-100 dark:ring-neutral-700`,`transition-shadow duration-100 focus-within:ring-3 hover:ring-3`,e),"cmdk-input-wrapper":``,children:[(0,z.jsx)(Sc,{className:`size-4 shrink-0 opacity-50`}),(0,z.jsx)(vg.Input,{className:`flex-1 bg-transparent text-sm outline-hidden placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50`,...t})]}),Ng=({className:e,...t})=>(0,z.jsx)(vg.List,{className:I(`max-h-75 overflow-y-auto overflow-x-hidden`,e),...t}),Pg=e=>(0,z.jsx)(vg.Empty,{className:`py-6 text-center text-sm`,...e}),Fg=({className:e,...t})=>(0,z.jsx)(vg.Group,{className:I(`overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground [&_[cmdk-group-heading]]:text-xs`,e),...t}),Ig=({className:e,...t})=>(0,z.jsx)(vg.Separator,{className:I(`-mx-1 h-px bg-border`,e),...t}),Lg=({className:e,...t})=>(0,z.jsx)(vg.Item,{className:I(`relative flex cursor-default select-none items-center rounded-sm px-2 py-1.5 text-sm outline-hidden data-[disabled=true]:pointer-events-none data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground data-[disabled=true]:opacity-50`,e),...t}),Rg=({className:e,...t})=>(0,z.jsx)(`span`,{className:I(`ml-auto text-muted-foreground text-xs tracking-widest`,e),...t}),zg={...Ag,Dialog:jg,Input:Mg,List:Ng,Empty:Pg,Group:Fg,Separator:Ig,Item:Lg,Shortcut:Rg},Bg=(0,L.createContext)(null),Vg=()=>{let e=(0,L.useContext)(Bg);if(!e)throw Error(`useMultiSelect must be used within MultiSelectProvider`);return e},Hg=({values:e,defaultValues:t,onValueChange:n,loop:r=!1,className:i,children:a,dir:o,...s})=>{let[c,l]=(0,L.useState)(t??[]),[u,d]=(0,L.useState)(``),[f,p]=(0,L.useState)(!1),[m,h]=(0,L.useState)(-1),g=(0,L.useRef)(null),[_,v]=(0,L.useState)(!1),[y,b]=(0,L.useState)(``);(0,L.useEffect)(()=>{e&&l(e)},[e]);let x=(0,L.useCallback)(e=>{if(c.includes(e)){let t=c.filter(t=>t!==e);l(t),n?.(t)}else{let t=[...c,e];l(t),n?.(t)}},[c]),S=(0,L.useCallback)(e=>{e.preventDefault();let t=e.currentTarget,n=t.value.substring(t.selectionStart??0,t.selectionEnd??0);b(n),v(n===u)},[u]),C=(0,L.useCallback)(e=>{e.stopPropagation();let t=g.current;if(!t)return;let n=()=>{let e=m+1;h(e>c.length-1?r?0:-1:e)},i=()=>{let e=m-1;h(e<0?c.length-1:e)},a=()=>{let e=m-1<=0?c.length-1==0?-1:0:m-1;h(e)};switch(e.key){case`ArrowLeft`:o===`rtl`?c.length>0&&(m!==-1||r)&&n():c.length>0&&t.selectionStart===0&&i();break;case`ArrowRight`:o===`rtl`?c.length>0&&t.selectionStart===0&&i():c.length>0&&(m!==-1||r)&&n();break;case`Backspace`:case`Delete`:c.length>0&&(m!==-1&&m<c.length?(x(c[m]),a()):(t.selectionStart===0&&y===u||_)&&x(c[c.length-1]));break;case`Enter`:p(!0);break;case`Escape`:m===-1?f&&p(!1):h(-1)}},[c,u,m,r]),w=(0,L.useMemo)(()=>({value:c,onValueChange:x,open:f,setOpen:p,inputValue:u,setInputValue:d,activeIndex:m,setActiveIndex:h,ref:g,handleSelect:S}),[c,x,f,p,u,d,m,h,g,S]);return(0,z.jsx)(Bg,{value:w,children:(0,z.jsx)(Ag,{onKeyDown:C,className:I(`flex w-full flex-col gap-2 overflow-visible bg-transparent`,i),dir:o,...s,children:a})})},Ug=({className:e,getBadgeValue:t=e=>e,validationStyleEnabled:n=!1,children:r,...i})=>{let{value:a,onValueChange:o,activeIndex:s}=Vg(),c=(0,L.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]);return(0,z.jsxs)(`div`,{className:I(`flex w-full flex-col gap-3`,`cursor-pointer select-text text-base shadow-none outline-none md:text-sm`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`px-2 py-3 md:py-2`,`bg-neutral-50 dark:bg-neutral-950`,`text-foreground`,`ring-0`,`focus-within:outline-none`,`focus-within:ring-3`,`focus-within:ring-neutral-200`,`dark:focus-within:ring-neutral-500`,`focus-within:ring-offset-white`,`dark:focus-within:ring-offset-neutral-500`,`[box-shadow:none]`,`disabled:cursor-not-allowed disabled:opacity-50`,`aria-invalid:border-error`,n&&`valid:border-success invalid:border-error`,e),...i,children:[a.length>0&&(0,z.jsx)(`div`,{className:`flex w-full flex-wrap gap-1`,children:a.map((e,n)=>(0,z.jsxs)(fh,{className:I(`flex items-center gap-1 rounded-xl px-1`,s===n&&`ring-2 ring-muted-foreground`),color:`text`,children:[(0,z.jsx)(`span`,{className:`text-xs`,children:t(e)}),(0,z.jsxs)(`button`,{"aria-label":`Remove ${e} option`,"aria-roledescription":`button to remove option`,onMouseDown:c,onClick:()=>o(e),children:[(0,z.jsxs)(`span`,{className:`sr-only`,children:[`Remove `,e,` option`]}),(0,z.jsx)(N,{className:`size-4 cursor-pointer`})]})]},e))}),r]})},Wg=({className:e,...t})=>{let{setOpen:n,inputValue:r,setInputValue:i,activeIndex:a,setActiveIndex:o,handleSelect:s,ref:c}=Vg();return(0,z.jsx)(zg.Input,{...t,tabIndex:0,ref:c,value:r,onValueChange:a===-1?i:void 0,onSelect:s,onBlur:()=>n(!1),onFocus:()=>n(!0),onClick:()=>o(-1),className:I(`ml-2 flex-1 cursor-pointer outline-hidden`,e,a!==-1&&`caret-transparent`)})},Gg=({children:e})=>{let{open:t}=Vg();return(0,z.jsx)(`div`,{className:`relative`,children:t&&e})},Kg=({className:e,children:t})=>(0,z.jsxs)(zg.List,{className:I(`absolute top-0 z-10 flex w-full flex-col gap-2`,`rounded-xl p-2 shadow-md`,`bg-white dark:bg-neutral-950`,`text-foreground`,`border border-neutral-200 dark:border-neutral-800`,`transition-colors`,e),children:[t,(0,z.jsx)(zg.Empty,{children:(0,z.jsx)(`span`,{className:`text-muted-foreground`,children:`No results found`})})]}),qg=({className:e,value:t,children:n,...r})=>{let{value:a,onValueChange:o,setInputValue:s}=Vg(),c=(0,L.useCallback)(e=>{e.preventDefault(),e.stopPropagation()},[]),l=a.includes(t);return(0,z.jsxs)(zg.Item,{...r,onSelect:()=>{o(t),s(``)},className:I(`flex cursor-pointer justify-between`,`rounded-lg px-2 py-1`,`transition-colors`,`hover:bg-neutral/10`,l&&`opacity-50`,r.disabled&&`cursor-not-allowed opacity-50`,e),onMouseDown:c,children:[n,l&&(0,z.jsx)(i,{className:`size-4`})]})},Jg=Hg;Jg.Trigger=Ug,Jg.Input=Wg,Jg.Content=Gg,Jg.List=Kg,Jg.Item=qg;var Yg=({id:e,...t})=>{let n=(0,L.useId)(),r=e??n;return(0,z.jsx)(Xg,{value:{id:r},children:(0,z.jsx)(`div`,{className:`flex flex-col gap-2 p-2`,id:r,suppressHydrationWarning:!0,...t})})},Xg=(0,L.createContext)({}),Zg=e=>e.type===`checkbox`,Qg=e=>e.type===`file`,$g=e=>e instanceof Date,e_=e=>e==null,t_=e=>typeof e==`object`,n_=e=>!e_(e)&&!Array.isArray(e)&&t_(e)&&!$g(e),r_=e=>n_(e)&&e.target?Zg(e.target)?e.target.checked:Qg(e.target)?e.target.files:e.target.value:e,i_=/[.[\]'"]/,a_=e=>e.split(i_).filter(Boolean);function o_(e,t){let n=a_(t),r=e._formValues,i=e._defaultValues;for(let e=0;e<n.length-1;e++){let t=n[e];if(r=r==null?r:r[t],i=i==null?i:i[t],r===null||i===null)return null}}var s_=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),c_=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function l_(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(c_&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&e.constructor!==Object)return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=l_(e[t]));return r}var u_={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},d_={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},f_={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},p_=`root`,m_=[`__proto__`,`constructor`,`prototype`],h_=/^\w*$/,g_=e=>h_.test(e),J=e=>e===void 0,Y=(e,t,n)=>{if(!t||!n_(e))return n;let r=g_(t)?[t]:a_(t);if(r.some(e=>m_.includes(e)))return n;let i=r.reduce((e,t)=>e_(e)?void 0:e[t],e);return J(i)||i===e?J(e[t])?n:e[t]:i},__=e=>typeof e==`boolean`,v_=e=>typeof e==`function`,X=(e,t,n)=>{let r=-1,i=g_(t)?[t]:a_(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=n_(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(m_.includes(t))return;e[t]=a,e=e[t]}},y_=L.createContext(null);y_.displayName=`HookFormControlContext`;var b_=()=>L.useContext(y_),x_=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==d_.all&&(t._proxyFormState[i]=!r||d_.all),n&&(n[i]=!0),e[i]}});return i},S_=c_?L.useLayoutEffect:L.useEffect,C_=e=>{let t=e.constructor&&e.constructor.prototype;return n_(t)&&t.hasOwnProperty(`isPrototypeOf`)},w_=e=>e_(e)||!t_(e),T_=(e,t)=>t.length===0&&!Array.isArray(e)&&!C_(e);function E_(e,t,n=new WeakMap){if(e===t)return!0;if(w_(e)||w_(t))return Object.is(e,t);if($g(e)&&$g(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(T_(e,r)||T_(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;let a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{let r=new WeakSet;r.add(t),n.set(e,r)}for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if($g(r)&&$g(e)||(n_(r)||Array.isArray(r))&&(n_(e)||Array.isArray(e))?!E_(r,e,n):!Object.is(r,e))return!1}}return!0}function D_(e){let t=L.useRef(!1),n=L.useRef(!1),r=L.useRef(void 0),i=L.useRef(0);return i.current++,!n.current&&e&&(n.current=!0,r.current=l_(e())),{resyncIfNeeded:L.useCallback((e,a,o)=>{if(e&&(t.current||n.current&&i.current>1)){let e=a();E_(r.current,e)||o(e)}t.current=!0},[]),snapshot:L.useCallback((e,t)=>{e&&(r.current=l_(t()))},[])}}function O_(e){let t=b_(),{control:n=t,disabled:r,name:i,exact:a}=e||{},o=()=>({...n._formState,defaultValues:n._defaultValues}),[s,c]=L.useState(o),l=L.useRef({isDirty:!1,isLoading:!1,dirtyFields:!1,touchedFields:!1,validatingFields:!1,isValidating:!1,isValid:!1,errors:!1}),{resyncIfNeeded:u,snapshot:d}=D_(o);return S_(()=>{u(!r,o,c);let e=n._subscribe({name:i,formState:l.current,exact:a,callback:e=>{!r&&c({...n._formState,...e,defaultValues:n._defaultValues})}});return()=>{e(),d(!r,o)}},[i,r,a,u,d]),L.useEffect(()=>{l.current.isValid&&n._setValid(!0)},[n]),L.useMemo(()=>x_(s,n,l.current,!1),[s,n])}var k_=e=>typeof e==`string`,A_=(e,t,n,r,i)=>k_(e)?(r&&t.watch.add(e),Y(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),Y(n,e,Y(i,e)))):(r&&(t.watchAll=!0),n);function j_(e){let t=b_(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=L.useRef(i),l=L.useRef(s),u=L.useRef(void 0),d=L.useRef(n),f=L.useRef(r);l.current=s;let p=()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e},[m,h]=L.useState(p),g=L.useCallback(e=>{let t=A_(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),_=L.useCallback(e=>{if(!a){let t=A_(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);E_(e,u.current)||(h(e),u.current=e)}else h(t)}},[n._formValues,n._names,a,r]),{resyncIfNeeded:v,snapshot:y}=D_(p),b=L.useRef(_);b.current=_;let x=L.useRef(g);x.current=g,S_(()=>{d.current!==n||!E_(f.current,r)?(d.current=n,f.current=r,b.current()):v(!a,()=>x.current(),e=>{h(e),u.current=e});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{b.current(e.values)}});return()=>{e(),y(!a,()=>x.current())}},[n,o,r,a,v,y]),L.useEffect(()=>n._removeUnmounted());let S=d.current!==n,C=f.current;return L.useMemo(()=>{if(a)return!1;let e=!S&&!E_(C,r);return S||e},[a,S,r,C])?g():m}function M_(e){let t=b_(),{name:n,disabled:r,control:i=t,shouldUnregister:a,defaultValue:o,exact:s=!0}=e,c=s_(i._names.array,n),l=j_({control:i,name:n,defaultValue:L.useMemo(()=>{let e=Y(i._formValues,n,Y(i._defaultValues,n,o));return J(e)?o_(i,n):e},[i,n,o]),exact:s}),u=O_({control:i,name:n,exact:s}),d=L.useRef(e),f=L.useRef(null),p=L.useRef(i.register(n,{...e.rules,value:l,...__(e.disabled)?{disabled:e.disabled}:{}}));d.current=e;let m=L.useMemo(()=>Object.defineProperties({},{invalid:{enumerable:!0,get:()=>!!Y(u.errors,n)},isDirty:{enumerable:!0,get:()=>!!Y(u.dirtyFields,n)},isTouched:{enumerable:!0,get:()=>!!Y(u.touchedFields,n)},isValidating:{enumerable:!0,get:()=>!!Y(u.validatingFields,n)},error:{enumerable:!0,get:()=>Y(u.errors,n)}}),[u,n]),h=L.useCallback(e=>{let t=r_(e);return Y(i._fields,n)||(p.current=i.register(n,{...d.current.rules,value:t})),p.current.onChange({target:{value:r_(e),name:n},type:u_.CHANGE})},[n,i]),g=L.useCallback(()=>p.current.onBlur({target:{value:Y(i._formValues,n),name:n},type:u_.BLUR}),[n,i._formValues]),_=L.useCallback(e=>{e&&(f.current={focus:()=>v_(e.focus)&&e.focus(),select:()=>v_(e.select)&&e.select(),setCustomValidity:t=>v_(e.setCustomValidity)&&e.setCustomValidity(t),reportValidity:()=>v_(e.reportValidity)&&e.reportValidity()});let t=Y(i._fields,n);t&&t._f&&e&&(t._f.ref=f.current)},[i._fields,n]),v=L.useMemo(()=>({name:n,value:l,...__(r)||u.disabled?{disabled:u.disabled||r}:{},onChange:h,onBlur:g,ref:_}),[n,r,u.disabled,h,g,_,l]);return L.useEffect(()=>{let e=i._options.shouldUnregister||a;p.current=i.register(n,{...d.current.rules,...__(d.current.disabled)?{disabled:d.current.disabled}:{}});let t=(e,t)=>{let n=Y(i._fields,e);n&&n._f&&(n._f.mount=t)};if(t(n,!0),e){let e=l_(Y(a?i._defaultValues:i._options.values||i._defaultValues,n,Y(i._options.defaultValues,n,d.current.defaultValue)));X(i._defaultValues,n,e),J(Y(i._formValues,n))&&X(i._formValues,n,e)}if(!c&&i.register(n),f.current){let e=Y(i._fields,n);e&&e._f&&(e._f.ref=f.current)}return()=>{(c?e&&!i._state.action:e)?i.unregister(n):t(n,!1)}},[n,i,c,a]),L.useEffect(()=>{i._setDisabledField({disabled:r,name:n})},[r,n,i]),L.useMemo(()=>({field:v,formState:u,fieldState:m}),[v,u,m])}var N_=e=>e.render(M_(e)),P_=e=>({isOnSubmit:!e||e===d_.onSubmit,isOnBlur:e===d_.onBlur,isOnChange:e===d_.onChange,isOnAll:e===d_.all,isOnTouch:e===d_.onTouched}),F_=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},I_=(e,t,n,r)=>{for(let i of n||Object.keys(e)){if(i===`_f`)continue;let a=n?Y(e,i):e[i];if(a){let{_f:e}=a;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(I_(a,t))break}else if((n_(a)||Array.isArray(a))&&I_(a,t))break}}},L_=(e,t,n)=>{let r=Y(e,n),i=Array.isArray(r)?r:[];return X(i,p_,t[n]),X(e,n,i),e},R_=e=>n_(e)&&!Object.keys(e).length,z_=e=>{if(!c_)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},B_=e=>e.type===`radio`,V_=e=>e instanceof RegExp,H_=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},U_={value:!1,isValid:!1},W_={value:!0,isValid:!0},G_=e=>{if(!Array.isArray(e))return U_;if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}let t=e[0];return!t||!t.checked||t.disabled?U_:!t.attributes||!(`value`in t.attributes)||J(t.value)||t.value===``?W_:{value:t.value,isValid:!0}},K_={isValid:!1,value:null},q_=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,K_):K_;function J_(e,t,n=`validate`){if(k_(e)||Array.isArray(e)&&e.every(k_)||__(e)&&!e)return{type:n,message:k_(e)?e:``,ref:t}}var Y_=e=>n_(e)&&!V_(e)?e:{value:e,message:``},X_=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=Y(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{if(i&&y.reportValidity){let t=__(e)?``:e||``;s?s.forEach(e=>e.setCustomValidity(t)):y.setCustomValidity(t),y.reportValidity()}},x={},S=B_(o),C=Zg(o),w=S||C,T=(g||Qg(o))&&J(o.value)&&J(v)||z_(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length,E=H_.bind(null,h,r,x),D=(e,t,n,r=f_.maxLength,i=f_.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...E(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||e_(v))||__(v)&&!v||C&&!G_(s).isValid||S&&!q_(s).isValid)){let{value:e,message:t}=k_(c)?{value:!!c,message:c}:Y_(c);if(e&&(x[h]={type:f_.required,message:t,ref:y,...E(f_.required,t)},!r))return b(t),x}if(!T&&(!e_(d)||!e_(f))){let e,t,n=Y_(f),i=Y_(d);if(!e_(v)&&!$g(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;e_(n.value)||(e=r>n.value),e_(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;k_(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),k_(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(D(!!e,n.message,i.message,f_.max,f_.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(k_(v)||a&&Array.isArray(v))){let e=Y_(l),t=Y_(u),n=!e_(e.value)&&v.length>+e.value,i=!e_(t.value)&&v.length<+t.value;if((n||i)&&(D(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&k_(v)){let{value:e,message:t}=Y_(p);if(V_(e)&&!v.match(e)&&(x[h]={type:f_.pattern,message:t,ref:o,...E(f_.pattern,t)},!r))return b(t),x}if(m){if(v_(m)){let e=J_(await m(v,n),y);if(e&&(x[h]={...e,...E(f_.validate,e.message)},!r))return b(e.message),x}else if(n_(m)){let e={};for(let t in m){if(!R_(e)&&!r)break;let i=J_(await m[t](v,n),y,t);i&&(e={...i,...E(t,i.message)},b(i.message),r&&(x[h]=e))}if(!R_(e)&&(x[h]={ref:y,...e},!r))return x}}let O=x[h];return b(!O||O.message),x},Z_=e=>Array.isArray(e)?e:[e],Q_=e=>Array.isArray(e)?e.filter(Boolean):[];function $_(e,t){let n=t.length-1,r=0;for(;r<n;){if(e_(e)){e=void 0;break}e=e[t[r]],r++}return e}function ev(e){for(let t in e)if(e.hasOwnProperty(t)&&!J(e[t]))return!1;return!0}function tv(e,t){if(k_(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:g_(t)?[t]:a_(t);if(n.some(e=>m_.includes(String(e))))return e;let r=n.length===1?e:$_(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(n_(r)&&R_(r)||Array.isArray(r)&&ev(r))&&tv(e,n.slice(0,-1)),e}var nv=L.createContext(null);nv.displayName=`HookFormContext`;var rv=()=>L.useContext(nv),iv=({children:e,watch:t,getValues:n,getErrors:r,getFieldState:i,setError:a,clearErrors:o,setValue:s,setValues:c,trigger:l,formState:u,resetField:d,reset:f,resetDefaultValues:p,handleSubmit:m,unregister:h,control:g,register:_,setFocus:v,subscribe:y})=>{let b=L.useMemo(()=>({watch:t,getValues:n,getErrors:r,getFieldState:i,setError:a,clearErrors:o,setValue:s,setValues:c,trigger:l,formState:u,resetField:d,reset:f,resetDefaultValues:p,handleSubmit:m,unregister:h,control:g,register:_,setFocus:v,subscribe:y}),[o,g,u,r,i,n,m,_,f,p,d,a,v,s,c,y,l,h,t]);return L.createElement(nv.Provider,{value:b},L.createElement(y_.Provider,{value:b.control},e))},av=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function ov(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&n_(i)&&a){let e=ov(i,a);n_(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var sv=(e,t)=>e!==null&&t_(e)&&Object.prototype.hasOwnProperty.call(e,t),cv=(e,t)=>{if(!t)return!1;let n=e;for(let r of g_(t)?[t]:a_(t)){if(!sv(n,r))return sv(e,t);n=n[r]}return!0},lv=e=>e.type===`select-multiple`,uv=e=>B_(e)||Zg(e),dv=e=>z_(e)&&e.isConnected;function fv(e){return Array.isArray(e)||n_(e)}function pv(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];fv(o)&&fv(Y(t,a))?pv(o,t,a,r):r.push(a)}return r}var mv=e=>{for(let t in e)if(v_(e[t]))return!0;return!1};function hv(e){return Array.isArray(e)||n_(e)&&!mv(e)}function gv(e){return!!(e&&`_f`in e)}function _v(e){return Array.isArray(e)?!e.some(e=>!J(e)):!Object.keys(e).length}function vv(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function yv(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];hv(i)&&(!Array.isArray(i)||!gv(a))?(t[r]=Array.isArray(i)?[]:{},yv(i,t[r],a),_v(t[r])&&vv(t,r)):J(i)||(t[r]=!0)}return t}function bv(e,t,n,r){n||=yv(t,{},r);for(let i in e){let a=e[i],o=r&&r[i];hv(a)&&(!Array.isArray(a)||!gv(o))?(J(t)||w_(n[i])?n[i]=yv(a,Array.isArray(a)?[]:{},o):bv(a,e_(t)?{}:t[i],n[i],o),_v(n[i])&&vv(n,i)):E_(a,t[i])?vv(n,i):n[i]=!0}return n}var xv=(e,t)=>{let n=t.split(`.`),r=[],i=n[0];for(let t=1;t<n.length;i+=`.`+n[t++])!isNaN(+n[t])&&e.has(i)&&r.push(`${i}.${n[t]}`);return r},Sv=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>J(e)?e:t?e===``?NaN:e&&+e:n&&k_(e)?new Date(e):r?r(e):e;function Cv(e){let t=e.ref;return Qg(t)?t.files:B_(t)?q_(e.refs).value:lv(t)?[...t.selectedOptions].map(({value:e})=>e):Zg(t)?G_(e.refs).value:Sv(t.value,e)}var wv=(e,t,n,r)=>{let i={};for(let n of e){let e=Y(t,n);e&&X(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Tv=e=>J(e)?e:V_(e)?e.source:n_(e)?V_(e.value)?e.value.source:e.value:e,Ev=`AsyncFunction`,Dv=e=>{if(!e||!e.validate)return!1;if(v_(e.validate))return e.validate.constructor.name===Ev;if(n_(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===Ev)return!0}return!1},Ov=e=>e.mount&&(e.required||!J(e.required)&&e.required!==!1||!J(e.min)||!J(e.max)||!J(e.maxLength)||!J(e.minLength)||e.pattern||e.validate);function kv(e,t,n){let r=Y(e,n);if(r||g_(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=Y(t,r),o=Y(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var Av=(e,t,n,r)=>{n(e);let i=Object.keys(e).filter(e=>e!==`name`);return!i.length||r&&i.length>=Object.keys(t).length||i.find(e=>t[e]===(!r||d_.all))},jv=(e,t,n)=>!e||!t||e===t||Z_(e).some(e=>e&&(n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e))),Mv=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,Nv=(e,t)=>{let n=Y(e,t);!Q_(n).length&&!(n!=null&&n.root)&&tv(e,t)},Pv={mode:d_.onSubmit,reValidateMode:d_.onChange,shouldFocusError:!0},Fv=`form`,Iv=(e,t)=>{for(let n in e)n in t||delete e[n];Object.assign(e,t)},Lv={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Rv(e={}){let t={...Pv,...e},n={...l_(Lv),isLoading:v_(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(n_(t.defaultValues)||n_(t.values))&&l_(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:l_(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c={},l={},u=0,d=P_(t.mode),f=P_(t.reValidateMode),p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...p},h={...m},g={array:av(),state:av()},_=0,v=t.criteriaMode===d_.all,y=(e,t)=>n=>{clearTimeout(l[e]),l[e]=setTimeout(t,n)},b=async e=>{if(!o.keepIsValid&&!t.disabled&&(m.isValid||h.isValid||e)){let e=++_,i;t.resolver?(i=R_((await A()).errors),e===_&&x()):i=await j({fields:r,onlyCheckValid:!0,eventType:u_.VALID}),e===_&&i!==n.isValid&&g.state.next({isValid:i})}},x=(e,r)=>{!t.disabled&&(m.isValidating||m.validatingFields||h.isValidating||h.validatingFields)&&((e||s.mount).forEach(e=>{e&&(r?X(n.validatingFields,e,r):tv(n.validatingFields,e))}),g.state.next({validatingFields:n.validatingFields,isValidating:!R_(n.validatingFields)}))},S=()=>{n.dirtyFields=bv(i,a,void 0,r)},C=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){o.action=!0;let t=Y(r,e);if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(t)?t.length:0),u&&Array.isArray(t)){let n=s(t,c.argA,c.argB);l&&X(r,e,n)}let a=Y(n.errors,e);if(u&&Array.isArray(a)){let t=a.root,r=s(a,c.argA,c.argB)||a;t&&(r.root=t),l&&X(n.errors,e,r),Nv(n.errors,e)}let d=Y(n.touchedFields,e);if((m.touchedFields||h.touchedFields)&&u&&Array.isArray(d)){let t=s(d,c.argA,c.argB);l&&X(n.touchedFields,e,t)}(m.dirtyFields||h.dirtyFields)&&S(),g.state.next({name:e,isDirty:ie(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else X(a,e,i)},w=(e,t)=>{X(n.errors,e,t),n.errors={...n.errors},g.state.next({errors:n.errors})},T=e=>{n.errors=e,g.state.next({errors:n.errors,isValid:!1})},E=e=>{let t=g_(e)?[e]:a_(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=e_(n)?n:n[i],r=e_(r)?r:r[i],n===null&&r!==null)return!0}return!1},D=e=>{if(!o.actionArrayLengths.size)return!1;let t=g_(e)?[e]:a_(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if(e_(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a]}return!1},O=(t,c,l,u)=>{let d=Y(r,t);if(d){if(E(t)||D(t))return;let r=J(Y(a,t)),f=Y(a,t,J(l)?Y(i,t):l);J(f)||u&&u.defaultChecked||c?X(a,t,c?f:Cv(d._f)):se(t,f),o.mount&&!o.action&&(b(),r&&n.isDirty&&(m.isDirty||h.isDirty)&&(ie()||(n.isDirty=!1,g.state.next({...n}))),e.shouldUnregister&&r&&!J(Y(a,t))&&F_(t,s)&&(o.watch=!0))}},k=(e,o,s,c,l)=>{let u=!1,d=!1,f={name:e};if(!t.disabled||c===!0){if(!s||c){let t=E_(Y(i,e),o);(m.isDirty||h.isDirty)&&(d=n.isDirty,n.isDirty=f.isDirty=!t||ie(),u=d!==f.isDirty),d=!!Y(n.dirtyFields,e),t===n.isDirty?t?tv(n.dirtyFields,e):X(n.dirtyFields,e,!0):Iv(n.dirtyFields,bv(i,a,void 0,r)),f.dirtyFields=n.dirtyFields,u||=(m.dirtyFields||h.dirtyFields)&&d!==!t}if(s){let t=Y(n.touchedFields,e);t||(X(n.touchedFields,e,s),f.touchedFields=n.touchedFields,u||=(m.touchedFields||h.touchedFields)&&t!==s)}u&&l&&g.state.next(f)}return u?f:{}},ee=(e,r,i,a)=>{let o=Y(n.errors,e),s=(m.isValid||h.isValid)&&__(r)&&n.isValid!==r;if(t.delayError&&i?(c[e]=y(e,()=>w(e,i)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e],i?X(n.errors,e,i):tv(n.errors,e),n.errors={...n.errors}),(i?!E_(o,i):o)||!R_(a)||s){let t={...a,...s&&__(r)?{isValid:r}:{},errors:n.errors,name:e};g.state.next(t)}},A=async e=>(x(e,!0),await t.resolver(a,t.context,wv(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),te=async e=>{let{errors:t}=await A(e);if(x(e),e){for(let r of e){let e=Y(t,r);e?s.array.has(r)&&n_(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e)))?L_(n.errors,{[r]:e},r):X(n.errors,r,e):tv(n.errors,r)}n.errors={...n.errors}}else n.errors=t;return t},ne=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(n_(i))for(let e in i){let t=i[e];t&&_e(`${Fv}.${e}`,{message:k_(t.message)?t.message:``,type:t.type||f_.validate})}else k_(i)||!i?_e(Fv,{message:i||``,type:f_.validate}):N(Fv);return i}return!0},j=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await ne({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...d}=u;if(r){let o=s.array.has(r.name),c=u._f&&Dv(u._f),d=m.validatingFields||m.isValidating||h.validatingFields||h.isValidating;c&&d&&x([r.name],!0);let f=await X_(u,s.disabled,a,v,t.shouldUseNativeValidation&&!i,o);if(c&&d&&x([r.name]),f[r.name]&&(l.valid=!1,i)||(!i&&(Y(f,r.name)?o?L_(n.errors,f,r.name):X(n.errors,r.name,f[r.name]):tv(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!R_(d)&&await j({context:l,onlyCheckValid:i,fields:d,name:o,eventType:c})}}return l.valid},re=()=>{for(let e of s.unMount){let t=Y(r,e);t&&(t._f.refs?t._f.refs.every(e=>!dv(e)):!dv(t._f.ref))&&xe(e)}s.unMount=new Set},ie=(e,t)=>(e&&t&&X(a,e,t),!E_(o.mount?a:i,i)),ae=(e,t,n)=>A_(e,s,{...o.mount?a:J(t)||k_(e)?i:t},n,t),oe=e=>Q_(Y(o.mount?a:i,e,t.shouldUnregister?Y(i,e,[]):[])),se=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=Y(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&X(a,e,Sv(t,n)),l=z_(n.ref)&&e_(t)?``:t,lv(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?Zg(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(l)?!!l.find(t=>t===e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):Qg(n.ref)?n.ref.value=``:(n.ref.value=l,!n.ref.type&&!o&&!s&&g.state.next({name:e,values:i?a:l_(a)})))}(n.shouldDirty||n.shouldTouch)&&k(e,l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&me(e,{delayError:n.delayError})},ce=(e,t,n,i=!1,o=!1,c=!1)=>{s.array.has(e)&&g.array.next({name:e,values:i?a:l_(a)});for(let a in t){if(!t.hasOwnProperty(a))continue;let l=t[a],u=e+`.`+a,d=Y(r,u);(s.array.has(e)||n_(l)||d&&!d._f)&&!$g(l)?ce(u,l,n,i,o,c):se(u,l,n,i,o,c)}},le=(e,t,i,c,l=!1)=>{let u=Y(r,e),d=s.array.has(e),f=c?t:l_(t),p=E_(Y(a,e),f);if(p||X(a,e,f),d)g.array.next({name:e,values:c?a:l_(a)}),(m.isDirty||m.dirtyFields||h.isDirty||h.dirtyFields)&&i.shouldDirty&&(S(),l||g.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:ie(e,f)}));else{let t=Array.isArray(f)&&!f.length||R_(f),n=!p&&!l;!u||u._f||e_(f)||t?se(e,f,i,c,l,n):ce(e,f,i,c,l,n)}if(!p&&!l){let t=F_(e,s),r=c?a:l_(a);if(g.state.next({...t&&n,name:o.mount||t?e:void 0,values:r}),!d)for(let t of xv(s.array,e))g.state.next({name:t,values:r})}},ue=(e,t,n={})=>le(e,t,n,!1),de=(e,t={})=>{let r=v_(e)?e(a):e;if(!E_(a,r)){a={...a,...r};for(let e of s.mount)cv(r,e)&&le(e,Y(r,e),t,!0,!0);g.state.next({...n,name:void 0,type:void 0,...u?{values:a}:{}}),t.shouldValidate&&b()}},fe=async i=>{o.mount=!0;let l=i.target,p=l.name,_=!0,y=Y(r,p),S=e=>{_=Number.isNaN(e)||$g(e)&&isNaN(e.getTime())||E_(e,Y(a,p,e))};if(y){let o,C,w=l.type?Cv(y._f):r_(i),T=i.type===u_.BLUR||i.type===u_.FOCUS_OUT,E=!Ov(y._f)&&!e.validate&&!t.resolver&&!Y(n.errors,p)&&!y._f.deps,D=E||Mv(T,Y(n.touchedFields,p),n.isSubmitted,f,d),O=F_(p,s,T);if(X(a,p,l_(w)),T){if(!l||!l.readOnly){y._f.onBlur&&y._f.onBlur(i);let e=c[p];e&&e(0)}}else y._f.onChange&&y._f.onChange(i);let te=k(p,w,T),re=!R_(te)||O;if(!T&&g.state.next({name:p,type:i.type,...u?{values:l_(a)}:{}}),D)return(!E||!n.isValid)&&(m.isValid||h.isValid)&&(t.mode===`onBlur`?T&&b():T||b()),re&&g.state.next({name:p,...O?{}:te});if(!t.resolver&&e.validate&&await ne({name:p,eventType:i.type}),!T&&O&&g.state.next({...n}),t.resolver){let{errors:e}=await A([p]);if(x([p]),S(w),!_){!R_(te)&&g.state.next(te);return}let t=kv(n.errors,r,p),i=kv(e,r,t.name||p);o=i.error,p=i.name,C=R_(e)}else x([p],!0),o=(await X_(y,s.disabled,a,v,t.shouldUseNativeValidation))[p],x([p]),S(w),_&&(o?C=!1:(m.isValid||h.isValid)&&(C=await j({fields:r,onlyCheckValid:!0,name:p,eventType:i.type})));_&&(y._f.deps&&(!Array.isArray(y._f.deps)||y._f.deps.length>0)&&me(y._f.deps),ee(p,C,o,te))}},pe=(e,t)=>{if(Y(n.errors,t)&&e.focus)return e.focus(),1},me=async(e,i={})=>{let a,o,u=Z_(e);if(t.resolver){let t=await te(J(e)?e:u);a=R_(t),o=e?!u.some(e=>Y(t,e)):a}else e?(o=(await Promise.all(u.map(async e=>{let t=Y(r,e);return await j({fields:t&&t._f?{[e]:t}:t,eventType:u_.TRIGGER})}))).every(Boolean),(o||n.isValid)&&b()):o=a=await j({fields:r,name:e,eventType:u_.TRIGGER});if(i.delayError&&t.delayError&&k_(e)){let r=Y(n.errors,e);r?(tv(n.errors,e),c[e]=y(e,()=>w(e,r)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e])}if(i.shouldTouch)for(let t of e?u:s.mount)!s.array.has(t)&&X(n.touchedFields,t,!0);return g.state.next({...!k_(e)||(m.isValid||h.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},...i.shouldTouch&&(m.touchedFields||h.touchedFields)?{touchedFields:n.touchedFields}:{},errors:n.errors}),i.shouldFocus&&!o&&I_(r,pe,e?u:s.mount),o},he=(e,t)=>{let r={...o.mount?a:i};return t&&(r=ov(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),J(e)?r:k_(e)?Y(r,e):e.map(e=>Y(r,e))},ge=e=>J(e)?{...n.errors}:k_(e)?Y(n.errors,e):e.map(e=>Y(n.errors,e)),M=(e,t)=>{let r=t||n,i=Y(r.errors,e);return{invalid:!!i,isDirty:!!Y(r.dirtyFields,e),error:i,isValidating:!!Y(n.validatingFields,e),isTouched:!!Y(r.touchedFields,e)}},N=e=>{let t=e?Z_(e):void 0;t?.forEach(e=>tv(n.errors,e)),t?t.forEach(e=>{g.state.next({name:e,errors:n.errors})}):(n.errors={},g.state.next({errors:n.errors}))},_e=(e,t,i)=>{let a=(Y(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=Y(n.errors,e)||{};X(n.errors,e,{...l,...t,ref:a}),g.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},ve=(e,t)=>{if(v_(e)){u++;let{unsubscribe:n}=g.state.subscribe({next:n=>`values`in n&&e(n.values||ae(void 0,t),n)}),r=!1;return{unsubscribe:()=>{r||(r=!0,u--,n())}}}return ae(e,t,!0)},ye=e=>{let t=!!e.formState?.values;t&&u++;let{unsubscribe:r}=g.state.subscribe({next:t=>{if(jv(e.name,t.name,e.exact)&&Av(t,e.formState||m,Ae,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}});if(!t)return r;let o=!1;return()=>{o||(o=!0,u--,r())}},be=e=>(o.mount=!0,h={...h,...e.formState},ye({...e,formState:{...p,...e.formState}})),xe=(e,o={})=>{for(let c of e?Z_(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(tv(r,c),tv(a,c)),!o.keepError&&tv(n.errors,c),!o.keepDirty&&tv(n.dirtyFields,c),!o.keepTouched&&tv(n.touchedFields,c),!o.keepIsValidating&&tv(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&tv(i,c);u&&g.state.next({values:l_(a)}),g.state.next({...n,...o.keepDirty?{}:{isDirty:ie()}}),!o.keepIsValid&&b()},P=({disabled:e,name:t})=>{if(__(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&b()}},Se=(e,n={})=>{let a=Y(r,e),c=__(n.disabled)||__(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return X(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?P({disabled:__(n.disabled)?n.disabled:t.disabled,name:e}):O(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:Tv(n.min),max:Tv(n.max),minLength:Tv(n.minLength),maxLength:Tv(n.maxLength),pattern:Tv(n.pattern)}:{},name:e,onChange:fe,onBlur:fe,ref:c=>{if(c){s.registerName.add(e),Se(e,n),s.registerName.delete(e),a=Y(r,e);let t=J(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=uv(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(dv),t,...Array.isArray(Y(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),X(r,e,{_f:u}),O(e,!1,void 0,t)}else a=Y(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(s_(s.array,e)&&o.action)&&s.unMount.add(e)}}},Ce=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&I_(r,pe,s.mount),we=e=>{__(e)&&(g.state.next({disabled:e}),I_(r,(t,n)=>{let i=Y(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},Te=(e,i)=>async o=>{let c,l;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let u=l_(a);if(g.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await A();x(),n.errors=e,u=l_(t)}else await j({fields:r,eventType:u_.SUBMIT});if(s.disabled.size)for(let e of s.disabled)tv(u,e);if(tv(n.errors,p_),R_(n.errors)){g.state.next({errors:{}});try{c=await e(u,o)}catch(e){l=e}}else i&&await i({...n.errors},o),Ce(),setTimeout(Ce);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:R_(n.errors)&&!l,submitCount:n.submitCount+1,errors:n.errors}),l)throw l;return c},Ee=(e,t={})=>{Y(r,e)&&(J(t.defaultValue)?ue(e,l_(Y(i,e))):(ue(e,t.defaultValue),X(i,e,l_(t.defaultValue))),t.keepTouched||tv(n.touchedFields,e),t.keepDirty||(tv(n.dirtyFields,e),n.isDirty=t.defaultValue?ie(e,l_(Y(i,e))):ie()),t.keepError||(tv(n.errors,e),b()),g.state.next({...n}))},De=(e,c={})=>{let l=e?l_(e):i,u=l_(l),d=R_(e),f=u,p=r;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...pv(bv(i,a,void 0,p),n.dirtyFields)]);for(let t of e){let e=Y(n.dirtyFields,t),r=Y(a,t),i=Y(f,t);e&&!J(r)?X(f,t,r):!e&&!J(i)&&ue(t,i)}}else{if(c_&&J(e))for(let e of s.mount){let t=Y(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(z_(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)ue(e,Y(f,e));else r={}}if(t.shouldUnregister){if(a=c.keepDefaultValues?l_(i):{},c.keepFieldsRef)for(let e of s.mount)X(a,e,Y(f,e))}else a=l_(f);g.array.next({values:{...f}}),g.state.next({name:void 0,type:void 0,values:{...f}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!m.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!R_(f),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),c.keepErrors||(n.errors={}),g.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:d?!1:c.keepDirty?n.isDirty:c.keepValues?ie():!(!c.keepDefaultValues||E_(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:d?{}:c.keepDirtyValues?c.keepDefaultValues&&a?bv(i,a,void 0,p):n.dirtyFields:c.keepDefaultValues&&e?bv(i,e,void 0,p):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},Oe=(e,n)=>De(v_(e)?e(a):e,{...t.resetOptions,...n}),ke=(e,t={})=>{let n=Y(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&v_(e.select)&&e.select()})}},Ae=e=>{let{name:t,type:r,values:i,...a}=e;n={...n,...a}};g.state.subscribe({next:Ae});let je={control:{register:Se,unregister:xe,getFieldState:M,handleSubmit:Te,setError:_e,_subscribe:ye,_runSchema:A,_updateIsValidating:x,_focusError:Ce,_getWatch:ae,_getDirty:ie,_setValid:b,_setFieldArray:C,_setDisabledField:P,_setErrors:T,_getFieldArray:oe,_reset:De,_resetDefaultValues:()=>v_(t.defaultValues)&&t.defaultValues().then(e=>{Oe(e,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:re,_disableForm:we,_subjects:g,_proxyFormState:m,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},d=P_(t.mode),f=P_(t.reValidateMode)}},subscribe:be,trigger:me,register:Se,handleSubmit:Te,watch:ve,setValue:ue,setValues:de,getValues:he,getErrors:ge,reset:Oe,resetField:Ee,resetDefaultValues:(e,t={})=>{if(i=l_(e),!t.keepDirty){let e=bv(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!R_(e)}t.keepIsValid||b(),g.state.next({...n,defaultValues:i})},clearErrors:N,unregister:xe,setError:_e,setFocus:ke,getFieldState:M};return{...je,formControl:je}}function zv(e={}){let t=L.useRef(void 0),n=L.useRef(void 0),r=L.useRef(e.formControl),[i,a]=L.useState(()=>({...l_(Lv),isLoading:v_(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:v_(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!v_(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=Rv(e);t.current={...r,formState:i}}}let o=t.current.control;o._options=e;let{resyncIfNeeded:s,snapshot:c}=D_();return S_(()=>{let e=()=>({...o._formState,defaultValues:o._defaultValues});s(!0,e,a);let t=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),o._formState.isReady=!0,()=>{t(),c(!0,e)}},[o,s,c]),L.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),L.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),L.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),L.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),L.useEffect(()=>{if(o._proxyFormState.isDirty){let e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}},[o,i.isDirty]),L.useEffect(()=>{e.values&&!E_(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),o._options.resetOptions?.keepIsValid||o._setValid(),n.current=e.values,a(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),L.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=L.useMemo(()=>x_(i,o),[o,i]),t.current}var Bv=(0,L.createContext)({}),Vv=({...e})=>{let t=(0,L.useMemo)(()=>({name:e.name}),[e.name]);return(0,z.jsx)(Bv,{value:t,children:(0,z.jsx)(N_,{...e})})},Hv=()=>{let e=(0,L.useContext)(Bv),t=(0,L.useContext)(Xg),{getFieldState:n,formState:r}=rv(),i=n(e.name,r);if(!e)throw Error(`useFormField should be used within <FormField>`);let{id:a}=t;return{id:a,name:e.name,formItemId:`${a}-form-item`,formDescriptionId:`${a}-form-item-description`,formMessageId:`${a}-form-item-message`,...i}},Uv=e=>{let{error:t,formItemId:n,formDescriptionId:r,formMessageId:i}=Hv();return(0,z.jsx)(Ae,{id:n,"aria-describedby":t?`${r} ${i}`:`${r}`,"aria-invalid":!!t,...e})},Wv=e=>{let{formDescriptionId:t}=Hv();return(0,z.jsx)(`p`,{className:`text-neutral text-sm`,id:t,...e})},Gv=({children:e,...t})=>{let{error:n,formMessageId:r}=Hv(),i=n?String(n?.message??``):e;return i?(0,z.jsx)(`p`,{className:`font-medium text-error text-xs`,role:`alert`,id:r,...t,children:i}):null},Kv=({className:e,children:t,...n})=>(0,z.jsxs)(`i`,{className:I(`text-neutral-400 text-xs`,e),...n,children:[`ⓘ `,t]}),qv=({className:e,...t})=>{let{error:n,formItemId:r}=Hv();return(0,z.jsx)(Fm,{className:I(`mb-2`,n&&`text-error`,e),htmlFor:r,...t})},Jv=({isRequired:e})=>e?(0,z.jsx)(`span`,{"aria-label":`Asterisk meaning the field is required`,children:`*`}):(0,z.jsx)(z.Fragment,{}),Yv=({children:e,isRequired:t,info:n,htmlFor:r,className:i})=>(0,z.jsxs)(`div`,{className:`ml-1 flex gap-1 align-middle text-base leading-none`,children:[e&&(0,z.jsxs)(qv,{htmlFor:r,id:`${r}-label`,suppressHydrationWarning:!0,className:I(`font-bold`,i),children:[e,(0,z.jsx)(Jv,{isRequired:t})]}),n&&(0,z.jsx)(Kv,{content:n})]}),Xv=({label:e,description:t,isRequired:n,info:r,children:i,showErrorMessage:a=!0,htmlFor:o,className:s})=>(0,z.jsxs)(Yg,{className:I(`flex w-full flex-col flex-wrap gap-2 px-1 py-2`,s),children:[(t||e)&&(0,z.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1 p-1 leading-none`,children:[e&&(0,z.jsx)(Yv,{isRequired:n,info:r,htmlFor:o,children:e}),t&&(0,z.jsx)(Wv,{children:t})]}),(0,z.jsx)(Uv,{children:i}),a&&(0,z.jsx)(Gv,{"data-testid":`error-message`})]}),Zv=({field:e,name:t,label:n,Element:r,isRequired:i=!1,info:a,description:o,showErrorMessage:s=!0,layoutClassName:c,...l})=>{let{error:u}=Hv(),{value:d,onChange:f,...p}=e??{},m=l,h=m.value===void 0?d??``:m.value,g=(...e)=>{typeof f==`function`&&f(...e),typeof m.onChange==`function`&&m.onChange(...e)};return(0,z.jsx)(Xv,{htmlFor:t,label:n,description:o,isRequired:i,info:a,showErrorMessage:s,"aria-invalid":!!u,className:c,children:(0,z.jsx)(r,{"data-testid":`element`,id:t,...p,...l,value:h,onChange:g,children:l.children})})},Qv=e=>{let{control:t}=rv();return(0,z.jsx)(Vv,{control:t,name:e.name,render:({field:t})=>(0,z.jsx)(Zv,{...e,field:t})})},$v=e=>(0,z.jsx)(Qv,{id:e.name,"data-testid":e.name,Element:Yp,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,...e}),ey=({field:e,name:t,label:n,description:r,isRequired:i,info:a,showErrorMessage:o,children:s,...c})=>{let{error:l}=Hv();return(0,z.jsx)(Xv,{htmlFor:t,label:n,description:r,isRequired:i,info:a,showErrorMessage:o,"aria-invalid":!!l,children:(0,z.jsx)(Jg,{onValueChange:e.onChange,values:e.value,...c,children:s})})},ty=({name:e,description:t,label:n,isRequired:r,info:i,showErrorMessage:a,children:o,...s})=>{let{control:c}=rv();return(0,z.jsx)(Vv,{control:c,name:e,render:({field:c})=>(0,z.jsx)(ey,{field:c,name:e,label:n,description:t,isRequired:r,info:i,showErrorMessage:a,...s,children:o})})},ny=({field:e,name:t,label:n,description:r,isRequired:i,info:a,showErrorMessage:o,children:s,...c})=>{let{error:l}=Hv();return(0,z.jsx)(Xv,{htmlFor:t,label:n,description:r,isRequired:i,info:a,showErrorMessage:o,"aria-invalid":!!l,children:(0,z.jsx)(F,{onValueChange:e.onChange,defaultValue:e.value,...c,children:s})})},ry=({name:e,description:t,label:n,isRequired:r,info:i,showErrorMessage:a,children:o,...s})=>{let{control:c}=rv();return(0,z.jsx)(Vv,{control:c,name:e,render:({field:c})=>(0,z.jsx)(ny,{field:c,name:e,label:n,description:t,isRequired:r,info:i,showErrorMessage:a,...s,children:o})})},iy=(e,t,n)=>{if(e&&`reportValidity`in e){let r=Y(n,t);e.setCustomValidity(r&&r.message||``),e.reportValidity()}},ay=(e,t)=>{for(let n in t.fields){let r=t.fields[n];r&&r.ref&&`reportValidity`in r.ref?iy(r.ref,n,e):r&&r.refs&&r.refs.forEach(t=>iy(t,n,e))}},oy=(e,t)=>{t.shouldUseNativeValidation&&ay(e,t);let n={};for(let r in e){let i=Y(t.fields,r),a=Object.assign(e[r]||{},{ref:i&&i.refs?i.refs[0]:i&&i.ref});if(sy(t.names||Object.keys(e),r)){let e=Object.assign({},Y(n,r));X(e,`root`,a),X(n,r,e)}else X(n,r,a)}return n},sy=(e,t)=>{let n=cy(t).replace(/[.*+?^${}()|\\]/g,`\\$&`);return e.some(e=>cy(e).match(`^${n}\\.\\d+`))};function cy(e){return e.replace(/\[(\d+)]/g,`.$1`).replace(/[[\]]/g,``)}function ly(){return ly=Object.assign?Object.assign.bind():function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)({}).hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},ly.apply(null,arguments)}function uy(e,t){try{var n=e()}catch(e){return t(e)}return n&&n.then?n.then(void 0,t):n}function dy(e,t){for(var n=Object.create(null);e.length;){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(`unionErrors`in r){var s=r.unionErrors.reduce(function(e,t){return t.errors.length<e.errors.length?t:e}).errors[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(`unionErrors`in r&&r.unionErrors.forEach(function(t){return t.errors.forEach(function(t){return e.push(t)})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=H_(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()}return n}function fy(e,t){for(var n=Object.create(null),r=function(){var r=e[0],i=r.code,a=r.message,o=r.path.join(`.`);if(!n[o]){if(r.code===`invalid_union`&&r.errors.length>0){var s=r.errors.reduce(function(e,t){return t.length<e.length?t:e})[0];n[o]={message:s?.message??a,type:s?.code??i}}else n[o]={message:a,type:i}}if(r.code===`invalid_union`&&r.errors.forEach(function(t){return t.forEach(function(t){return e.push(ly({},t,{path:[].concat(r.path,t.path)}))})}),t){var c=n[o].types,l=c&&c[r.code];n[o]=H_(o,t,n,i,l?[].concat(l,r.message):r.message)}e.shift()};e.length;)r();return n}function py(e,t,n){if(n===void 0&&(n={}),function(e){return`_zod`in e&&typeof e._zod==`object`}(e))return function(r,i,a){try{return Promise.resolve(uy(function(){function i(e){return a.shouldUseNativeValidation&&ay({},a),{errors:{},values:n.raw?Object.assign({},r):e}}var o=e;return n.mode===`sync`?i(o.parse(r,t)):Promise.resolve(o.parseAsync(r,t)).then(i)},function(e){if(function(e){var t;return!(e==null||(t=e._zod)==null||(t=t.traits)==null||!t.has(`$ZodError`))}(e))return{values:{},errors:oy(fy(e.issues,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};if(function(e){return`_def`in e&&typeof e._def==`object`}(e))return function(r,i,a){try{return Promise.resolve(uy(function(){return Promise.resolve(e[n.mode===`sync`?`parse`:`parseAsync`](r,t)).then(function(e){return a.shouldUseNativeValidation&&ay({},a),{errors:{},values:n.raw?Object.assign({},r):e}})},function(e){if(function(e){return Array.isArray(e?.issues)}(e))return{values:{},errors:oy(dy(e.errors,!a.shouldUseNativeValidation&&a.criteriaMode===`all`),a)};throw e}))}catch(e){return Promise.reject(e)}};throw Error(`Invalid input: not a Zod schema`)}var my=async e=>e&&typeof e.then==`function`?await e:e,hy=({schema:e,onSubmit:t,onSubmitSuccess:n,onSubmitError:r,className:i,children:a,autoComplete:o,method:s,...c})=>{let l=async i=>{let a=e?.safeParse(i)??{success:!0,data:void 0};await my(t?.(i)),a.success?await my(n?.(a.data)):await my(r?.(Error(a.error.issues.map(e=>e.message).join(`, `))))},u=e=>{if(e.key!==`Enter`)return;let t=e.target;if(t.tagName!==`INPUT`)return;e.preventDefault();let n=e.currentTarget,r=Array.from(n.querySelectorAll(`input:not([disabled]):not([type="hidden"]), textarea:not([disabled])`)),i=r.indexOf(t);i>=0&&i<r.length-1&&r[i+1]?.focus()};return(0,z.jsx)(iv,{...c,children:(0,z.jsx)(`form`,{className:I(`flex flex-col gap-y-6`,i),onSubmit:c.handleSubmit(l),onKeyDown:u,autoComplete:o?`on`:`off`,noValidate:!0,method:s,children:a})})},gy=(e,t)=>{let n=zv({resolver:py(e),...t}),{isSubmitting:r,isSubmitted:i,isLoading:a,isValid:o}=O_({control:n.control});return{form:n,isSubmitting:r,isSubmitted:i,isLoading:a,isValid:o}},_y=hy;function vy(e){let t=Object.values(e).filter(e=>typeof e==`number`);return Object.entries(e).filter(([e,n])=>t.indexOf(+e)===-1).map(([e,t])=>t)}function yy(e,t=`|`){return e.map(e=>Uy(e)).join(t)}function by(e,t){return typeof t==`bigint`?t.toString():t}var xy=class{constructor(e){this._getter=e,this._value=void 0}get value(){let e=this._getter;return e!==void 0&&(this._value=e(),this._getter=void 0),this._value}};function Sy(e){return new xy(e)}function Cy(e){return e==null}function wy(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}function Ty(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Ey(e){let t=Object.getOwnPropertyDescriptor(e,`shape`);return t?.get?t.get.raw:t?.value}function Dy(e){return Ey(e._zod.def)??e._zod.def.shape}function Oy(e,t,n){Object.defineProperty(e,t,{get(){let e=n();return Ty(this,t,e),e},enumerable:!0,configurable:!0})}function ky(e,t,n){t in e?Ty(e,t,n):e[t]=n}function Ay(e,t,n,r){let i=Dy(t);for(let a of n){let n=Object.getOwnPropertyDescriptor(i,a);n.enumerable&&(n.get?Oy(e,a,()=>{let e=t._zod.def.shape[a];return r?r(e,a):e}):ky(e,a,r?r(n.value,a):n.value))}}function jy(e,t){for(let n of Reflect.ownKeys(t)){let r=Object.getOwnPropertyDescriptor(t,n);r.enumerable&&(r.get?Oy(e,n,()=>t[n]):ky(e,n,r.value))}}function My(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Ny(e){return JSON.stringify(e)}function Py(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Fy=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Iy(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}var Ly=Sy(()=>{if(Mb.jitless||typeof navigator<`u`&&navigator?.userAgent?.includes(`Cloudflare`))return!1;try{return Function(``),!0}catch{return!1}});function Ry(e){if(Iy(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Iy(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function zy(e){return Ry(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}var By=new Set([`string`,`number`,`symbol`]);function Vy(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function Hy(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}function Uy(e){return typeof e==`bigint`?e.toString()+`n`:typeof e==`string`?`"${e}"`:`${e}`}function Wy(e){return Object.keys(e).filter(t=>e[t]._zod.optin!==void 0&&e[t]._zod.optout===`optional`)}var Gy={safeint:[-(2**53-1),2**53-1],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Ky={int64:[BigInt(`-9223372036854775808`),BigInt(`9223372036854775807`)],uint64:[BigInt(0),BigInt(`18446744073709551615`)]};function qy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.pick() cannot be used on object schemas containing refinements`);let i={};return Ay(i,e,Jy(e,t)),Hy(e,My(n,{shape:i,checks:[]}))}function Jy(e,t){let n=Dy(e),r=[];for(let e of Reflect.ownKeys(t)){if(!Object.getOwnPropertyDescriptor(n,e)?.enumerable)throw Error(`Unrecognized key: "${String(e)}"`);t[e]&&r.push(e)}return r}function Yy(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw Error(`.omit() cannot be used on object schemas containing refinements`);let i=new Set(Jy(e,t)),a={};return Ay(a,e,Reflect.ownKeys(Dy(e)).filter(e=>!i.has(e))),Hy(e,My(n,{shape:a,checks:[]}))}function Xy(e,t){if(!Ry(t))throw Error(`Invalid input to extend: expected a plain object`);let n=e._zod.def.checks;if(n&&n.length>0){let n=Dy(e);for(let e of Reflect.ownKeys(t))if(Object.getOwnPropertyDescriptor(n,e)!==void 0)throw Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}return Hy(e,My(e._zod.def,{shape:Zy(e,t)}))}function Zy(e,t){let n={};return Ay(n,e,Reflect.ownKeys(Dy(e))),jy(n,t),n}function Qy(e,t){if(!Ry(t))throw Error(`Invalid input to safeExtend: expected a plain object`);return Hy(e,My(e._zod.def,{shape:Zy(e,t)}))}function $y(e,t){if(!t?._zod?.def)throw Error("Invalid input to merge: expected an object schema. To merge a plain shape, use `.extend()`.");if(e._zod.def.checks?.length)throw Error(`.merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.`);let n={};return Ay(n,e,Reflect.ownKeys(Dy(e))),Ay(n,t,Reflect.ownKeys(Dy(t))),Hy(e,My(e._zod.def,{shape:n,get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]}))}function eb(e,t,n,r=`partial`){let i=t._zod.def.checks;if(i&&i.length>0)throw Error(`.${r}() cannot be used on object schemas containing refinements`);let a=n?new Set(Jy(t,n)):void 0,o={};return Ay(o,t,Reflect.ownKeys(Dy(t)),e&&((t,n)=>a&&!a.has(n)?t:new e({type:`optional`,innerType:t}))),Hy(t,My(t._zod.def,{shape:o,checks:[]}))}function tb(e,t,n){let r=n?new Set(Jy(t,n)):void 0,i={};return Ay(i,t,Reflect.ownKeys(Dy(t)),(t,n)=>r&&!r.has(n)?t:new e({type:`nonoptional`,innerType:t})),Hy(t,My(t._zod.def,{shape:i}))}function nb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function rb(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ib(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function ab(e){return typeof e==`string`?e:e?.message}function ob(e,t,n){var r;for(let i=t;i<e.length;i++)(r=e[i]).schema??(r.schema=n)}function sb(e,t,n){var r;let i=e.inst?._zod?.traits;i?.has(`$ZodType`)&&(i.has(`$ZodCheck`)?(r=e).schema??(r.schema=e.inst):e.schema=e.inst);let a=e.schema===e.inst?void 0:e.schema?._zod.def?.error,o=e.message?e.message:ab(e.inst?._zod.def?.error?.(e))??ab(a?.(e))??ab(t?.error?.(e))??ab(n.customError?.(e))??ab(n.localeError?.(e))??`Invalid input`,s={};for(let t of Object.keys(e))t!==`inst`&&t!==`schema`&&t!==`continue`&&t!==`input`&&t!==`__proto__`&&(s[t]=e[t]);return s.path??=[],s.message=o,t?.reportInput&&(s.input=e.input),s}var cb=/[\uD800-\uDBFF]/;function lb(e){let t=e.length;if(!cb.test(e))return t;let n=t;for(let r=0;r<t-1;r++)(e.charCodeAt(r)&64512)==55296&&(e.charCodeAt(r+1)&64512)==56320&&(n--,r++);return n}function ub(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function db(e){let t=typeof e;switch(t){case`number`:return Number.isNaN(e)?`nan`:`number`;case`object`:{if(e===null)return`null`;if(Array.isArray(e))return`array`;let t=e;if(t&&Object.getPrototypeOf(t)!==Object.prototype&&`constructor`in t&&t.constructor)return t.constructor.name}}return t}function fb(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}function pb(e,t){for(let n in t){let r=Object.getOwnPropertyDescriptor(t,n);r.get?Object.defineProperty(e,n,{...r,enumerable:!1}):_b(e,n,r.value)}for(let n of Object.getOwnPropertySymbols(t))_b(e,n,t[n])}function mb(e,t,n,r=!0){return Object.defineProperty(e,t,{configurable:!0,writable:!0,enumerable:r,value:n}),n}function hb(e,t,n){return mb(e,t,n,!1)}function gb(e,t){for(let n in e){let r=e[n];Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get(){return mb(this,n,r(this))},set(e){mb(this,n,e)}})}return t}function _b(e,t,n){Object.defineProperty(e,t,{configurable:!0,get(){return this==null?n:mb(this,t,n.bind(this))},set(e){mb(this,t,e)}})}function vb(e,t){let n=Object.getPrototypeOf(e);return t in n?void 0:n}var yb,bb=!1,xb={configurable:!0,get(){bb=!0}};function Sb(e,t,n){let r=Object.getPrototypeOf(e._zod);if(t in r&&yb!==e._zod){yb=void 0;return}yb=e._zod,Object.defineProperty(r,t,{configurable:!0,get(){Object.defineProperty(this,t,xb);let e=bb;bb=!1;try{let r=n(this);return bb?delete this[t]:Object.defineProperty(this,t,{configurable:!0,writable:!0,value:r}),bb||=e,r}catch(n){throw delete this[t],bb||=e,n}},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,value:e})}})}function Cb(e,t,n,r){let i=vb(e,t);i&&Object.defineProperty(i,t,{configurable:!0,get(){let e={configurable:!0,writable:!0,enumerable:r,value:void 0};return Object.defineProperty(this,t,e),e.value=n(this),Object.defineProperty(this,t,e),e.value},set(e){Object.defineProperty(this,t,{configurable:!0,writable:!0,enumerable:r,value:e})}})}var wb=`~constantCatch`;function Tb(e){let t=()=>e;return t[wb]=!0,t}var Eb,Db={value:void 0,enumerable:!1},Ob=`captureStackTrace`in Error?Error:null;function kb(e){let t=Ob;if(t){let n=t.stackTraceLimit;if(typeof n==`number`){try{t.stackTraceLimit=0}catch{return Ob=null,new e}try{return new e}finally{t.stackTraceLimit=n}}}return new e}function Q(e,t,n,r){let i={};function a(e){this.def=e,this.constr=d,this.traits=new Set}a.prototype=i;let o=n,s=o&&new WeakSet;function c(n,r){if(!n._zod){Db.value=new a(r);try{Object.defineProperty(n,"_zod",Db)}finally{Db.value=void 0}}if(n._zod.traits.has(e))return;if(n._zod.traits.add(e),t(n,r),s){let e=Object.getPrototypeOf(n),t=n._zod.constr.prototype,r=e;for(;r&&r!==t;)r=Object.getPrototypeOf(r);let i=r??e;s.has(i)||(s.add(i),pb(i,o))}let i=d.prototype;for(let e in i)Object.prototype.hasOwnProperty.call(i,e)&&(e in n||(n[e]=i[e].bind(n)))}let l=r?.Parent??Object;class u extends l{}Object.defineProperty(u,"name",{value:e});function d(e){let t=r?.Parent?kb(u):this;c(t,e);let n=t._zod.deferred;if(n){for(let e of n)e();t._zod.deferred=void 0}let i=globalThis.__zod_globalConfig?.postProcessor;return i&&i(t),t}return Object.defineProperty(d,"init",{value:c}),Object.defineProperty(d,Symbol.hasInstance,{value:t=>r?.Parent&&t instanceof r.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(d,"name",{value:e}),d}var Ab=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},jb=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Eb=globalThis).__zod_globalConfig??(Eb.__zod_globalConfig={});var Mb=globalThis.__zod_globalConfig;function Nb(e){return e&&Object.assign(Mb,e),Mb}function Pb(){let e=this._zod;return e.message??=JSON.stringify(e.def,by,2),e.message}function Fb(e){this._zod.message=e}var Ib={get:Pb,set:Fb,enumerable:!0,configurable:!0},Lb={value:void 0,enumerable:!1},Rb=new WeakSet([Object.prototype,Error.prototype]),zb=(e,t)=>{e.name=`$ZodError`,Lb.value=t,Object.defineProperty(e,"issues",Lb),Lb.value=void 0,Object.defineProperty(e,"message",Ib);let n=Object.getPrototypeOf(e);Rb.has(n)||(Rb.add(n),Object.defineProperty(n,"toString",{configurable:!0,enumerable:!1,get(){let e=()=>this.message;return Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,"toString",{value:e,configurable:!0,writable:!0})}}))},Bb=Q(`$ZodError`,zb);Q(`$ZodError`,zb,void 0,{Parent:Error});function Vb(e,t,n){return Object.prototype.hasOwnProperty.call(e,t)||(t===`__proto__`?Object.defineProperty(e,t,{value:n(),writable:!0,enumerable:!0,configurable:!0}):e[t]=n()),e[t]}function Hb(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?Vb(n,i.path[0],()=>[]).push(t(i)):r.push(t(i));return{formErrors:r,fieldErrors:n}}function Ub(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i],o=i===e.length-1;if(n===`_errors`){o&&r._errors.push(t(a)),i++;continue}Object.prototype.hasOwnProperty.call(r,n)||Object.defineProperty(r,n,{value:{_errors:[]},enumerable:!0,writable:!0,configurable:!0});let s=r[n];o&&s._errors.push(t(a)),r=s,i++}}}};return r(e),n}function Wb(e,t){return{callee:t?.callee??e,Err:t?.Err}}var Gb=e=>{let t=(n,r,i,a)=>{let o=i?{...i,async:!1}:{async:!1},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise)throw new Ab;if(s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>sb(e,o,Nb())));throw Fy(n,a?.callee??t),n}return s.value};return t},Kb=e=>{let t=async(n,r,i,a)=>{let o=i?{...i,async:!0}:{async:!0},s=n._zod.run({value:r,issues:[]},o);if(s instanceof Promise&&(s=await s),s.issues.length){let n=new((a?.Err)??e)(s.issues.map(e=>sb(e,o,Nb())));throw Fy(n,a?.callee??t),n}return s.value};return t},qb=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Ab;return a.issues.length?Jb(e,a.issues,i):{success:!0,data:a.value}};function Jb(e,t,n){let r;return{success:!1,get error(){return r||(r=new e(t.map(e=>sb(e,n,Nb()))),t=void 0,n=void 0),r},set error(e){r=e,t=void 0,n=void 0}}}var Yb=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?Jb(e,a.issues,i):{success:!0,data:a.value}},Xb=Symbol.for(`zod.compile.invalid`),Zb=Symbol.for(`zod.compile.fallback`),Qb=((e,t,n)=>{let r=e._zod.bag.validator;if(r!==void 0){if(r(t)!==Xb)return!0;if(r.definite===!0&&n===void 0)return!1}return $b(e,t,n)});function $b(e,t,n){let r=n?{...n,async:!1,abortEarly:!0}:{async:!1,abortEarly:!0},i=e._zod.bag.fallbackRun,a;if(i?(r[Zb]=!0,a=i({value:t,issues:[]},r)):a=e._zod.run({value:t,issues:[]},r),a instanceof Promise)throw new Ab;return a.issues.length===0}var ex=async(e,t,n)=>{let r=n?{...n,async:!0,abortEarly:!0}:{async:!0,abortEarly:!0},i=e._zod.run({value:t,issues:[]},r);return i instanceof Promise&&(i=await i),i.issues.length===0},tx=e=>{let t=Gb(e),n=(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return t(e,r,o,Wb(n,a))};return n},nx=e=>{let t=Gb(e),n=(e,r,i,a)=>t(e,r,i,Wb(n,a));return n},rx=e=>{let t=Kb(e),n=async(e,r,i,a)=>{let o=i?{...i,direction:`backward`}:{direction:`backward`};return await t(e,r,o,Wb(n,a))};return n},ix=e=>{let t=Kb(e),n=async(e,r,i,a)=>await t(e,r,i,Wb(n,a));return n},ax=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return qb(e)(t,n,i)},ox=e=>(t,n,r)=>qb(e)(t,n,r),sx=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return Yb(e)(t,n,i)},cx=e=>async(t,n,r)=>Yb(e)(t,n,r),lx=/^[cC][0-9a-z]{6,}$/,ux=/^[0-9a-z]+$/,dx=/^[0-7][0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{25}$/,fx=/^[0-9a-vA-V]{20}$/,px=/^[A-Za-z0-9]{27}$/,mx=/^[a-zA-Z0-9_-]{21}$/;function hx(e){return RegExp(`^[a-zA-Z0-9_-]{${e}}$`)}var gx=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,_x=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,vx=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,yx=/^(?:[A-Za-z0-9_'+\-]+\.)*[A-Za-z0-9_'+\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,bx=`^(?=[\\s\\S]*[\\p{Extended_Pictographic}\\p{Regional_Indicator}\\u20E3])[\\p{Extended_Pictographic}\\p{Emoji_Component}]+$`;function xx(){return new RegExp(bx,`u`)}var Sx=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Cx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,wx=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Tx=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Ex=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Dx=/^(?:[A-Za-z0-9_-]{4})*(?:[A-Za-z0-9_-]{2,3})?$/,Ox=/^https?$/,kx=/^\+[1-9]\d{6,14}$/,Ax=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`;function jx(e){return RegExp(`^${e}$`)}var Mx=jx(Ax);function Nx(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:e.seconds?`${t}:[0-5]\\d(?:\\.\\d+)?`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Px(e){return RegExp(`^${Nx(e)}$`)}function Fx(e){let t=[`Z`];e.offset&&t.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let n=`${Nx({precision:e.precision,seconds:!0})}(?:${t.join(`|`)})`,r=e.local?`${n}|${Nx({precision:e.precision})}`:n;return RegExp(`^${Ax}T(?:${r})$`)}var Ix=/^[\s\S]{0,}$/,Lx=/^[^A-Z]*$/,Rx=/^[^a-z]*$/,zx=Q(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),Bx=e=>{let t=e.value;return!Cy(t)&&t.length!==void 0},Vx=Q(`$ZodCheckMaxLength`,(e,t)=>{var n;zx.init(e,t),(n=e._zod.def).when??(n.when=Bx),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>t.maximum?lb(r):i)<=t.maximum)return;let a=ub(r);n.issues.push({origin:a,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Hx=Q(`$ZodCheckMinLength`,(e,t)=>{var n;zx.init(e,t),(n=e._zod.def).when??(n.when=Bx),e._zod.check=n=>{let r=n.value,i=r.length;if((typeof r==`string`&&i>=t.minimum&&i<t.minimum*2?lb(r):i)>=t.minimum)return;let a=ub(r);n.issues.push({origin:a,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),Ux=Q(`$ZodCheckLengthEquals`,(e,t)=>{var n;zx.init(e,t),(n=e._zod.def).when??(n.when=Bx),e._zod.check=n=>{let r=n.value,i=r.length,a=typeof r==`string`&&i>=t.length&&i<=t.length*2?lb(r):i;if(a===t.length)return;let o=ub(r),s=a>t.length;n.issues.push({origin:o,...s?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),Wx=Q(`$ZodCheckStringFormat`,(e,t)=>{var n,r;zx.init(e,t),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),Gx=Q(`$ZodCheckRegex`,(e,t)=>{Wx.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),Kx=Q(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=Lx,Wx.init(e,t)}),qx=Q(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=Rx,Wx.init(e,t)}),Jx=Q(`$ZodCheckIncludes`,(e,t)=>{zx.init(e,t);let n=Vy(t.includes);t.pattern=new RegExp(typeof t.position==`number`?`^.{${t.position},}${n}`:n),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),Yx=Q(`$ZodCheckStartsWith`,(e,t)=>{zx.init(e,t);let n=RegExp(`^${Vy(t.prefix)}.*`);t.pattern??=n,e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),Xx=Q(`$ZodCheckEndsWith`,(e,t)=>{zx.init(e,t);let n=RegExp(`.*${Vy(t.suffix)}$`);t.pattern??=n,e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),Zx=Q(`$ZodCheckOverwrite`,(e,t)=>{zx.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),Qx=class{constructor(e=[],t={}){this.content=[],this.indent=0,this.args=e,this.closed=t}indented(e){this.indent+=1;try{e(this)}finally{--this.indent}}write(e){if(typeof e==`function`){e(this,{execution:`sync`}),e(this,{execution:`async`});return}let t=e.split(`
|
|
59
|
-
`).filter(e=>e),n=Math.min(...t.map(e=>e.length-e.trimStart().length)),r=t.map(e=>e.slice(n)).map(e=>` `.repeat(this.indent*2)+e);for(let e of r)this.content.push(e)}compile(){let e=Function,t=this?.content??[``];return new e(...Object.keys(this.closed),`return function (${this.args.join(`, `)}) {\n${t.join(`
|
|
60
|
-
`)}\n};`)(...Object.values(this.closed))}},$x={major:4,minor:6,patch:2},eS=Q(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=$x;let r=e._zod.def.checks,i=e._zod.traits.has(`$ZodCheck`)?[e,...r??[]]:r?.length?[...r]:[];for(let t of i)for(let n of t._zod.onattach)n(e);if(i.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(t,n,r)=>{if(t.memo)return t;let i=nb(t),a;for(let o of n){if(o._zod.def.when){if(rb(t)||!o._zod.def.when(t))continue}else if(i)continue;let n=t.issues.length,s=o._zod.check(t);if(s instanceof Promise&&r?.async===!1)throw new Ab;if(a||s instanceof Promise)a=(a??Promise.resolve()).then(async()=>{await s,t.issues.length!==n&&(ob(t.issues,n,e),i||=nb(t,n))});else{if(t.issues.length===n)continue;ob(t.issues,n,e),i||=nb(t,n)}}return a?a.then(()=>t):t},n=(n,r,a)=>{if(nb(n))return n.aborted=!0,n;let o=t(r,i,a);if(o instanceof Promise){if(a.async===!1)throw new Ab;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(r,a)=>{if(a.skipChecks)return e._zod.parse(r,a);if(a.direction===`backward`){let t=e._zod.parse({value:r.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,r,a)):n(t,r,a)}let o=e._zod.parse(r,a);if(o instanceof Promise){if(a.async===!1)throw new Ab;return o.then(e=>t(e,i,a))}return t(o,i,a)}}},{get"~standard"(){return hb(this,`~standard`,rS(this))},set"~standard"(e){mb(this,`~standard`,e)}}),tS=(e,t)=>e.issues.length?{issues:e.issues.map(e=>sb(e,t,Nb()))}:{value:e.value};async function nS(e,t){let n={async:!0};return tS(await e._zod.run({value:t,issues:[]},n),n)}function rS(e){return{validate:t=>{let n={async:!1};try{let r=e._zod.run({value:t,issues:[]},n);if(!(r instanceof Promise))return tS(r,n)}catch{}return nS(e,t)},vendor:`zod`,version:1}}var iS=Q(`$ZodString`,(e,t)=>{eS.init(e,t),e._zod.pattern=t.pattern??Ix,e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),aS=Q(`$ZodStringFormat`,(e,t)=>{Wx.init(e,t),iS.init(e,t)}),oS=Q(`$ZodGUID`,(e,t)=>{t.pattern??=_x,aS.init(e,t)}),sS=Q(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=vx(e)}else t.pattern??=vx();aS.init(e,t)}),cS=Q(`$ZodEmail`,(e,t)=>{t.pattern??=yx,aS.init(e,t)});function lS(e,t){if(!t.normalize&&t.protocol?.source===Ox.source&&!/^https?:\/\//i.test(e))return 1;try{return new URL(e)}catch{return 2}}var uS=/[\t\n\r]/g;function dS(e){return e.replace(uS,``)}function fS(e,t){return t.lastIndex=0,t.test(e.hostname)}function pS(e,t){return t.lastIndex=0,t.test(e.protocol.endsWith(`:`)?e.protocol.slice(0,-1):e.protocol)}var mS=Q(`$ZodURL`,(e,t)=>{aS.init(e,t),e._zod.check=n=>{try{let r=n.value.trim(),i=lS(r,t);if(i===1){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}if(i===2){n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort});return}t.hostname&&!fS(i,t.hostname)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort}),t.protocol&&!pS(i,t.protocol)&&n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort}),n.value=t.normalize?i.href:dS(r);return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),hS=Q(`$ZodEmoji`,(e,t)=>{t.pattern??=xx(),aS.init(e,t)}),gS=Q(`$ZodNanoID`,(e,t)=>{if(t.length!==void 0&&(!Number.isInteger(t.length)||t.length<1))throw Error(`Invalid nanoid length: ${t.length}`);t.pattern??=t.length===void 0?mx:hx(t.length),aS.init(e,t)}),_S=Q(`$ZodCUID`,(e,t)=>{t.pattern??=lx,aS.init(e,t)}),vS=Q(`$ZodCUID2`,(e,t)=>{t.pattern??=ux,aS.init(e,t)}),yS=Q(`$ZodULID`,(e,t)=>{t.pattern??=dx,aS.init(e,t)}),bS=Q(`$ZodXID`,(e,t)=>{t.pattern??=fx,aS.init(e,t)}),xS=Q(`$ZodKSUID`,(e,t)=>{t.pattern??=px,aS.init(e,t)}),SS=Q(`$ZodISODateTime`,(e,t)=>{t.pattern??=Fx(t),aS.init(e,t)}),CS=Q(`$ZodISODate`,(e,t)=>{t.pattern??=Mx,aS.init(e,t)}),wS=Q(`$ZodISOTime`,(e,t)=>{t.pattern??=Px(t),aS.init(e,t)}),TS=Q(`$ZodISODuration`,(e,t)=>{t.pattern??=gx,aS.init(e,t)}),ES=Q(`$ZodIPv4`,(e,t)=>{t.pattern??=Sx,aS.init(e,t)}),DS=/^[0-9a-fA-F:.]+$/;function OS(e){if(!DS.test(e))return!1;try{return new URL(`http://[${e}]`),!0}catch{return!1}}var kS=Q(`$ZodIPv6`,(e,t)=>{t.pattern??=Cx,aS.init(e,t),e._zod.check=n=>{OS(n.value)||n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}),AS=Q(`$ZodCIDRv4`,(e,t)=>{t.pattern??=wx,aS.init(e,t)});function jS(e){let t=e.split(`/`);if(t.length!==2)return!1;let[n,r]=t;if(!r)return!1;let i=Number(r);return`${i}`!==r||i<0||i>128?!1:OS(n)}var MS=Q(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Tx,aS.init(e,t),e._zod.check=n=>{jS(n.value)||n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}});function NS(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var PS=/^[0-9a-zA-Z+/]*={0,2}$/,FS=Q(`$ZodBase64`,(e,t)=>{t.pattern??=PS,aS.init(e,t),e._zod.check=n=>{NS(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}}),IS=/^[A-Za-z0-9_-]*$/;function LS(e){if(!IS.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return NS(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var RS=Q(`$ZodBase64URL`,(e,t)=>{t.pattern??=IS,aS.init(e,t),e._zod.check=n=>{LS(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),zS=Q(`$ZodE164`,(e,t)=>{t.pattern??=kx,aS.init(e,t)});function BS(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var VS=Q(`$ZodJWT`,(e,t)=>{aS.init(e,t),e._zod.check=n=>{BS(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}}),HS=Q(`$ZodUnknown`,(e,t)=>{eS.init(e,t),e._zod.parse=e=>e}),US=Q(`$ZodNever`,(e,t)=>{eS.init(e,t),e._zod.parse=(t,n)=>(t.issues.push({expected:`never`,code:`invalid_type`,input:t.value,inst:e}),t)});function WS(e,t,n){e.issues.length&&t.issues.push(...ib(n,e.issues)),t.value[n]=e.value}var GS=Q(`$ZodArray`,(e,t)=>{eS.init(e,t);let n=Mb.memoizer;n?.attach(e),e._zod.parse=(r,i)=>{let a=r.value;if(!Array.isArray(a))return r.issues.push({expected:`array`,code:`invalid_type`,input:a,inst:e}),r;r.value=n?n.alloc(e,r,Array(a.length),i):Array(a.length);let o=[],s=i?.abortEarly;for(let e=0;e<a.length;e++){let n=a[e],c=t.element._zod.run({value:n,issues:[]},i);if(c instanceof Promise)o.push(c.then(t=>WS(t,r,e)));else if(WS(c,r,e),s&&c.issues.length!==0&&nb(c))break}return o.length?Promise.all(o).then(()=>r):r}});function KS(e,t,n,r,i,a){let o=n in r,s=a===`optional`;if(o||!s||i!==`optional`){if(e.issues.length){if(i!==void 0&&s&&!o)return;t.issues.push(...ib(n,e.issues))}if(!o&&i===void 0){e.issues.length||t.issues.push({code:`invalid_type`,expected:`nonoptional`,input:void 0,path:[n]});return}e.value===void 0?(o||i===`defaulted`&&!s)&&(t.value[n]=void 0):t.value[n]=e.value}}var qS=[];function JS(e){let t=Object.keys(e.shape),n=Object.getOwnPropertySymbols(e.shape),r=n.length?n:qS,i=r.length?[...t,...r]:t;for(let t of i)if(!e.shape?.[t]?._zod?.traits?.has(`$ZodType`))throw Error(`Invalid element at key "${String(t)}": expected a Zod schema`);let a=Wy(e.shape);return{...e,allKeys:i,symbolKeys:r,keySet:new Set(t),numKeys:t.length,optionalKeys:new Set(a)}}function YS(e,t,n,r,i,a,o){let s=[],c=i.keySet,l=i.catchall._zod,u=l.def.type,d=l.optin,f=l.optout,p=0;for(let i in t){if(o&&n.issues.length!==p){if(nb(n,p))break;p=n.issues.length}if(c.has(i))continue;if(i===`__proto__`){u===`never`&&s.push(i);continue}if(u===`never`){s.push(i);continue}let a=l.run({value:t[i],issues:[]},r);a instanceof Promise?e.push(a.then(e=>KS(e,n,i,t,d,f))):KS(a,n,i,t,d,f)}return s.length&&n.issues.push({code:`unrecognized_keys`,keys:s,input:t,inst:a,continue:!0}),e.length?Promise.all(e).then(()=>n):n}var XS=Q(`$ZodObject`,(e,t)=>{eS.init(e,t);let n=Object.getOwnPropertyDescriptor(t,`shape`),r=n?.get?n.get.raw:t.shape??{};if(r){let e=()=>{let n={...r};return Object.defineProperty(t,"shape",{value:n}),e.raw=n,n};e.raw=r,Object.defineProperty(t,"shape",{get:e})}let i=Sy(()=>JS(t));Sb(e,`propValues`,e=>{let t=e.def.shape,n={};for(let e in t){let r=t[e]._zod;if(r.values){Object.prototype.hasOwnProperty.call(n,e)||Ty(n,e,new Set);for(let t of r.values)n[e].add(t);r.optin!==void 0&&n[e].add(void 0)}}return n});let a=Iy,o=t.catchall,s,c=Mb.memoizer;c?.attach(e),e._zod.parse=(t,n)=>{s??=i.value;let r=t.value;if(!a(r))return t.issues.push({expected:`object`,code:`invalid_type`,input:r,inst:e}),t;t.value=c?c.alloc(e,t,{},n):{};let l=[],u=s.shape,d=n?.abortEarly,f=t.issues.length;for(let e of s.allKeys){if(d&&t.issues.length!==f){if(nb(t,f))break;f=t.issues.length}if(e===`__proto__`)continue;let i=u[e],a=i._zod.optin,o=i._zod.optout,s=i._zod.run({value:r[e],issues:[]},n);s instanceof Promise?l.push(s.then(n=>KS(n,t,e,r,a,o))):KS(s,t,e,r,a,o)}return o?YS(l,r,t,n,i.value,e,d===!0):l.length?Promise.all(l).then(()=>t):t}}),ZS=Q(`$ZodObjectJIT`,(e,t)=>{XS.init(e,t);let n=e._zod.parse,r=Sy(()=>JS(t)),i=Mb.memoizer,a=t=>{let n=r.value,a=n.symbolKeys,o=new Qx([`payload`,`ctx`],{shape:t,inst:e,memo:i,syms:a}),s=e=>`shape[${e}]._zod.run({ value: input[${e}], issues: [] }, ctx)`,c=(e,t)=>`
|
|
61
|
-
let ${e}_ab = false;
|
|
62
|
-
for (let i = 0; i < ${e}.issues.length; i++) {
|
|
63
|
-
const iss = ${e}.issues[i];
|
|
64
|
-
iss.path = iss.path ? [${t}, ...iss.path] : [${t}];
|
|
65
|
-
payload.issues.push(iss);
|
|
66
|
-
if (iss.continue !== true) ${e}_ab = true;
|
|
67
|
-
}
|
|
68
|
-
if (${e}_ab && ctx && ctx.abortEarly) {
|
|
69
|
-
payload.value = newResult;
|
|
70
|
-
return payload;
|
|
71
|
-
}`;o.write(`const input = payload.value;`);let l=Object.create(null),u=0;for(let e of n.allKeys)l[e]=`key_${u++}`;o.write(i?`const newResult = memo.alloc(inst, payload, {}, ctx);`:`const newResult = {};`);for(let e of n.allKeys){if(e===`__proto__`)continue;let n=l[e],r=typeof e==`symbol`?`syms[${a.indexOf(e)}]`:Ny(e),i=`${r} in input`,u=t[e],d=u?._zod?.optin,f=d!==void 0,p=u?._zod?.optout===`optional`;if(o.write(`const ${n} = ${s(r)};`),f&&p){let e=d===`optional`?`${n}_present`:`${n}.value !== undefined || ${n}_present`;o.write(`
|
|
72
|
-
const ${n}_present = ${i};
|
|
73
|
-
if (!${n}.issues.length || ${n}_present) {
|
|
74
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
if (${e}) {
|
|
78
|
-
newResult[${r}] = ${n}.value;
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
|
|
82
|
-
`)}else f?(o.write(`
|
|
83
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
84
|
-
}
|
|
85
|
-
`),d===`defaulted`?o.write(`newResult[${r}] = ${n}.value;`):o.write(`
|
|
86
|
-
if (${n}.value !== undefined || ${i}) {
|
|
87
|
-
newResult[${r}] = ${n}.value;
|
|
88
|
-
}
|
|
89
|
-
`)):o.write(`
|
|
90
|
-
const ${n}_present = ${i};
|
|
91
|
-
if (${n}.issues.length) {${c(n,r)}
|
|
92
|
-
}
|
|
93
|
-
if (!${n}_present && !${n}.issues.length) {
|
|
94
|
-
payload.issues.push({
|
|
95
|
-
code: "invalid_type",
|
|
96
|
-
expected: "nonoptional",
|
|
97
|
-
input: undefined,
|
|
98
|
-
path: [${r}]
|
|
99
|
-
});
|
|
100
|
-
if (ctx && ctx.abortEarly) {
|
|
101
|
-
payload.value = newResult;
|
|
102
|
-
return payload;
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
if (${n}_present) {
|
|
107
|
-
newResult[${r}] = ${n}.value;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
`)}return o.write(`payload.value = newResult;`),o.write(`return payload;`),o.compile()},o,s=Iy,c=!Mb.jitless,l=c&&Ly.value,u=t.catchall,d;e._zod.parse=(i,f)=>{d??=r.value;let p=i.value;return s(p)?c&&l&&f?.async===!1&&f.jitless!==!0?(o||=a(t.shape),i=o(i,f),u?YS([],p,i,f,d,e,f?.abortEarly===!0):i):n(i,f):(i.issues.push({expected:`object`,code:`invalid_type`,input:p,inst:e}),i)}});function QS(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!nb(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>sb(e,r,Nb())))}),t)}var $S=Q(`$ZodUnion`,(e,t)=>{eS.init(e,t),Sb(e,`optin`,e=>e.def.options.some(e=>e._zod.optin===`defaulted`)?`defaulted`:e.def.options.some(e=>e._zod.optin!==void 0)?`optional`:void 0),Sb(e,`optout`,e=>e.def.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Sb(e,`values`,e=>{if(e.def.options.every(e=>e._zod.values))return new Set(e.def.options.flatMap(e=>Array.from(e._zod.values)))}),Sb(e,`pattern`,e=>{if(e.def.options.every(e=>e._zod.pattern)){let t=e.def.options.map(e=>e._zod.pattern);return RegExp(`^(${t.map(e=>wy(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>QS(t,r,e,i)):QS(o,r,e,i)}}),eC=Q(`$ZodIntersection`,(e,t)=>{eS.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>nC(e,t,n)):nC(e,i,a)}});function tC(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if(Ry(e)&&Ry(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};Object.prototype.hasOwnProperty.call(i,`__proto__`)&&delete i.__proto__;for(let n of r){if(n===`__proto__`)continue;let r=tC(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=tC(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function nC(e,t,n){let r=new Map,i,a=new Map,o=(e,t)=>{let n;if(e.code===`unrecognized_keys`&&!e.path?.length)i??=e,n=e.keys;else if(e.code===`invalid_key`&&e.origin===`record`&&e.path?.length===1){let t=String(e.path[0]);a.has(t)||a.set(t,e),n=[t]}else return!1;for(let e of n)r.has(e)||r.set(e,{}),r.get(e)[t]=!0;return!0};for(let n of t.issues)o(n,`l`)||e.issues.push(n);for(let t of n.issues)o(t,`r`)||e.issues.push(t);let s=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(s.length){let t=i?s.filter(e=>i.keys.includes(e)):[];t.length&&e.issues.push({...i,keys:t});for(let n of s)!t.includes(n)&&a.has(n)&&e.issues.push(a.get(n))}let c=tC(t.value,n.value);if(!c.valid){if(nb(e))return e;throw Error(`Unmergable intersection. Error path: ${JSON.stringify(c.mergeErrorPath)}`)}return e.value=c.data,e}var rC=Q(`$ZodEnum`,(e,t)=>{eS.init(e,t);let n=vy(t.entries),r=new Set(n);e._zod.values=r,Sb(e,`pattern`,e=>{let t=vy(e.def.entries).filter(e=>By.has(typeof e));return RegExp(t.length?`^(${t.map(e=>Vy(e.toString())).join(`|`)})$`:`^[^\\s\\S]$`)}),e._zod.parse=(t,i)=>{let a=t.value;return r.has(a)||t.issues.push({code:`invalid_value`,values:n,input:a,inst:e}),t}}),iC=Q(`$ZodTransform`,(e,t)=>{eS.init(e,t),e._zod.optin=`optional`,Mb.memoizer?.guard(e),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jb(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n));if(i instanceof Promise)throw new Ab;return n.value=i,n}});function aC(e,t){return e.value=t.issues.length?void 0:t.value,e}var oC=Q(`$ZodOptional`,(e,t)=>{eS.init(e,t),Sb(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),e._zod.optout=`optional`,Sb(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t,void 0]):void 0}),Sb(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${wy(t.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(e.value===void 0){if(t.innerType._zod.optin!==`defaulted`)return e;let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(t=>aC(e,t)):aC(e,r)}return t.innerType._zod.run(e,n)}}),sC=Q(`$ZodExactOptional`,(e,t)=>{oC.init(e,t),Sb(e,`values`,e=>e.def.innerType._zod.values),Sb(e,`pattern`,e=>e.def.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),cC=Q(`$ZodNullable`,(e,t)=>{eS.init(e,t),Sb(e,`optin`,e=>e.def.innerType._zod.optin),Sb(e,`optout`,e=>e.def.innerType._zod.optout),Sb(e,`pattern`,e=>{let t=e.def.innerType._zod.pattern;return t?RegExp(`^(${wy(t.source)}|null)$`):void 0}),Sb(e,`values`,e=>e.def.innerType._zod.values?new Set([...e.def.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),lC=Q(`$ZodDefault`,(e,t)=>{eS.init(e,t),e._zod.optin=`defaulted`,Sb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>uC(e,t)):uC(r,t)}});function uC(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var dC=Q(`$ZodPrefault`,(e,t)=>{eS.init(e,t),e._zod.optin=`defaulted`,Sb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),fC=Q(`$ZodNonOptional`,(e,t)=>{eS.init(e,t),Sb(e,`values`,e=>{let t=e.def.innerType._zod.values;return t?new Set([...t].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>pC(t,e)):pC(i,e)}});function pC(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}function mC(e,t,n,r){return t.issues.length?(e.value=n.catchValue({...t,value:e.value,error:{issues:t.issues.map(e=>sb(e,r,Nb()))},input:e.value}),e):(e.value=t.value,t.memo&&(e.memo=!0),e)}var hC=Q(`$ZodCatch`,(e,t)=>{eS.init(e,t),Sb(e,`optin`,e=>e.def.innerType._zod.optin===`defaulted`?`defaulted`:`optional`),Sb(e,`optout`,e=>e.def.innerType._zod.optout),Sb(e,`values`,e=>e.def.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run({value:e.value,issues:[]},n);return r instanceof Promise?r.then(r=>mC(e,r,t,n)):mC(e,r,t,n)}}),gC=Q(`$ZodPipe`,(e,t)=>{eS.init(e,t),Sb(e,`values`,e=>e.def.in._zod.values),Sb(e,`optin`,e=>e.def.in._zod.optin),Sb(e,`optout`,e=>e.def.out._zod.optout),Sb(e,`propValues`,e=>e.def.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>_C(e,t.in,n)):_C(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>_C(e,t.out,n)):_C(r,t.out,n)}});function _C(e,t,n){return e.issues.some(e=>e.code!==`unrecognized_keys`)?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues},n)}var vC=Q(`$ZodReadonly`,(e,t)=>{eS.init(e,t),Sb(e,`propValues`,e=>e.def.innerType._zod.propValues),Sb(e,`values`,e=>e.def.innerType._zod.values),Sb(e,`optin`,e=>e.def.innerType?._zod?.optin),Sb(e,`optout`,e=>e.def.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(yC):yC(r)}});function yC(e){return e.memo||(e.value=Object.freeze(e.value)),e}var bC=Q(`$ZodCustom`,(e,t)=>{zx.init(e,t),eS.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>xC(t,n,r,e));xC(i,n,r,e)}});function xC(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(fb(e))}}var SC=class extends Error{constructor(){super(`Cannot parse a reference cycle that closes through a transform`),this.name=`ZodCyclicError`}},CC=`~memo`,wC=[];function TC(e){return e!==null&&(typeof e==`object`||typeof e==`function`)}function EC(e){return e.map(e=>e.path?{...e,path:e.path.slice()}:{...e})}var DC=new WeakMap,OC=0,kC=1,AC=2;function jC(e,t,n){let r=DC.get(e);if(r!==void 0)return r?AC:OC;if(t.has(e))return AC;t.add(e);let i=OC,a=e=>{if(i!==AC&&e?._zod){let r=jC(e,t,n);r>i&&(i=r)}},o=(e,r)=>{let i=OC;for(let a of Reflect.ownKeys(e)){let o=Object.getOwnPropertyDescriptor(e,a);if(r&&!o.enumerable)continue;let s=o.get?kC:o.value?._zod?jC(o.value,t,n):OC;s>i&&(i=s)}return i},s=e=>{e>i&&(i=e)},c=e._zod.def;switch(c.type){case`object`:{let e=Ey(c);s(e?o(e,!0):kC),a(c.catchall);break}case`properties`:s(o(c.shape,!1));break;case`array`:a(c.element);break;case`tuple`:for(let e of c.items)a(e);a(c.rest);break;case`record`:case`map`:a(c.keyType),a(c.valueType);break;case`set`:a(c.valueType);break;case`union`:for(let e of c.options)a(e);break;case`intersection`:a(c.left),a(c.right);break;case`optional`:case`nullable`:case`default`:case`prefault`:case`catch`:case`readonly`:case`nonoptional`:case`promise`:case`success`:a(c.innerType);break;case`pipe`:a(c.in),a(c.out);break;case`function`:a(c.input),a(c.output);break;case`lazy`:{let r=c._cachedInner??(n?e._zod.innerType:void 0);s(r?jC(r,t,!1):kC);break}case`template_literal`:case`string`:case`number`:case`int`:case`boolean`:case`bigint`:case`symbol`:case`undefined`:case`null`:case`void`:case`never`:case`any`:case`unknown`:case`date`:case`nan`:case`enum`:case`literal`:case`file`:case`transform`:case`custom`:break;default:for(let e in c){let t=Object.getOwnPropertyDescriptor(c,e);if(!t||t.get)continue;let n=t.value;if(n&&typeof n==`object`){if(n._zod)a(n);else if(Array.isArray(n))for(let e of n)a(e)}}}return t.delete(e),MC(e,i)}function MC(e,t){return t!==kC&&DC.set(e,t===AC),t}function NC(e,t){let n=e.buckets.get(t);return n||(n=new WeakMap,e.buckets.set(t,n)),n}var PC,FC=[],IC={alloc(e,t,n){let r=PC;if(!r)return n;PC=void 0;let i={value:n,issues:null};return r.set(t.value,i),FC.push(i),n},guard(e){var t;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,n=(e,n)=>{if(n.direction!==`backward`&&RC(n,e.value))throw new SC;return t(e,n)};e._zod.parse=n,e._zod.run===t&&(e._zod.run=n)})},attach(e){var t;let n,r=!1,i,a;(t=e._zod).deferred??(t.deferred=[]),e._zod.deferred.push(()=>{let t=e._zod.parse,o=(s,c)=>{if(n===void 0){let i=jC(e,new Set,!1);if(i===OC)return e._zod.parse=t,e._zod.run===o&&(e._zod.run=t),t(s,c);i===AC||r?n=!0:r=!0}let l=s.value;if(!TC(l))return t(s,c);let u=c[CC];u||(u={buckets:new WeakMap,backEdges:void 0},c[CC]=u);let d;i===c?d=a:(d=NC(u,e),i=c,a=d);let f=d.get(l);if(f)return s.value=f.value,f.issues?f.issues.length&&s.issues.push(...EC(f.issues)):(s.memo=!0,u.backEdges??(u.backEdges=new WeakSet),u.backEdges.add(f.value)),s;PC=d;let p=FC.length,m=t(s,c);PC=void 0;let h=FC.length>p?FC.pop():void 0;return m instanceof Promise?m.then(e=>(h&&(h.issues=e.issues.length?EC(e.issues):wC),e)):(h&&(h.issues=m.issues.length?EC(m.issues):wC),m)};e._zod.parse=o,e._zod.run===t&&(e._zod.run=o)})}};function LC(){return IC}function RC(e,t){let n=e[CC]?.backEdges;return n!==void 0&&TC(t)&&n.has(t)}var zC=()=>{let e={string:{unit:`characters`,verb:`to have`},file:{unit:`bytes`,verb:`to have`},array:{unit:`items`,verb:`to have`},set:{unit:`items`,verb:`to have`},map:{unit:`entries`,verb:`to have`}};function t(t){return e[t]??null}let n={regex:`input`,email:`email address`,url:`URL`,emoji:`emoji`,uuid:`UUID`,uuidv4:`UUIDv4`,uuidv6:`UUIDv6`,nanoid:`nanoid`,guid:`GUID`,cuid:`cuid`,cuid2:`cuid2`,ulid:`ULID`,xid:`XID`,ksuid:`KSUID`,datetime:`ISO datetime`,date:`ISO date`,time:`ISO time`,duration:`ISO duration`,ipv4:`IPv4 address`,ipv6:`IPv6 address`,mac:`MAC address`,cidrv4:`IPv4 range`,cidrv6:`IPv6 range`,base64:`base64-encoded string`,base64url:`base64url-encoded string`,json_string:`JSON string`,e164:`E.164 number`,credit_card:`credit card number`,iban:`IBAN`,jwt:`JWT`,template_literal:`input`},r={nan:`NaN`};function i(e,t){return e===`number`&&typeof t==`number`&&!Number.isFinite(t)?String(t):r[e]??e}return e=>{switch(e.code){case`invalid_type`:return`Invalid input: expected ${i(e.expected)}, received ${i(db(e.input),e.input)}`;case`invalid_value`:return e.values.length===1?`Invalid input: expected ${Uy(e.values[0])}`:`Invalid option: expected one of ${yy(e.values,`|`)}`;case`too_big`:{let n=e.exact?`exactly `:e.inclusive?`<=`:`<`,r=t(e.origin);return r?`Too big: expected ${e.origin??`value`} to have ${n}${e.maximum.toString()} ${r.unit??`elements`}`:`Too big: expected ${e.origin??`value`} to be ${n}${e.maximum.toString()}`}case`too_small`:{let n=e.exact?`exactly `:e.inclusive?`>=`:`>`,r=t(e.origin);return r?`Too small: expected ${e.origin} to have ${n}${e.minimum.toString()} ${r.unit}`:`Too small: expected ${e.origin} to be ${n}${e.minimum.toString()}`}case`invalid_format`:{let t=e;return t.format===`starts_with`?`Invalid string: must start with "${t.prefix}"`:t.format===`ends_with`?`Invalid string: must end with "${t.suffix}"`:t.format===`includes`?`Invalid string: must include "${t.includes}"`:t.format===`regex`?`Invalid string: must match pattern ${t.pattern}`:`Invalid ${n[t.format]??e.format}`}case`not_multiple_of`:return`Invalid number: must be a multiple of ${e.divisor}`;case`unrecognized_keys`:return`Unrecognized key${e.keys.length>1?`s`:``}: ${yy(e.keys,`, `)}`;case`invalid_key`:return`Invalid key in ${e.origin}`;case`invalid_union`:return e.options&&Array.isArray(e.options)&&e.options.length>0?`Invalid discriminator value. Expected ${e.options.map(e=>`'${e}'`).join(` | `)}`:e.inclusive===!1?`Invalid input: more than one option matched`:`Invalid input`;case`invalid_element`:return`Invalid value in ${e.origin}`;default:return`Invalid input`}}};function BC(){return{localeError:zC()}}var VC,HC=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function UC(){return new HC}(VC=globalThis).__zod_globalRegistry??(VC.__zod_globalRegistry=UC());var WC=globalThis.__zod_globalRegistry;function GC(e,t){return new e({type:`string`,...Z(t)})}function KC(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Z(t)})}function qC(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Z(t)})}function JC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Z(t)})}function YC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Z(t)})}function XC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Z(t)})}function ZC(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Z(t)})}function QC(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Z(t)})}function $C(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Z(t)})}function ew(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Z(t)})}function tw(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Z(t)})}function nw(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Z(t)})}function rw(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Z(t)})}function iw(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Z(t)})}function aw(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Z(t)})}function ow(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Z(t)})}function sw(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Z(t)})}function cw(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Z(t)})}function lw(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Z(t)})}function uw(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Z(t)})}function dw(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Z(t)})}function fw(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Z(t)})}function pw(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Z(t)})}function mw(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Z(t)})}function hw(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Z(t)})}function gw(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Z(t)})}function _w(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Z(t)})}function vw(e){return new e({type:`unknown`})}function yw(e,t){return new e({type:`never`,...Z(t)})}function bw(e,t){return new Vx({check:`max_length`,...Z(t),maximum:e})}function xw(e,t){return new Hx({check:`min_length`,...Z(t),minimum:e})}function Sw(e,t){return new Ux({check:`length_equals`,...Z(t),length:e})}function Cw(e,t){return new Gx({check:`string_format`,format:`regex`,...Z(t),pattern:e})}function ww(e){return new Kx({check:`string_format`,format:`lowercase`,...Z(e)})}function Tw(e){return new qx({check:`string_format`,format:`uppercase`,...Z(e)})}function Ew(e,t){return new Jx({check:`string_format`,format:`includes`,...Z(t),includes:e})}function Dw(e,t){return new Yx({check:`string_format`,format:`starts_with`,...Z(t),prefix:e})}function Ow(e,t){return new Xx({check:`string_format`,format:`ends_with`,...Z(t),suffix:e})}function kw(e){return new Zx({check:`overwrite`,tx:e})}function Aw(e){return kw(t=>t.normalize(e))}function jw(){return kw(e=>e.trim())}function Mw(){return kw(e=>e.toLowerCase())}function Nw(){return kw(e=>e.toUpperCase())}function Pw(){return kw(e=>Py(e))}function Fw(e,t,n){return new e({type:`array`,element:t,...Z(n)})}function Iw(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Z(n)})}function Lw(e,t){let n=Rw(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(fb(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,`input`in r||(r.input=t.value),r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(fb(r))}},e(t.value,t)),t);return n}function Rw(e,t){let n=new zx({check:`custom`,...Z(t)});return n._zod.check=e,n}function zw(e,...t){for(let n of t)for(let t of Reflect.ownKeys(n))Object.prototype.propertyIsEnumerable.call(n,t)&&Ty(e,t,n[t]);return e}function Bw(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??WC,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,sharedDefsExtractedFor:void 0,sharedEmitDoneFor:void 0,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,intersections:[],deferred:[],external:e?.external??void 0}}function Vw(e,t,n,r,i){let a=typeof t.unrepresentable==`function`?t.unrepresentable({zodSchema:e,path:r.path,message:i}):t.unrepresentable;if(a===`any`)return!1;if(a===void 0||a===`throw`)throw Error(i);return Object.assign(n,a),!0}function Hw(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o),t.sharedDefsExtractedFor=void 0,t.sharedEmitDoneFor=void 0;let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,Hw(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&zw(o.schema,c),t.io===`input`&&Qw(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function Uw(e){return e.replace(/~/g,`~0`).replace(/\//g,`~1`)}function Ww(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);if(e.external&&e.sharedDefsExtractedFor===e.external)return;let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${Uw(a)}`}}let i=`#/${r}/`;if(t[1]===n&&!t[1].schema.id)return{ref:`#`};let a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+Uw(a)}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
|
|
111
|
-
|
|
112
|
-
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}r.count>1&&e.reused===`ref`&&a(n)}e.external&&(e.sharedDefsExtractedFor=e.external)}function Gw(e){let t=e.anyOf;if(!Array.isArray(t)||t.length===0||e.type!==void 0)return;let n=[];for(let e of t){if(!e||typeof e!=`object`)return;Gw(e);let t=Object.keys(e);if(t.length!==1||t[0]!==`type`)return;let r=e.type;for(let e of Array.isArray(r)?r:[r]){if(typeof e!=`string`)return;n.includes(e)||n.push(e)}}delete e.anyOf,e.type=n.length===1?n[0]:n}var Kw=new Set([`type`,`properties`,`required`,`additionalProperties`]),qw=[`oneOf`,`anyOf`];function Jw(e){let t=e.additionalProperties;return t===void 0||t===!1||typeof t!=`object`||!t?null:Object.keys(t).length?t:null}function Yw(e){let t=[];for(let n of e){if(typeof n!=`object`||n.type!==`object`)return null;for(let e in n)if(!Kw.has(e))return null;t.push(n)}let n={},r=new Set;for(let e of t){for(let r in e.properties){if(Object.prototype.hasOwnProperty.call(n,r))continue;let e=[];for(let n of t){let t=n.properties?.[r]??Jw(n);t!=null&&(e.some(e=>JSON.stringify(e)===JSON.stringify(t))||e.push(t))}Ty(n,r,e.length===1?e[0]:Yw(e)??{allOf:e})}for(let t of e.required??[])r.add(t)}let i={type:`object`,properties:n};if(r.size&&(i.required=[...r]),t.every(e=>e.additionalProperties===!1))i.additionalProperties=!1;else{let e=[];for(let n of t){let t=Jw(n);t&&!e.some(e=>JSON.stringify(e)===JSON.stringify(t))&&e.push(t)}e.length===1?i.additionalProperties=e[0]:e.length>1&&(i.additionalProperties={allOf:e})}return i}function Xw(e){let t=e.allOf;if(!Array.isArray(t)||t.length<2)return;for(let t of Kw)if(t in e)return;let n=t.filter(e=>qw.some(t=>Array.isArray(e[t]))),r=null;if(!n.length)r=Yw(t);else{let e=n[0],i=qw.find(t=>Array.isArray(e[t]));if(Object.keys(e).length!==1)return;let a=t.filter(t=>t!==e),o=e[i].map(e=>Yw([...a,e]));if(o.some(e=>!e))return;r={[i]:o}}r&&(delete e.allOf,zw(e,r))}function Zw(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):zw(i,s),zw(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};if(!e.external||e.sharedEmitDoneFor!==e.external){for(let t of[...e.seen.entries()].reverse())r(t[0]);if(e.target!==`openapi-3.0`)for(let t of e.seen.entries())Gw(t[1].def??t[1].schema);for(let t of e.deferred)t();if(e.intersections.length){let t=new Map;for(let n of e.seen.values())for(let e of[n.schema,n.def]){let n=e?.allOf;if(!Array.isArray(n))continue;let r=t.get(n);r?r.push(e):t.set(n,[e])}for(let n of e.intersections)for(let e of t.get(n)??[])Xw(e)}}let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}zw(i,n.defId?n.schema:n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};if(!e.external||e.sharedEmitDoneFor!==e.external)for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,Ty(o,e.defId,e.def))}e.external&&(e.sharedEmitDoneFor=e.external),e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:eT(t,`input`,e.processors),output:eT(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function Qw(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return Qw(r.element,n);if(r.type===`set`)return Qw(r.valueType,n);if(r.type===`lazy`)return Qw(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`||r.type===`catch`)return Qw(r.innerType,n);if(r.type===`intersection`)return Qw(r.left,n)||Qw(r.right,n);if(r.type===`record`||r.type===`map`)return Qw(r.keyType,n)||Qw(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:Qw(r.in,n)||Qw(r.out,n);if(r.type===`object`){for(let e in r.shape)if(Qw(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(Qw(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(Qw(e,n))return!0;return!!(r.rest&&Qw(r.rest,n))}return!1}var $w=(e,t={})=>n=>{let r=Bw({...n,processors:t});return Hw(e,r),Ww(r,e),Zw(r,e)},eT=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=Bw({...i??{},target:a,io:t,processors:n});return Hw(e,o),Ww(o,e),Zw(o,e)},tT=(e,t,n)=>{(e[t]===void 0||n>e[t])&&(e[t]=n)},nT=(e,t,n)=>{(e[t]===void 0||n<e[t])&&(e[t]=n)},rT=(e,t)=>{tT(e,`minimum`,t),nT(e,`maximum`,t)},iT=(e,t)=>{e.multipleOf??=[],e.multipleOf.includes(t)||e.multipleOf.push(t)},aT=(e,t)=>{e.patterns??=new Set,e.patterns.add(t)},oT=(e,t)=>{e.mime=e.mime?e.mime.filter(e=>t.includes(e)):[...t]},sT=(e,t)=>{e.format=t,t.includes(`int`)&&(e.isInt=!0)},cT=(e,t)=>tT(e,`minimum`,t.minimum),lT=(e,t)=>nT(e,`maximum`,t.maximum),uT=e=>(t,n)=>{sT(t,n.format);let[r,i]=e[n.format];tT(t,`minimum`,r),nT(t,`maximum`,i)},dT={greater_than:(e,t)=>tT(e,t.inclusive?`minimum`:`exclusiveMinimum`,t.value),less_than:(e,t)=>nT(e,t.inclusive?`maximum`:`exclusiveMaximum`,t.value),multiple_of:(e,t)=>iT(e,t.value),number_format:uT(Gy),bigint_format:uT(Ky),min_length:cT,max_length:lT,length_equals:(e,t)=>rT(e,t.length),min_size:cT,max_size:lT,size_equals:(e,t)=>rT(e,t.size),string_format:(e,t)=>{sT(e,t.format),t.pattern&&aT(e,t.pattern),(t.format===`base64`||t.format===`base64url`)&&(e.contentEncoding=t.format),(t.local||t.precision===-1)&&(e.laxFormat=!0)},mime_type:(e,t)=>oT(e,t.mime)};function fT(e){let t={},n=e._zod.def,r=e._zod.traits.has(`$ZodCheck`)?[e,...n.checks??[]]:n.checks??[];for(let e of r)dT[e._zod.def.check]?.(t,e._zod.def);let i=e._zod.bag;i.minimum!==void 0&&tT(t,`minimum`,i.minimum),i.exclusiveMinimum!==void 0&&tT(t,`exclusiveMinimum`,i.exclusiveMinimum),i.maximum!==void 0&&nT(t,`maximum`,i.maximum),i.exclusiveMaximum!==void 0&&nT(t,`exclusiveMaximum`,i.exclusiveMaximum),i.multipleOf!==void 0&&iT(t,i.multipleOf),i.format!==void 0&&(t.format??=i.format,i.format.includes(`int`)&&(t.isInt=!0)),i.mime&&oT(t,i.mime);for(let e of i.patterns??[])aT(t,e);return t}var pT={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},mT=new Map([[PS,Ex],[IS,Dx]]),hT=e=>mT.get(e)??e,gT=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l,laxFormat:u}=fT(e);if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=pT[s]??s,i.format===``&&delete i.format,(s===`time`||u)&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c].map(hT);e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},_T=(e,t,n,r)=>{n.not={}},vT=(e,t,n,r)=>{let i=e._zod.def,a=vy(i.entries);if(a.length===0){n.not={};return}a.every(e=>typeof e==`number`)&&(n.type=`number`),a.every(e=>typeof e==`string`)&&(n.type=`string`),n.enum=a},yT=(e,t,n,r)=>{Vw(e,t,n,r,`Custom types cannot be represented in JSON Schema`)},bT=(e,t,n,r)=>{Vw(e,t,n,r,`Transforms cannot be represented in JSON Schema`)},xT=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=fT(e);typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=Hw(a.element,t,{...r,path:[...r.path,`items`]})};function ST(e){let t=e._zod.def;return t.type===`pipe`&&t.in._zod.traits.has(`$ZodTransform`)?ST(t.out):t.type===`catch`?ST(t.innerType):e._zod.optin}var CT=(e,t,n,r)=>{let i=n,a=e._zod.def,o=a.shape;if(Object.getOwnPropertySymbols(o).length&&Vw(e,t,i,r,`Symbol keys cannot be represented in JSON Schema`))return;i.type=`object`,i.properties={};for(let e in o)Ty(i.properties,e,Hw(o[e],t,{...r,path:[...r.path,`properties`,e]}));let s=new Set(Object.keys(o)),c=new Set([...s].filter(e=>{let n=a.shape[e];return t.io===`input`?ST(n)===void 0:n._zod.optout===void 0}));c.size>0&&(i.required=Array.from(c)),a.catchall?._zod.def.type===`never`?i.additionalProperties=!1:a.catchall?a.catchall&&(i.additionalProperties=Hw(a.catchall,t,{...r,path:[...r.path,`additionalProperties`]})):t.io===`output`&&(i.additionalProperties=!1)},wT=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>Hw(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},TT=(e,t,n,r)=>{let i=e._zod.def,a=Hw(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=Hw(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1,c=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]];n.allOf=c,t.intersections.push(c)},ET=(e,t,n,r)=>{let i=e._zod.def,a=Hw(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},DT=(e,t,n,r)=>{let i=e._zod.def;Hw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},OT=Symbol();function kT(e,t,n,r,i){let a=!1,o=JSON.stringify(e,(e,t)=>typeof t==`bigint`?(a=!0,null):t);return a?(Vw(t,n,r,i,`BigInt defaults cannot be represented in JSON Schema`),OT):JSON.parse(o)}var AT=(e,t,n,r)=>{let i=e._zod.def;Hw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o=kT(i.defaultValue,e,t,n,r);o!==OT&&(n.default=o)},jT=(e,t,n,r)=>{let i=e._zod.def;Hw(i.innerType,t,r);let a=t.seen.get(e);if(a.ref=i.innerType,t.io!==`input`)return;let o=kT(i.defaultValue,e,t,n,r);o!==OT&&(n._prefault=o)},MT=(e,t,n,r)=>{let i=e._zod.def;Hw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{Vw(e,t,n,r,`Dynamic catch values are not supported in JSON Schema`);return}n.default=o},NT=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;Hw(o,t,r);let s=t.seen.get(e);s.ref=o},PT=(e,t,n,r)=>{let i=e._zod.def;Hw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},FT=(e,t,n,r)=>{let i=e._zod.def;Hw(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},IT=new WeakSet([Object.prototype,Error.prototype]);function LT(e,t,n){Object.defineProperty(e,t,{configurable:!0,enumerable:!1,get(){let e=n(this);return Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0}),e},set(e){Object.defineProperty(this,t,{value:e,configurable:!0,writable:!0})}})}var RT=Q(`ZodError`,(e,t)=>{Bb.init(e,t),e.name=`ZodError`;let n=Object.getPrototypeOf(e);IT.has(n)||(IT.add(n),LT(n,`format`,e=>t=>Ub(e,t)),LT(n,`flatten`,e=>t=>Hb(e,t)),LT(n,`addIssue`,e=>t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,by,2)}),LT(n,`addIssues`,e=>t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,by,2)}),Object.defineProperty(n,"isEmpty",{configurable:!0,enumerable:!1,get(){return this.issues.length===0}}))},void 0,{Parent:Error}),zT=Gb(RT),BT=Kb(RT),VT=qb(RT),HT=Yb(RT),UT=tx(RT),WT=nx(RT),GT=rx(RT),KT=ix(RT),qT=ax(RT),JT=ox(RT),YT=sx(RT),XT=cx(RT);function ZT(){Mb.localeError||Nb(BC())}function QT(){Mb.memoizer||Nb({memoizer:LC()})}var $T=Q(`ZodType`,(e,t)=>(ZT(),eS.init(e,t),e.def=t,e.type=t.type,e),{check(...e){let t=this.def;return this.clone(My(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return Hy(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(cD(e,t))},superRefine(e,t){return this.check(lD(e,t))},overwrite(e){return this.check(kw(e))},optional(){return WE(this)},exactOptional(){return KE(this)},nullable(){return JE(this)},nullish(){return WE(JE(this))},nonoptional(e){return eD(this,e)},array(){return ME(this)},or(e){return IE([this,e])},and(e){return RE(this,e)},transform(e){return iD(this,HE(e))},default(e){return XE(this,e)},prefault(e){return QE(this,e)},catch(e){return nD(this,e)},pipe(e){return iD(this,e)},readonly(){return oD(this)},describe(e){let t=this.clone();return WC.add(t,{description:e}),t},meta(...e){if(e.length===0)return WC.get(this);let t=this.clone();return WC.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e,...t){return t.length===0?e(this):e(this,...t)},get"~standard"(){return hb(this,`~standard`,{...rS(this),jsonSchema:{input:eT(this,`input`),output:eT(this,`output`)}})},set"~standard"(e){mb(this,`~standard`,e)},parse:function e(t,n){return zT(this,t,n,{callee:e})},parseAsync:async function e(t,n){return await BT(this,t,n,{callee:e})},safeParse(e,t){return VT(this,e,t)},async safeParseAsync(e,t){return HT(this,e,t)},get spa(){return this?.safeParseAsync},set spa(e){mb(this,`spa`,e)},validate(e,t){return Qb(this,e,t)},validateAsync(e,t){return ex(this,e,t)},encode:function e(t,n){return UT(this,t,n,{callee:e})},decode:function e(t,n){return WT(this,t,n,{callee:e})},encodeAsync:async function e(t,n){return await GT(this,t,n,{callee:e})},decodeAsync:async function e(t,n){return await KT(this,t,n,{callee:e})},safeEncode(e,t){return qT(this,e,t)},safeDecode(e,t){return JT(this,e,t)},async safeEncodeAsync(e,t){return YT(this,e,t)},async safeDecodeAsync(e,t){return XT(this,e,t)},toJSONSchema(e){return $w(this,{})(e)},get description(){return WC.get(this)?.description},get _def(){return this._zod.def}}),eE=Q(`_ZodString`,(e,t)=>{iS.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>gT(e,t,n,r)},gb({format:e=>fT(e).format??null,minLength:e=>fT(e).minimum??null,maxLength:e=>fT(e).maximum??null},{regex(...e){return this.check(Cw(...e))},includes(...e){return this.check(Ew(...e))},startsWith(...e){return this.check(Dw(...e))},endsWith(...e){return this.check(Ow(...e))},min(...e){return this.check(xw(...e))},max(...e){return this.check(bw(...e))},length(...e){return this.check(Sw(...e))},nonempty(...e){return this.check(xw(1,...e))},lowercase(e){return this.check(ww(e))},uppercase(e){return this.check(Tw(e))},trim(){return this.check(jw())},normalize(...e){return this.check(Aw(...e))},toLowerCase(){return this.check(Mw())},toUpperCase(){return this.check(Nw())},slugify(){return this.check(Pw())}})),tE=Q(`ZodString`,(e,t)=>{iS.init(e,t),eE.init(e,t)},{email(e){return this.check(KC(cE,e))},url(e){return this.check(QC(dE,e))},jwt(e){return this.check(pw(EE,e))},emoji(e){return this.check($C(fE,e))},guid(e){return this.check(qC(lE,e))},uuid(e){return this.check(JC(uE,e))},uuidv4(e){return this.check(YC(uE,e))},uuidv6(e){return this.check(XC(uE,e))},uuidv7(e){return this.check(ZC(uE,e))},nanoid(e){return this.check(ew(pE,e))},cuid(e){return this.check(tw(mE,e))},cuid2(e){return this.check(nw(hE,e))},ulid(e){return this.check(rw(gE,e))},base64(e){return this.check(uw(CE,e))},base64url(e){return this.check(dw(wE,e))},xid(e){return this.check(iw(_E,e))},ksuid(e){return this.check(aw(vE,e))},ipv4(e){return this.check(ow(yE,e))},ipv6(e){return this.check(sw(bE,e))},cidrv4(e){return this.check(cw(xE,e))},cidrv6(e){return this.check(lw(SE,e))},e164(e){return this.check(fw(TE,e))},datetime(e){return this.check(mw(iE,e))},date(e){return this.check(hw(aE,e))},time(e){return this.check(gw(oE,e))},duration(e){return this.check(_w(sE,e))}});function nE(e){return GC(tE,e)}var rE=Q(`ZodStringFormat`,(e,t)=>{aS.init(e,t),eE.init(e,t)}),iE=Q(`ZodISODateTime`,(e,t)=>{SS.init(e,t),rE.init(e,t)}),aE=Q(`ZodISODate`,(e,t)=>{CS.init(e,t),rE.init(e,t)}),oE=Q(`ZodISOTime`,(e,t)=>{wS.init(e,t),rE.init(e,t)}),sE=Q(`ZodISODuration`,(e,t)=>{TS.init(e,t),rE.init(e,t)}),cE=Q(`ZodEmail`,(e,t)=>{cS.init(e,t),rE.init(e,t)}),lE=Q(`ZodGUID`,(e,t)=>{oS.init(e,t),rE.init(e,t)}),uE=Q(`ZodUUID`,(e,t)=>{sS.init(e,t),rE.init(e,t)}),dE=Q(`ZodURL`,(e,t)=>{mS.init(e,t),rE.init(e,t)}),fE=Q(`ZodEmoji`,(e,t)=>{hS.init(e,t),rE.init(e,t)}),pE=Q(`ZodNanoID`,(e,t)=>{gS.init(e,t),rE.init(e,t)}),mE=Q(`ZodCUID`,(e,t)=>{_S.init(e,t),rE.init(e,t)}),hE=Q(`ZodCUID2`,(e,t)=>{vS.init(e,t),rE.init(e,t)}),gE=Q(`ZodULID`,(e,t)=>{yS.init(e,t),rE.init(e,t)}),_E=Q(`ZodXID`,(e,t)=>{bS.init(e,t),rE.init(e,t)}),vE=Q(`ZodKSUID`,(e,t)=>{xS.init(e,t),rE.init(e,t)}),yE=Q(`ZodIPv4`,(e,t)=>{ES.init(e,t),rE.init(e,t)}),bE=Q(`ZodIPv6`,(e,t)=>{kS.init(e,t),rE.init(e,t)}),xE=Q(`ZodCIDRv4`,(e,t)=>{AS.init(e,t),rE.init(e,t)}),SE=Q(`ZodCIDRv6`,(e,t)=>{MS.init(e,t),rE.init(e,t)}),CE=Q(`ZodBase64`,(e,t)=>{FS.init(e,t),rE.init(e,t)}),wE=Q(`ZodBase64URL`,(e,t)=>{RS.init(e,t),rE.init(e,t)}),TE=Q(`ZodE164`,(e,t)=>{zS.init(e,t),rE.init(e,t)}),EE=Q(`ZodJWT`,(e,t)=>{VS.init(e,t),rE.init(e,t)}),DE=Q(`ZodUnknown`,(e,t)=>{HS.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(e,t,n)=>void 0});function OE(){return vw(DE)}var kE=Q(`ZodNever`,(e,t)=>{US.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>_T(e,t,n,r)});function AE(e){return yw(kE,e)}var jE=Q(`ZodArray`,(e,t)=>{QT(),GS.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xT(e,t,n,r),e.element=t.element},{min(e,t){return this.check(xw(e,t))},nonempty(e){return this.check(xw(1,e))},max(e,t){return this.check(bw(e,t))},length(e,t){return this.check(Sw(e,t))},unwrap(){return this.element}});function ME(e,t){return Fw(jE,e,t)}var NE=Q(`ZodObject`,(e,t)=>{QT(),ZS.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>CT(e,t,n,r),Cb(e,`shape`,e=>e._zod.def.shape,!1)},{keyof(){return BE(Object.keys(this._zod.def.shape))},catchall(e){return this.clone(My(this._zod.def,{catchall:e}))},passthrough(){return this.clone(My(this._zod.def,{catchall:OE()}))},loose(){return this.clone(My(this._zod.def,{catchall:OE()}))},strict(){return this.clone(My(this._zod.def,{catchall:AE()}))},strip(){return this.clone(My(this._zod.def,{catchall:void 0}))},extend(e){return Xy(this,e)},safeExtend(e){return Qy(this,e)},merge(e){return $y(this,e)},pick(e){return qy(this,e)},omit(e){return Yy(this,e)},partial(...e){return eb(UE,this,e[0])},exactPartial(...e){return eb(GE,this,e[0],`exactPartial`)},required(...e){return tb($E,this,e[0])}});function PE(e,t){return new NE({type:`object`,shape:e??{},...Z(t)})}var FE=Q(`ZodUnion`,(e,t)=>{$S.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wT(e,t,n,r),e.options=t.options});function IE(e,t){return new FE({type:`union`,options:e,...Z(t)})}var LE=Q(`ZodIntersection`,(e,t)=>{eC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>TT(e,t,n,r)});function RE(e,t){return new LE({type:`intersection`,left:e,right:t})}var zE=Q(`ZodEnum`,(e,t)=>{rC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vT(e,t,n,r),e.enum=t.entries,e.options=[...e._zod.values];let n=new Set(Object.keys(t.entries));e.extract=(e,r)=>{let i={};for(let r of e)if(n.has(r))i[r]=t.entries[r];else throw Error(`Key ${r} not found in enum`);return new zE({...t,checks:[],...Z(r),entries:i})},e.exclude=(e,r)=>{let i={...t.entries};for(let t of e)if(n.has(t))delete i[t];else throw Error(`Key ${t} not found in enum`);return new zE({...t,checks:[],...Z(r),entries:i})}});function BE(e,t){return new zE({type:`enum`,entries:Array.isArray(e)?Object.fromEntries(e.map(e=>[e,e])):e,...Z(t)})}var VE=Q(`ZodTransform`,(e,t)=>{QT(),iC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bT(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new jb(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(fb(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,`input`in t||(t.input=n.value),t.inst??=e,n.issues.push(fb(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n)):(n.value=i,n)}});function HE(e){return new VE({type:`transform`,transform:e})}var UE=Q(`ZodOptional`,(e,t)=>{oC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function WE(e){return new UE({type:`optional`,innerType:e})}var GE=Q(`ZodExactOptional`,(e,t)=>{sC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>FT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function KE(e){return new GE({type:`optional`,innerType:e})}var qE=Q(`ZodNullable`,(e,t)=>{cC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ET(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function JE(e){return new qE({type:`nullable`,innerType:e})}var YE=Q(`ZodDefault`,(e,t)=>{lC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>AT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function XE(e,t){return new YE({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():zy(t)}})}var ZE=Q(`ZodPrefault`,(e,t)=>{dC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function QE(e,t){return new ZE({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():zy(t)}})}var $E=Q(`ZodNonOptional`,(e,t)=>{fC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>DT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function eD(e,t){return new $E({type:`nonoptional`,innerType:e,...Z(t)})}var tD=Q(`ZodCatch`,(e,t)=>{hC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>MT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function nD(e,t){return new tD({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:Tb(t)})}var rD=Q(`ZodPipe`,(e,t)=>{gC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>NT(e,t,n,r),e.in=t.in,e.out=t.out});function iD(e,t){return new rD({type:`pipe`,in:e,out:t})}var aD=Q(`ZodReadonly`,(e,t)=>{vC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>PT(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function oD(e){return new aD({type:`readonly`,innerType:e})}var sD=Q(`ZodCustom`,(e,t)=>{bC.init(e,t),$T.init(e,t),e._zod.processJSONSchema=(t,n,r)=>yT(e,t,n,r)});function cD(e,t={}){return Iw(sD,e,t)}function lD(e,t){return Lw(e,t)}var uD=e=>e&&{neutral:`text-neutral`,text:`text-muted-foreground`,"text-inverse":`text-foreground-opposite`,error:`text-error`,success:`text-success`,custom:``}[e]||``,dD=$e(`flex flex-row flex-wrap items-center`,{variants:{size:{xs:`gap-1 text-xs`,sm:`gap-1.5 text-sm`,md:`gap-2 text-base`,lg:`gap-3 text-lg`,xl:`gap-4 text-xl`},spacing:{compact:`gap-1`,normal:`gap-2`,loose:`gap-4`}},defaultVariants:{size:`md`,spacing:`normal`}}),fD=({href:e,lang:t,children:n,onClick:r,color:i,position:a,locale:o,className:c,...l})=>{let u=s(`breadcrumb`).linkLabel;return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Ue,{href:e,locale:o,color:i,onClick:r,itemProp:`item`,isExternalLink:!1,itemScope:!0,itemType:`https://schema.org/WebPage`,...l,label:`${u} ${n}`,itemID:e,size:`custom`,children:(0,z.jsx)(`span`,{itemProp:`name`,children:n})}),(0,z.jsx)(`meta`,{itemProp:`position`,content:a.toString()})]})},pD=({children:e,onClick:t,color:n,position:r,className:i,...a})=>{let{linkLabel:o}=ce(`breadcrumb`);return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(j,{onClick:t,variant:`link`,label:`${o} ${e}`,color:n,itemProp:`item`,size:`custom`,...a,children:(0,z.jsx)(`span`,{itemProp:`name`,children:e})}),(0,z.jsx)(`meta`,{itemProp:`position`,content:r.toString()})]})},mD=({children:e,position:t,className:n,...r})=>(0,z.jsxs)(`span`,{itemProp:`item`,className:I(`inline-flex items-center`,`font-medium text-muted-foreground`,`transition-colors duration-200`,n),children:[(0,z.jsx)(`span`,{itemProp:`name`,...r,children:e}),(0,z.jsx)(`meta`,{itemProp:`position`,content:t.toString()})]}),hD=({links:e,className:t,color:n=`text`,locale:r,elementType:i=`page`,separator:a=(0,z.jsx)(nc,{size:10}),ariaLabel:o=`breadcrumb`,includeStructuredData:s=!0,maxItems:c,size:l,spacing:u,...d})=>{let f=c&&e.length>c?[...e.slice(0,1),`...`,...e.slice(-(c-2))]:e;return(0,z.jsx)(`nav`,{"aria-label":o,children:(0,z.jsx)(`ol`,{className:I(dD({size:l,spacing:u}),t),...s&&{itemScope:!0,itemType:`http://schema.org/BreadcrumbList`},...d,children:f.map((e,t)=>{let o=t===f.length-1,c=typeof e==`object`&&typeof e.href==`string`,l=typeof e==`object`&&typeof e.onClick==`function`,u=t===f.length-1,d=u?i:void 0,p=e===`...`,m=e.text??e,h=uD(n);if(p)return(0,z.jsxs)(L.Fragment,{children:[(0,z.jsx)(`li`,{className:`flex items-center`,"aria-hidden":`true`,children:(0,z.jsx)(`span`,{className:`text-neutral-500`,children:`…`})}),!o&&(0,z.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,z.jsx)(`span`,{className:I(h),children:a})})]},`truncated-${m}`);let g=(0,z.jsx)(mD,{position:t+1,"aria-current":d,className:I(`transition-colors duration-200`,u&&`text-foreground`),children:m},m);c?g=(0,z.jsx)(fD,{href:e.href,color:n,position:t+1,locale:r,"aria-current":d,className:I(u&&`cursor-default text-foreground`),children:m},m):l&&(g=(0,z.jsx)(pD,{onClick:e.onClick,color:n,position:t+1,"aria-current":d,className:I(u&&`cursor-default text-neutral-900`),children:m},m));let _=(0,L.createElement)(`li`,{...s&&{itemProp:`itemListElement`,itemScope:!0,itemType:`https://schema.org/ListItem`},key:m,className:`flex items-center`},g);return o?_:(0,z.jsxs)(L.Fragment,{children:[_,(0,z.jsx)(`li`,{"aria-hidden":`true`,className:`flex items-center`,children:(0,z.jsx)(`span`,{className:I(h),children:a})})]},m)})})})},gD=({keyPath:e,dictionaryKey:t,onClickKeyPath:n,locale:r,color:i,showDictionaryKey:a=!0})=>{let o=[...a?[{text:At(t),onClick:n?()=>n([]):void 0}]:[],...e.map((t,r)=>({onClick:n?()=>n?.(e.slice(0,r+1)):void 0,text:At(t.key?.toString()??``)}))];return(0,z.jsx)(hD,{links:o,locale:r,elementType:`location`,color:i})},_D=({children:e,className:t,identifier:n,...r})=>(0,z.jsx)(`div`,{className:I(`group/dropdown relative flex`,t),"aria-label":`DropDown ${n}`,id:`dropdown-container-${n}`,...r,children:e});_D.Trigger=({children:e,identifier:t,className:n,label:r,...i})=>(0,z.jsx)(j,{className:I([`w-full cursor-pointer`,`group-focus-within/dropdown:bg-current/20 group-focus-within/dropdown:ring-4`,n]),label:r??`Open panel ${t}`,"aria-haspopup":`true`,"aria-controls":`dropdown-panel-${t}`,id:`dropdown-trigger-${t}`,onClick:e=>{e.currentTarget.focus()},variant:`none`,...i,children:e}),_D.Panel=({children:e,isHidden:t=void 0,isOverable:n=!1,isFocusable:r=!1,align:i=`start`,yAlign:a=`below`,identifier:o,className:s,smootherClassName:c,...l})=>(0,z.jsx)(`div`,{className:I(`absolute z-100 min-w-full`,i===`start`&&`left-0`,i===`end`&&`right-0`,a===`below`&&`top-[calc(100%+0.5rem)]`,a===`above`&&`bottom-[calc(100%+0.5rem)]`,s),"aria-hidden":t,role:`region`,"aria-labelledby":`dropdown-trigger-${o}`,id:`dropdown-panel-${o}`,children:(0,z.jsx)(ee,{isHidden:t,className:I(`overflow-x-visible`,t===!1&&`invisible`,t===!0&&`visible`,n&&`group-hover/dropdown:visible group-hover/dropdown:grid-rows-[1fr]`,r&&`group-focus-within/dropdown:visible group-focus-within/dropdown:grid-rows-[1fr]`,c),...l,children:e})});function vD(e){return Array.isArray?Array.isArray(e):OD(e)===`[object Array]`}function yD(e){if(typeof e==`string`)return e;if(typeof e==`bigint`)return e.toString();let t=e+``;return t==`0`&&1/e==-1/0?`-0`:t}function bD(e){return e==null?``:yD(e)}function xD(e){return typeof e==`string`}function SD(e){return typeof e==`number`}function CD(e){return e===!0||e===!1||TD(e)&&OD(e)==`[object Boolean]`}function wD(e){return typeof e==`object`}function TD(e){return wD(e)&&e!==null}function ED(e){return e!=null}function DD(e){return!e.trim().length}function OD(e){return e==null?e===void 0?`[object Undefined]`:`[object Null]`:Object.prototype.toString.call(e)}var kD=`Incorrect 'index' type`,AD=`Invalid doc index: must be a non-negative integer within the bounds of the docs array`,jD=e=>`Invalid value for key ${e}`,MD=e=>`Pattern length exceeds max of ${e}.`,ND=e=>`Missing ${e} property in key`,PD=e=>`Property 'weight' in key '${e}' must be a positive integer`,FD=`Fuse.match does not support useTokenSearch: token search requires corpus-level statistics (df, fieldCount) that a one-off string comparison does not have. Use new Fuse(...).search(...) instead.`,ID=Object.prototype.hasOwnProperty,LD=class{constructor(e){this._keys=[],this._keyMap={};let t=0;e.forEach(e=>{let n=RD(e);this._keys.push(n),this._keyMap[n.id]=n,t+=n.weight}),this._keys.forEach(e=>{e.weight/=t})}get(e){return this._keyMap[e]}keys(){return this._keys}toJSON(){return JSON.stringify(this._keys)}};function RD(e){let t=null,n=null,r=null,i=1,a=null;if(xD(e)||vD(e))r=e,t=zD(e),n=BD(e);else{if(!ID.call(e,`name`))throw Error(ND(`name`));let o=e.name;if(r=o,ID.call(e,`weight`)&&e.weight!==void 0&&(i=e.weight,i<=0))throw Error(PD(BD(o)));t=zD(o),n=BD(o),a=e.getFn??null}return{path:t,id:n,weight:i,src:r,getFn:a}}function zD(e){return vD(e)?e:e.split(`.`)}function BD(e){return vD(e)?e.join(`.`):e}function VD(e,t){let n=[],r=!1,i=(e,t,a,o)=>{if(ED(e)){if(!t[a])n.push(o===void 0?e:{v:e,i:o});else{let s=e[t[a]];if(!ED(s))return;if(a===t.length-1&&(xD(s)||SD(s)||CD(s)||typeof s==`bigint`))n.push(o===void 0?bD(s):{v:bD(s),i:o});else if(vD(s)){r=!0;for(let e=0,n=s.length;e<n;e+=1)i(s[e],t,a+1,e)}else t.length&&i(s,t,a+1,o)}}};return i(e,xD(t)?t.split(`.`):t,0),r?n:n[0]}var HD={includeMatches:!1,findAllMatches:!1,minMatchCharLength:1},UD={isCaseSensitive:!1,ignoreDiacritics:!1,includeScore:!1,keys:[],shouldSort:!0,sortFn:(e,t)=>e.score===t.score?e.idx<t.idx?-1:1:e.score<t.score?-1:1},WD={location:0,threshold:.6,distance:100},GD={useExtendedSearch:!1,useTokenSearch:!1,tokenize:void 0,tokenMatch:`any`,getFn:VD,ignoreLocation:!1,ignoreFieldNorm:!1,fieldNormWeight:1},$=Object.freeze({...UD,...HD,...WD,...GD});function KD(e){return e>=9&&e<=13||e===32||e===160}function qD(e=1,t=3){let n=new Map,r=10**t;return{get(t){let i=0,a=!1;for(let e=0;e<t.length;e++)KD(t.charCodeAt(e))?a=!1:a||=(i++,!0);if(i===0&&(i=1),n.has(i))return n.get(i);let o=Math.round(r/i**(.5*e))/r;return n.set(i,o),o},clear(){n.clear()}}}var JD=class{constructor({getFn:e=$.getFn,fieldNormWeight:t=$.fieldNormWeight}={}){this.norm=qD(t,3),this.getFn=e,this.isCreated=!1,this.docs=[],this.keys=[],this._keysMap={},this.setIndexRecords()}setSources(e=[]){this.docs=e}setIndexRecords(e=[]){this.records=e}setKeys(e=[]){this.keys=e,this._keysMap={},e.forEach((e,t)=>{this._keysMap[e.id]=t})}create(){if(this.isCreated||!this.docs.length)return;this.isCreated=!0;let e=this.docs.length;this.records=Array(e);let t=0;if(xD(this.docs[0]))for(let n=0;n<e;n++){let e=this._createStringRecord(this.docs[n],n);e&&(this.records[t++]=e)}else for(let n=0;n<e;n++)this.records[t++]=this._createObjectRecord(this.docs[n],n);this.records.length=t,this.norm.clear()}add(e,t){if(!Number.isInteger(t)||t<0)throw Error(AD);if(xD(e)){let n=this._createStringRecord(e,t);return n&&this.records.push(n),n}let n=this._createObjectRecord(e,t);return this.records.push(n),n}removeAt(e){if(!Number.isInteger(e)||e<0)throw Error(AD);for(let t=0,n=this.records.length;t<n;t+=1)if(this.records[t].i===e){this.records.splice(t,1);break}for(let t=0,n=this.records.length;t<n;t+=1)this.records[t].i>e&&--this.records[t].i}removeAll(e){let t=new Set;for(let n of e)Number.isInteger(n)&&n>=0&&t.add(n);if(t.size===0)return;this.records=this.records.filter(e=>!t.has(e.i));let n=Array.from(t).sort((e,t)=>e-t);for(let e of this.records){let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e.i?t=i+1:r=i}e.i-=t}}getValueForItemAtKeyId(e,t){return e[this._keysMap[t]]}size(){return this.records.length}_createStringRecord(e,t){return!ED(e)||DD(e)?null:{v:e,i:t,n:this.norm.get(e)}}_createObjectRecord(e,t){let n={i:t,$:{}};for(let t=0,r=this.keys.length;t<r;t++){let r=this.keys[t],i=r.getFn?r.getFn(e):this.getFn(e,r.path);if(ED(i)){if(vD(i)){let e=[];for(let t=0,n=i.length;t<n;t+=1){let n=i[t];if(ED(n)){if(xD(n)){if(!DD(n)){let r={v:n,i:t,n:this.norm.get(n)};e.push(r)}}else if(ED(n.v)){let t=xD(n.v)?n.v:bD(n.v);if(!DD(t)){let r={v:t,i:n.i,n:this.norm.get(t)};e.push(r)}}}}n.$[t]=e}else if(xD(i)&&!DD(i)){let e={v:i,n:this.norm.get(i)};n.$[t]=e}}}return n}toJSON(){return{keys:this.keys.map(({getFn:e,...t})=>t),records:this.records}}};function YD(e,t,{getFn:n=$.getFn,fieldNormWeight:r=$.fieldNormWeight}={}){let i=new JD({getFn:n,fieldNormWeight:r});return i.setKeys(e.map(RD)),i.setSources(t),i.create(),i}function XD(e,{getFn:t=$.getFn,fieldNormWeight:n=$.fieldNormWeight}={}){let{keys:r,records:i}=e,a=new JD({getFn:t,fieldNormWeight:n});return a.setKeys(r),a.setIndexRecords(i),a}function ZD(e=[],t=$.minMatchCharLength){let n=[],r=-1,i=-1,a=0;for(let o=e.length;a<o;a+=1){let o=e[a];o&&r===-1?r=a:!o&&r!==-1&&(i=a-1,i-r+1>=t&&n.push([r,i]),r=-1)}return e[a-1]&&a-r>=t&&n.push([r,a-1]),n}function QD(e,t,n,{location:r=$.location,distance:i=$.distance,threshold:a=$.threshold,findAllMatches:o=$.findAllMatches,minMatchCharLength:s=$.minMatchCharLength,includeMatches:c=$.includeMatches,ignoreLocation:l=$.ignoreLocation}={}){if(t.length>32)throw Error(MD(32));let u=t.length,d=e.length,f=Math.max(0,Math.min(r,d)),p=a,m=f,h=(e,t)=>{let n=e/u;if(l)return n;let r=Math.abs(f-t);return i?n+r/i:r?1:n},g=s>1||c,_=g?Array(d):[],v;for(;(v=e.indexOf(t,m))>-1;){let e=h(0,v);if(p=Math.min(e,p),m=v+u,g){let e=0;for(;e<u;)_[v+e]=1,e+=1}}m=-1;let y=[],b=1,x=0,S=u+d,C=1<<u-1;for(let t=0;t<u;t+=1){let r=0,i=S;for(;r<i;)h(t,f+i)<=p?r=i:S=i,i=Math.floor((S-r)/2+r);S=i;let a=Math.max(1,f-i+1),s=o?d:Math.min(f+i,d)+u,c=Array(s+2);c[s+1]=(1<<t)-1;for(let r=s;r>=a;--r){let i=r-1,o=n[e[i]];if(c[r]=(c[r+1]<<1|1)&o,t&&(c[r]|=(y[r+1]|y[r])<<1|1|y[r+1]),c[r]&C&&(b=h(t,i),b<=p)){if(p=b,m=i,x=t,m<=f)break;a=Math.max(1,2*f-m)}}if(h(t+1,f)>p)break;y=c}if(g&&m>=0){let t=Math.min(d-1,m+u-1+x);for(let r=m;r<=t;r+=1)n[e[r]]&&(_[r]=1)}let w={isMatch:m>=0,score:Math.max(.001,b)};if(g){let e=ZD(_,s);e.length?c&&(w.indices=e):w.isMatch=!1}return w}function $D(e){let t={};for(let n=0,r=e.length;n<r;n+=1){let i=e.charAt(n);t[i]=(t[i]||0)|1<<r-n-1}return t}function eO(e){if(e.length<=1)return e;e.sort((e,t)=>e[0]-t[0]||e[1]-t[1]);let t=[e[0]];for(let n=1,r=e.length;n<r;n+=1){let r=t[t.length-1],i=e[n];i[0]<=r[1]+1?r[1]=Math.max(r[1],i[1]):t.push(i)}return t}var tO={ł:`l`,Ł:`L`,đ:`d`,Đ:`D`,ø:`o`,Ø:`O`,ħ:`h`,Ħ:`H`,ŧ:`t`,Ŧ:`T`,ı:`i`,ß:`ss`},nO=RegExp(`[`+Object.keys(tO).join(``)+`]`,`g`),rO=typeof String.prototype.normalize==`function`?e=>e.normalize(`NFD`).replace(/[\u0300-\u036F\u0483-\u0489\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u065F\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u0711\u0730-\u074A\u07A6-\u07B0\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u08D3-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A70\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B56\u0B57\u0B62\u0B63\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0C00-\u0C04\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D82\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0EB1\u0EB4-\u0EB9\u0EBB\u0EBC\u0EC8-\u0ECD\u0F18\u0F19\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F\u109A-\u109D\u135D-\u135F\u1712-\u1714\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u180B-\u180D\u1885\u1886\u18A9\u1920-\u192B\u1930-\u193B\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F\u1AB0-\u1ABE\u1B00-\u1B04\u1B34-\u1B44\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BE6-\u1BF3\u1C24-\u1C37\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF2-\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DF9\u1DFB-\u1DFF\u20D0-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\uA66F-\uA672\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA880\uA881\uA8B4-\uA8C5\uA8E0-\uA8F1\uA8FF\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9E5\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F]/g,``).replace(nO,e=>tO[e]):e=>e,iO=class{constructor(e,{location:t=$.location,threshold:n=$.threshold,distance:r=$.distance,includeMatches:i=$.includeMatches,findAllMatches:a=$.findAllMatches,minMatchCharLength:o=$.minMatchCharLength,isCaseSensitive:s=$.isCaseSensitive,ignoreDiacritics:c=$.ignoreDiacritics,ignoreLocation:l=$.ignoreLocation}={}){if(this.options={location:t,threshold:n,distance:r,includeMatches:i,findAllMatches:a,minMatchCharLength:o,isCaseSensitive:s,ignoreDiacritics:c,ignoreLocation:l},e=s?e:e.toLowerCase(),e=c?rO(e):e,this.pattern=e,this.chunks=[],!this.pattern.length)return;let u=(e,t)=>{this.chunks.push({pattern:e,alphabet:$D(e),startIndex:t})},d=this.pattern.length;if(d>32){let e=0,t=d%32,n=d-t;for(;e<n;)u(this.pattern.substr(e,32),e),e+=32;if(t){let e=d-32;u(this.pattern.substr(e),e)}}else u(this.pattern,0)}searchIn(e){let{isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r}=this.options;if(e=t?e:e.toLowerCase(),e=n?rO(e):e,this.pattern===e){if(e.length<this.options.minMatchCharLength)return{isMatch:!1,score:1};let t={isMatch:!0,score:0};return r&&(t.indices=[[0,e.length-1]]),t}let{location:i,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,ignoreLocation:l}=this.options,u=[],d=0,f=!1;this.chunks.forEach(({pattern:t,alphabet:n,startIndex:p})=>{let{isMatch:m,score:h,indices:g}=QD(e,t,n,{location:i+p,distance:a,threshold:o,findAllMatches:s,minMatchCharLength:c,includeMatches:r,ignoreLocation:l});m&&(f=!0),d+=h,m&&g&&u.push(...g)});let p={isMatch:f,score:f?d/this.chunks.length:1};return f&&r&&(p.indices=eO(u)),p}},aO=new Set([`fuzzy`,`include`]);function oO(e){return e.startsWith(`inverse`)}var sO=[{type:`exact`,multiRegex:/^="(.*)"$/,singleRegex:/^=(.*)$/,create:e=>({type:`exact`,search(t){let n=t===e;return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`include`,multiRegex:/^'"(.*)"$/,singleRegex:/^'(.*)$/,create:e=>({type:`include`,search(t){let n=0,r,i=[],a=e.length;for(;(r=t.indexOf(e,n))>-1;)n=r+a,i.push([r,n-1]);let o=!!i.length;return{isMatch:o,score:+!o,indices:i}}})},{type:`prefix-exact`,multiRegex:/^\^"(.*)"$/,singleRegex:/^\^(.*)$/,create:e=>({type:`prefix-exact`,search(t){let n=t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,e.length-1]}}})},{type:`inverse-prefix-exact`,multiRegex:/^!\^"(.*)"$/,singleRegex:/^!\^(.*)$/,create:e=>({type:`inverse-prefix-exact`,search(t){let n=!t.startsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`inverse-suffix-exact`,multiRegex:/^!"(.*)"\$$/,singleRegex:/^!(.*)\$$/,create:e=>({type:`inverse-suffix-exact`,search(t){let n=!t.endsWith(e);return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`suffix-exact`,multiRegex:/^"(.*)"\$$/,singleRegex:/^(.*)\$$/,create:e=>({type:`suffix-exact`,search(t){let n=t.endsWith(e);return{isMatch:n,score:+!n,indices:[t.length-e.length,t.length-1]}}})},{type:`inverse-exact`,multiRegex:/^!"(.*)"$/,singleRegex:/^!(.*)$/,create:e=>({type:`inverse-exact`,search(t){let n=t.indexOf(e)===-1;return{isMatch:n,score:+!n,indices:[0,t.length-1]}}})},{type:`fuzzy`,multiRegex:/^"(.*)"$/,singleRegex:/^(.*)$/,create:(e,t={})=>{let n=new iO(e,{location:t.location??$.location,threshold:t.threshold??$.threshold,distance:t.distance??$.distance,includeMatches:t.includeMatches??$.includeMatches,findAllMatches:t.findAllMatches??$.findAllMatches,minMatchCharLength:t.minMatchCharLength??$.minMatchCharLength,isCaseSensitive:t.isCaseSensitive??$.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics??$.ignoreDiacritics,ignoreLocation:t.ignoreLocation??$.ignoreLocation});return{type:`fuzzy`,search(e){return n.searchIn(e)}}}}],cO=sO.length,lO=`\0`,uO=`|`;function dO(e){let t=[],n=e.length,r=0;for(;r<n;){for(;r<n&&e[r]===` `;)r++;if(r>=n)break;let i=r;for(;i<n&&e[i]!==` `&&e[i]!==`"`;)i++;if(i<n&&e[i]===`"`){for(i++;i<n;){if(e[i]===`"`){let t=i+1;if(t>=n||e[t]===` `){i++;break}if(e[t]===`$`&&(t+1>=n||e[t+1]===` `)){i+=2;break}}i++}t.push(e.substring(r,i)),r=i}else{for(;i<n&&e[i]!==` `;)i++;t.push(e.substring(r,i)),r=i}}return t}function fO(e,t){let n=e.match(t);return n?n[1]:null}function pO(e,t={}){return e.replace(/\\\|/g,lO).split(uO).map(e=>{let n=dO(e.replace(/\u0000/g,`|`).trim()).filter(e=>e&&!!e.trim()),r=[];for(let e=0,i=n.length;e<i;e+=1){let i=n[e],a=!1,o=-1;for(;!a&&++o<cO;){let e=sO[o],n=fO(i,e.multiRegex);n&&(r.push(e.create(n,t)),a=!0)}if(!a)for(o=-1;++o<cO;){let e=sO[o],n=fO(i,e.singleRegex);if(n){r.push(e.create(n,t));break}}}return r})}var mO=class{constructor(e,{isCaseSensitive:t=$.isCaseSensitive,ignoreDiacritics:n=$.ignoreDiacritics,includeMatches:r=$.includeMatches,minMatchCharLength:i=$.minMatchCharLength,ignoreLocation:a=$.ignoreLocation,findAllMatches:o=$.findAllMatches,location:s=$.location,threshold:c=$.threshold,distance:l=$.distance}={}){this.query=null,this.options={isCaseSensitive:t,ignoreDiacritics:n,includeMatches:r,minMatchCharLength:i,findAllMatches:o,ignoreLocation:a,location:s,threshold:c,distance:l},e=t?e:e.toLowerCase(),e=n?rO(e):e,this.pattern=e,this.query=pO(this.pattern,this.options)}static condition(e,t){return t.useExtendedSearch}searchIn(e){let t=this.query;if(!t)return{isMatch:!1,score:1};let{includeMatches:n,isCaseSensitive:r,ignoreDiacritics:i}=this.options;e=r?e:e.toLowerCase(),e=i?rO(e):e;let a=0,o=[],s=0,c=!1;for(let r=0,i=t.length;r<i;r+=1){let i=t[r];o.length=0,a=0,c=!1;for(let t=0,r=i.length;t<r;t+=1){let r=i[t],{isMatch:l,indices:u,score:d}=r.search(e);if(l)a+=1,s+=d,oO(r.type)&&(c=!0),n&&(aO.has(r.type)?o.push(...u):o.push(u));else{s=0,a=0,o.length=0,c=!1;break}}if(a){let e={isMatch:!0,score:s/a};return c&&(e.hasInverse=!0),n&&(e.indices=eO(o)),e}}return{isMatch:!1,score:1}}},hO=[];function gO(...e){hO.push(...e)}function _O(e,t){for(let n=0,r=hO.length;n<r;n+=1){let r=hO[n];if(r.condition(e,t))return new r(e,t)}return new iO(e,t)}var vO={AND:`$and`,OR:`$or`},yO={PATH:`$path`,PATTERN:`$val`},bO=e=>!!(e[vO.AND]||e[vO.OR]),xO=e=>!!e[yO.PATH],SO=e=>!vD(e)&&wD(e)&&!bO(e),CO=e=>({[vO.AND]:Object.keys(e).map(t=>({[t]:e[t]}))});function wO(e,t,{auto:n=!0}={}){let r=e=>{if(xD(e)){let r={keyId:null,pattern:e};return n&&(r.searcher=_O(e,t)),r}let i=Object.keys(e),a=xO(e);if(!a&&i.length>1&&!bO(e))return r(CO(e));if(SO(e)){let r=a?e[yO.PATH]:i[0],o=a?e[yO.PATTERN]:e[r];if(!xD(o))throw Error(jD(r));let s={keyId:BD(r),pattern:o};return n&&(s.searcher=_O(o,t)),s}let o={children:[],operator:i[0]};return i.forEach(t=>{let n=e[t];vD(n)&&n.forEach(e=>{o.children.push(r(e))})}),o};return bO(e)||(e=CO(e)),r(e)}function TO(e,{ignoreFieldNorm:t=$.ignoreFieldNorm}){let n=1;return e.forEach(({key:e,norm:r,score:i})=>{let a=e?e.weight:null;n*=(i===0&&a?2**-52:i)**+((a||1)*(t?1:r))}),n}function EO(e,{ignoreFieldNorm:t=$.ignoreFieldNorm}){e.forEach(e=>{e.score=TO(e.matches,{ignoreFieldNorm:t})})}var DO=class{constructor(e,t){this.limit=e,this.heap=[],this.comparator=t}get size(){return this.heap.length}insert(e){this.size<this.limit?(this.heap.push(e),this._bubbleUp(this.size-1)):this.comparator(e,this.heap[0])<0&&(this.heap[0]=e,this._sinkDown(0))}extractSorted(){return this.heap.sort(this.comparator)}_bubbleUp(e){let t=this.heap;for(;e>0;){let n=e-1>>1;if(this.comparator(t[e],t[n])<=0)break;let r=t[e];t[e]=t[n],t[n]=r,e=n}}_sinkDown(e){let t=this.heap,n=t.length,r=e;do{e=r;let i=2*e+1,a=2*e+2;if(i<n&&this.comparator(t[i],t[r])>0&&(r=i),a<n&&this.comparator(t[a],t[r])>0&&(r=a),r!==e){let n=t[e];t[e]=t[r],t[r]=n}}while(r!==e)}};function OO(e){let t=[];return e.matches.forEach(e=>{if(!ED(e.indices)||!e.indices.length)return;let n={indices:e.indices,value:e.value};e.key&&(n.key=e.key.id),e.idx>-1&&(n.refIndex=e.idx),t.push(n)}),t}function kO(e,t,{includeMatches:n=$.includeMatches,includeScore:r=$.includeScore}={}){return e.map(e=>{let{idx:i}=e,a={item:t[i],refIndex:i};return n&&(a.matches=OO(e)),r&&(a.score=e.score),a})}var AO=/[\p{L}\p{M}\p{N}_]+/gu,jO=new WeakSet;function MO(e){jO.has(e)||(jO.add(e),console.warn(`[Fuse] tokenize regex ${e} lacks the global flag; only the first match per text will be returned. Add the 'g' flag.`))}function NO(e){if(typeof e==`function`){let t=!1;return n=>{let r=e(n);if(!t&&(t=!0,!Array.isArray(r)||r.some(e=>typeof e!=`string`)))throw Error(`[Fuse] tokenize function must return string[]; received ${Array.isArray(r)?`array containing non-strings`:typeof r}.`);return r}}return e instanceof RegExp?(e.global||MO(e),t=>t.match(e)||[]):e=>e.match(AO)||[]}function PO({isCaseSensitive:e=!1,ignoreDiacritics:t=!1,tokenize:n}={}){let r=NO(n);return{tokenize(n){return e||(n=n.toLowerCase()),t&&(n=rO(n)),r(n)}}}var FO=class{static condition(e,t){return t.useTokenSearch}constructor(e,t){this.options=t,this.analyzer=PO({isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,tokenize:t.tokenize});let n=this.analyzer.tokenize(e),{df:r,fieldCount:i}=t._invertedIndex;this.termSearchers=[],this.idfWeights=[];for(let e of n){this.termSearchers.push(new iO(e,{location:t.location,threshold:t.threshold,distance:t.distance,includeMatches:t.includeMatches,findAllMatches:t.findAllMatches,minMatchCharLength:t.minMatchCharLength,isCaseSensitive:t.isCaseSensitive,ignoreDiacritics:t.ignoreDiacritics,ignoreLocation:!0}));let n=r.get(e)||0,a=Math.log(1+(i-n+.5)/(n+.5));this.idfWeights.push(a)}this.combineAll=t.tokenMatch===`all`,this.numTerms=this.termSearchers.length,this.useMask=this.numTerms<=31}searchIn(e){if(!this.termSearchers.length)return{isMatch:!1,score:1};let t=[],n=0,r=0,i=0,a=0,o=this.combineAll&&!this.useMask?new Set:null;for(let s=0;s<this.termSearchers.length;s++){let c=this.termSearchers[s].searchIn(e),l=this.idfWeights[s];r+=l,c.isMatch&&(i++,n+=l*(1-c.score),c.indices&&t.push(...c.indices),this.combineAll&&(this.useMask?a|=1<<s:o.add(s)))}if(i===0)return{isMatch:!1,score:1};let s=r>0?1-n/r:0,c={isMatch:!0,score:Math.max(.001,s)};return this.options.includeMatches&&t.length&&(c.indices=eO(t)),this.combineAll&&(this.useMask?c.matchedMask=a:c.matchedTerms=o,c.termCount=this.numTerms),c}};function IO(e,t,n,r){let i=r.tokenize(t);if(!i.length)return;e.fieldCount++,e.docFieldCount.set(n,(e.docFieldCount.get(n)||0)+1);let a=new Set(i),o=e.docTermFieldHits.get(n);o||(o=new Map,e.docTermFieldHits.set(n,o));for(let t of a)o.set(t,(o.get(t)||0)+1),e.df.set(t,(e.df.get(t)||0)+1)}function LO(e,t,n,r){let{i,v:a,$:o}=t;if(a!==void 0){IO(e,a,i,r);return}if(o)for(let t=0;t<n;t++){let n=o[t];if(n){if(Array.isArray(n))for(let t of n)IO(e,t.v,i,r);else IO(e,n.v,i,r)}}}function RO(e,t,n){let r={fieldCount:0,df:new Map,docFieldCount:new Map,docTermFieldHits:new Map};for(let i of e)LO(r,i,t,n);return r}function zO(e,t,n,r){LO(e,t,n,r)}function BO(e,t){let n=e.docFieldCount.get(t);if(n===void 0)return;e.fieldCount-=n,e.docFieldCount.delete(t);let r=e.docTermFieldHits.get(t);if(r){for(let[t,n]of r){let r=(e.df.get(t)||0)-n;r<=0?e.df.delete(t):e.df.set(t,r)}e.docTermFieldHits.delete(t)}}function VO(e,t){if(t.length===0)return;let n=Array.from(new Set(t)).sort((e,t)=>e-t);for(let t of n)BO(e,t);let r=e=>{let t=0,r=n.length;for(;t<r;){let i=t+r>>>1;n[i]<e?t=i+1:r=i}return e-t},i=n[0],a=new Map;for(let[t,n]of e.docFieldCount)a.set(t>i?r(t):t,n);e.docFieldCount=a;let o=new Map;for(let[t,n]of e.docTermFieldHits)o.set(t>i?r(t):t,n);e.docTermFieldHits=o}var HO=class{constructor(e,t,n){this.options={...$,...t},this.options.useExtendedSearch,this.options.useTokenSearch,this._keyStore=new LD(this.options.keys),this._docs=e,this._myIndex=null,this._invertedIndex=null,this.setCollection(e,n),this._lastQuery=null,this._lastSearcher=null}_getSearcher(e){if(this._lastQuery===e)return this._lastSearcher;let t=_O(e,this._invertedIndex?{...this.options,_invertedIndex:this._invertedIndex}:this.options);return this._lastQuery=e,this._lastSearcher=t,t}setCollection(e,t){if(this._docs=e,t&&!(t instanceof JD))throw Error(kD);if(this._myIndex=t||YD(this.options.keys,this._docs,{getFn:this.options.getFn,fieldNormWeight:this.options.fieldNormWeight}),this.options.useTokenSearch){let e=PO({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});this._invertedIndex=RO(this._myIndex.records,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}add(e){if(!ED(e))return;this._docs.push(e);let t=this._myIndex.add(e,this._docs.length-1);if(this._invertedIndex&&t){let e=PO({isCaseSensitive:this.options.isCaseSensitive,ignoreDiacritics:this.options.ignoreDiacritics,tokenize:this.options.tokenize});zO(this._invertedIndex,t,this._myIndex.keys.length,e)}this._invalidateSearcherCache()}remove(e=()=>!1){let t=[],n=[];for(let r=0,i=this._docs.length;r<i;r+=1)e(this._docs[r],r)&&(t.push(this._docs[r]),n.push(r));if(n.length){this._invertedIndex&&VO(this._invertedIndex,n);let e=new Set(n);this._docs=this._docs.filter((t,n)=>!e.has(n)),this._myIndex.removeAll(n),this._invalidateSearcherCache()}return t}removeAt(e){if(!Number.isInteger(e)||e<0||e>=this._docs.length)throw Error(AD);this._invertedIndex&&VO(this._invertedIndex,[e]);let t=this._docs.splice(e,1)[0];return this._myIndex.removeAt(e),this._invalidateSearcherCache(),t}_invalidateSearcherCache(){this._lastQuery=null,this._lastSearcher=null}getIndex(){return this._myIndex}_normalizedKeys(){return this._myIndex.keys.map(e=>this._keyStore.get(e.id)||e)}search(e,t){let{limit:n=-1}=t||{},{includeMatches:r,includeScore:i,shouldSort:a,sortFn:o,ignoreFieldNorm:s}=this.options;if(xD(e)&&!e.trim()){let e=this._docs.map((e,t)=>({item:e,refIndex:t}));return SD(n)&&n>-1&&(e=e.slice(0,n)),e}let c=a&&SD(n)&&n>0&&xD(e),l=o,u=(e,t)=>l(e,t)||e.idx-t.idx,d;if(c){let t=new DO(n,u);xD(this._docs[0])?this._searchStringList(e,{heap:t,ignoreFieldNorm:s}):this._searchObjectList(e,{heap:t,ignoreFieldNorm:s}),d=t.extractSorted()}else d=xD(e)?xD(this._docs[0])?this._searchStringList(e):this._searchObjectList(e):this._searchLogical(e),EO(d,{ignoreFieldNorm:s}),a&&d.sort(xD(e)?u:l),SD(n)&&n>-1&&(d=d.slice(0,n));return kO(d,this._docs,{includeMatches:r,includeScore:i})}_searchStringList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=t?null:[];return a.forEach(({v:e,i:a,n:s})=>{if(!ED(e))return;let c=r.searchIn(e);if(c.isMatch){let r={score:c.score,value:e,norm:s,indices:c.indices};i&&(r.matchedMask=c.matchedMask,r.matchedTerms=c.matchedTerms,r.termCount=c.termCount);let l=[r];if(!i||this._coversAllTokens(l)){let r={item:e,idx:a,matches:l};t?(r.score=TO(r.matches,{ignoreFieldNorm:n}),t.insert(r)):o.push(r)}}}),o}_searchLogical(e){let t=wO(e,this.options),n=this._normalizedKeys(),r=(e,t,i)=>{if(!(`children`in e)){let{keyId:r,searcher:a}=e,o;return r===null?(o=[],n.forEach((e,n)=>{o.push(...this._findMatches({key:e,value:t[n],searcher:a}))})):o=this._findMatches({key:this._keyStore.get(r),value:this._myIndex.getValueForItemAtKeyId(t,r),searcher:a}),o&&o.length?[{idx:i,item:t,matches:o}]:[]}let{children:a,operator:o}=e,s=[];for(let e=0,n=a.length;e<n;e+=1){let n=a[e],c=r(n,t,i);if(c.length)s.push(...c);else if(o===vO.AND)return[]}return s},i=this._myIndex.records,a=new Map,o=[];return i.forEach(({$:e,i:n})=>{if(ED(e)){let i=r(t,e,n);i.length&&(a.has(n)||(a.set(n,{idx:n,item:e,matches:[]}),o.push(a.get(n))),i.forEach(({matches:e})=>{a.get(n).matches.push(...e)}))}}),o}_searchObjectList(e,{heap:t,ignoreFieldNorm:n}={}){let r=this._getSearcher(e),i=this.options.useTokenSearch&&this.options.tokenMatch===`all`,{records:a}=this._myIndex,o=this._normalizedKeys(),s=t?null:[];return a.forEach(({$:e,i:a})=>{if(!ED(e))return;let c=[],l=!1,u=!1;if(o.forEach((t,n)=>{let i=this._findMatches({key:t,value:e[n],searcher:r});i.length?(c.push(...i),i[0].hasInverse&&(u=!0)):l=!0}),!(u&&l)&&c.length&&(!i||this._coversAllTokens(c))){let r={idx:a,item:e,matches:c};t?(r.score=TO(r.matches,{ignoreFieldNorm:n}),t.insert(r)):s.push(r)}}),s}_findMatches({key:e,value:t,searcher:n}){if(!ED(t))return[];let r=[];if(vD(t))t.forEach(({v:t,i,n:a})=>{if(!ED(t))return;let o=n.searchIn(t);if(o.isMatch){let n={score:o.score,key:e,value:t,idx:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(n.matchedMask=o.matchedMask,n.matchedTerms=o.matchedTerms,n.termCount=o.termCount),r.push(n)}});else{let{v:i,n:a}=t,o=n.searchIn(i);if(o.isMatch){let t={score:o.score,key:e,value:i,norm:a,indices:o.indices,hasInverse:o.hasInverse};o.termCount!==void 0&&(t.matchedMask=o.matchedMask,t.matchedTerms=o.matchedTerms,t.termCount=o.termCount),r.push(t)}}return r}_coversAllTokens(e){let t=e.length?e[0].termCount:void 0;if(t===void 0)return!0;if(t<=31){let n=0;for(let t=0;t<e.length;t++)n|=e[t].matchedMask||0;return n===2**t-1}let n=new Set;for(let t=0;t<e.length;t++){let r=e[t].matchedTerms;if(r)for(let e of r)n.add(e)}return n.size===t}};HO.version=`7.5.0`,HO.createIndex=YD,HO.parseIndex=XD,HO.config=$,HO.match=function(e,t,n){if(n&&n.useTokenSearch)throw Error(FD);return _O(e,{...$,...n}).searchIn(t)},HO.parseQuery=wO,gO(mO),gO(FO),HO.use=function(...e){e.forEach(e=>gO(e))};var UO=HO,WO=`locale-switcher-content`,GO=({panelProps:e,isMultilingual:t=!0})=>{let{switchTo:n,searchInput:r,localeSwitcherLabel:a,languageListLabel:s,seeAllLocalesSwitch:c}=ce(`locale-switcher-content`),l=(0,L.useRef)(null),{locale:u}=R(),{availableLocales:d,selectedLocales:f,setSelectedLocales:p}=Lm(),m=(0,L.useMemo)(()=>d.map(e=>({locale:e,englishName:Nt(e,`en`),currentLocaleName:Nt(e,u),ownLocaleName:Nt(e)})),[d,u]),[h,g]=(0,L.useState)(``),[_,v]=o(`locale-content-selector-see-all-locales`,!1),y=(0,L.useMemo)(()=>new UO(m,{keys:[{name:`ownLocaleName`,weight:.4},{name:`englishName`,weight:.2},{name:`currentLocaleName`,weight:.2},{name:`locale`,weight:.2}],threshold:.02}),[m]),b=(0,L.useMemo)(()=>h?y.search(h).map(e=>e.item):m,[h,m,y]),x=e=>{t?f.includes(e)?f.length>1&&p(t=>t.filter(t=>t!==e)):p(t=>[...t,e]):p([e])},S=e=>{v(e),p(e?d:[u])};return(0,z.jsx)(`div`,{className:`rounded-xl border border-text text-foreground transition-colors`,children:(0,z.jsxs)(_D,{identifier:WO,children:[(0,z.jsx)(_D.Trigger,{identifier:WO,label:a.value,className:`p-0!`,roundedSize:`3xl`,color:`text`,variant:`hoverable`,children:(0,z.jsxs)(`div`,{className:`flex w-full items-center justify-between text-foreground`,children:[(0,z.jsx)(`div`,{className:`px-2 py-1`,children:(0,z.jsx)(cc,{size:16})}),(0,z.jsx)(uc,{className:`self-center`,size:16})]})}),(0,z.jsx)(_D.Panel,{identifier:WO,isOverable:!0,isFocusable:!0,align:`end`,...e,children:(0,z.jsxs)(Fe,{className:`max-h-[60vh] min-w-28`,separator:`y`,role:`listbox`,transparency:`xs`,border:!0,roundedSize:`3xl`,borderColor:`text`,"aria-label":s.value,children:[t&&(0,z.jsx)(`div`,{className:`m-auto p-2`,children:(0,z.jsx)(Up,{defaultValue:_,onChange:S,color:`text`,size:`sm`,className:`!w-60`,choices:[{content:c.true.value,value:!0},{content:c.false.value,value:!1}]})}),!(t&&_)&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(`div`,{className:`p-3`,children:(0,z.jsx)(Yp,{type:`search`,"aria-label":r.ariaLabel.value,placeholder:r.placeholder.value,onChange:e=>g(e.target.value),ref:l})}),(0,z.jsx)(`ol`,{className:`divide-y divide-dashed divide-text/20 overflow-y-auto p-1`,children:b.map(({locale:e,currentLocaleName:r,ownLocaleName:a})=>(0,z.jsx)(`li`,{className:`px-1.5 py-1`,children:(0,z.jsx)(j,{onClick:()=>x(e),label:`${n} ${r}`,disabled:!(d??d).includes(e),isActive:f.includes(e),variant:`hoverable`,color:`text`,isFullWidth:!0,textAlign:`left`,size:`sm`,children:(0,z.jsxs)(`div`,{className:`flex flex-row items-center justify-between gap-3 px-2 py-1`,children:[t&&(0,z.jsx)(`div`,{className:`w-4`,children:f.includes(e)&&(0,z.jsx)(i,{className:`size-full`})}),(0,z.jsxs)(`div`,{className:`flex flex-1 flex-row items-center justify-between gap-3 px-2 py-1`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col text-nowrap`,children:[(0,z.jsx)(`span`,{dir:Mt(e),lang:e,children:a}),(0,z.jsx)(`span`,{className:`text-neutral text-xs`,children:r})]}),(0,z.jsx)(`span`,{className:`text-neutral text-sm`,children:e.toUpperCase()})]})]})})},e))})]})]})})]})})},KO=$e(`flex items-center justify-center gap-1`,{variants:{size:{sm:`gap-1`,md:`gap-2`,lg:`gap-3`},color:{text:`background-text`,neutral:`background-neutral`},variant:{default:``,bordered:`rounded-lg border border-border p-2`,ghost:`bg-transparent`}},defaultVariants:{size:`md`,variant:`default`}}),qO=(e,t,n)=>{if(t<=n)return Array.from({length:t},(e,t)=>t+1);let r=[],i=Math.floor(n/2);if(r.push(1),e<=i+2){for(let e=2;e<=Math.min(n-1,t-1);e++)r.push(e);t>n&&r.push(`ellipsis`),t>1&&r.push(t)}else if(e>=t-i-1){t>n&&r.push(`ellipsis`);for(let e=Math.max(2,t-n+2);e<=t;e++)r.push(e)}else{r.push(`ellipsis`);let n=e-i,a=e+i;for(let e=n;e<=a;e++)r.push(e);r.push(`ellipsis`),r.push(t)}return r},JO=e=>e?.getAttribute(`aria-current`)===`true`,YO=e=>e===`sm`?`icon-sm`:e===`lg`?`icon-lg`:`icon-md`,XO=e=>(0,z.jsx)(`div`,{className:`absolute top-0 z-0 h-full w-auto rounded-xl bg-text/20 ring-4 ring-text/10 transition-[left,width] duration-300 ease-in-out [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl motion-reduce:transition-none`,...e}),ZO=({currentPage:e,totalPages:t,onPageChange:n,showFirstLast:r=!1,showPrevNext:i=!0,maxVisiblePages:a=5,disabled:o=!1,size:s=`md`,variant:c=`default`,color:l=`text`,className:u,...d})=>{let{goToNextPage:f,goToPreviousPage:p}=ce(`pagination`),m=qO(e,t,a),h=YO(s),g=e===1,_=e===t,v=(0,L.useRef)([]),y=(0,L.useRef)(null),{choiceIndicatorPosition:b,scheduleMeasurement:x}=O(v,{selector:JO,isHoverable:!0});if((0,L.useEffect)(()=>{let e=setTimeout(()=>{x()},300);return()=>clearTimeout(e)},[e,x]),t<=1)return null;let S=r=>{!o&&r>=1&&r<=t&&r!==e&&n(r)};return(0,z.jsx)(`div`,{className:I(KO({size:s,variant:c}),u),...d,children:(0,z.jsxs)(`div`,{className:`relative flex items-center gap-1`,children:[b&&(0,z.jsx)(XO,{style:b,ref:y}),i&&(0,z.jsx)(j,{variant:`outline`,size:h,color:`text`,onClick:()=>S(e-1),disabled:o||g,label:p.value,Icon:ec,ref:e=>{e&&(v.current[0]=e)},className:`min-w-0 px-2`}),(0,z.jsx)(`div`,{className:`flex items-center gap-1 max-md:gap-0.5`,children:m.map((t,n)=>{if(t===`ellipsis`){let e=n===m.indexOf(`ellipsis`)?`ellipsis-start`:`ellipsis-end`;return(0,z.jsx)(`div`,{className:`flex h-8 min-w-8 items-center justify-center px-1`,children:(0,z.jsx)(oc,{className:`h-4 w-4 text-muted-foreground`})},e)}let r=t===e,a=+!!i+m.slice(0,n).filter(e=>e!==`ellipsis`).length;return(0,z.jsx)(j,{variant:r?`default`:`outline`,size:h,color:`text`,onClick:()=>S(t),disabled:o,label:`Go to page ${t}`,"aria-current":r?`true`:`false`,ref:e=>{e&&(v.current[a]=e)},className:I(`flex aspect-square h-8 w-8 min-w-0 items-center justify-center p-0 text-sm`,s===`sm`&&`h-6 w-6 text-xs`,s===`lg`&&`size-10 text-base`,r&&`font-semibold`),children:t},t)})}),i&&(0,z.jsx)(j,{variant:`outline`,size:h,color:`text`,onClick:()=>S(e+1),disabled:o||_,label:f.value,Icon:nc,ref:e=>{let t=+!!i+m.filter(e=>e!==`ellipsis`).length;e&&(v.current[t]=e)},className:`min-w-0 px-2`})]})})},QO=e=>{let t=Rt(e),n=Ht(e);return t&&(n===`reactNode`||n===`file`)?!0:t&&typeof t.nodeType==`string`?QO(t[t.nodeType]):typeof t==`string`||typeof t==`number`||typeof t==`boolean`||t===void 0},$O=({children:e,onToggle:t,...n})=>{let[r,i]=(0,L.useState)(!1);return(0,z.jsx)(Fp,{...n,onToggle:e=>{e&&!r&&i(!0),t?.(e)},children:r?e:null})},ek=({section:e,keyPath:t,dictionary:n})=>{let{selectedLocales:r}=Lm(),i=Ft(e,t,Qf()),{addEditedContent:a}=ip(),{setFocusedContentKeyPath:o,focusedContent:s}=ep(),{addNewElement:c,goToField:l}=ce(`navigation-view`),u=Ht(i),d=e=>(s?.keyPath?.length??0)>0&&kt(e,s?.keyPath??[]),f=QO(i);if(!i)return(0,z.jsx)(z.Fragment,{});if(f)return(0,z.jsx)(j,{label:l.label.value,variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>o(t),IconRight:nc,children:At(t[t.length-1]?.key)});if(typeof i==`object`){if(u===`reactNode`)return(0,z.jsx)(z.Fragment,{children:`React Node`});if(u===`translation`)return(0,z.jsx)(`div`,{className:`flex flex-col justify-between gap-2`,children:r.map(r=>{let i=[...t,{type:ye,key:r}];return(0,z.jsx)(ek,{keyPath:i,section:e,dictionary:n},r)})});if(u===`enumeration`||u===`plural`||u===`condition`)return(0,z.jsx)(`div`,{className:`flex flex-col justify-between gap-2`,children:Object.keys(i[u]).map(r=>{let i=[...t,{type:u,key:r}];return(0,z.jsx)(ek,{keyPath:i,section:e,dictionary:n},r)})});if(u===`array`)return(0,z.jsxs)(`div`,{className:`flex flex-col justify-between gap-2`,children:[i.map((r,i)=>{let a=[...t,{type:k,key:i}];return QO(r)?(0,z.jsxs)(j,{label:`${l.label.value} ${i}`,variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>o(a),IconRight:nc,isActive:d(a),children:[`Item `,i]},JSON.stringify(a)):(0,z.jsx)($O,{label:`${l.label.value} ${i}`,header:`Item ${i}`,isActive:d(a),onClick:()=>o(a),children:(0,z.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,z.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,z.jsx)(ek,{keyPath:a,section:e,dictionary:n})})})},JSON.stringify(a))}),(0,z.jsx)(j,{label:c.label.value,variant:`hoverable`,color:`neutral`,textAlign:`left`,onClick:()=>{let e=[...t,{type:k,key:i.length}],r=i,s=Lt(r[r.length-1])??``;a(n.localId,s,e,!1),o(e)},Icon:gc,children:c.text})]});if(typeof i.nodeType==`string`){let r=[...t,{type:i.nodeType}];return(0,z.jsx)(ek,{keyPath:r,section:e,dictionary:n})}let s=Object.keys(i);return(0,z.jsx)(`div`,{className:`flex w-full max-w-full flex-col justify-between gap-2`,children:s.map(r=>{let i=[...t,{type:he,key:r}];return QO(Ft(e,i))?(0,z.jsx)(j,{label:`${l.label.value} ${r}`,isActive:d(i),variant:`hoverable`,color:`text`,className:`w-full`,onClick:()=>o(i),IconRight:nc,children:At(r)},r):(0,z.jsx)($O,{label:`${l.label.value} ${r}`,isActive:d(i),onClick:()=>o(i),header:At(r),children:(0,z.jsx)(`div`,{className:`mt-2 flex w-full max-w-full`,children:(0,z.jsx)(`div`,{className:`flex-1 pl-10`,children:(0,z.jsx)(ek,{keyPath:i,section:e,dictionary:n})})})},r)})})}return(0,z.jsxs)(z.Fragment,{children:[`Error loading section --`,u,`--`,JSON.stringify(i),`--`,JSON.stringify(t)]})},tk=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,nk=({dictionary:e})=>{let{itemPagination:t,variantSwitcher:n}=ce(`content-editor`),{editedContent:r}=ap(),{focusedContent:i,setFocusedContentKeyPath:a}=ep(),[,o]=(0,L.useTransition)(),s=e=>o(()=>a(e)),[c,l]=(0,L.useState)(e);(0,L.useEffect)(()=>{l(e)},[e]);let u=e.item!==void 0||e.variant!==void 0,{data:d}=Dp({keys:[e.key]},{enabled:u&&!!e.key}),f=(0,L.useMemo)(()=>d?.data??[],[d]),p=(0,L.useMemo)(()=>e.item===void 0?[]:f.filter(e=>e.item!==void 0).sort((e,t)=>(e.item??0)-(t.item??0)),[e,f]),m=(0,L.useMemo)(()=>e.variant===void 0?[]:f.filter(e=>e.variant!==void 0),[e,f]),h=(0,L.useCallback)(e=>{l(e),s([])},[s]),{content:g,key:_,localId:v}=c,y=i?.keyPath,b=r?.[v]?.content===void 0?g:r?.[v]?.content,x=Qf(),S=Ft(b,y??[],x),C=(0,L.useDeferredValue)(y),w=(0,L.useDeferredValue)(S),T=w!==S,E=QO(b),D=QO(w);(0,L.useEffect)(()=>{S===void 0&&s(i?.keyPath?.slice(0,-1)??[])},[]);let O=p.findIndex(e=>e.localId===c.localId),k=c.variant;return(0,z.jsxs)(`div`,{children:[u&&(0,z.jsxs)(`div`,{className:`mb-4 flex flex-wrap items-center gap-4`,children:[p.length>0&&(0,z.jsxs)(`div`,{className:`flex items-center gap-2`,children:[(0,z.jsx)(`span`,{className:`font-medium text-muted text-xs`,children:t.label}),(0,z.jsx)(ZO,{currentPage:O>=0?O+1:1,totalPages:p.length,onPageChange:e=>{let t=p[e-1];t&&h(t)},size:`sm`})]}),m.length>0&&(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2`,children:[(0,z.jsxs)(`span`,{className:`font-medium text-muted text-xs`,children:[n.label,`:`]}),m.map(e=>{let t=e.localId===c.localId;return(0,z.jsx)(`button`,{type:`button`,onClick:()=>!t&&h(e),className:`rounded-lg px-3 py-1 text-xs transition-colors ${t?`bg-text font-semibold text-foreground-opposite`:`cursor-pointer border border-border hover:bg-text/10`}`,children:tk(e.variant)},e.localId)}),k!==void 0&&!m.some(t=>t.localId===e.localId)&&(0,z.jsx)(`span`,{className:`rounded-lg bg-text px-3 py-1 font-semibold text-foreground-opposite text-xs`,children:tk(k)})]})]}),(0,z.jsxs)(`div`,{className:`mb-6 flex items-center justify-between gap-2`,children:[(0,z.jsx)(gD,{dictionaryKey:_,keyPath:y??[],onClickKeyPath:s}),(0,z.jsx)(`div`,{className:`flex items-center gap-2`,children:(0,z.jsx)(GO,{})})]}),(0,z.jsxs)(`div`,{className:`flex flex-1 gap-2 overflow-visible max-md:flex-col`,children:[typeof b==`object`&&b&&!E&&Object.keys(b).length>0&&(0,z.jsx)(Fe,{border:!0,background:`none`,className:`top-10 flex h-full flex-col items-start gap-0.5 overflow-auto p-2 md:sticky md:max-w-[50%]`,roundedSize:`2xl`,transparency:`xs`,children:(0,z.jsx)(ek,{keyPath:[],section:b,dictionary:c})}),(D||(C??[]).length>0)&&(0,z.jsx)(`div`,{className:T?`pointer-events-none flex-1 opacity-50 transition-opacity`:`flex-1 transition-opacity`,children:(0,z.jsx)(uh,{keyPath:C??[],section:w,dictionary:c})})]})]})},rk=({dictionary:e,mode:t,className:n,onDelete:r,onSave:i,...a})=>{let[o,s]=(0,L.useState)(!1),{setLocaleDictionary:c}=Zf(),{mutate:l,isPending:u}=kp(),{mutate:d,isPending:f}=jp(),{mutate:p,isPending:m}=Op(),h=f||m,{editedContent:g,restoreEditedContent:_}=ap(),{deleteButton:v,resetButton:y,saveButton:b,publishButton:x,downloadButton:S,confirmation:C}=ce(`save-dictionary-details`),{isAuthenticated:w}=yp(),{session:T}=vp(),E=(T?.permissions?.includes(`dictionary:admin`)||T?.permissions?.includes(`dictionary:write`))??!1,D=E,O=g?.[e.localId],k=O&&JSON.stringify(O)!==JSON.stringify(e),ee=e?.id!==void 0,A=async()=>{if(!g?.[e.localId])return;let t={...e,...g?.[e.localId]};d({dictionary:t},{onSuccess:()=>{c(g?.[e.localId]),_(e.localId),s(!1),i?.()}})},te=()=>{let t={...e,...g?.[e.localId]};p({dictionaries:[t]},{onSuccess:n=>{n&&(c(t),_(e.localId),i?.())}})},ne=()=>{e.id&&l({dictionaryId:e.id},{onSuccess:e=>{e&&r?.()}})};return(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Ne,{isOpen:o,title:C.title.value,size:`md`,onClose:()=>s(!1),padding:`md`,children:(0,z.jsxs)(`form`,{className:`size-full`,children:[(0,z.jsx)(`p`,{className:`py-4 text-muted-foreground text-sm`,children:C.message}),(0,z.jsxs)(`div`,{className:`mt-12 flex justify-end gap-2 max-md:flex-col`,children:[(0,z.jsx)(j,{label:C.cancelButton.label.value,disabled:!k||h,color:`text`,className:`max-md:w-full`,variant:`outline`,onClick:()=>s(!1),children:C.cancelButton.text}),(0,z.jsx)(j,{label:C.confirmButton.label.value,disabled:!k||h||!E,Icon:bc,color:`text`,className:`max-md:w-full`,isLoading:m,onClick:A,children:C.confirmButton.text})]})]})}),(0,z.jsxs)(`form`,{className:I(`flex justify-end gap-2`,n),...a,children:[t.includes(`remote`)&&ee&&r&&w&&(0,z.jsx)(j,{label:v.label.value,Icon:wc,color:`error`,variant:`outline`,className:`max-md:w-full`,isLoading:u,onClick:ne,disabled:!D,children:v.text}),k&&(0,z.jsx)(j,{label:y.label.value,disabled:!k,Icon:vc,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:()=>_(e.localId),children:y.text}),t.includes(`local`)&&(0,z.jsx)(j,{label:S.label.value,disabled:!k||h,Icon:ic,color:`text`,variant:w?`outline`:`default`,className:`max-md:w-full`,isLoading:f,onClick:()=>s(!0),children:S.text}),t.includes(`remote`)&&w&&!ee&&(0,z.jsx)(j,{label:x.label.value,disabled:h||!E,Icon:Qs,color:`text`,className:`max-md:w-full`,isLoading:m,onClick:te,children:x.text}),t.includes(`remote`)&&w&&ee&&k&&(0,z.jsx)(j,{label:b.label.value,disabled:!k||h||!E,Icon:bc,color:`text`,className:`max-md:w-full`,isLoading:m,onClick:te,children:b.text})]})]})},ik=(e,t=2e3,n,r)=>{let[i,a]=(0,L.useState)(!1);return{isCopied:i,copy:async()=>{if(e)try{if(navigator.clipboard?.writeText)await navigator.clipboard.writeText(e);else{r?.(Error(`Clipboard API not supported in this browser`));return}a(!0),setTimeout(()=>a(!1),t),n?.()}catch(e){let t=e instanceof Error?e.message:`Failed to copy to clipboard`;r?.(e instanceof Error?e:Error(t))}}}},ak=({text:e,children:t,className:n,"aria-label":r=`Copy to clipboard`,"aria-copied-label":i=`Copied to clipboard`,feedbackDuration:a=2e3,onCopySuccess:o,onCopyError:s,disable:c,preventDefault:l=!0,stopPropagation:u=!0,size:d=14})=>{let{isCopied:f,copy:p}=ik(e,a,o,s);if(c)return(0,z.jsx)(`span`,{className:n,children:t});let m=e=>{(e.key===`Enter`||e.key===` `)&&h(e)},h=e=>{l&&e.preventDefault(),u&&e.stopPropagation(),p()},g=f?i:r,_=f?ve:ge;return(0,z.jsxs)(`span`,{className:I(`inline-flex max-w-full cursor-pointer items-center gap-2 rounded-md p-0.5 hover:bg-neutral/10`,n),onClick:h,onKeyDown:m,role:`button`,tabIndex:0,"aria-label":g,"aria-pressed":f,"data-testid":`copy-to-clipboard`,children:[(0,z.jsx)(`span`,{className:`min-w-0 break-all`,children:t}),e&&(0,z.jsx)(_,{className:`ml-1 ml-auto shrink-0`,size:d,"aria-hidden":`true`})]})},ok=$e([`appearance-none`,`relative cursor-pointer border-2`,`focus:outline-0`,`checked:hover:opacity-80`,`ring-offset-background`,`hover:bg-neutral-500/10`,`disabled:opacity-50`,`ring-0 transition-all duration-300 ease-in-out hover:ring-4 focus-visible:ring-6`,`checked:before:absolute checked:before:inset-0 checked:before:content-['✓']`,`checked:before:flex checked:before:items-center checked:before:justify-center`,`checked:before:text-foreground-opposite/80`,`rounded-xl [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-2xl`,`after:absolute after:-inset-2 after:content-['']`].join(` `),{variants:{variant:{default:``},size:{xs:`size-3 rounded-sm`,sm:`size-4 rounded-md`,md:`size-5 rounded-lg`,lg:`size-6 rounded-xl`},color:{neutral:`border-neutral/30 text-muted-foreground ring-neutral/20 checked:border-neutral checked:bg-neutral`,light:`border-white/30 text-white ring-white/20 checked:border-white checked:bg-white`,text:`border-text/30 text-foreground ring-text/20 checked:border-text checked:bg-text`,"text-inverse":`border-text-inverse/30 text-foreground-inverse ring-text-inverse/20 checked:border-text-inverse checked:bg-text-inverse`,dark:`border-neutral-800/30 text-neutral-800 ring-neutral-800/20 checked:border-neutral-800 checked:bg-neutral-800`,error:`border-error/30 text-error ring-error/20 checked:border-error checked:bg-error`,success:`border-success/30 text-success ring-success/20 checked:border-success checked:bg-success`,custom:`border-custom/30 text-custom ring-custom/20 checked:border-custom checked:bg-custom`},validationStyleEnabled:{disabled:``,enabled:`valid:border-success invalid:border-error`}},defaultVariants:{variant:`default`,color:`text`,validationStyleEnabled:`disabled`,size:`md`}}),sk=({validationStyleEnabled:e=!1,label:t,size:n,color:r,name:i,variant:a,className:o,labelClassName:s,...c})=>(0,z.jsx)(`input`,{type:`checkbox`,className:I(ok({variant:a,size:n,color:r,validationStyleEnabled:e?`enabled`:`disabled`}),o),...c}),ck=e=>{let{label:t,name:n,id:r}=e;return t?(0,z.jsxs)(`label`,{htmlFor:r??n,className:I(`flex w-full cursor-pointer items-center gap-x-4 font-medium text-sm`,e.size===`xs`&&`text-xs`,e.labelClassName),children:[(0,z.jsx)(sk,{id:r??n,...e}),t]}):(0,z.jsx)(sk,{id:r??n,...e})},lk=e=>(0,z.jsx)(Qv,{id:e.name,"data-testid":e.name,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,Element:cm,...e}),uk=e=>(0,z.jsx)(Qv,{id:e.name,"data-testid":e.name,"aria-labelledby":e.label?`${e.name}-label`:void 0,"aria-label":e.label?void 0:e.name,Element:tm,...e}),dk=e=>{let{titleRequiredError:t,titleInvalidTypeError:n,titleMinLengthError:r,keyRequiredError:i,keyInvalidTypeError:a,keySpaceError:o,keyMinLengthError:s,descriptionRequiredError:c,descriptionInvalidTypeError:l,requiredErrorProjectId:u,invalidTypeErrorProjectId:d,invalidTypeErrorTags:f,locationRequiredError:p,locationInvalidTypeError:m,filePathRequiredError:h,filePathInvalidTypeError:g}=ce(`dictionary-detail-schema`);return PE({title:nE({error:e=>e.input===void 0?t.value:n.value}).refine(e=>e.length===0||e.length>=4,{error:r.value}).optional(),key:nE({error:e=>e.input===void 0?i.value:a.value}).min(4,{error:s.value}).regex(/^[a-zA-Z0-9-_]+$/,{error:o.value}).default(``),description:nE({error:e=>e.input===void 0?c.value:l.value}).optional(),projectIds:ME(nE({error:e=>e.input===void 0?u.value:d.value})).default([e]),tags:ME(nE({error:()=>f.value})).default([]),location:BE([`local`,`remote`,`hybrid`,`plugin`],{error:e=>e.input===void 0?p.value:m.value}).optional(),importMode:BE([`static`,`dynamic`,`fetch`]).optional(),filePath:nE({error:e=>e.input===void 0?h.value:g.value}).optional()})},fk=[`collection`,`variant`],pk=e=>{let t=[];return e.item!==void 0&&t.push(`collection`),e.variant!==void 0&&t.push(`variant`),t},mk=e=>typeof e==`object`&&e?JSON.stringify(e):e??``,hk=e=>{if(e.trim().startsWith(`{`))try{return{variant:JSON.parse(e),error:!1}}catch{return{variant:e,error:!0}}return{variant:e,error:!1}},gk=({dictionary:e,mode:t,onSelectSibling:n})=>{let{session:r}=vp(),{project:i}=r??{},{data:a,isLoading:o}=Mp(),{data:s}=Np(),c=a?.data??[],l=s?.data??[],u=dk(String(i?.id)),{form:d,isSubmitting:f}=gy(u,{defaultValues:{...e,location:e.location??`remote`}}),{editedContent:p,setEditedDictionary:h}=ap(),{titleInput:g,keyInput:_,descriptionInput:v,projectInput:y,tagsSelect:x,locationSelect:S,importModeSelect:C,filePathInput:w,auditButton:T,qualifierSection:E,siblingDictionaries:D,typeSwitch:O}=ce(`dictionary-details`),{mutate:k,isPending:ee}=Sp(),A=p?.[e.localId],{data:te,isLoading:ne}=Dp({keys:[e.key]},{enabled:!!e.key}),re=(0,L.useMemo)(()=>(te?.data??[]).filter(t=>t.localId!==e.localId),[te,e.localId]),ie=(0,L.useMemo)(()=>re.filter(e=>e.item!==void 0).sort((e,t)=>(e.item??0)-(t.item??0)),[re]),ae=(0,L.useMemo)(()=>re.filter(e=>e.variant!==void 0),[re]),oe=(0,L.useMemo)(()=>e.item===void 0?ie:[e,...ie].sort((e,t)=>(e.item??0)-(t.item??0)),[e,ie]),se=(0,L.useMemo)(()=>e.variant===void 0?ae:[e,...ae],[e,ae]);(0,L.useEffect)(()=>{d.reset({...e,tags:e.tags??[],location:e.location??`remote`}),me(pk(e)),ge(e.item??1),N(mk(e.variant)),ve(!1),be(!1)},[e,d?.reset]),(0,L.useEffect)(()=>{A===void 0&&d.reset({...e,tags:e.tags??[],location:e.location??`remote`})},[A]);let le=()=>{let t={...e,...A};k({fileContent:JSON.stringify(t)},{onSuccess:e=>{if(!e?.data)return;let n=e.data.fileContent,r={...t,...n,tags:n.tags??t.tags??[]};h(r),d.reset(r)}})},ue=j_({control:d.control,name:`location`}),de=ue===`local`||ue===`hybrid`,fe=re.length>0,[pe,me]=(0,L.useState)(()=>pk(e)),[he,ge]=(0,L.useState)(e.item??1),[M,N]=(0,L.useState)(mk(e.variant)),[_e,ve]=(0,L.useState)(!1),[ye,be]=(0,L.useState)(!1),xe=(0,L.useMemo)(()=>[...ie,...ae],[ie,ae]),P=t=>{let n=[t].flat(),r=n.filter(e=>!pe.includes(e)),i=pe.filter(e=>!n.includes(e)),a={...e,...A??{}};for(let e of i)e===`collection`&&(a={...a,item:void 0}),e===`variant`&&(a={...a,variant:void 0});for(let e of r)if(e===`collection`){let e=oe.length>0?Math.max(...oe.map(e=>e.item??0))+1:1;ge(e),a={...a,item:e}}else if(e===`variant`){let e=M||`default`;N(e),a={...a,variant:hk(e).variant}}me(n),h(a),ve(!1),n.length===0&&xe.length>0?be(!0):be(!1)};return(0,z.jsxs)(_y,{className:`flex w-full flex-col gap-8`,...d,schema:u,children:[(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,z.jsx)(lk,{name:`key`,label:_.label,placeholder:_.label.value,description:_.description,disabled:f,isRequired:!0,onSave:t=>{d.setValue(`key`,t,{shouldDirty:!0}),h({...e,...A??{},key:t})}}),(0,z.jsx)(lk,{name:`title`,label:g.label,placeholder:g.placeholder.value,description:g.description,disabled:f,onSave:t=>{d.setValue(`title`,t,{shouldDirty:!0}),h({...e,...A??{},title:t})}})]}),(0,z.jsx)(uk,{name:`description`,label:v.label,placeholder:v.placeholder.value,description:v.description,disabled:f,onSave:t=>{d.setValue(`description`,t,{shouldDirty:!0}),h({...e,...A??{},description:t})}}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 px-1 max-md:grid-cols-1`,children:[(0,z.jsx)(Vv,{control:d.control,name:`location`,render:({field:n})=>{let r=n.value,i=r===`local`||r===`hybrid`,a=r===`remote`||r===`hybrid`,o=t=>{if(!t&&!a)return;let r=t?a?`hybrid`:`local`:`remote`;n.onChange(r);let i=t?d.getValues(`filePath`)??e.filePath:void 0;t||d.setValue(`filePath`,void 0),h({...e,...A??{},location:r,filePath:i})},s=t=>{if(!t&&!i)return;let r=t?i?`hybrid`:`remote`:`local`;n.onChange(r),h({...e,...A??{},location:r})};return(0,z.jsxs)(Yg,{className:`flex flex-col gap-2 px-1`,children:[(0,z.jsx)(Yv,{className:`ml-1`,children:S.label}),(0,z.jsxs)(`div`,{className:`ml-2 flex items-center gap-4 py-2`,children:[(0,z.jsx)(ck,{id:`location-local`,name:`location-local`,label:S.local.value,color:`text`,checked:i,disabled:!t.includes(`local`)&&!t.includes(`remote`),onChange:e=>o(e.target.checked)}),(0,z.jsx)(ck,{id:`location-remote`,name:`location-remote`,label:S.remote.value,color:`text`,checked:a,disabled:!t.includes(`remote`)&&e.location!==`remote`&&e.location!==`hybrid`,onChange:e=>s(e.target.checked)})]}),(0,z.jsx)(Wv,{children:S.testDescription}),(0,z.jsx)(Gv,{})]})}}),(0,z.jsx)(Wc,{mode:`wait`,children:de&&(0,z.jsx)(b.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.3},children:(0,z.jsx)($v,{name:`filePath`,label:w.label.value,placeholder:w.placeholder.value,description:w.description.value,disabled:f||!de,onChange:t=>{let n=t.target.value;h({...e,...A??{},filePath:n})}})},`filePath-input`)})]}),(0,z.jsx)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:(0,z.jsxs)(ry,{name:`importMode`,label:C.label.value,description:C.description.value,onValueChange:t=>{d.setValue(`importMode`,t,{shouldDirty:!0}),h({...e,...A??{},importMode:t})},children:[(0,z.jsx)(F.Trigger,{children:(0,z.jsx)(F.Value,{placeholder:C.label.value})}),(0,z.jsxs)(F.Content,{children:[(0,z.jsx)(F.Item,{value:`static`,children:C.static.value}),(0,z.jsx)(F.Item,{value:`dynamic`,children:C.dynamic.value}),(0,z.jsx)(F.Item,{value:`live`,children:C.live.value})]})]})}),(0,z.jsxs)(`div`,{className:`grid grid-cols-2 gap-8 max-md:grid-cols-1`,children:[(0,z.jsxs)(ty,{name:`projectIds`,label:y.label.value,description:y.description,onValueChange:t=>{let n=[t].flat();d.setValue(`projectIds`,n,{shouldDirty:!0}),h({...e,...A??{},projectIds:n})},children:[(0,z.jsx)(Jg.Trigger,{getBadgeValue:e=>c?.find(t=>String(t.id)===e)?.name??e,children:(0,z.jsx)(Jg.Input,{placeholder:y.placeholder.value})}),(0,z.jsx)(Jg.Content,{children:(0,z.jsx)(m,{isLoading:o,children:(0,z.jsx)(Jg.List,{children:c?.map(e=>(0,z.jsx)(Jg.Item,{value:String(e.id),children:e.name},String(e.id)))})})})]}),(0,z.jsxs)(ty,{name:`tags`,label:x.label.value,description:x.description,onValueChange:t=>{let n=[t].flat();d.setValue(`tags`,n,{shouldDirty:!0}),h({...e,...A??{},tags:n})},children:[(0,z.jsx)(Jg.Trigger,{getBadgeValue:e=>l?.find(t=>String(t.key)===e)?.name??e,children:(0,z.jsx)(Jg.Input,{placeholder:x.placeholder.value})}),(0,z.jsx)(Jg.Content,{children:(0,z.jsx)(m,{isLoading:o,children:(0,z.jsx)(Jg.List,{children:l?.map(e=>(0,z.jsx)(Jg.Item,{value:String(e.key),children:e.name??e.key},String(e.key)))})})})]})]}),(0,z.jsxs)(Fe,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`card`,children:[(0,z.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,z.jsx)(`p`,{className:`ml-1 font-semibold text-sm`,children:O.label}),(0,z.jsx)(`p`,{className:`ml-1 text-muted text-xs`,children:O.description})]}),(0,z.jsxs)(Jg,{values:pe,onValueChange:P,className:`max-w-xs`,children:[(0,z.jsx)(Jg.Trigger,{getBadgeValue:e=>e===`collection`?String(O.collection):e===`variant`?String(O.variant):e,children:(0,z.jsx)(Jg.Input,{placeholder:O.label.value})}),(0,z.jsx)(Jg.Content,{children:(0,z.jsx)(Jg.List,{children:fk.map(e=>(0,z.jsx)(Jg.Item,{value:e,children:O[e].value},e))})})]}),(0,z.jsxs)(Wc,{children:[pe.includes(`collection`)&&(0,z.jsx)(b.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,z.jsx)(`label`,{htmlFor:`qualifier-item-value`,className:`ml-1 font-medium text-sm`,children:O.itemValueLabel}),(0,z.jsx)(Yp,{id:`qualifier-item-value`,type:`number`,min:1,value:he,placeholder:O.itemValuePlaceholder.value,onChange:t=>{let n=parseInt(t.target.value,10);!Number.isNaN(n)&&n>=1&&(ge(n),h({...e,...A??{},item:n}))}})]})},`item-input`),pe.includes(`variant`)&&(0,z.jsx)(b.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 px-1`,children:[(0,z.jsx)(`label`,{htmlFor:`qualifier-variant-value`,className:`ml-1 font-medium text-sm`,children:O.variantValueLabel}),(0,z.jsx)(Yp,{id:`qualifier-variant-value`,type:`text`,value:M,placeholder:O.variantValuePlaceholder.value,onChange:t=>{let n=t.target.value;N(n);let{variant:r,error:i}=hk(n);ve(i),i||h({...e,...A??{},variant:r})}}),_e&&(0,z.jsx)(`p`,{className:`ml-1 text-destructive text-xs`,children:O.variantJsonError})]})},`variant-input`),pe.length===0&&ye&&(0,z.jsx)(b.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:`auto`},exit:{opacity:0,height:0},transition:{duration:.2},children:(0,z.jsxs)(Fe,{background:`none`,border:!0,borderColor:`neutral`,roundedSize:`xl`,padding:`md`,className:`gap-3`,children:[(0,z.jsx)(`p`,{className:`font-medium text-sm`,children:O.disablePickerTitle}),(0,z.jsx)(`p`,{className:`text-muted text-xs`,children:O.disablePickerDescription}),(0,z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:xe.map(e=>(0,z.jsxs)(`button`,{type:`button`,onClick:()=>{n?.(e),be(!1)},className:`cursor-pointer rounded-lg border border-border px-3 py-1 text-xs transition-colors hover:bg-text/10`,children:[e.variant!==void 0&&(0,z.jsxs)(`span`,{children:[E.variant,`:`,` `,mk(e.variant)]}),e.item!==void 0&&(0,z.jsxs)(`span`,{children:[E.item,`: `,e.item]})]},e.localId))})]})},`sibling-picker`)]})]}),(0,z.jsxs)(Fe,{className:`gap-4`,padding:`md`,roundedSize:`2xl`,background:`none`,border:!0,borderColor:`neutral`,children:[(0,z.jsx)(`p`,{className:`font-semibold text-sm`,children:D.title}),(0,z.jsxs)(m,{isLoading:ne,children:[!fe&&(0,z.jsx)(`p`,{className:`text-muted text-sm`,children:D.noSiblings}),oe.length>0&&(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.collectionItems}),(0,z.jsx)(ZO,{currentPage:oe.findIndex(t=>t.localId===e.localId)+1||1,totalPages:oe.length,onPageChange:e=>{let t=oe[e-1];t&&n&&n(t)},showPrevNext:!0}),(0,z.jsx)(`div`,{className:`mt-1 flex flex-wrap gap-2`,children:oe.map(t=>{let r=t.localId===e.localId;return(0,z.jsxs)(`button`,{type:`button`,onClick:()=>!r&&n?.(t),className:I(`rounded-lg px-3 py-1 text-xs transition-colors`,r?`bg-text font-semibold text-foreground-opposite`:`cursor-pointer border border-border hover:bg-text/10`),children:[D.itemIndex,` `,t.item]},t.localId)})})]}),se.length>0&&(0,z.jsxs)(`div`,{className:`flex flex-col gap-2`,children:[(0,z.jsx)(`p`,{className:`font-medium text-muted text-xs uppercase tracking-wide`,children:D.variants}),(0,z.jsx)(`div`,{className:`flex flex-wrap gap-2`,children:se.map(t=>{let r=t.localId===e.localId;return(0,z.jsx)(`button`,{type:`button`,onClick:()=>!r&&n?.(t),className:I(`rounded-lg px-3 py-1 text-xs transition-colors`,r?`bg-text font-semibold text-foreground-opposite`:`cursor-pointer border border-border hover:bg-text/10`),children:mk(t.variant)},t.localId)})})]})]})]}),(0,z.jsx)(`div`,{className:`flex flex-wrap items-center justify-end gap-2 max-md:flex-col`,children:(0,z.jsx)(j,{type:`button`,size:`icon-md`,label:T.label.value,Icon:Ec,variant:`outline`,color:`text`,className:`max-md:w-full`,onClick:le,disabled:f||ee,isLoading:ee})})]})},_k=(0,L.lazy)(()=>Et(()=>import(`./dist-BHukwvnD.js`).then(e=>({default:e.Editor})),__vite__mapDeps([8,2,3]))),vk=({children:e,language:t,isDarkMode:n,showLineNumbers:r,showCopyButton:i=!0,isReadOnly:a=!1,onChange:o})=>{let s=(0,L.useRef)(null),c=(0,L.useRef)(null),[l,u]=(0,L.useState)({height:0,width:0}),d=n?`vs-dark-transparent`:`hc-light-theme`,f=(e,t)=>{c.current=e;let n=(e.getContentHeight()??0)+25;t.editor.defineTheme(`vs-dark-transparent`,{base:`vs-dark`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),t.editor.defineTheme(`hc-light-theme`,{base:`vs`,inherit:!0,rules:[],colors:{"editor.background":`#00000000`}}),t.editor.setTheme(d),t.languages.typescript.typescriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),t.languages.typescript.javascriptDefaults.setDiagnosticsOptions({noSemanticValidation:!0,noSyntaxValidation:!0}),t.languages.typescript.typescriptDefaults.setCompilerOptions({noLib:!0,allowNonTsExtensions:!0}),t.languages.typescript.javascriptDefaults.setCompilerOptions({noLib:!0,allowNonTsExtensions:!0}),u({height:n,width:s.current?.clientWidth??0})},p=r??(typeof e==`string`&&e.split(`
|
|
113
|
-
`).length>1);return(0,z.jsxs)(`div`,{className:I(`relative size-full text-sm`,r&&`ml-0`),children:[i&&(0,z.jsx)(`div`,{className:`sticky top-5 z-10`,children:(0,z.jsx)(`div`,{className:I(`absolute right-2 bottom-0 flex h-7 items-center`),children:(0,z.jsx)(Ve,{content:e})})}),(0,z.jsx)(`div`,{className:`z-0 grid size-full grid-cols-[0px] overflow-auto`,ref:s,children:(0,z.jsx)(L.Suspense,{fallback:(0,z.jsx)(m,{}),children:(0,z.jsx)(_k,{...l,defaultLanguage:`typescript`,language:t,loading:(0,z.jsx)(m,{}),defaultValue:String(e).replace(/\n$/,``),onMount:f,onChange:o,options:{contextmenu:!1,readOnly:a,cursorStyle:`line`,minimap:{enabled:!1},scrollbar:{vertical:`hidden`,verticalScrollbarSize:0,alwaysConsumeMouseWheel:!1},folding:!1,renderValidationDecorations:`off`,quickSuggestions:!1,parameterHints:{enabled:!1},suggestOnTriggerCharacters:!1,mouseWheelScrollSensitivity:0,fastScrollSensitivity:0,scrollBeyondLastLine:!1,lineNumbers:p?`on`:`off`},theme:d,className:`my-2 rounded-md`})})})]})},yk=({dictionary:e,isDarkMode:t})=>{let{setEditedContent:n,editedContent:r}=ap(),i=e=>{try{return JSON.parse(e),!0}catch{return!1}},a=r?.[e.localId]?.content??e?.content;return(0,z.jsx)(vk,{language:`json`,onChange:t=>{i(t??`{}`)&&n(e.localId,JSON.parse(t??`{}`))},isDarkMode:t,children:JSON.stringify(a,null,2)})},bk=({section:e,onValueChange:t})=>{let{multilingual:n,text:r,number:i,boolean:a,node:o,array:s,enumeration:c,plural:u,triggerPlaceHolder:d,nest:f,gender:p,select:m,condition:g,markdown:v,insertion:y,reactNode:b,file:S}=ce(`node-type-selector`),w=Ht(e),[T,E]=(0,L.useState)(w);return(0,z.jsxs)(F,{value:T,onValueChange:e=>{E(e),t(e)},children:[(0,z.jsx)(F.Trigger,{children:(0,z.jsx)(F.Value,{placeholder:d})}),(0,z.jsxs)(F.Content,{children:[(0,z.jsx)(F.Item,{value:ye,children:n}),(0,z.jsx)(F.Item,{value:M,children:r}),(0,z.jsx)(F.Item,{value:de,children:i}),(0,z.jsx)(F.Item,{value:A,children:a}),(0,z.jsx)(F.Item,{value:he,children:o}),(0,z.jsx)(F.Item,{value:k,children:s}),(0,z.jsx)(F.Item,{value:h,children:c}),(0,z.jsx)(F.Item,{value:_,children:u}),(0,z.jsx)(F.Item,{value:D,children:p}),(0,z.jsx)(F.Item,{value:C,children:m}),(0,z.jsx)(F.Item,{value:ot,children:y}),(0,z.jsx)(F.Item,{value:l,children:v}),(0,z.jsx)(F.Item,{value:pe,children:f}),(0,z.jsx)(F.Item,{value:re,children:g}),(0,z.jsx)(F.Item,{value:Ke,disabled:!0,children:b}),(0,z.jsx)(F.Item,{value:x,children:S})]})]})},xk=({section:e,dictionaryLocalId:t,keyPath:n,onNodeTypeChange:r})=>{let i=rp()?.internationalization?.locales??[],a=Ht(e),o=Rt(e),s=e=>{r(It(a,i,e))};if(a===`translation`||a===`condition`||a===`gender`||a===`select`||a===`enumeration`||a===`plural`){let c=Object.keys(e[a])[0],l=[...n,{type:a,key:c}];return(0,z.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,z.jsx)(bk,{section:e,onValueChange:e=>r(It(e,i))}),(0,z.jsx)(xk,{section:o,keyPath:l,dictionaryLocalId:t,onNodeTypeChange:s})]})}if(a===`array`){let c=[...n,{type:a,key:0}];return(0,z.jsxs)(`div`,{className:`flex w-full flex-col gap-1`,children:[(0,z.jsx)(bk,{section:e,onValueChange:e=>r(It(e,i))}),(0,z.jsx)(xk,{section:o,keyPath:c,dictionaryLocalId:t,onNodeTypeChange:s})]})}return a===`object`?(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(bk,{section:e,onValueChange:e=>r(It(e,i))}),(0,z.jsx)(`div`,{className:`mt-6 ml-10`,children:(0,z.jsx)(wk,{keyPath:n,section:e,dictionaryLocalId:t})})]}):(0,z.jsx)(bk,{section:e,onValueChange:e=>r(It(e,i))})},Sk=({sectionKey:e,section:t,keyPath:n,dictionaryLocalId:r})=>{let{focusedContent:i,setFocusedContentKeyPath:a}=ep(),{renameEditedContent:o,addEditedContent:s}=ip(),{titleInput:c,deleteButton:l}=ce(`structure-view`),u=e=>{o(r,e,n);let t=n.slice(0,-1),i=n[n.length-1],s=[...t,{...i,key:e}];a(s)};return(0,z.jsx)(Fe,{transparency:`xl`,roundedSize:`2xl`,className:`w-full min-w-80 gap-2 overflow-auto px-5 py-2`,border:!0,borderColor:`text`,background:`none`,"aria-selected":kt(n,i?.keyPath??[]),onClick:()=>a(n),children:(0,z.jsxs)(`div`,{className:`flex w-full flex-col items-start justify-between gap-3`,children:[typeof e==`string`&&(0,z.jsxs)(`div`,{className:`w-full`,children:[(0,z.jsxs)(`div`,{className:`flex w-full items-center justify-between gap-10`,children:[(0,z.jsx)(cm,{name:`key`,"aria-label":`Key`,placeholder:c.placeholder.value,defaultValue:e,onSave:e=>u(e),variant:`invisible`}),(0,z.jsx)(j,{label:l.label.value,variant:`hoverable`,size:`icon-sm`,color:`text`,className:`translate-x-2`,Icon:wc,onClick:()=>{s(r,void 0,n);let e=n.slice(0,-1);a(e)}})]}),(0,z.jsxs)(`span`,{className:`ml-3 text-muted-foreground text-sm`,children:[`( `,At(e),` )`]})]}),(0,z.jsx)(xk,{keyPath:n,dictionaryLocalId:r,section:t,onNodeTypeChange:e=>{s(r,e,n)}})]})})},Ck=({section:e,keyPath:t,dictionaryLocalId:n})=>{let{addNodeButton:r}=ce(`structure-view`),{setFocusedContentKeyPath:i}=ep(),{addEditedContent:a}=ip();return!e||typeof e!=`object`?(0,z.jsx)(`div`,{children:`Not an object`}):(0,z.jsxs)(`div`,{className:`flex flex-col gap-2 overflow-y-auto`,children:[(0,z.jsx)(`ul`,{className:`mr-auto flex flex-col gap-4`,children:Object.keys(e).map(r=>(0,z.jsx)(`li`,{className:`flex w-full`,children:(0,z.jsx)(Sk,{sectionKey:r,section:e?.[r],keyPath:[...t,{type:he,key:r}],dictionaryLocalId:n})},`${JSON.stringify(t)}-object-${r}`))}),(0,z.jsx)(j,{label:r.label.value,variant:`hoverable`,size:`md`,color:`text`,Icon:gc,className:`flex-1`,onClick:()=>{let e=[...t,{type:he,key:`newKey`}];a(n,``,e),i(e)},children:r.text})]})},wk=({section:e,keyPath:t,dictionaryLocalId:n})=>!e||typeof e!=`object`||typeof e.nodeType==`string`?(0,z.jsx)(Sk,{sectionKey:`content`,section:e,keyPath:t,dictionaryLocalId:n}):(0,z.jsx)(Ck,{section:e,keyPath:t,dictionaryLocalId:n}),Tk=({dictionary:e})=>{let{content:t,localId:n}=e,{editedContent:r}=ap(),i=r?.[n]?.content===void 0?t:r?.[n]?.content;return(0,z.jsx)(Sk,{section:i,keyPath:[],dictionaryLocalId:n})},Ek=({dictionary:e,onClickDictionaryList:t,isDarkMode:n,mode:r,onDelete:i,onSave:a,showReturnButton:o=!0,rightContent:s})=>{let c=rp(),{returnToDictionaryList:l}=ce(`dictionary-field-editor`),{focusedContent:u,setFocusedContent:d}=ep(),{setLocaleDictionary:f}=Zf(),[p,m]=(0,L.useState)(`content`);return(0,L.useEffect)(()=>{d({...u??{},dictionaryKey:e.key,dictionaryLocalId:e.localId}),f(e)},[]),(0,z.jsx)(Rm,{availableLocales:c?.internationalization?.locales??[],children:(0,z.jsxs)(`div`,{className:`relative flex h-full min-h-0 w-full flex-1 flex-col md:overflow-hidden`,children:[o&&(0,z.jsx)(j,{onClick:t,variant:`hoverable`,className:`z-10 mr-auto mb-6 ml-5 shrink-0`,color:`text`,Icon:Xs,label:l.label.value,children:l.text}),(0,z.jsxs)(`div`,{className:`mb-22 flex min-h-0 flex-1 flex-col overflow-hidden`,children:[(0,z.jsxs)(`div`,{className:`sticky top-0 z-10 flex shrink-0 gap-3 rounded-xl bg-background/20 p-3 pb-4`,children:[(0,z.jsx)(qe,{selectedChoice:p,tabs:[...r.includes(`remote`)?[(0,z.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`details`,onClick:()=>m(`details`),type:`button`,children:`Details`},`details`)]:[],(0,z.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`structure`,onClick:()=>m(`structure`),type:`button`,children:`Structure`},`structure`),(0,z.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`content`,onClick:()=>m(`content`),type:`button`,children:`Content`},`content`),(0,z.jsx)(`button`,{className:`cursor-pointer whitespace-nowrap rounded-md px-4 py-1 font-medium text-sm transition-colors focus:outline-none`,"data-active":p===`json`,onClick:()=>m(`json`),type:`button`,children:`JSON`},`json`)],hoverable:!0,color:`text`}),(0,z.jsx)(`div`,{className:`flex w-full items-center justify-end`,children:s})]}),(0,z.jsx)(`div`,{className:`min-h-0 flex-1 overflow-y-auto p-6`,children:(0,z.jsxs)(`div`,{className:`flex w-full min-w-0 flex-col items-stretch gap-6`,children:[r.includes(`remote`)&&p===`details`&&(0,z.jsx)(gk,{dictionary:e,mode:r}),p===`structure`&&(0,z.jsx)(Tk,{dictionary:e}),p===`content`&&(0,z.jsx)(nk,{dictionary:e}),p===`json`&&(0,z.jsx)(yk,{dictionary:e,isDarkMode:n})]})})]}),(0,z.jsx)(`div`,{className:`absolute bottom-3 z-20 w-full p-2`,children:(0,z.jsxs)(Fe,{color:`card`,roundedSize:`2xl`,padding:`sm`,className:`w-full shrink-0 flex-row flex-wrap items-center justify-end gap-10 bg-background/20 md:bottom-0`,children:[(0,z.jsx)(ak,{text:e.id,className:`text-nowrap text-muted-foreground text-sm`,size:9,children:e.id}),(0,z.jsx)(rk,{dictionary:e,mode:r,onDelete:()=>{d(null),i?.()},onSave:a})]})})]})})},Dk=new class{listeners=new Set;drawers={};subscribe=e=>(this.listeners.add(e),()=>{this.listeners.delete(e)});getSnapshot=()=>this.drawers;isOpen=e=>!!this.drawers[e];open=e=>{this.drawers[e]||(this.drawers={...this.drawers,[e]:!0},this.emit())};close=e=>{this.drawers[e]&&(this.drawers={...this.drawers,[e]:!1},this.emit())};set=e=>{let t=!1,n={...this.drawers};for(let[r,i]of Object.entries(e))n[r]!==i&&(n[r]=i,t=!0);t&&(this.drawers=n,this.emit())};emit=()=>{this.listeners.forEach(e=>{e()})}},Ok={open:Dk.open,close:Dk.close,set:Dk.set},kk=()=>!1,Ak=()=>Ok,jk=e=>{let t=(0,L.useCallback)(()=>Dk.isOpen(e),[e]);return(0,L.useSyncExternalStore)(Dk.subscribe,t,kk)},Mk=()=>{let e=(0,L.useSyncExternalStore)(Dk.subscribe,Dk.getSnapshot,()=>({}));return{...Ok,isOpen:t=>!!e[t]}},Nk={xs:480,sm:640,md:768,lg:1024,xl:1280,"2xl":1536},Pk=e=>typeof e==`number`?e:Nk[e]??Nk.md,Fk=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/android|bb\d+|meego|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(?:hone|od|ad)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(?:ob|in)i|palm(?: os)?|phone|p(?:ixi|re)\/|plucker|pocket|psp|series(?:4|6)0|symbian|treo|up\.(?:browser|link)|vodafone|wap|windows ce|windows phone|xda|xiino|zte-/i.test(e)},Ik=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/iP(?:hone|ad|od)/.test(e)},Lk=()=>{if(typeof window>`u`)return;let e=window.navigator?.userAgent;if(e!==void 0)return/Macintosh|MacIntel|Mac OS X/.test(e)},Rk=Object.freeze({isMobileScreen:void 0,isMobileUserAgent:void 0,isMobile:void 0,isIOS:void 0,isMac:void 0}),zk,Bk=()=>(zk??={isMobileUserAgent:Fk(),isIOS:Ik(),isMac:Lk()},zk),Vk=new Map,Hk=e=>{let t=window.matchMedia(`(max-width: ${e}px)`),n=new Set,r=e=>({...Bk(),isMobileScreen:e,isMobile:e}),i=r(t.matches),a=e=>i.isMobileScreen!==e&&(i=r(e),!0),o=e=>{if(a(e.matches))for(let e of n)e()};return{subscribe:e=>(n.size===0&&(a(t.matches),t.addEventListener(`change`,o)),n.add(e),()=>{n.delete(e),n.size===0&&t.removeEventListener(`change`,o)}),getSnapshot:()=>i}},Uk=e=>{let t=Vk.get(e);if(t)return t;let n=Hk(e);return Vk.set(e,n),n},Wk=()=>Rk,Gk=(e=`md`)=>{let t=Pk(e),n=(0,L.useCallback)(e=>Uk(t).subscribe(e),[t]),r=(0,L.useCallback)(()=>Uk(t).getSnapshot(),[t]);return(0,L.useSyncExternalStore)(n,r,Wk)},Kk=e=>e.split(` + `).map(e=>e.trim()),qk=e=>({"⌘":`Meta`,Ctrl:`Control`,Control:`Control`,Alt:`Alt`,"⌥":`Alt`,Shift:`Shift`,Meta:`Meta`,"↑":`ArrowUp`,"↓":`ArrowDown`,"←":`ArrowLeft`,"→":`ArrowRight`,ArrowUp:`ArrowUp`,ArrowDown:`ArrowDown`,ArrowLeft:`ArrowLeft`,ArrowRight:`ArrowRight`})[e]||e,Jk=(e,t)=>{let n=t.map(qk),r={Meta:n.includes(`Meta`),Control:n.includes(`Control`),Alt:n.includes(`Alt`),Shift:n.includes(`Shift`)};if(r.Meta!==e.metaKey||r.Control!==e.ctrlKey||r.Alt!==e.altKey||r.Shift!==e.shiftKey)return!1;let i=t.find(e=>![`⌘`,`Ctrl`,`Control`,`Alt`,`⌥`,`Shift`,`Meta`].includes(qk(e)));if(!i)return!1;let a=qk(i);return a.startsWith(`Arrow`)?e.key===a:e.key.toLowerCase()===a.toLowerCase()},Yk=e=>({ArrowUp:`↑`,ArrowDown:`↓`,ArrowLeft:`←`,ArrowRight:`→`})[e]||e,Xk=(e,t)=>{let n=e;return t?(n=n.replace(/Ctrl/g,`⌘`),n=n.replace(/Alt/g,`⌥`)):(n=n.replace(/⌘/g,`Ctrl`),n=n.replace(/⌥/g,`Alt`)),n=n.replace(/ArrowUp/g,`↑`),n=n.replace(/ArrowDown/g,`↓`),n=n.replace(/ArrowLeft/g,`←`),n=n.replace(/ArrowRight/g,`→`),n},Zk=({shortcut:e,onTriggered:t,display:n=!0,disabled:r=!1,className:i,size:a=`md`})=>{let{isMac:o}=Gk(),s=Kk(Xk(e,o??!1)),[c,l]=(0,L.useState)(new Set);if((0,L.useEffect)(()=>{let e=e=>{let n=e.target,i=n.tagName===`INPUT`||n.tagName===`TEXTAREA`||n.isContentEditable,a=e.key,c=new Set;if(e.metaKey&&c.add(`⌘`),e.ctrlKey&&c.add(`Ctrl`),e.altKey&&c.add(o?`⌥`:`Alt`),e.shiftKey&&c.add(`Shift`),a.startsWith(`Arrow`)?(c.add(a),c.add(Yk(a))):c.add(a.toUpperCase()),l(c),!r&&t&&Jk(e,s)){let n=s.includes(`Escape`);if(i&&!n)return;e.preventDefault(),t()}},n=()=>{l(new Set)};return window.addEventListener(`keydown`,e),window.addEventListener(`keyup`,n),window.addEventListener(`blur`,n),()=>{window.removeEventListener(`keydown`,e),window.removeEventListener(`keyup`,n),window.removeEventListener(`blur`,n)}},[s,t,o,r]),!n)return null;let u=e=>{let t=e.toUpperCase(),n=qk(e);return c.has(e)||c.has(t)||c.has(n)||e===`⌘`&&c.has(`Meta`)||e===`Ctrl`&&c.has(`Control`)||e===`⌥`&&c.has(`Alt`)||e===`Alt`&&c.has(`Alt`)||e===`←`&&c.has(`ArrowLeft`)||e===`→`&&c.has(`ArrowRight`)||e===`↑`&&c.has(`ArrowUp`)||e===`↓`&&c.has(`ArrowDown`)};return(0,z.jsx)(`kbd`,{className:I(`inline-flex items-center justify-center gap-0.5 p-0.5`,`rounded-lg [corner-shape:squircle] supports-[corner-shape:squircle]:rounded-xl`,`font-medium font-sans`,`border-1 text-neutral`,a===`sm`&&`text-xs`,a===`md`&&`text-sm`,a===`lg`&&`text-base`,i),children:s.map((t,n)=>{let r=`${t}-${n}-${e}`,i=Yk(t);return(0,z.jsxs)(`span`,{className:`inline-flex items-center`,children:[n>0&&(0,z.jsx)(`span`,{className:`text-neutral/50`,children:`+`}),(0,z.jsx)(`span`,{className:I(`min-w-4 px-0.5 text-center`,u(t)&&`scale-120 font-bold text-foreground`),suppressHydrationWarning:!0,children:i})]},r)})})},Qk=({children:e,isHidden:t,minWidth:n=0,align:r=`left`,isDisabled:i=!1,className:a,...o})=>{let s=t&&!i;return(0,z.jsx)(`div`,{className:I(`relative grid h-full grid-cols-[0fr] overflow-x-hidden overflow-y-hidden transition-[grid-template-columns] duration-500 ease-in-out`,s?``:`grid-cols-[1fr]`,a),"aria-hidden":s,inert:s?!0:void 0,...o,children:(0,z.jsx)(`div`,{style:{minWidth:`${n}px`},className:I(r===`right`&&`ml-auto`),children:e})})},$k=e=>{let t=e.getBoundingClientRect(),n=t.top,r=t.bottom-1;if(n>=0&&r<=window.innerHeight){let n=t.left+t.width/2,r=t.top+10,i=document.elementFromPoint(n,r);return e===i||e.contains(i)}return!1},eA=({title:e,identifier:t,children:n,header:r,footer:i,closeOnOutsideClick:a=!0,backButton:o,isOpen:s,onClose:c,container:l})=>{let u=ce(`right-drawer`),{isMobile:d}=Gk(`md`),f=(0,L.useRef)(null),p=(0,L.useRef)(null),m=De(l),{open:h,close:g}=Ak(),_=jk(t),v=_,[y,b]=(0,L.useState)(!1);(0,L.useEffect)(()=>{if(!v){b(!1);return}let e=0,t=requestAnimationFrame(()=>{e=requestAnimationFrame(()=>b(!0))});return()=>{cancelAnimationFrame(t),cancelAnimationFrame(e)}},[v]);let x=v&&y;Ce({disableScroll:v,key:t?`right_drawer_${t}`:`right_drawer`}),(0,L.useEffect)(()=>{if(!v)return;let e=e=>{try{if(!f.current)return;let n=a,r=e.target&&!f.current.contains(e.target),i=$k(f.current);(n&&r&&i||!e.target)&&(g(t),c?.())}catch{g(t),c?.()}};return window.addEventListener(`mousedown`,e),()=>window.removeEventListener(`mousedown`,e)},[v,g,c,a,t]);let S=(0,L.useRef)(c);return(0,L.useEffect)(()=>{S.current=c},[c]),(0,L.useEffect)(()=>{s!==void 0&&s!==_&&(s?h(t):(g(t),S.current?.()))},[s,_,t,h,g]),m?(0,$o.createPortal)((0,z.jsx)(`div`,{className:`fixed top-0 right-0 z-50 flex h-full justify-end`,children:(0,z.jsx)(Qk,{isHidden:!x,align:`right`,children:(0,z.jsxs)(Fe,{className:`relative flex h-screen w-screen flex-col border-l text-foreground md:w-100`,ref:f,roundedSize:`none`,borderColor:`neutral`,children:[(0,z.jsxs)(`div`,{className:`flex shrink-0 flex-col gap-3 px-6 pt-6`,children:[(0,z.jsxs)(`div`,{className:`flex justify-between gap-3`,children:[(0,z.jsx)(`div`,{children:o&&(0,z.jsx)(j,{variant:`hoverable`,color:`text`,label:o.text??u.goBack.value,onClick:o.onBack,Icon:ec,children:o?.text})}),(0,z.jsx)(`div`,{children:(0,z.jsxs)(Ze,{identifier:`close-drawer`,children:[(0,z.jsx)(j,{variant:`hoverable`,color:`text`,label:`Close`,className:`ml-auto`,onClick:()=>{g(t),c?.()},Icon:N,size:`icon-md`}),(0,z.jsx)(Ze.Detail,{identifier:`close-drawer`,children:(0,z.jsxs)(`div`,{className:`flex items-center gap-2 p-2`,children:[(0,z.jsx)(`span`,{className:`whitespace-nowrap text-muted-foreground text-xs`,children:u.closeDrawer}),(0,z.jsx)(Zk,{shortcut:`Escape`,size:`sm`,onTriggered:()=>{g(t),c?.()}})]})})]})})]}),e&&(0,z.jsx)(`h2`,{className:`flex items-center justify-center font-bold text-lg`,children:e}),r]}),(0,z.jsx)(`div`,{className:`flex min-h-0 flex-1 flex-col overflow-y-auto p-2`,children:(0,z.jsx)(`div`,{className:`flex flex-1 flex-col outline-none`,onClick:e=>{e.target===e.currentTarget&&d&&(g(t),c?.())},onKeyDown:e=>{e.target===e.currentTarget&&(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),d&&(g(t),c?.()))},ref:p,role:`button`,tabIndex:0,children:n})}),i&&(0,z.jsx)(`div`,{className:`shrink-0`,children:i})]})})}),m):(0,z.jsx)(z.Fragment,{})},tA=$e(`w-fit backdrop-blur`,{variants:{roundedSize:{none:`rounded-none`,sm:`rounded-sm`,md:`rounded-md`,lg:`rounded-lg`,xl:`rounded-xl`,xxl:`rounded-2xl`,xxxl:`rounded-3xl`,full:`rounded-full`},color:{success:`border-success bg-success/10 text-success`,error:`border-error bg-error/10 text-error`,warning:`border-warning bg-warning/10 text-warning`,neutral:`/10 border-neutral bg-neutral/10 text-neutral`,text:`border-text bg-text/10 text-foreground`,black:`border-black bg-black/10 text-black`,white:`border-white bg-white/10 text-white`},size:{xs:`border-[1.2px] px-2 py-0.5 text-xs`,sm:`border-[1.3px] px-2 py-0.5 text-sm`,md:`border-2 px-2 py-1 text-base`,lg:`border-2 px-3 py-2 text-lg`,xl:`border-2 px-3 py-2 text-xl`},border:{none:`border-none`,with:`border-[1.3px] border-text`},background:{none:`bg-none`,with:``}},defaultVariants:{roundedSize:`full`,border:`none`,color:`text`,size:`md`}}),nA=({children:e,color:t,roundedSize:n,size:r,border:i,background:a,className:o,...s})=>(0,z.jsx)(`div`,{className:tA({color:t,roundedSize:n,size:r,border:i,background:a,className:o}),...s,children:e}),rA=`dictionaryList`,iA=e=>`dictionary_edition_${e}`,aA=e=>{let t=(0,Yc.c)(23),n;t[0]===e?n=t[1]:(n=iA(e),t[0]=e,t[1]=n);let r=n,{isOpen:i,open:a,close:o}=Mk(),{getEditedContentValue:s}=ip(),{focusedContent:c,setFocusedContent:l}=ep(),u;t[2]!==c?.dictionaryKey||t[3]!==r||t[4]!==a?(u=()=>{c?.dictionaryKey&&a(r)},t[2]=c?.dictionaryKey,t[3]=r,t[4]=a,t[5]=u):u=t[5];let d=c?.dictionaryKey,f;t[6]!==r||t[7]!==a||t[8]!==d?(f=[d,a,r],t[6]=r,t[7]=a,t[8]=d,t[9]=f):f=t[9],(0,L.useEffect)(u,f);let p;t[10]!==i||t[11]!==r?(p=i(r),t[10]=i,t[11]=r,t[12]=p):p=t[12];let m;t[13]!==o||t[14]!==c||t[15]!==r||t[16]!==l?(m=()=>{o(r),c?.dictionaryKey&&l({...c,keyPath:[]})},t[13]=o,t[14]=c,t[15]=r,t[16]=l,t[17]=m):m=t[17];let h;return t[18]!==c||t[19]!==s||t[20]!==p||t[21]!==m?(h={isOpen:p,focusedContent:c,getEditedContentValue:s,close:m},t[18]=c,t[19]=s,t[20]=p,t[21]=m,t[22]=h):h=t[22],h},oA=e=>{let t=(0,Yc.c)(77),{dictionaryKey:n,isDarkMode:r}=e,{backButtonText:i,openDictionaryEditor:a,modalTitle:o,noDictionaryFocused:s,focusedDictionaryNotFound:c}=Wt($c),l;t[0]===n?l=t[1]:(l=iA(n),t[0]=n,t[1]=l);let u=l,{focusedContent:d,close:f}=aA(n),{setFocusedContent:p}=ep(),{open:m}=Mk(),h;t[2]===m?h=t[3]:(h=()=>m(rA),t[2]=m,t[3]=h);let g=h,{data:_}=Ap(),v;t[4]!==f||t[5]!==g||t[6]!==p?(v=()=>{f(),p(null),g()},t[4]=f,t[5]=g,t[6]=p,t[7]=v):v=t[7];let y=v,[b,x]=(0,L.useState)(!1),S;t[8]===y?S=t[9]:(S=()=>{x(!1),y()},t[8]=y,t[9]=S);let C=S;if(!d?.dictionaryKey){let e;return t[10]===s?e=t[11]:(e=(0,z.jsx)(`span`,{className:`mx-auto my-10 text-neutral text-sm`,children:s}),t[10]=s,t[11]=e),e}let w,T,E,D,O,k,ee,A,te,ne;if(t[12]!==i||t[13]!==f||t[14]!==d||t[15]!==c||t[16]!==y||t[17]!==u||t[18]!==a||t[19]!==p||t[20]!==_){O=Symbol.for(`react.early_return_sentinel`);bb0:{if(T=_?.[d.dictionaryKey]?.find(e=>e.localId===d?.dictionaryLocalId),!T){let e;t[31]===c?e=t[32]:(e=(0,z.jsx)(`span`,{className:`mx-auto my-10 text-neutral text-sm`,children:c}),t[31]=c,t[32]=e),O=e;break bb0}w=eA,ne=u,t[33]!==i.value||t[34]!==y?(E={onBack:y,text:i.value},t[33]=i.value,t[34]=y,t[35]=E):E=t[35],t[36]!==f||t[37]!==p?(D=()=>{f(),p(null)},t[36]=f,t[37]=p,t[38]=D):D=t[38];let e;t[39]===Symbol.for(`react.memo_cache_sentinel`)?(e=()=>x(!0),t[39]=e):e=t[39];let n;t[40]===a.label.value?n=t[41]:(n=(0,z.jsx)(j,{variant:`hoverable`,color:`text`,size:`icon-md`,IconRight:fc,label:a.label.value,onClick:e}),t[40]=a.label.value,t[41]=n);let r;t[42]===a.popoverContent?r=t[43]:(r=(0,z.jsx)(Ze.Detail,{identifier:`open-dictionary-editor`,children:(0,z.jsx)(`span`,{className:`whitespace-nowrap p-2 text-neutral text-xs`,children:a.popoverContent})}),t[42]=a.popoverContent,t[43]=r);let o;t[44]!==n||t[45]!==r?(o=(0,z.jsxs)(Ze,{identifier:`open-dictionary-editor`,children:[n,r]}),t[44]=n,t[45]=r,t[46]=o):o=t[46],te=(0,z.jsxs)(`header`,{className:`mb-5 flex w-full px-3`,children:[(0,z.jsx)(`h3`,{className:`w-full text-center text-lg`,children:T.title?T.title:T.key}),o]}),k=`flex flex-wrap items-center justify-center gap-x-4 gap-y-2 border-text/20 border-b border-dotted pb-3`,ee=(0,z.jsx)(nA,{color:`text`,roundedSize:`full`,size:`xs`,children:T.key}),A=T.filePath&&(0,z.jsx)(nA,{color:`blue`,roundedSize:`full`,size:`xs`,children:T.filePath.split(`/`).pop()})}t[12]=i,t[13]=f,t[14]=d,t[15]=c,t[16]=y,t[17]=u,t[18]=a,t[19]=p,t[20]=_,t[21]=w,t[22]=T,t[23]=E,t[24]=D,t[25]=O,t[26]=k,t[27]=ee,t[28]=A,t[29]=te,t[30]=ne}else w=t[21],T=t[22],E=t[23],D=t[24],O=t[25],k=t[26],ee=t[27],A=t[28],te=t[29],ne=t[30];if(O!==Symbol.for(`react.early_return_sentinel`))return O;let re;t[47]===T.id?re=t[48]:(re=T.id&&(0,z.jsx)(nA,{color:`purple`,roundedSize:`full`,size:`xs`,children:`remote`}),t[47]=T.id,t[48]=re);let ie;t[49]!==re||t[50]!==k||t[51]!==ee||t[52]!==A?(ie=(0,z.jsxs)(`div`,{className:k,children:[ee,A,re]}),t[49]=re,t[50]=k,t[51]=ee,t[52]=A,t[53]=ie):ie=t[53];let ae;t[54]!==ie||t[55]!==te?(ae=(0,z.jsxs)(z.Fragment,{children:[te,ie]}),t[54]=ie,t[55]=te,t[56]=ae):ae=t[56];let oe;t[57]===Symbol.for(`react.memo_cache_sentinel`)?(oe=[`local`,`remote`],t[57]=oe):oe=t[57];let se;t[58]!==T||t[59]!==y?(se=(0,z.jsx)(rk,{dictionary:T,mode:oe,className:`mb-4 flex-col px-3`,onDelete:y}),t[58]=T,t[59]=y,t[60]=se):se=t[60];let ce;t[61]!==T||t[62]!==b||t[63]!==d||t[64]!==y||t[65]!==r||t[66]!==o||t[67]!==C?(ce=d&&(0,z.jsxs)(z.Fragment,{children:[(0,z.jsx)(Ne,{isOpen:b,onClose:()=>x(!1),hasCloseButton:!0,title:o,size:`xl`,transparency:`lg`,className:`h-full`,children:(0,z.jsx)(`div`,{className:`flex h-full min-h-0 w-full flex-1 flex-col px-3 pt-5`,children:(0,z.jsx)(Ek,{dictionary:T,onClickDictionaryList:C,isDarkMode:r,mode:[`local`,`remote`],onDelete:()=>{x(!1),y()},onSave:()=>{x(!1)}})})}),(0,z.jsx)(hm,{dictionary:T})]}),t[61]=T,t[62]=b,t[63]=d,t[64]=y,t[65]=r,t[66]=o,t[67]=C,t[68]=ce):ce=t[68];let le;return t[69]!==w||t[70]!==E||t[71]!==D||t[72]!==ae||t[73]!==se||t[74]!==ce||t[75]!==ne?(le=(0,z.jsx)(w,{identifier:ne,backButton:E,onClose:D,header:ae,footer:se,children:ce}),t[69]=w,t[70]=E,t[71]=D,t[72]=ae,t[73]=se,t[74]=ce,t[75]=ne,t[76]=le):le=t[76],le},sA=e=>{let t=(0,Yc.c)(4),{isDarkMode:n}=e,{focusedContent:r}=ep(),i=r?.dictionaryKey;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,z.jsx)(z.Fragment,{}),t[0]=e):e=t[0],e}let a;return t[1]!==i||t[2]!==n?(a=(0,z.jsx)(oA,{dictionaryKey:i,isDarkMode:n}),t[1]=i,t[2]=n,t[3]=a):a=t[3],a},cA={key:`dictionary-list-drawer`,content:{nodeType:`translation`,translation:{en:{drawerTitle:{label:`Dictionary list`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Open dictionary editor {{dictionaryLocalId}}`}}},"en-GB":{drawerTitle:{label:`Dictionary list`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Open dictionary editor {{dictionaryLocalId}}`}}},fr:{drawerTitle:{label:`Liste des dictionnaires`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Ouvrir le dictionnaire dans l'éditeur {{dictionaryLocalId}}`}}},es:{drawerTitle:{label:`Lista de diccionarios`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Abrir el diccionario en el editor {{dictionaryLocalId}}`}}},de:{drawerTitle:{label:`Wörterbuchliste`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Wörterbuch-Editor öffnen {{dictionaryLocalId}}`}}},ja:{drawerTitle:{label:`辞書リスト`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`辞書エディタを開く {{dictionaryLocalId}}`}}},ko:{drawerTitle:{label:`사전 목록`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`사전 편집기 열기 {{dictionaryLocalId}}`}}},zh:{drawerTitle:{label:`字典列表`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`打开字典编辑器 {{dictionaryLocalId}}`}}},it:{drawerTitle:{label:`Lista dei dizionari`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Apri editor dizionario {{dictionaryLocalId}}`}}},pt:{drawerTitle:{label:`Lista de dicionários`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Abrir editor de dicionário {{dictionaryLocalId}}`}}},hi:{drawerTitle:{label:`शब्दकोश सूची`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`शब्दकोश संपादक खोलें {{dictionaryLocalId}}`}}},ar:{drawerTitle:{label:`قائمة القواميس`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`فتح محرر القاموس {{dictionaryLocalId}}`}}},ru:{drawerTitle:{label:`Список словарей`},buttonLabel:{label:{fields:[`dictionaryLocalId`],nodeType:`insertion`,insertion:`Открыть редактор словаря {{dictionaryLocalId}}`}}}}},location:`local`,localId:`dictionary-list-drawer::local::client/src/components/Editor/DictionaryListDrawer/dictionaryListDrawer.content.ts`,filePath:`client/src/components/Editor/DictionaryListDrawer/dictionaryListDrawer.content.ts`},lA=e=>{let{minChars:t=3,debounceMs:n=300,trim:r=!0,defaultValue:i,onSearch:a,onClear:o}=e??{},s=(0,L.useRef)(``),c=(0,L.useRef)(null),[l,u]=(0,L.useState)(i??``),d=()=>{c.current&&=(clearTimeout(c.current),null)};return(0,L.useEffect)(()=>()=>{d()},[]),{setSearch:e=>{s.current=e;let i=r?e.trim():e;if(d(),i.length<t){u(``),o?.();return}c.current=setTimeout(()=>{let e=r?s.current.trim():s.current;e.length>=t?(u(e),a?.(e)):(u(``),o?.())},n)},search:l,hasMinChars:l.length>=t}},uA=({className:e,...t})=>(0,z.jsxs)(`div`,{className:`relative flex w-full items-center gap-1`,children:[(0,z.jsx)(Sc,{className:`absolute left-2 size-4`}),(0,z.jsx)(Yp,{...t,type:`search`,className:I(`pl-8`,e)})]}),dA=()=>{let e=(0,Yc.c)(29),{drawerTitle:t,buttonLabel:n}=Wt(cA),{set:r}=Mk(),{localeDictionaries:i}=Xf(),{editedContent:a}=ap(),{setFocusedContent:o}=ep(),{setSearch:s,search:c}=lA(),l;e[0]===i?l=e[1]:(l=new UO(Object.values(i),{keys:[`key`,`title`,`filePath`,`description`,`tags`],threshold:.3,includeScore:!0}),e[0]=i,e[1]=l);let u=l,d;bb0:{if(!c||c.trim()===``){let t;e[2]===i?t=e[3]:(t=Object.values(i),e[2]=i,e[3]=t),d=t;break bb0}let t;e[4]!==u||e[5]!==c?(t=u.search(c).map(fA),e[4]=u,e[5]=c,e[6]=t):t=e[6],d=t}let f=d,p;e[7]!==r||e[8]!==o?(p=e=>{o({dictionaryKey:e.key,dictionaryLocalId:e.localId,keyPath:[]}),r({[rA]:!1,[iA(e.key)]:!0})},e[7]=r,e[8]=o,e[9]=p):p=e[9];let m=p,h;e[10]===a?h=e[11]:(h=e=>Object.keys(a??{}).includes(e),e[10]=a,e[11]=h);let g=h,_=t.label.value,v;e[12]===s?v=e[13]:(v=(0,z.jsx)(`div`,{className:`p-3 pb-4`,children:(0,z.jsx)(uA,{placeholder:`Search dictionaries`,onChange:e=>s(e.target.value),type:`search`})}),e[12]=s,e[13]=v);let y;if(e[14]!==n||e[15]!==f||e[16]!==m||e[17]!==g){let t;e[19]!==n||e[20]!==m||e[21]!==g?(t=e=>(0,z.jsx)(`li`,{className:`w-full`,children:(0,z.jsx)(j,{label:n.label({dictionaryLocalId:e.localId}).value,onClick:()=>m(e),variant:`hoverable`,color:`text`,IconRight:nc,size:`md`,isFullWidth:!0,Icon:g(e.localId)?mc:void 0,children:(0,z.jsx)(`div`,{className:`flex items-center gap-2 py-1`,children:(0,z.jsxs)(`div`,{className:`flex max-w-full flex-col gap-1`,children:[(0,z.jsxs)(`div`,{className:`flex flex-wrap items-center gap-2 py-1.5`,children:[(0,z.jsx)(nA,{color:`text`,roundedSize:`full`,size:`xs`,children:e.key}),e.filePath&&(0,z.jsx)(nA,{color:`blue`,roundedSize:`full`,size:`xs`,children:e.filePath.split(`/`).pop()}),e.id&&(0,z.jsx)(nA,{color:`purple`,roundedSize:`full`,size:`xs`,children:`remote`})]}),(0,z.jsx)(`span`,{children:(e.title??``).length>0?e.title:e.key})]})})})},e.localId),e[19]=n,e[20]=m,e[21]=g,e[22]=t):t=e[22],y=f.map(t),e[14]=n,e[15]=f,e[16]=m,e[17]=g,e[18]=y}else y=e[18];let b;e[23]===y?b=e[24]:(b=(0,z.jsx)(`ul`,{className:`flex flex-col gap-1`,children:y}),e[23]=y,e[24]=b);let x;return e[25]!==t.label.value||e[26]!==v||e[27]!==b?(x=(0,z.jsxs)(eA,{title:_,identifier:rA,children:[v,b]}),e[25]=t.label.value,e[26]=v,e[27]=b,e[28]=x):x=e[28],x};function fA(e){return e.item}var pA={key:`long-press-message`,content:{nodeType:`translation`,translation:{en:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press to edit the "{{dictionaryKey}}" dictionary`}},"en-GB":{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press to edit the "{{dictionaryKey}}" dictionary`}},fr:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Long press pour éditer le dictionnaire "{{dictionaryKey}}"`}},es:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Presiona largo para editar el diccionario "{{dictionaryKey}}"`}},de:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Lang press für Bearbeitung des Wörterbuchs "{{dictionaryKey}}"`}},ja:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`長押しして編集 "{{dictionaryKey}}" 辞書`}},ko:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`길게 눌러 편집 "{{dictionaryKey}}" 사전`}},zh:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`长按编辑 "{{dictionaryKey}}" 字典`}},it:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Premi a lungo per modificare il dizionario "{{dictionaryKey}}"`}},pt:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Pressione longa para editar o dicionário "{{dictionaryKey}}"`}},hi:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`लंग प्रेस करें टू एडिट "{{dictionaryKey}}"`}},ar:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`اضغط طويلاً للتعديل "{{dictionaryKey}}"`}},ru:{message:{fields:[`dictionaryKey`],nodeType:`insertion`,insertion:`Длительное нажатие для редактирования словаря "{{dictionaryKey}}"`}}}},location:`local`,localId:`long-press-message::local::client/src/components/Editor/LongPressMessage/index.content.ts`,filePath:`client/src/components/Editor/LongPressMessage/index.content.ts`},mA=()=>{let e=(0,Yc.c)(8),{message:t}=Wt(pA),[n]=Jf(af.INTLAYER_HOVERED_CONTENT_CHANGED,null),r=n?.dictionaryKey?`opacity-100`:`opacity-0`,i;e[0]===r?i=e[1]:(i=I(`rounded-2xl bg-neutral/30 px-3 py-1 font-bold text-sm text-text transition-opacity duration-100`,r),e[0]=r,e[1]=i);let a;e[2]!==n||e[3]!==t?(a=n?.dictionaryKey?t({dictionaryKey:n.dictionaryKey}):``,e[2]=n,e[3]=t,e[4]=a):a=e[4];let o;return e[5]!==i||e[6]!==a?(o=(0,z.jsx)(`div`,{className:i,children:a}),e[5]=i,e[6]=a,e[7]=o):o=e[7],o},hA=e=>{let t=(0,Yc.c)(5),{children:n}=e,r,i,a;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=(0,z.jsx)(`div`,{className:`absolute right-2 bottom-2`,children:(0,z.jsx)(mA,{})}),i=(0,z.jsx)(sA,{}),a=(0,z.jsx)(dA,{}),t[0]=r,t[1]=i,t[2]=a):(r=t[0],i=t[1],a=t[2]);let o;return t[3]===n?o=t[4]:(o=(0,z.jsxs)(`div`,{className:`relative size-full bg-card p-3`,children:[n,r,i,a]}),t[3]=n,t[4]=o),o},gA=()=>{let e=(0,Yc.c)(2),[t,n]=(0,L.useState)(),r,i;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(r=()=>{fetch(`/api/config`).then(_A).then(e=>n(e.data))},i=[],e[0]=r,e[1]=i):(r=e[0],i=e[1]),(0,L.useEffect)(r,i),t};function _A(e){return e.json()}var vA=e=>{let t=(0,Yc.c)(11),{children:n,iframeRef:r}=e,i=gA(),a=i?.editor.applicationURL;if(!i){let e;return t[0]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,z.jsx)(m,{}),t[0]=e):e=t[0],e}let o;t[1]!==a||t[2]!==r?(o=e=>{r.current?.contentWindow?.postMessage(e,a)},t[1]=a,t[2]=r,t[3]=o):o=t[3];let s;t[4]===a?s=t[5]:(s=[a],t[4]=a,t[5]=s);let c;return t[6]!==n||t[7]!==i||t[8]!==o||t[9]!==s?(c=(0,z.jsx)(tp,{postMessage:o,allowedOrigins:s,configuration:i,children:n}),t[6]=n,t[7]=i,t[8]=o,t[9]=s,t[10]=c):c=t[10],c},yA={key:`iframe-controller`,content:{nodeType:`translation`,translation:{en:{intlayerApplication:`Intlayer Application`,enableEditor:`Enable Editor`},"en-GB":{intlayerApplication:`Intlayer Application`,enableEditor:`Enable Editor`},fr:{intlayerApplication:`Application Intlayer`,enableEditor:`Activer l'éditeur`},es:{intlayerApplication:`Aplicación Intlayer`,enableEditor:`Activar el editor`},de:{intlayerApplication:`Intlayer-Anwendung`,enableEditor:`Editor aktivieren`},ja:{intlayerApplication:`Intlayerアプリケーション`,enableEditor:`エディタを有効にする`},ko:{intlayerApplication:`Intlayer 애플리케이션`,enableEditor:`에디터 활성화`},zh:{intlayerApplication:`Intlayer 应用程序`,enableEditor:`启用编辑器`},it:{intlayerApplication:`Applicazione Intlayer`,enableEditor:`Abilita l'editor`},pt:{intlayerApplication:`Aplicativo Intlayer`,enableEditor:`Ativar editor`},hi:{intlayerApplication:`इंटलेयर एप्लिकेशन`,enableEditor:`संपादक सक्षम करें`},ar:{intlayerApplication:`تطبيق Intlayer`,enableEditor:`تفعيل المحرر`},ru:{intlayerApplication:`Приложение Intlayer`,enableEditor:`Включить редактор`}}},location:`local`,localId:`iframe-controller::local::client/src/components/Editor/iframeController.content.ts`,filePath:`client/src/components/Editor/iframeController.content.ts`},bA=()=>{let e=(0,Yc.c)(9),{editedContent:t,setEditedContentState:n}=ap(),r;e[0]===n?r=e[1]:(r=()=>{let e=localStorage?.getItem(`INTLAYER_EDITED_CONTENT_CHANGED`);if(e)try{let t=JSON.parse(e);n(t)}catch(e){console.error(e)}},e[0]=n,e[1]=r);let i=r,a,o;e[2]===t?(a=e[3],o=e[4]):(a=()=>{t!==void 0&&localStorage?.setItem(`INTLAYER_EDITED_CONTENT_CHANGED`,JSON.stringify(t))},o=[t],e[2]=t,e[3]=a,e[4]=o),(0,L.useEffect)(a,o);let s;e[5]!==t||e[6]!==i?(s=()=>{t===void 0&&i()},e[5]=t,e[6]=i,e[7]=s):s=e[7];let c;return e[8]===Symbol.for(`react.memo_cache_sentinel`)?(c=[],e[8]=c):c=e[8],(0,L.useEffect)(s,c),i},xA={key:`no-application-url-view`,content:{nodeType:`translation`,translation:{en:{title:`Your project configuration do not includes application URL`,description:`To use the editor, you need to add the URL of the application to access to the configuration file.`,documentationLink:{label:`Click to go to the editor documentation`,text:`See how to configure the editor`}},"en-GB":{title:`Your project configuration do not includes application URL`,description:`To use the editor, you need to add the URL of the application to access to the configuration file.`,documentationLink:{label:`Click to go to the editor documentation`,text:`See how to configure the editor`}},fr:{title:`Votre configuration de projet ne comprend pas l’URL de l’application`,description:`Pour utiliser l’éditeur, vous devez ajouter l’URL de l’application pour accéder au fichier de configuration.`,documentationLink:{label:`Cliquez ici pour accéder à la documentation de l’éditeur`,text:`Voir comment configurer l’éditeur`}},es:{title:`Su configuración de proyecto no incluye la URL de la aplicación`,description:`Para usar el editor, debe agregar la URL de la aplicación para acceder al archivo de configuración.`,documentationLink:{label:`Haga clic aquí para acceder a la documentación del editor`,text:`Vea cómo configurar el editor`}},de:{title:`Ihre Projektkonfiguration enthält keine Anwendungs-URL`,description:`Um den Editor zu verwenden, müssen Sie die URL der Anwendung hinzufügen, um auf die Konfigurationsdatei zuzugreifen.`,documentationLink:{label:`Klicken Sie hier, um die Editor-Dokumentation zu besuchen`,text:`Siehe, wie man den Editor konfiguriert`}},ja:{title:`あなたのプロジェクト構成にはアプリケーション URL が含まれていません`,description:`エディターを使用するには、アプリケーションの URL を設定ファイルに追加する必要があります。`,documentationLink:{label:`エディターのドキュメントに移動するには、ここをクリックしてください`,text:`エディターの設定方法を見る`}},ko:{title:`당신의 프로젝트 구성에 앱 URL이 포함되어 있지 않습니다.`,description:`에디터를 사용하려면 설정 파일에 앱 URL을 추가해야 합니다.`,documentationLink:{label:`에디터 문서로 이동하려면 여기를 클릭하십시오.`,text:`에디터 설정 방법을 보십시오`}},zh:{title:`您的项目配置未包含应用程序 URL`,description:`要使用编辑器,您需要将应用程序 URL 添加到访问配置文件。`,documentationLink:{label:`点击此处访问编辑器文档`,text:`查看如何配置编辑器`}},it:{title:`La configurazione del progetto non include l’URL dell’applicazione`,description:`Per utilizzare l’editor, è necessario aggiungere l’URL dell’applicazione per accedere al file di configurazione.`,documentationLink:{label:`Fai clic qui per accedere alla documentazione dell’editor`,text:`Vedi come configurare l’editor`}},pt:{title:`Sua configuração do projeto não inclui a URL do aplicativo`,description:`Para usar o editor, você precisa adicionar a URL do aplicativo para acessar o arquivo de configuração.`,documentationLink:{label:`Clique aqui para acessar a documentação do editor`,text:`Veja como configurar o editor`}},hi:{title:`आपके प्रोजेक्ट कॉन्फ़िगरेशन में ऐप का URL शामिल नहीं है`,description:`एडिटर का उपयोग करने के लिए, आपको कॉन्फ़िगरेशन फ़ाइल तक ऐप का URL को जोड़ना होगा।`,documentationLink:{label:`एडिटर को डॉक्यूमेंट पर जाए रखना चाहते हैं?`,text:`एडिटर को काने के बारे में देखें`}},ar:{title:`تم إنشاء مشروعك بدون تضمين عنوان URL التطبيق`,description:`لاستخدام المحرر، يجب عليك إضافة عنوان URL التطبيق للوصول إلى ملف التكوين.`,documentationLink:{label:`انقر هنا للوصول إلى وثائق المحرر`,text:`انظر كيفية تكوين المحرر`}},ru:{title:`Ваша конфигурация проекта не включает URL-адрес приложения`,description:`Чтобы использовать редактор, вам необходимо добавить URL-адрес приложения для доступа к файлу конфигурации.`,documentationLink:{label:`Нажмите, чтобы перейти к документации редактора`,text:`Смотрите, как настроить редактор`}}}},location:`local`,localId:`no-application-url-view::local::client/src/components/Editor/NoApplicationURLView/noApplicationURLView.content.ts`,filePath:`client/src/components/Editor/NoApplicationURLView/noApplicationURLView.content.ts`},SA=()=>{let e=(0,Yc.c)(11),{title:t,description:n,documentationLink:r}=Wt(xA),i;e[0]===t?i=e[1]:(i=(0,z.jsx)(Ye,{className:`mb-8`,children:t}),e[0]=t,e[1]=i);let a;e[2]===n?a=e[3]:(a=(0,z.jsx)(`strong`,{className:`block text-neutral`,children:n}),e[2]=n,e[3]=a);let o;e[4]!==r.label.value||e[5]!==r.text?(o=(0,z.jsx)(Ue,{label:r.label.value,href:`https://intlayer.org/doc/concept/configuration#editor-configuration`,color:`text`,variant:`button`,className:`ml-auto`,isExternalLink:!0,children:r.text}),e[4]=r.label.value,e[5]=r.text,e[6]=o):o=e[6];let s;return e[7]!==i||e[8]!==a||e[9]!==o?(s=(0,z.jsxs)(`div`,{className:`flex flex-col gap-6`,children:[i,a,o]}),e[7]=i,e[8]=a,e[9]=o,e[10]=s):s=e[10],s},CA=e=>{let t=(0,Yc.c)(23),{iframeRef:n,applicationPath:r}=e,i=Wt(yA),{editor:a}=rp()??{},{enabled:o}=op(),s=sp();bA(),lp();let[c,l]=(0,L.useState)(!0),u;t[0]===Symbol.for(`react.memo_cache_sentinel`)?(u={receive:!0,emit:!1},t[0]=u):u=t[0];let[d]=Yf(void 0,u),f,p;if(t[1]===d?(f=t[2],p=t[3]):(f=()=>{typeof d==`string`&&window.history.replaceState({},``,d)},p=[d],t[1]=d,t[2]=f,t[3]=p),(0,L.useEffect)(f,p),!a?.applicationURL){let e;return t[4]===Symbol.for(`react.memo_cache_sentinel`)?(e=(0,z.jsx)(Fe,{className:`max-w-xl`,padding:`xl`,roundedSize:`2xl`,children:(0,z.jsx)(SA,{})}),t[4]=e):e=t[4],e}let h;t[5]===c?h=t[6]:(h=(0,z.jsx)(m,{isLoading:c}),t[5]=c,t[6]=h);let g=`${a.applicationURL}${r}`,_=i.intlayerApplication.value,v=c&&`hidden`,y;t[7]===v?y=t[8]:(y=I(`size-full`,v),t[7]=v,t[8]=y);let b;t[9]===Symbol.for(`react.memo_cache_sentinel`)?(b=()=>{l(!1)},t[9]=b):b=t[9];let x;t[10]!==i.intlayerApplication.value||t[11]!==n||t[12]!==g||t[13]!==y?(x=(0,z.jsx)(`iframe`,{src:g,title:_,sandbox:`allow-scripts allow-same-origin`,className:y,ref:n,onLoad:b}),t[10]=i.intlayerApplication.value,t[11]=n,t[12]=g,t[13]=y,t[14]=x):x=t[14];let S;t[15]!==i.enableEditor||t[16]!==o||t[17]!==s?(S=!o&&(0,z.jsx)(`div`,{className:`fixed right-4 bottom-4`,children:(0,z.jsx)(j,{label:i.enableEditor.value,onClick:s,color:`text`,children:i.enableEditor})}),t[15]=i.enableEditor,t[16]=o,t[17]=s,t[18]=S):S=t[18];let C;return t[19]!==x||t[20]!==S||t[21]!==h?(C=(0,z.jsxs)(`div`,{className:`relative size-full overflow-hidden rounded-lg`,children:[h,x,S]}),t[19]=x,t[20]=S,t[21]=h,t[22]=C):C=t[22],C},wA=()=>{let e=(0,Yc.c)(2),t=(0,L.useRef)(null),n=br(),r;return e[0]===n.pathname?r=e[1]:(r=(0,z.jsx)(vA,{iframeRef:t,children:(0,z.jsx)(nt,{disableEditor:!0,children:(0,z.jsx)(hA,{children:(0,z.jsx)(CA,{iframeRef:t,applicationPath:n.pathname})})})}),e[0]=n.pathname,e[1]=r),r};(0,Jc.createRoot)(document.getElementById(`root`)).render((0,z.jsx)(L.StrictMode,{children:(0,z.jsx)(()=>{let e=(0,Yc.c)(1),t;return e[0]===Symbol.for(`react.memo_cache_sentinel`)?(t=(0,z.jsx)(Qc,{children:(0,z.jsx)(Zc,{children:(0,z.jsx)(wA,{})})}),e[0]=t):t=e[0],t},{})}));export{ug as a,na as c,vg as i,Et as l,Ag as n,wp as o,gg as r,wc as s,zg as t};
|