@gouvfr-lasuite/ui-kit 0.0.1
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/LICENSE +21 -0
- package/README.md +1 -0
- package/dist/cunningham.ts +306 -0
- package/dist/index.cjs +101 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.ts +567 -0
- package/dist/index.js +15807 -0
- package/dist/index.js.map +1 -0
- package/dist/style.css +1 -0
- package/dist/vite.svg +1 -0
- package/package.json +97 -0
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const f=require("react"),hn=require("@openfun/cunningham-react"),Mt=require("react-dom");function eu(t){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const n in t)if(n!=="default"){const r=Object.getOwnPropertyDescriptor(t,n);Object.defineProperty(e,n,r.get?r:{enumerable:!0,get:()=>t[n]})}}return e.default=t,Object.freeze(e)}const x=eu(f),Gf=eu(Mt);function qf(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var Xn={exports:{}},En={};/**
|
|
2
|
+
* @license React
|
|
3
|
+
* react-jsx-runtime.production.min.js
|
|
4
|
+
*
|
|
5
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
+
*
|
|
7
|
+
* This source code is licensed under the MIT license found in the
|
|
8
|
+
* LICENSE file in the root directory of this source tree.
|
|
9
|
+
*/var Ba;function Yf(){if(Ba)return En;Ba=1;var t=f,e=Symbol.for("react.element"),n=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,i=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,o={key:!0,ref:!0,__self:!0,__source:!0};function a(s,l,u){var c,d={},h=null,g=null;u!==void 0&&(h=""+u),l.key!==void 0&&(h=""+l.key),l.ref!==void 0&&(g=l.ref);for(c in l)r.call(l,c)&&!o.hasOwnProperty(c)&&(d[c]=l[c]);if(s&&s.defaultProps)for(c in l=s.defaultProps,l)d[c]===void 0&&(d[c]=l[c]);return{$$typeof:e,type:s,key:h,ref:g,props:d,_owner:i.current}}return En.Fragment=n,En.jsx=a,En.jsxs=a,En}var wn={};/**
|
|
10
|
+
* @license React
|
|
11
|
+
* react-jsx-runtime.development.js
|
|
12
|
+
*
|
|
13
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
+
*
|
|
15
|
+
* This source code is licensed under the MIT license found in the
|
|
16
|
+
* LICENSE file in the root directory of this source tree.
|
|
17
|
+
*/var Wa;function Xf(){return Wa||(Wa=1,process.env.NODE_ENV!=="production"&&function(){var t=f,e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),i=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),a=Symbol.for("react.provider"),s=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),u=Symbol.for("react.suspense"),c=Symbol.for("react.suspense_list"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),g=Symbol.for("react.offscreen"),m=Symbol.iterator,p="@@iterator";function v(S){if(S===null||typeof S!="object")return null;var K=m&&S[m]||S[p];return typeof K=="function"?K:null}var y=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(S){{for(var K=arguments.length,U=new Array(K>1?K-1:0),G=1;G<K;G++)U[G-1]=arguments[G];$("error",S,U)}}function $(S,K,U){{var G=y.ReactDebugCurrentFrame,oe=G.getStackAddendum();oe!==""&&(K+="%s",U=U.concat([oe]));var le=U.map(function(re){return String(re)});le.unshift("Warning: "+K),Function.prototype.apply.call(console[S],console,le)}}var P=!1,D=!1,O=!1,I=!1,b=!1,R;R=Symbol.for("react.module.reference");function V(S){return!!(typeof S=="string"||typeof S=="function"||S===r||S===o||b||S===i||S===u||S===c||I||S===g||P||D||O||typeof S=="object"&&S!==null&&(S.$$typeof===h||S.$$typeof===d||S.$$typeof===a||S.$$typeof===s||S.$$typeof===l||S.$$typeof===R||S.getModuleId!==void 0))}function k(S,K,U){var G=S.displayName;if(G)return G;var oe=K.displayName||K.name||"";return oe!==""?U+"("+oe+")":U}function B(S){return S.displayName||"Context"}function E(S){if(S==null)return null;if(typeof S.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof S=="function")return S.displayName||S.name||null;if(typeof S=="string")return S;switch(S){case r:return"Fragment";case n:return"Portal";case o:return"Profiler";case i:return"StrictMode";case u:return"Suspense";case c:return"SuspenseList"}if(typeof S=="object")switch(S.$$typeof){case s:var K=S;return B(K)+".Consumer";case a:var U=S;return B(U._context)+".Provider";case l:return k(S,S.render,"ForwardRef");case d:var G=S.displayName||null;return G!==null?G:E(S.type)||"Memo";case h:{var oe=S,le=oe._payload,re=oe._init;try{return E(re(le))}catch{return null}}}return null}var T=Object.assign,j=0,W,Y,N,X,ie,de,M;function _(){}_.__reactDisabledLog=!0;function F(){{if(j===0){W=console.log,Y=console.info,N=console.warn,X=console.error,ie=console.group,de=console.groupCollapsed,M=console.groupEnd;var S={configurable:!0,enumerable:!0,value:_,writable:!0};Object.defineProperties(console,{info:S,log:S,warn:S,error:S,group:S,groupCollapsed:S,groupEnd:S})}j++}}function A(){{if(j--,j===0){var S={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:T({},S,{value:W}),info:T({},S,{value:Y}),warn:T({},S,{value:N}),error:T({},S,{value:X}),group:T({},S,{value:ie}),groupCollapsed:T({},S,{value:de}),groupEnd:T({},S,{value:M})})}j<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var z=y.ReactCurrentDispatcher,H;function L(S,K,U){{if(H===void 0)try{throw Error()}catch(oe){var G=oe.stack.trim().match(/\n( *(at )?)/);H=G&&G[1]||""}return`
|
|
18
|
+
`+H+S}}var q=!1,Q;{var ye=typeof WeakMap=="function"?WeakMap:Map;Q=new ye}function ve(S,K){if(!S||q)return"";{var U=Q.get(S);if(U!==void 0)return U}var G;q=!0;var oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var le;le=z.current,z.current=null,F();try{if(K){var re=function(){throw Error()};if(Object.defineProperty(re.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(re,[])}catch(Pe){G=Pe}Reflect.construct(S,[],re)}else{try{re.call()}catch(Pe){G=Pe}S.call(re.prototype)}}else{try{throw Error()}catch(Pe){G=Pe}S()}}catch(Pe){if(Pe&&G&&typeof Pe.stack=="string"){for(var te=Pe.stack.split(`
|
|
19
|
+
`),Te=G.stack.split(`
|
|
20
|
+
`),fe=te.length-1,pe=Te.length-1;fe>=1&&pe>=0&&te[fe]!==Te[pe];)pe--;for(;fe>=1&&pe>=0;fe--,pe--)if(te[fe]!==Te[pe]){if(fe!==1||pe!==1)do if(fe--,pe--,pe<0||te[fe]!==Te[pe]){var Re=`
|
|
21
|
+
`+te[fe].replace(" at new "," at ");return S.displayName&&Re.includes("<anonymous>")&&(Re=Re.replace("<anonymous>",S.displayName)),typeof S=="function"&&Q.set(S,Re),Re}while(fe>=1&&pe>=0);break}}}finally{q=!1,z.current=le,A(),Error.prepareStackTrace=oe}var zt=S?S.displayName||S.name:"",mt=zt?L(zt):"";return typeof S=="function"&&Q.set(S,mt),mt}function se(S,K,U){return ve(S,!1)}function Ce(S){var K=S.prototype;return!!(K&&K.isReactComponent)}function ne(S,K,U){if(S==null)return"";if(typeof S=="function")return ve(S,Ce(S));if(typeof S=="string")return L(S);switch(S){case u:return L("Suspense");case c:return L("SuspenseList")}if(typeof S=="object")switch(S.$$typeof){case l:return se(S.render);case d:return ne(S.type,K,U);case h:{var G=S,oe=G._payload,le=G._init;try{return ne(le(oe),K,U)}catch{}}}return""}var De=Object.prototype.hasOwnProperty,at={},be=y.ReactDebugCurrentFrame;function gt(S){if(S){var K=S._owner,U=ne(S.type,S._source,K?K.type:null);be.setExtraStackFrame(U)}else be.setExtraStackFrame(null)}function pi(S,K,U,G,oe){{var le=Function.call.bind(De);for(var re in S)if(le(S,re)){var te=void 0;try{if(typeof S[re]!="function"){var Te=Error((G||"React class")+": "+U+" type `"+re+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof S[re]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw Te.name="Invariant Violation",Te}te=S[re](K,re,G,U,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(fe){te=fe}te&&!(te instanceof Error)&&(gt(oe),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",G||"React class",U,re,typeof te),gt(null)),te instanceof Error&&!(te.message in at)&&(at[te.message]=!0,gt(oe),w("Failed %s type: %s",U,te.message),gt(null))}}}var vt=Array.isArray;function Ft(S){return vt(S)}function gi(S){{var K=typeof Symbol=="function"&&Symbol.toStringTag,U=K&&S[Symbol.toStringTag]||S.constructor.name||"Object";return U}}function Pf(S){try{return _a(S),!1}catch{return!0}}function _a(S){return""+S}function ka(S){if(Pf(S))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",gi(S)),_a(S)}var Na=y.ReactCurrentOwner,Of={key:!0,ref:!0,__self:!0,__source:!0},Ra,Ma;function If(S){if(De.call(S,"ref")){var K=Object.getOwnPropertyDescriptor(S,"ref").get;if(K&&K.isReactWarning)return!1}return S.ref!==void 0}function _f(S){if(De.call(S,"key")){var K=Object.getOwnPropertyDescriptor(S,"key").get;if(K&&K.isReactWarning)return!1}return S.key!==void 0}function kf(S,K){typeof S.ref=="string"&&Na.current}function Nf(S,K){{var U=function(){Ra||(Ra=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};U.isReactWarning=!0,Object.defineProperty(S,"key",{get:U,configurable:!0})}}function Rf(S,K){{var U=function(){Ma||(Ma=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",K))};U.isReactWarning=!0,Object.defineProperty(S,"ref",{get:U,configurable:!0})}}var Mf=function(S,K,U,G,oe,le,re){var te={$$typeof:e,type:S,key:K,ref:U,props:re,_owner:le};return te._store={},Object.defineProperty(te._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(te,"_self",{configurable:!1,enumerable:!1,writable:!1,value:G}),Object.defineProperty(te,"_source",{configurable:!1,enumerable:!1,writable:!1,value:oe}),Object.freeze&&(Object.freeze(te.props),Object.freeze(te)),te};function Af(S,K,U,G,oe){{var le,re={},te=null,Te=null;U!==void 0&&(ka(U),te=""+U),_f(K)&&(ka(K.key),te=""+K.key),If(K)&&(Te=K.ref,kf(K,oe));for(le in K)De.call(K,le)&&!Of.hasOwnProperty(le)&&(re[le]=K[le]);if(S&&S.defaultProps){var fe=S.defaultProps;for(le in fe)re[le]===void 0&&(re[le]=fe[le])}if(te||Te){var pe=typeof S=="function"?S.displayName||S.name||"Unknown":S;te&&Nf(re,pe),Te&&Rf(re,pe)}return Mf(S,te,Te,oe,G,Na.current,re)}}var vi=y.ReactCurrentOwner,Aa=y.ReactDebugCurrentFrame;function jt(S){if(S){var K=S._owner,U=ne(S.type,S._source,K?K.type:null);Aa.setExtraStackFrame(U)}else Aa.setExtraStackFrame(null)}var mi;mi=!1;function yi(S){return typeof S=="object"&&S!==null&&S.$$typeof===e}function La(){{if(vi.current){var S=E(vi.current.type);if(S)return`
|
|
22
|
+
|
|
23
|
+
Check the render method of \``+S+"`."}return""}}function Lf(S){return""}var Ka={};function Kf(S){{var K=La();if(!K){var U=typeof S=="string"?S:S.displayName||S.name;U&&(K=`
|
|
24
|
+
|
|
25
|
+
Check the top-level render call using <`+U+">.")}return K}}function Fa(S,K){{if(!S._store||S._store.validated||S.key!=null)return;S._store.validated=!0;var U=Kf(K);if(Ka[U])return;Ka[U]=!0;var G="";S&&S._owner&&S._owner!==vi.current&&(G=" It was passed a child from "+E(S._owner.type)+"."),jt(S),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',U,G),jt(null)}}function ja(S,K){{if(typeof S!="object")return;if(Ft(S))for(var U=0;U<S.length;U++){var G=S[U];yi(G)&&Fa(G,K)}else if(yi(S))S._store&&(S._store.validated=!0);else if(S){var oe=v(S);if(typeof oe=="function"&&oe!==S.entries)for(var le=oe.call(S),re;!(re=le.next()).done;)yi(re.value)&&Fa(re.value,K)}}}function Ff(S){{var K=S.type;if(K==null||typeof K=="string")return;var U;if(typeof K=="function")U=K.propTypes;else if(typeof K=="object"&&(K.$$typeof===l||K.$$typeof===d))U=K.propTypes;else return;if(U){var G=E(K);pi(U,S.props,"prop",G,S)}else if(K.PropTypes!==void 0&&!mi){mi=!0;var oe=E(K);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",oe||"Unknown")}typeof K.getDefaultProps=="function"&&!K.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function jf(S){{for(var K=Object.keys(S.props),U=0;U<K.length;U++){var G=K[U];if(G!=="children"&&G!=="key"){jt(S),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",G),jt(null);break}}S.ref!==null&&(jt(S),w("Invalid attribute `ref` supplied to `React.Fragment`."),jt(null))}}var za={};function Ha(S,K,U,G,oe,le){{var re=V(S);if(!re){var te="";(S===void 0||typeof S=="object"&&S!==null&&Object.keys(S).length===0)&&(te+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var Te=Lf();Te?te+=Te:te+=La();var fe;S===null?fe="null":Ft(S)?fe="array":S!==void 0&&S.$$typeof===e?(fe="<"+(E(S.type)||"Unknown")+" />",te=" Did you accidentally export a JSX literal instead of a component?"):fe=typeof S,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",fe,te)}var pe=Af(S,K,U,oe,le);if(pe==null)return pe;if(re){var Re=K.children;if(Re!==void 0)if(G)if(Ft(Re)){for(var zt=0;zt<Re.length;zt++)ja(Re[zt],S);Object.freeze&&Object.freeze(Re)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else ja(Re,S)}if(De.call(K,"key")){var mt=E(S),Pe=Object.keys(K).filter(function(Vf){return Vf!=="key"}),bi=Pe.length>0?"{key: someKey, "+Pe.join(": ..., ")+": ...}":"{key: someKey}";if(!za[mt+bi]){var Uf=Pe.length>0?"{"+Pe.join(": ..., ")+": ...}":"{}";w(`A props object containing a "key" prop is being spread into JSX:
|
|
26
|
+
let props = %s;
|
|
27
|
+
<%s {...props} />
|
|
28
|
+
React keys must be passed directly to JSX without using spread:
|
|
29
|
+
let props = %s;
|
|
30
|
+
<%s key={someKey} {...props} />`,bi,mt,Uf,mt),za[mt+bi]=!0}}return S===r?jf(pe):Ff(pe),pe}}function zf(S,K,U){return Ha(S,K,U,!0)}function Hf(S,K,U){return Ha(S,K,U,!1)}var Bf=Hf,Wf=zf;wn.Fragment=r,wn.jsx=Bf,wn.jsxs=Wf}()),wn}var Ua;function Jf(){return Ua||(Ua=1,process.env.NODE_ENV==="production"?Xn.exports=Yf():Xn.exports=Xf()),Xn.exports}var C=Jf();const Qf={alert:{close_aria_label:"Delete alert",expand_aria_label:"Expand alert",shrink_aria_label:"Shrink alert"},pagination:{goto_label:"Go to page",goto_label_aria:"Go to any page",next_aria:"Go to next page",previous_aria:"Go to previous page",goto_page_aria:"Go to page {page}",current_page_aria:"You are currently on page {page}"},datagrid:{empty:"This table is empty",empty_alt:"Illustration of an empty table",loader_aria:"Loading data",rows_selection_aria:"All rows selection",row_selection_aria:"Row selection"},provider:{test:"This is a test: {name}"},forms:{input:{password:{show_password:"Show password",hide_password:"Hide password"}},select:{toggle_button_aria_label:"Toggle dropdown",clear_button_aria_label:"Clear selection",clear_all_button_aria_label:"Clear all selections",menu_empty_placeholder:"No options available"},file_uploader:{delete_file_name:"Delete file {name}",delete_file:"Delete file",uploading:"Uploading...",caption:"Drag and drop or ",browse_files:"Browse files"},date_picker:{toggle_button_aria_label_open:"Open calendar",toggle_button_aria_label_close:"Close calendar",clear_button_aria_label:"Clear date",next_month_button_aria_label:"Next month",next_year_button_aria_label:"Next year",previous_month_button_aria_label:"Previous month",previous_year_button_aria_label:"Previous year",year_select_button_aria_label:"Select a year",month_select_button_aria_label:"Select a month"}},modals:{helpers:{delete_confirmation:{title:"Are you sure?",children:"Are you sure to delete this item?",cancel:"Cancel",delete:"Delete"},confirmation:{title:"Are you sure?",children:"Are you sure you want to do that?",cancel:"Cancel",yes:"Yes"},disclaimer:{title:"Disclaimer",children:"This is a disclaimer",ok:"Ok"}}}},Zf={components:Qf},eh={alert:{close_aria_label:"Supprimer l'alerte",expand_aria_label:"Ouvrir l'alerte",shrink_aria_label:"Fermer l'alerte"},pagination:{goto_label:"Aller à",goto_label_aria:"Aller à la page",next_aria:"Aller à la page suivante",previous_aria:"Aller à la page précédente",goto_page_aria:"Aller à la page {page}",current_page_aria:"Vous êtes actuellement sur la page {page}"},datagrid:{empty:"Ce tableau est vide",empty_alt:"Illustration d'un tableau vide",loader_aria:"Loading data"},provider:{test:"Ceci est un test : {name}"},forms:{select:{toggle_button_aria_label:"Ouvrir le menu",clear_button_aria_label:"Effacer la sélection",clear_all_button_aria_label:"Effacer toutes les sélections",menu_empty_placeholder:"Aucun choix disponible"},file_uploader:{delete_file_name:"Supprimer le fichier {name}",delete_file:"Supprimer le fichier",uploading:"Upload en cours ...",caption:"Glisser-déposer ou ",browse_files:"Parcourir"},date_picker:{toggle_button_aria_label_open:"Ouvrir le calendrier",toggle_button_aria_label_close:"Fermer le calendrier",clear_button_aria_label:"Effacer la date",next_month_button_aria_label:"Mois suivant",next_year_button_aria_label:"Année suivante",previous_month_button_aria_label:"Mois précédent",previous_year_button_aria_label:"Année précédente",year_select_button_aria_label:"Sélectionner une année",month_select_button_aria_label:"Sélectionner un mois"}}},th={components:eh},nh={},rh={};function Si(t){return t&&typeof t=="object"&&!Array.isArray(t)}function Or(t,...e){if(!e.length)return t;const n=e.shift();if(Si(t)&&Si(n))for(const r in n)Si(n[r])?(t[r]||Object.assign(t,{[r]:{}}),Or(t[r],n[r])):Object.assign(t,{[r]:n[r]});return Or(t,...e)}function tu(){return{enUS:Or(Zf,nh),frFR:Or(th,rh)}}const ih=t=>{const e=tu();return C.jsx(hn.CunninghamProvider,{theme:"dsfr",customLocales:e,...t})},oh=({disabled:t,onClick:e})=>C.jsx(hn.Button,{disabled:t,className:"pro-connect-button",onClick:e}),ae=typeof document<"u"?f.useLayoutEffect:()=>{};function ke(t){const e=f.useRef(null);return ae(()=>{e.current=t},[t]),f.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}function ah(t){let[e,n]=f.useState(t),r=f.useRef(null),i=ke(()=>{if(!r.current)return;let a=r.current.next();if(a.done){r.current=null;return}e===a.value?i():n(a.value)});ae(()=>{r.current&&i()});let o=ke(a=>{r.current=a(e),i()});return[e,o]}const Ir={prefix:String(Math.round(Math.random()*1e10)),current:0},nu=f.createContext(Ir),sh=f.createContext(!1);let lh=!!(typeof window<"u"&&window.document&&window.document.createElement),Ei=new WeakMap;function uh(t=!1){let e=f.useContext(nu),n=f.useRef(null);if(n.current===null&&!t){var r,i;let o=(i=f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED)===null||i===void 0||(r=i.ReactCurrentOwner)===null||r===void 0?void 0:r.current;if(o){let a=Ei.get(o);a==null?Ei.set(o,{id:e.current,state:o.memoizedState}):o.memoizedState!==a.state&&(e.current=a.id,Ei.delete(o))}n.current=++e.current}return n.current}function ch(t){let e=f.useContext(nu);e===Ir&&!lh&&console.warn("When server rendering, you must wrap your application in an <SSRProvider> to ensure consistent ids are generated between the client and server.");let n=uh(!!t),r=e===Ir&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${e.prefix}`;return t||`${r}-${n}`}function dh(t){let e=f.useId(),[n]=f.useState(yn()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Ir.prefix}`;return t||`${r}-${e}`}const fh=typeof f.useId=="function"?dh:ch;function hh(){return!1}function ph(){return!0}function gh(t){return()=>{}}function yn(){return typeof f.useSyncExternalStore=="function"?f.useSyncExternalStore(gh,hh,ph):f.useContext(sh)}let vh=!!(typeof window<"u"&&window.document&&window.document.createElement),ct=new Map;function Un(t){let[e,n]=f.useState(t),r=f.useRef(null),i=fh(e),o=f.useCallback(a=>{r.current=a},[]);return vh&&(ct.has(i)&&!ct.get(i).includes(o)?ct.set(i,[...ct.get(i),o]):ct.set(i,[o])),ae(()=>{let a=i;return()=>{ct.delete(a)}},[i]),f.useEffect(()=>{let a=r.current;a&&(r.current=null,n(a))}),i}function mh(t,e){if(t===e)return t;let n=ct.get(t);if(n)return n.forEach(i=>i(e)),e;let r=ct.get(e);return r?(r.forEach(i=>i(t)),t):e}function wi(t=[]){let e=Un(),[n,r]=ah(e),i=f.useCallback(()=>{r(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,r]);return ae(i,[e,i,...t]),n}function An(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const ce=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},We=t=>t&&"window"in t&&t.window===t?t:ce(t).defaultView||window;function ru(t){var e,n,r="";if(typeof t=="string"||typeof t=="number")r+=t;else if(typeof t=="object")if(Array.isArray(t)){var i=t.length;for(e=0;e<i;e++)t[e]&&(n=ru(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function At(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=ru(t))&&(r&&(r+=" "),r+=e);return r}function Ee(...t){let e={...t[0]};for(let n=1;n<t.length;n++){let r=t[n];for(let i in r){let o=e[i],a=r[i];typeof o=="function"&&typeof a=="function"&&i[0]==="o"&&i[1]==="n"&&i.charCodeAt(2)>=65&&i.charCodeAt(2)<=90?e[i]=An(o,a):(i==="className"||i==="UNSAFE_className")&&typeof o=="string"&&typeof a=="string"?e[i]=At(o,a):i==="id"&&o&&a?e.id=mh(o,a):e[i]=a!==void 0?a:o}}return e}function iu(...t){return t.length===1&&t[0]?t[0]:e=>{for(let n of t)typeof n=="function"?n(e):n!=null&&(n.current=e)}}const yh=new Set(["id"]),bh=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Sh=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),Eh=/^(data-.*)$/;function Ve(t,e={}){let{labelable:n,isLink:r,propNames:i}=e,o={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(yh.has(a)||n&&bh.has(a)||r&&Sh.has(a)||i!=null&&i.has(a)||Eh.test(a))&&(o[a]=t[a]);return o}function nt(t){if(wh())t.focus({preventScroll:!0});else{let e=xh(t);t.focus(),$h(e)}}let Jn=null;function wh(){if(Jn==null){Jn=!1;try{document.createElement("div").focus({get preventScroll(){return Jn=!0,!0}})}catch{}}return Jn}function xh(t){let e=t.parentNode,n=[],r=document.scrollingElement||document.documentElement;for(;e instanceof HTMLElement&&e!==r;)(e.offsetHeight<e.scrollHeight||e.offsetWidth<e.scrollWidth)&&n.push({element:e,scrollTop:e.scrollTop,scrollLeft:e.scrollLeft}),e=e.parentNode;return r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft}),n}function $h(t){for(let{element:e,scrollTop:n,scrollLeft:r}of t)e.scrollTop=n,e.scrollLeft=r}function Gr(t){var e;return typeof window>"u"||window.navigator==null?!1:((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.brands.some(n=>t.test(n.brand)))||t.test(window.navigator.userAgent)}function Uo(t){var e;return typeof window<"u"&&window.navigator!=null?t.test(((e=window.navigator.userAgentData)===null||e===void 0?void 0:e.platform)||window.navigator.platform):!1}function ot(t){let e=null;return()=>(e==null&&(e=t()),e)}const Tt=ot(function(){return Uo(/^Mac/i)}),Ch=ot(function(){return Uo(/^iPhone/i)}),ou=ot(function(){return Uo(/^iPad/i)||Tt()&&navigator.maxTouchPoints>1}),qr=ot(function(){return Ch()||ou()}),Th=ot(function(){return Tt()||qr()}),au=ot(function(){return Gr(/AppleWebKit/i)&&!su()}),su=ot(function(){return Gr(/Chrome/i)}),Vo=ot(function(){return Gr(/Android/i)}),Dh=ot(function(){return Gr(/Firefox/i)}),Ph=f.createContext({isNative:!0,open:Ih,useHref:t=>t});function Yr(){return f.useContext(Ph)}function Dt(t,e,n=!0){var r,i;let{metaKey:o,ctrlKey:a,altKey:s,shiftKey:l}=e;Dh()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&t.target==="_blank"&&(Tt()?o=!0:a=!0);let u=au()&&Tt()&&!ou()?new KeyboardEvent("keydown",{keyIdentifier:"Enter",metaKey:o,ctrlKey:a,altKey:s,shiftKey:l}):new MouseEvent("click",{metaKey:o,ctrlKey:a,altKey:s,shiftKey:l,bubbles:!0,cancelable:!0});Dt.isOpening=n,nt(t),t.dispatchEvent(u),Dt.isOpening=!1}Dt.isOpening=!1;function Oh(t,e){if(t instanceof HTMLAnchorElement)e(t);else if(t.hasAttribute("data-href")){let n=document.createElement("a");n.href=t.getAttribute("data-href"),t.hasAttribute("data-target")&&(n.target=t.getAttribute("data-target")),t.hasAttribute("data-rel")&&(n.rel=t.getAttribute("data-rel")),t.hasAttribute("data-download")&&(n.download=t.getAttribute("data-download")),t.hasAttribute("data-ping")&&(n.ping=t.getAttribute("data-ping")),t.hasAttribute("data-referrer-policy")&&(n.referrerPolicy=t.getAttribute("data-referrer-policy")),t.appendChild(n),e(n),t.removeChild(n)}}function Ih(t,e){Oh(t,n=>Dt(n,e))}function lu(t){let e=Yr();var n;const r=e.useHref((n=t==null?void 0:t.href)!==null&&n!==void 0?n:"");return{href:t!=null&&t.href?r:void 0,target:t==null?void 0:t.target,rel:t==null?void 0:t.rel,download:t==null?void 0:t.download,ping:t==null?void 0:t.ping,referrerPolicy:t==null?void 0:t.referrerPolicy}}let en=new Map,co=new Set;function Va(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{if(!t(r)||!r.target)return;let i=en.get(r.target);i||(i=new Set,en.set(r.target,i),r.target.addEventListener("transitioncancel",n,{once:!0})),i.add(r.propertyName)},n=r=>{if(!t(r)||!r.target)return;let i=en.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),en.delete(r.target)),en.size===0)){for(let o of co)o();co.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?Va():document.addEventListener("DOMContentLoaded",Va));function uu(t){requestAnimationFrame(()=>{en.size===0?t():co.add(t)})}function cu(){let t=f.useRef(new Map),e=f.useCallback((i,o,a,s)=>{let l=s!=null&&s.once?(...u)=>{t.current.delete(a),a(...u)}:a;t.current.set(a,{type:o,eventTarget:i,fn:l,options:s}),i.addEventListener(o,l,s)},[]),n=f.useCallback((i,o,a,s)=>{var l;let u=((l=t.current.get(a))===null||l===void 0?void 0:l.fn)||a;i.removeEventListener(o,u,s),t.current.delete(a)},[]),r=f.useCallback(()=>{t.current.forEach((i,o)=>{n(i.eventTarget,i.type,o,i.options)})},[n]);return f.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}}function Go(t,e){let{id:n,"aria-label":r,"aria-labelledby":i}=t;return n=Un(n),i&&r?i=[...new Set([n,...i.trim().split(/\s+/)])].join(" "):i&&(i=i.trim().split(/\s+/).join(" ")),!r&&!i&&e&&(r=e),{id:n,"aria-label":r,"aria-labelledby":i}}function bn(t){const e=f.useRef(null);return f.useMemo(()=>({get current(){return e.current},set current(n){e.current=n,typeof t=="function"?t(n):t&&(t.current=n)}}),[t])}function Ga(t,e){const n=f.useRef(!0),r=f.useRef(null);ae(()=>(n.current=!0,()=>{n.current=!1}),[]),ae(()=>{n.current?n.current=!1:(!r.current||e.some((i,o)=>!Object.is(i,r[o])))&&t(),r.current=e},e)}function _h(){return typeof window.ResizeObserver<"u"}function qa(t){const{ref:e,box:n,onResize:r}=t;f.useEffect(()=>{let i=e==null?void 0:e.current;if(i)if(_h()){const o=new window.ResizeObserver(a=>{a.length&&r()});return o.observe(i,{box:n}),()=>{i&&o.unobserve(i)}}else return window.addEventListener("resize",r,!1),()=>{window.removeEventListener("resize",r,!1)}},[r,e,n])}function kh(t,e){ae(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function Ln(t,e){if(!t)return!1;let n=window.getComputedStyle(t),r=/(auto|scroll)/.test(n.overflow+n.overflowX+n.overflowY);return r&&e&&(r=t.scrollHeight!==t.clientHeight||t.scrollWidth!==t.clientWidth),r}function du(t,e){let n=t;for(Ln(n,e)&&(n=n.parentElement);n&&!Ln(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function Nh(t,e){const n=[];for(;t&&t!==document.documentElement;)Ln(t,e)&&n.push(t),t=t.parentElement;return n}let Rh=0;const xi=new Map;function Mh(t){let[e,n]=f.useState();return ae(()=>{if(!t)return;let r=xi.get(t);if(r)n(r.element.id);else{let i=`react-aria-description-${Rh++}`;n(i);let o=document.createElement("div");o.id=i,o.style.display="none",o.textContent=t,document.body.appendChild(o),r={refCount:0,element:o},xi.set(t,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),xi.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}function Qn(t,e,n,r){let i=ke(n),o=n==null;f.useEffect(()=>{if(o||!t.current)return;let a=t.current;return a.addEventListener(e,i,r),()=>{a.removeEventListener(e,i,r)}},[t,e,r,o,i])}function fu(t,e){let n=Ya(t,e,"left"),r=Ya(t,e,"top"),i=e.offsetWidth,o=e.offsetHeight,a=t.scrollLeft,s=t.scrollTop,{borderTopWidth:l,borderLeftWidth:u,scrollPaddingTop:c,scrollPaddingRight:d,scrollPaddingBottom:h,scrollPaddingLeft:g}=getComputedStyle(t),m=a+parseInt(u,10),p=s+parseInt(l,10),v=m+t.clientWidth,y=p+t.clientHeight,w=parseInt(c,10)||0,$=parseInt(h,10)||0,P=parseInt(d,10)||0,D=parseInt(g,10)||0;n<=a+D?a=n-parseInt(u,10)-D:n+i>v-P&&(a+=n+i-v+P),r<=p+w?s=r-parseInt(l,10)-w:r+o>y-$&&(s+=r+o-y+$),t.scrollLeft=a,t.scrollTop=s}function Ya(t,e,n){const r=n==="left"?"offsetLeft":"offsetTop";let i=0;for(;e.offsetParent&&(i+=e[r],e.offsetParent!==t);){if(e.offsetParent.contains(t)){i-=t[r];break}e=e.offsetParent}return i}function Xa(t,e){if(t&&document.contains(t)){let a=document.scrollingElement||document.documentElement;if(window.getComputedStyle(a).overflow==="hidden"){let l=Nh(t);for(let u of l)fu(u,t)}else{var n;let{left:l,top:u}=t.getBoundingClientRect();t==null||(n=t.scrollIntoView)===null||n===void 0||n.call(t,{block:"nearest"});let{left:c,top:d}=t.getBoundingClientRect();if(Math.abs(l-c)>1||Math.abs(u-d)>1){var r,i,o;e==null||(i=e.containingElement)===null||i===void 0||(r=i.scrollIntoView)===null||r===void 0||r.call(i,{block:"center",inline:"center"}),(o=t.scrollIntoView)===null||o===void 0||o.call(t,{block:"nearest"})}}}}function fo(t){return t.mozInputSource===0&&t.isTrusted?!0:Vo()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Ah(t){return!Vo()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}const Lh="react-aria-clear-focus",Kh="react-aria-focus",hu="react-aria-update-activedescendant";function tn(t){return Tt()?t.metaKey:t.ctrlKey}function Fh(t,e=!0){let[n,r]=f.useState(!0),i=n&&e;return ae(()=>{if(i&&t.current&&"getAnimations"in t.current)for(let o of t.current.getAnimations())o instanceof CSSTransition&&o.cancel()},[t,i]),pu(t,i,f.useCallback(()=>r(!1),[])),i}function jh(t,e){let[n,r]=f.useState(e?"open":"closed");switch(n){case"open":e||r("exiting");break;case"closed":case"exiting":e&&r("open");break}let i=n==="exiting";return pu(t,i,f.useCallback(()=>{r(o=>o==="exiting"?"closed":o)},[])),i}function pu(t,e,n){ae(()=>{if(e&&t.current){if(!("getAnimations"in t.current)){n();return}let r=t.current.getAnimations();if(r.length===0){n();return}let i=!1;return Promise.all(r.map(o=>o.finished)).then(()=>{i||Mt.flushSync(()=>{n()})}).catch(()=>{}),()=>{i=!0}}},[t,e,n])}function Xr(t,e,n){let[r,i]=f.useState(t||e),o=f.useRef(t!==void 0),a=t!==void 0;f.useEffect(()=>{let u=o.current;u!==a&&console.warn(`WARN: A component changed from ${u?"controlled":"uncontrolled"} to ${a?"controlled":"uncontrolled"}.`),o.current=a},[a]);let s=a?t:r,l=f.useCallback((u,...c)=>{let d=(h,...g)=>{n&&(Object.is(s,h)||n(h,...g)),a||(s=h)};typeof u=="function"?(console.warn("We can not support a function callback. See Github Issues for details https://github.com/adobe/react-spectrum/issues/2320"),i((g,...m)=>{let p=u(a?s:g,...m);return d(p,...c),a?g:p})):(a||i(u),d(u,...c))},[a,s,n]);return[s,l]}function ho(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}const Ja=Symbol("default");function Vn({values:t,children:e}){for(let[n,r]of t)e=f.createElement(n.Provider,{value:r},e);return e}function pt(t){let{className:e,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=t;return f.useMemo(()=>{let l,u,c;return typeof e=="function"?l=e({...s,defaultClassName:i}):l=e,typeof n=="function"?u=n({...s,defaultStyle:a||{}}):u=n,typeof r=="function"?c=r({...s,defaultChildren:o}):r==null?c=o:c=r,{className:l??i,style:u||a?{...a,...u}:void 0,children:c??o,"data-rac":""}},[e,n,r,i,o,a,s])}function qo(t,e){let n=f.useContext(t);if(e===null)return null;if(n&&typeof n=="object"&&"slots"in n&&n.slots){let r=new Intl.ListFormat().format(Object.keys(n.slots).map(o=>`"${o}"`));if(!e&&!n.slots[Ja])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let i=e||Ja;if(!n.slots[i])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[i]}return n}function Gn(t,e,n){let r=qo(n,t.slot)||{},{ref:i,...o}=r,a=bn(f.useMemo(()=>iu(e,i),[e,i])),s=Ee(o,t);return"style"in o&&o.style&&"style"in t&&t.style&&(typeof o.style=="function"||typeof t.style=="function"?s.style=l=>{let u=typeof o.style=="function"?o.style(l):o.style,c={...l.defaultStyle,...u},d=typeof t.style=="function"?t.style({...l,defaultStyle:c}):t.style;return{...c,...d}}:s.style={...o.style,...t.style}),[s,a]}function zh(){let[t,e]=f.useState(!0),n=f.useRef(!1),r=f.useCallback(i=>{n.current=!0,e(!!i)},[]);return ae(()=>{n.current||e(!1)},[]),[r,t]}class Yo{get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new Yo(this.type,this.key);return e.value=this.value,e.level=this.level,e.hasChildNodes=this.hasChildNodes,e.rendered=this.rendered,e.textValue=this.textValue,e["aria-label"]=this["aria-label"],e.index=this.index,e.parentKey=this.parentKey,e.prevKey=this.prevKey,e.nextKey=this.nextKey,e.firstChildKey=this.firstChildKey,e.lastChildKey=this.lastChildKey,e.props=this.props,e.render=this.render,e}constructor(e,n){this.value=null,this.level=0,this.hasChildNodes=!1,this.rendered=null,this.textValue="",this["aria-label"]=void 0,this.index=0,this.parentKey=null,this.prevKey=null,this.nextKey=null,this.firstChildKey=null,this.lastChildKey=null,this.props={},this.type=e,this.key=n}}class Xo{get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}*[Symbol.iterator](){let e=this.firstKey!=null?this.keyMap.get(this.firstKey):void 0;for(;e;)yield e,e=e.nextKey!=null?this.keyMap.get(e.nextKey):void 0}getChildren(e){let n=this.keyMap;return{*[Symbol.iterator](){let r=n.get(e),i=(r==null?void 0:r.firstChildKey)!=null?n.get(r.firstChildKey):null;for(;i;)yield i,i=i.nextKey!=null?n.get(i.nextKey):void 0}}}getKeyBefore(e){let n=this.keyMap.get(e);if(!n)return null;if(n.prevKey!=null){for(n=this.keyMap.get(n.prevKey);n&&n.type!=="item"&&n.lastChildKey!=null;)n=this.keyMap.get(n.lastChildKey);var r;return(r=n==null?void 0:n.key)!==null&&r!==void 0?r:null}return n.parentKey}getKeyAfter(e){let n=this.keyMap.get(e);if(!n)return null;if(n.type!=="item"&&n.firstChildKey!=null)return n.firstChildKey;for(;n;){if(n.nextKey!=null)return n.nextKey;if(n.parentKey!=null)n=this.keyMap.get(n.parentKey);else return null}return null}getFirstKey(){return this.firstKey}getLastKey(){let e=this.lastKey!=null?this.keyMap.get(this.lastKey):null;for(;(e==null?void 0:e.lastChildKey)!=null;)e=this.keyMap.get(e.lastChildKey);var n;return(n=e==null?void 0:e.key)!==null&&n!==void 0?n:null}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(){throw new Error("Not implemented")}clone(){let e=this.constructor,n=new e;return n.keyMap=new Map(this.keyMap),n.firstKey=this.firstKey,n.lastKey=this.lastKey,n}addNode(e){if(this.frozen)throw new Error("Cannot add a node to a frozen collection");this.keyMap.set(e.key,e)}removeNode(e){if(this.frozen)throw new Error("Cannot remove a node to a frozen collection");this.keyMap.delete(e)}commit(e,n,r=!1){if(this.frozen)throw new Error("Cannot commit a frozen collection");this.firstKey=e,this.lastKey=n,this.frozen=!r}filter(e){let n=new Xo,r=null;for(let i of this)if(i.type==="section"&&i.hasChildNodes){let o=i.clone(),a=null;for(let s of this.getChildren(i.key))if(e(s.textValue)||s.type==="header"){let l=s.clone();a==null&&(o.firstChildKey=l.key),n.firstKey==null&&(n.firstKey=o.key),a&&a.parentKey===l.parentKey?(a.nextKey=l.key,l.prevKey=a.key):l.prevKey=null,l.nextKey=null,n.addNode(l),a=l}a&&(a.type!=="header"?(o.lastChildKey=a.key,r==null?o.prevKey=null:(r.type==="section"||r.type==="separator")&&(r.nextKey=o.key,o.prevKey=r.key),o.nextKey=null,r=o,n.addNode(o)):(n.firstKey===o.key&&(n.firstKey=null),n.removeNode(a.key)))}else if(i.type==="separator"){let o=i.clone();o.nextKey=null,(r==null?void 0:r.type)==="section"&&(r.nextKey=o.key,o.prevKey=r.key,r=o,n.addNode(o))}else if(e(i.textValue)){let o=i.clone();n.firstKey==null&&(n.firstKey=o.key),r!=null&&r.type!=="section"&&r.type!=="separator"&&r.parentKey===o.parentKey?(r.nextKey=o.key,o.prevKey=r.key):o.prevKey=null,o.nextKey=null,n.addNode(o),r=o}if((r==null?void 0:r.type)==="separator"&&r.nextKey===null){let i;r.prevKey!=null&&(i=n.getItem(r.prevKey),i.nextKey=null),n.removeNode(r.key),r=i}return n.lastKey=(r==null?void 0:r.key)||null,n}constructor(){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.frozen=!1}}class gu{*[Symbol.iterator](){let e=this.firstChild;for(;e;)yield e,e=e.nextSibling}get firstChild(){return this._firstChild}set firstChild(e){this._firstChild=e,this.ownerDocument.markDirty(this)}get lastChild(){return this._lastChild}set lastChild(e){this._lastChild=e,this.ownerDocument.markDirty(this)}get previousSibling(){return this._previousSibling}set previousSibling(e){this._previousSibling=e,this.ownerDocument.markDirty(this)}get nextSibling(){return this._nextSibling}set nextSibling(e){this._nextSibling=e,this.ownerDocument.markDirty(this)}get parentNode(){return this._parentNode}set parentNode(e){this._parentNode=e,this.ownerDocument.markDirty(this)}get isConnected(){var e;return((e=this.parentNode)===null||e===void 0?void 0:e.isConnected)||!1}appendChild(e){this.ownerDocument.startTransaction(),e.parentNode&&e.parentNode.removeChild(e),this.firstChild==null&&(this.firstChild=e),this.lastChild?(this.lastChild.nextSibling=e,e.index=this.lastChild.index+1,e.previousSibling=this.lastChild):(e.previousSibling=null,e.index=0),e.parentNode=this,e.nextSibling=null,this.lastChild=e,this.ownerDocument.markDirty(this),e.hasSetProps&&this.ownerDocument.addNode(e),this.ownerDocument.endTransaction(),this.ownerDocument.queueUpdate()}insertBefore(e,n){if(n==null)return this.appendChild(e);this.ownerDocument.startTransaction(),e.parentNode&&e.parentNode.removeChild(e),e.nextSibling=n,e.previousSibling=n.previousSibling,e.index=n.index,this.firstChild===n?this.firstChild=e:n.previousSibling&&(n.previousSibling.nextSibling=e),n.previousSibling=e,e.parentNode=n.parentNode;let r=n;for(;r;)r.index++,r=r.nextSibling;e.hasSetProps&&this.ownerDocument.addNode(e),this.ownerDocument.endTransaction(),this.ownerDocument.queueUpdate()}removeChild(e){if(e.parentNode!==this||!this.ownerDocument.isMounted)return;this.ownerDocument.startTransaction();let n=e.nextSibling;for(;n;)n.index--,n=n.nextSibling;e.nextSibling&&(e.nextSibling.previousSibling=e.previousSibling),e.previousSibling&&(e.previousSibling.nextSibling=e.nextSibling),this.firstChild===e&&(this.firstChild=e.nextSibling),this.lastChild===e&&(this.lastChild=e.previousSibling),e.parentNode=null,e.nextSibling=null,e.previousSibling=null,e.index=0,this.ownerDocument.removeNode(e),this.ownerDocument.endTransaction(),this.ownerDocument.queueUpdate()}addEventListener(){}removeEventListener(){}constructor(e){this._firstChild=null,this._lastChild=null,this._previousSibling=null,this._nextSibling=null,this._parentNode=null,this.ownerDocument=e}}class Kn extends gu{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof Kn?this.parentNode.level+(this.node.type==="item"?1:0):0}updateNode(){var e,n,r,i;let o=this.ownerDocument.getMutableNode(this);o.index=this.index,o.level=this.level,o.parentKey=this.parentNode instanceof Kn?this.parentNode.node.key:null;var a;o.prevKey=(a=(e=this.previousSibling)===null||e===void 0?void 0:e.node.key)!==null&&a!==void 0?a:null;var s;o.nextKey=(s=(n=this.nextSibling)===null||n===void 0?void 0:n.node.key)!==null&&s!==void 0?s:null,o.hasChildNodes=!!this.firstChild;var l;o.firstChildKey=(l=(r=this.firstChild)===null||r===void 0?void 0:r.node.key)!==null&&l!==void 0?l:null;var u;o.lastChildKey=(u=(i=this.lastChild)===null||i===void 0?void 0:i.node.key)!==null&&u!==void 0?u:null}setProps(e,n,r,i){let o=this.ownerDocument.getMutableNode(this),{value:a,textValue:s,id:l,...u}=e;if(u.ref=n,o.props=u,o.rendered=r,o.render=i,o.value=a,o.textValue=s||(typeof u.children=="string"?u.children:"")||e["aria-label"]||"",l!=null&&l!==o.key){if(this.hasSetProps)throw new Error("Cannot change the id of an item");o.key=l}this.hasSetProps||(this.ownerDocument.addNode(this),this.ownerDocument.endTransaction(),this.hasSetProps=!0),this.ownerDocument.queueUpdate()}get style(){return{}}hasAttribute(){}setAttribute(){}setAttributeNS(){}removeAttribute(){}constructor(e,n){super(n),this.nodeType=8,this._index=0,this.hasSetProps=!1,this.node=new Yo(e,`react-aria-${++n.nodeId}`),this.ownerDocument.startTransaction()}}class Hh extends gu{get isConnected(){return this.isMounted}createElement(e){return new Kn(e,this)}getMutableNode(e){let n=e.node;return this.mutatedNodes.has(e)||(n=e.node.clone(),this.mutatedNodes.add(e),e.node=n),this.markDirty(e),n}getMutableCollection(){return!this.isSSR&&!this.collectionMutated&&(this.collection=this.collection.clone(),this.collectionMutated=!0),this.collection}markDirty(e){this.dirtyNodes.add(e)}startTransaction(){this.transactionCount++}endTransaction(){this.transactionCount--}addNode(e){let n=this.getMutableCollection();if(!n.getItem(e.node.key)){n.addNode(e.node);for(let r of e)this.addNode(r)}this.markDirty(e)}removeNode(e){for(let r of e)this.removeNode(r);this.getMutableCollection().removeNode(e.node.key),this.markDirty(e)}getCollection(){return this.transactionCount>0?this.collection:(this.updateCollection(),this.collection)}updateCollection(){for(let o of this.dirtyNodes)o instanceof Kn&&o.isConnected&&o.updateNode();if(this.dirtyNodes.clear(),this.mutatedNodes.size||this.collectionMutated){var e,n;let o=this.getMutableCollection();for(let a of this.mutatedNodes)a.isConnected&&o.addNode(a.node);var r,i;o.commit((r=(e=this.firstChild)===null||e===void 0?void 0:e.node.key)!==null&&r!==void 0?r:null,(i=(n=this.lastChild)===null||n===void 0?void 0:n.node.key)!==null&&i!==void 0?i:null,this.isSSR),this.mutatedNodes.clear()}this.collectionMutated=!1}queueUpdate(){if(!(this.dirtyNodes.size===0||this.transactionCount>0))for(let e of this.subscriptions)e()}subscribe(e){return this.subscriptions.add(e),()=>this.subscriptions.delete(e)}resetAfterSSR(){this.isSSR&&(this.isSSR=!1,this.firstChild=null,this.lastChild=null,this.nodeId=0)}constructor(e){super(null),this.nodeType=11,this.ownerDocument=this,this.dirtyNodes=new Set,this.isSSR=!1,this.nodeId=0,this.nodesByProps=new WeakMap,this.isMounted=!0,this.mutatedNodes=new Set,this.subscriptions=new Set,this.transactionCount=0,this.collection=e,this.collectionMutated=!0}}function vu(t){let{children:e,items:n,idScope:r,addIdAndValue:i,dependencies:o=[]}=t,a=f.useMemo(()=>new WeakMap,o);return f.useMemo(()=>{if(n&&typeof e=="function"){let u=[];for(let c of n){let d=a.get(c);if(!d){d=e(c);var s,l;let h=(l=(s=d.props.id)!==null&&s!==void 0?s:c.key)!==null&&l!==void 0?l:c.id;if(h==null)throw new Error("Could not determine key for item");r&&(h=r+":"+h),d=f.cloneElement(d,i?{key:h,id:h,value:c}:{key:h}),a.set(c,d)}u.push(d)}return u}else if(typeof e!="function")return e},[e,n,a,r,i])}if(typeof HTMLTemplateElement<"u"){const t=Object.getOwnPropertyDescriptor(Node.prototype,"firstChild").get;Object.defineProperty(HTMLTemplateElement.prototype,"firstChild",{configurable:!0,enumerable:!0,get:function(){return this.dataset.reactAriaHidden?this.content.firstChild:t.call(this)}})}const _r=f.createContext(!1),Bh=typeof DocumentFragment<"u"?new DocumentFragment:null;function Wh(t){let e=f.useContext(_r),n=yn();if(e)return f.createElement(f.Fragment,null,t.children);let r=f.createElement(_r.Provider,{value:!0},t.children);return n?f.createElement("template",{"data-react-aria-hidden":!0},r):Mt.createPortal(r,Bh)}function Uh(t){let e=(n,r)=>f.useContext(_r)?null:t(n,r);return e.displayName=t.displayName||t.name,f.forwardRef(e)}function Vh(){return f.useContext(_r)}var Zn={exports:{}},$i={};/**
|
|
31
|
+
* @license React
|
|
32
|
+
* use-sync-external-store-shim.production.js
|
|
33
|
+
*
|
|
34
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
35
|
+
*
|
|
36
|
+
* This source code is licensed under the MIT license found in the
|
|
37
|
+
* LICENSE file in the root directory of this source tree.
|
|
38
|
+
*/var Qa;function Gh(){if(Qa)return $i;Qa=1;var t=f;function e(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var n=typeof Object.is=="function"?Object.is:e,r=t.useState,i=t.useEffect,o=t.useLayoutEffect,a=t.useDebugValue;function s(d,h){var g=h(),m=r({inst:{value:g,getSnapshot:h}}),p=m[0].inst,v=m[1];return o(function(){p.value=g,p.getSnapshot=h,l(p)&&v({inst:p})},[d,g,h]),i(function(){return l(p)&&v({inst:p}),d(function(){l(p)&&v({inst:p})})},[d]),a(g),g}function l(d){var h=d.getSnapshot;d=d.value;try{var g=h();return!n(d,g)}catch{return!0}}function u(d,h){return h()}var c=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?u:s;return $i.useSyncExternalStore=t.useSyncExternalStore!==void 0?t.useSyncExternalStore:c,$i}var Ci={};/**
|
|
39
|
+
* @license React
|
|
40
|
+
* use-sync-external-store-shim.development.js
|
|
41
|
+
*
|
|
42
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
43
|
+
*
|
|
44
|
+
* This source code is licensed under the MIT license found in the
|
|
45
|
+
* LICENSE file in the root directory of this source tree.
|
|
46
|
+
*/var Za;function qh(){return Za||(Za=1,process.env.NODE_ENV!=="production"&&function(){function t(g,m){return g===m&&(g!==0||1/g===1/m)||g!==g&&m!==m}function e(g,m){c||i.startTransition===void 0||(c=!0,console.error("You are using an outdated, pre-release alpha of React 18 that does not support useSyncExternalStore. The use-sync-external-store shim will not work correctly. Upgrade to a newer pre-release."));var p=m();if(!d){var v=m();o(p,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),d=!0)}v=a({inst:{value:p,getSnapshot:m}});var y=v[0].inst,w=v[1];return l(function(){y.value=p,y.getSnapshot=m,n(y)&&w({inst:y})},[g,p,m]),s(function(){return n(y)&&w({inst:y}),g(function(){n(y)&&w({inst:y})})},[g]),u(p),p}function n(g){var m=g.getSnapshot;g=g.value;try{var p=m();return!o(g,p)}catch{return!0}}function r(g,m){return m()}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var i=f,o=typeof Object.is=="function"?Object.is:t,a=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,c=!1,d=!1,h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;Ci.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:h,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ci}var es;function Yh(){return es||(es=1,process.env.NODE_ENV==="production"?Zn.exports=Gh():Zn.exports=qh()),Zn.exports}var Jo=Yh();const mu=f.createContext(!1),Fn=f.createContext(null);function yu(t){if(f.useContext(Fn))return t.content;let{collection:n,document:r}=Zh(t.createCollection);return f.createElement(f.Fragment,null,f.createElement(Wh,null,f.createElement(Fn.Provider,{value:r},t.content)),f.createElement(Xh,{render:t.children,collection:n}))}function Xh({collection:t,render:e}){return e(t)}function Jh(t,e,n){let r=yn(),i=f.useRef(r);i.current=r;let o=f.useCallback(()=>i.current?n():e(),[e,n]);return Jo.useSyncExternalStore(t,o)}const Qh=typeof f.useSyncExternalStore=="function"?f.useSyncExternalStore:Jh;function Zh(t){let[e]=f.useState(()=>new Hh((t==null?void 0:t())||new Xo)),n=f.useCallback(a=>e.subscribe(a),[e]),r=f.useCallback(()=>{let a=e.getCollection();return e.isSSR&&e.resetAfterSSR(),a},[e]),i=f.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),o=Qh(n,r,i);return ae(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:o,document:e}}const po=f.createContext(null);function ep(t,e,n,r,i,o){let a=f.useCallback(l=>{l==null||l.setProps(e,n,r,o)},[e,n,r,o]),s=f.useContext(po);if(s){let l=s.ownerDocument.nodesByProps.get(e);return l||(l=s.ownerDocument.createElement(t),l.setProps(e,n,r,o),s.appendChild(l),s.ownerDocument.updateCollection(),s.ownerDocument.nodesByProps.set(e,l)),i?f.createElement(po.Provider,{value:l},i):null}return f.createElement(t,{ref:a},i)}function Qo(t,e){let n=({node:i})=>e(i.props,i.props.ref,i),r=f.forwardRef((i,o)=>{if(!f.useContext(mu)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(i,o)}return ep(t,i,o,"children"in i?i.children:null,null,s=>f.createElement(n,{node:s}))});return r.displayName=e.name,r}function tp(t){return vu({...t,addIdAndValue:!0})}const ts=f.createContext(null);function bu(t){let e=f.useContext(ts),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),i=tp({...t,idScope:r,dependencies:n});return f.useContext(Fn)&&(i=f.createElement(np,null,i)),e=f.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),f.createElement(ts.Provider,{value:e},i)}function np({children:t}){let e=f.useContext(Fn),n=f.useMemo(()=>f.createElement(Fn.Provider,{value:null},f.createElement(mu.Provider,{value:!0},t)),[t]);return yn()?f.createElement(po.Provider,{value:e},n):Mt.createPortal(n,e)}let on="default",go="",mr=new WeakMap;function ns(t){if(qr()){if(on==="default"){const e=ce(t);go=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}on="disabled"}else(t instanceof HTMLElement||t instanceof SVGElement)&&(mr.set(t,t.style.userSelect),t.style.userSelect="none")}function er(t){if(qr()){if(on!=="disabled")return;on="restoring",setTimeout(()=>{uu(()=>{if(on==="restoring"){const e=ce(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=go||""),go="",on="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&mr.has(t)){let e=mr.get(t);t.style.userSelect==="none"&&(t.style.userSelect=e),t.getAttribute("style")===""&&t.removeAttribute("style"),mr.delete(t)}}const Zo=f.createContext({register:()=>{}});Zo.displayName="PressResponderContext";function rp(t,e){return e.get?e.get.call(t):e.value}function Su(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function ip(t,e){var n=Su(t,e,"get");return rp(t,n)}function op(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function ap(t,e,n){op(t,e),e.set(t,n)}function sp(t,e,n){if(e.set)e.set.call(t,n);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=n}}function rs(t,e,n){var r=Su(t,e,"set");return sp(t,r,n),n}function lp(t){let e=f.useContext(Zo);if(e){let{register:n,...r}=e;t=Ee(r,t),n()}return kh(e,t.ref),t}var tr=new WeakMap;class nr{continuePropagation(){rs(this,tr,!1)}get shouldStopPropagation(){return ip(this,tr)}constructor(e,n,r,i){ap(this,tr,{writable:!0,value:void 0}),rs(this,tr,!0);var o;let a=(o=i==null?void 0:i.target)!==null&&o!==void 0?o:r.currentTarget;const s=a==null?void 0:a.getBoundingClientRect();let l,u=0,c,d=null;r.clientX!=null&&r.clientY!=null&&(c=r.clientX,d=r.clientY),s&&(c!=null&&d!=null?(l=c-s.left,u=d-s.top):(l=s.width/2,u=s.height/2)),this.type=e,this.pointerType=n,this.target=r.currentTarget,this.shiftKey=r.shiftKey,this.metaKey=r.metaKey,this.ctrlKey=r.ctrlKey,this.altKey=r.altKey,this.x=l,this.y=u}}const is=Symbol("linkClicked");function ea(t){let{onPress:e,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:o,isDisabled:a,isPressed:s,preventFocusOnPress:l,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:c,ref:d,...h}=lp(t),[g,m]=f.useState(!1),p=f.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:v,removeAllGlobalListeners:y}=cu(),w=ke((b,R)=>{let V=p.current;if(a||V.didFirePressStart)return!1;let k=!0;if(V.isTriggeringEvent=!0,r){let B=new nr("pressstart",R,b);r(B),k=B.shouldStopPropagation}return n&&n(!0),V.isTriggeringEvent=!1,V.didFirePressStart=!0,m(!0),k}),$=ke((b,R,V=!0)=>{let k=p.current;if(!k.didFirePressStart)return!1;k.ignoreClickAfterPress=!0,k.didFirePressStart=!1,k.isTriggeringEvent=!0;let B=!0;if(i){let E=new nr("pressend",R,b);i(E),B=E.shouldStopPropagation}if(n&&n(!1),m(!1),e&&V&&!a){let E=new nr("press",R,b);e(E),B&&(B=E.shouldStopPropagation)}return k.isTriggeringEvent=!1,B}),P=ke((b,R)=>{let V=p.current;if(a)return!1;if(o){V.isTriggeringEvent=!0;let k=new nr("pressup",R,b);return o(k),V.isTriggeringEvent=!1,k.shouldStopPropagation}return!0}),D=ke(b=>{let R=p.current;R.isPressed&&R.target&&(R.isOverTarget&&R.pointerType!=null&&$(Qe(R.target,b),R.pointerType,!1),R.isPressed=!1,R.isOverTarget=!1,R.activePointerId=null,R.pointerType=null,y(),c||er(R.target))}),O=ke(b=>{u&&D(b)}),I=f.useMemo(()=>{let b=p.current,R={onKeyDown(k){if(Ti(k.nativeEvent,k.currentTarget)&&k.currentTarget.contains(k.target)){var B;as(k.target,k.key)&&k.preventDefault();let E=!0;if(!b.isPressed&&!k.repeat){b.target=k.currentTarget,b.isPressed=!0,E=w(k,"keyboard");let T=k.currentTarget,j=W=>{Ti(W,T)&&!W.repeat&&T.contains(W.target)&&b.target&&P(Qe(b.target,W),"keyboard")};v(ce(k.currentTarget),"keyup",An(j,V),!0)}E&&k.stopPropagation(),k.metaKey&&Tt()&&((B=b.metaKeyEvents)===null||B===void 0||B.set(k.key,k.nativeEvent))}else k.key==="Meta"&&(b.metaKeyEvents=new Map)},onClick(k){if(!(k&&!k.currentTarget.contains(k.target))&&k&&k.button===0&&!b.isTriggeringEvent&&!Dt.isOpening){let B=!0;if(a&&k.preventDefault(),!b.ignoreClickAfterPress&&!b.ignoreEmulatedMouseEvents&&!b.isPressed&&(b.pointerType==="virtual"||fo(k.nativeEvent))){!a&&!l&&nt(k.currentTarget);let E=w(k,"virtual"),T=P(k,"virtual"),j=$(k,"virtual");B=E&&T&&j}b.ignoreEmulatedMouseEvents=!1,b.ignoreClickAfterPress=!1,B&&k.stopPropagation()}}},V=k=>{var B;if(b.isPressed&&b.target&&Ti(k,b.target)){var E;as(k.target,k.key)&&k.preventDefault();let j=k.target;$(Qe(b.target,k),"keyboard",b.target.contains(j)),y(),k.key!=="Enter"&&ta(b.target)&&b.target.contains(j)&&!k[is]&&(k[is]=!0,Dt(b.target,k,!1)),b.isPressed=!1,(E=b.metaKeyEvents)===null||E===void 0||E.delete(k.key)}else if(k.key==="Meta"&&(!((B=b.metaKeyEvents)===null||B===void 0)&&B.size)){var T;let j=b.metaKeyEvents;b.metaKeyEvents=void 0;for(let W of j.values())(T=b.target)===null||T===void 0||T.dispatchEvent(new KeyboardEvent("keyup",W))}};if(typeof PointerEvent<"u"){R.onPointerDown=T=>{if(T.button!==0||!T.currentTarget.contains(T.target))return;if(Ah(T.nativeEvent)){b.pointerType="virtual";return}Pi(T.currentTarget)&&T.preventDefault(),b.pointerType=T.pointerType;let j=!0;if(!b.isPressed){b.isPressed=!0,b.isOverTarget=!0,b.activePointerId=T.pointerId,b.target=T.currentTarget,!a&&!l&&nt(T.currentTarget),c||ns(b.target),j=w(T,b.pointerType);let W=T.target;"releasePointerCapture"in W&&W.releasePointerCapture(T.pointerId),v(ce(T.currentTarget),"pointerup",k,!1),v(ce(T.currentTarget),"pointercancel",E,!1)}j&&T.stopPropagation()},R.onMouseDown=T=>{T.currentTarget.contains(T.target)&&T.button===0&&(Pi(T.currentTarget)&&T.preventDefault(),T.stopPropagation())},R.onPointerUp=T=>{!T.currentTarget.contains(T.target)||b.pointerType==="virtual"||T.button===0&&P(T,b.pointerType||T.pointerType)},R.onPointerEnter=T=>{T.pointerId===b.activePointerId&&b.target&&!b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!0,w(Qe(b.target,T),b.pointerType))},R.onPointerLeave=T=>{T.pointerId===b.activePointerId&&b.target&&b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!1,$(Qe(b.target,T),b.pointerType,!1),O(T))};let k=T=>{T.pointerId===b.activePointerId&&b.isPressed&&T.button===0&&b.target&&(b.target.contains(T.target)&&b.pointerType!=null?$(Qe(b.target,T),b.pointerType):b.isOverTarget&&b.pointerType!=null&&$(Qe(b.target,T),b.pointerType,!1),b.isPressed=!1,b.isOverTarget=!1,b.activePointerId=null,b.pointerType=null,y(),c||er(b.target),"ontouchend"in b.target&&T.pointerType!=="mouse"&&v(b.target,"touchend",B,{once:!0}))},B=T=>{Eu(T.currentTarget)&&T.preventDefault()},E=T=>{D(T)};R.onDragStart=T=>{T.currentTarget.contains(T.target)&&D(T)}}else{R.onMouseDown=E=>{if(E.button!==0||!E.currentTarget.contains(E.target))return;if(Pi(E.currentTarget)&&E.preventDefault(),b.ignoreEmulatedMouseEvents){E.stopPropagation();return}b.isPressed=!0,b.isOverTarget=!0,b.target=E.currentTarget,b.pointerType=fo(E.nativeEvent)?"virtual":"mouse",!a&&!l&&nt(E.currentTarget),w(E,b.pointerType)&&E.stopPropagation(),v(ce(E.currentTarget),"mouseup",k,!1)},R.onMouseEnter=E=>{if(!E.currentTarget.contains(E.target))return;let T=!0;b.isPressed&&!b.ignoreEmulatedMouseEvents&&b.pointerType!=null&&(b.isOverTarget=!0,T=w(E,b.pointerType)),T&&E.stopPropagation()},R.onMouseLeave=E=>{if(!E.currentTarget.contains(E.target))return;let T=!0;b.isPressed&&!b.ignoreEmulatedMouseEvents&&b.pointerType!=null&&(b.isOverTarget=!1,T=$(E,b.pointerType,!1),O(E)),T&&E.stopPropagation()},R.onMouseUp=E=>{E.currentTarget.contains(E.target)&&!b.ignoreEmulatedMouseEvents&&E.button===0&&P(E,b.pointerType||"mouse")};let k=E=>{if(E.button===0){if(b.isPressed=!1,y(),b.ignoreEmulatedMouseEvents){b.ignoreEmulatedMouseEvents=!1;return}b.target&&Di(E,b.target)&&b.pointerType!=null?$(Qe(b.target,E),b.pointerType):b.target&&b.isOverTarget&&b.pointerType!=null&&$(Qe(b.target,E),b.pointerType,!1),b.isOverTarget=!1}};R.onTouchStart=E=>{if(!E.currentTarget.contains(E.target))return;let T=up(E.nativeEvent);if(!T)return;b.activePointerId=T.identifier,b.ignoreEmulatedMouseEvents=!0,b.isOverTarget=!0,b.isPressed=!0,b.target=E.currentTarget,b.pointerType="touch",!a&&!l&&nt(E.currentTarget),c||ns(b.target),w(st(b.target,E),b.pointerType)&&E.stopPropagation(),v(We(E.currentTarget),"scroll",B,!0)},R.onTouchMove=E=>{if(!E.currentTarget.contains(E.target))return;if(!b.isPressed){E.stopPropagation();return}let T=os(E.nativeEvent,b.activePointerId),j=!0;T&&Di(T,E.currentTarget)?!b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!0,j=w(st(b.target,E),b.pointerType)):b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!1,j=$(st(b.target,E),b.pointerType,!1),O(st(b.target,E))),j&&E.stopPropagation()},R.onTouchEnd=E=>{if(!E.currentTarget.contains(E.target))return;if(!b.isPressed){E.stopPropagation();return}let T=os(E.nativeEvent,b.activePointerId),j=!0;T&&Di(T,E.currentTarget)&&b.pointerType!=null?(P(st(b.target,E),b.pointerType),j=$(st(b.target,E),b.pointerType)):b.isOverTarget&&b.pointerType!=null&&(j=$(st(b.target,E),b.pointerType,!1)),j&&E.stopPropagation(),b.isPressed=!1,b.activePointerId=null,b.isOverTarget=!1,b.ignoreEmulatedMouseEvents=!0,b.target&&!c&&er(b.target),y()},R.onTouchCancel=E=>{E.currentTarget.contains(E.target)&&(E.stopPropagation(),b.isPressed&&D(st(b.target,E)))};let B=E=>{b.isPressed&&E.target.contains(b.target)&&D({currentTarget:b.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};R.onDragStart=E=>{E.currentTarget.contains(E.target)&&D(E)}}return R},[v,a,l,y,c,D,O,$,w,P]);return f.useEffect(()=>()=>{var b;c||er((b=p.current.target)!==null&&b!==void 0?b:void 0)},[c]),{isPressed:s||g,pressProps:Ee(h,I)}}function ta(t){return t.tagName==="A"&&t.hasAttribute("href")}function Ti(t,e){const{key:n,code:r}=t,i=e,o=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof We(i).HTMLInputElement&&!wu(i,n)||i instanceof We(i).HTMLTextAreaElement||i.isContentEditable)&&!((o==="link"||!o&&ta(i))&&n!=="Enter")}function up(t){const{targetTouches:e}=t;return e.length>0?e[0]:null}function os(t,e){const n=t.changedTouches;for(let r=0;r<n.length;r++){const i=n[r];if(i.identifier===e)return i}return null}function st(t,e){let n=0,r=0;return e.targetTouches&&e.targetTouches.length===1&&(n=e.targetTouches[0].clientX,r=e.targetTouches[0].clientY),{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:r}}function Qe(t,e){let n=e.clientX,r=e.clientY;return{currentTarget:t,shiftKey:e.shiftKey,ctrlKey:e.ctrlKey,metaKey:e.metaKey,altKey:e.altKey,clientX:n,clientY:r}}function cp(t){let e=0,n=0;return t.width!==void 0?e=t.width/2:t.radiusX!==void 0&&(e=t.radiusX),t.height!==void 0?n=t.height/2:t.radiusY!==void 0&&(n=t.radiusY),{top:t.clientY-n,right:t.clientX+e,bottom:t.clientY+n,left:t.clientX-e}}function dp(t,e){return!(t.left>e.right||e.left>t.right||t.top>e.bottom||e.top>t.bottom)}function Di(t,e){let n=e.getBoundingClientRect(),r=cp(t);return dp(n,r)}function Pi(t){return!(t instanceof HTMLElement)||!t.hasAttribute("draggable")}function Eu(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!ta(t)}function as(t,e){return t instanceof HTMLInputElement?!wu(t,e):Eu(t)}const fp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function wu(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":fp.has(t.type)}function hp({children:t}){let e=f.useMemo(()=>({register:()=>{}}),[]);return f.createElement(Zo.Provider,{value:e},t)}class pp{isDefaultPrevented(){return this.nativeEvent.defaultPrevented}preventDefault(){this.defaultPrevented=!0,this.nativeEvent.preventDefault()}stopPropagation(){this.nativeEvent.stopPropagation(),this.isPropagationStopped=()=>!0}isPropagationStopped(){return!1}persist(){}constructor(e,n){this.nativeEvent=n,this.target=n.target,this.currentTarget=n.currentTarget,this.relatedTarget=n.relatedTarget,this.bubbles=n.bubbles,this.cancelable=n.cancelable,this.defaultPrevented=n.defaultPrevented,this.eventPhase=n.eventPhase,this.isTrusted=n.isTrusted,this.timeStamp=n.timeStamp,this.type=e}}function xu(t){let e=f.useRef({isFocused:!1,observer:null});ae(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=ke(r=>{t==null||t(r)});return f.useCallback(r=>{if(r.target instanceof HTMLButtonElement||r.target instanceof HTMLInputElement||r.target instanceof HTMLTextAreaElement||r.target instanceof HTMLSelectElement){e.current.isFocused=!0;let i=r.target,o=a=>{e.current.isFocused=!1,i.disabled&&n(new pp("blur",a)),e.current.observer&&(e.current.observer.disconnect(),e.current.observer=null)};i.addEventListener("focusout",o,{once:!0}),e.current.observer=new MutationObserver(()=>{if(e.current.isFocused&&i.disabled){var a;(a=e.current.observer)===null||a===void 0||a.disconnect();let s=i===document.activeElement?null:document.activeElement;i.dispatchEvent(new FocusEvent("blur",{relatedTarget:s})),i.dispatchEvent(new FocusEvent("focusout",{bubbles:!0,relatedTarget:s}))}}),e.current.observer.observe(i,{attributes:!0,attributeFilter:["disabled"]})}},[n])}function $u(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:i}=t;const o=f.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),a=xu(o),s=f.useCallback(l=>{const u=ce(l.target);l.target===l.currentTarget&&u.activeElement===l.target&&(n&&n(l),i&&i(!0),a(l))},[i,n,a]);return{focusProps:{onFocus:!e&&(n||i||r)?s:void 0,onBlur:!e&&(r||i)?o:void 0}}}let Sn=null,vo=new Set,Rn=new Map,Pt=!1,mo=!1;const gp={Tab:!0,Escape:!0};function na(t,e){for(let n of vo)n(t,e)}function vp(t){return!(t.metaKey||!Tt()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function kr(t){Pt=!0,vp(t)&&(Sn="keyboard",na("keyboard",t))}function Ke(t){Sn="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(Pt=!0,na("pointer",t))}function Cu(t){fo(t)&&(Pt=!0,Sn="virtual")}function Tu(t){t.target===window||t.target===document||(!Pt&&!mo&&(Sn="virtual",na("virtual",t)),Pt=!1,mo=!1)}function Du(){Pt=!1,mo=!0}function yo(t){if(typeof window>"u"||Rn.get(We(t)))return;const e=We(t),n=ce(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Pt=!0,r.apply(this,arguments)},n.addEventListener("keydown",kr,!0),n.addEventListener("keyup",kr,!0),n.addEventListener("click",Cu,!0),e.addEventListener("focus",Tu,!0),e.addEventListener("blur",Du,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Ke,!0),n.addEventListener("pointermove",Ke,!0),n.addEventListener("pointerup",Ke,!0)):(n.addEventListener("mousedown",Ke,!0),n.addEventListener("mousemove",Ke,!0),n.addEventListener("mouseup",Ke,!0)),e.addEventListener("beforeunload",()=>{Pu(t)},{once:!0}),Rn.set(e,{focus:r})}const Pu=(t,e)=>{const n=We(t),r=ce(t);e&&r.removeEventListener("DOMContentLoaded",e),Rn.has(n)&&(n.HTMLElement.prototype.focus=Rn.get(n).focus,r.removeEventListener("keydown",kr,!0),r.removeEventListener("keyup",kr,!0),r.removeEventListener("click",Cu,!0),n.removeEventListener("focus",Tu,!0),n.removeEventListener("blur",Du,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Ke,!0),r.removeEventListener("pointermove",Ke,!0),r.removeEventListener("pointerup",Ke,!0)):(r.removeEventListener("mousedown",Ke,!0),r.removeEventListener("mousemove",Ke,!0),r.removeEventListener("mouseup",Ke,!0)),Rn.delete(n))};function mp(t){const e=ce(t);let n;return e.readyState!=="loading"?yo(t):(n=()=>{yo(t)},e.addEventListener("DOMContentLoaded",n)),()=>Pu(t,n)}typeof document<"u"&&mp();function ra(){return Sn!=="pointer"}function Nr(){return Sn}const yp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function bp(t,e,n){var r;const i=typeof window<"u"?We(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,o=typeof window<"u"?We(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?We(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?We(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return t=t||(n==null?void 0:n.target)instanceof i&&!yp.has(n==null||(r=n.target)===null||r===void 0?void 0:r.type)||(n==null?void 0:n.target)instanceof o||(n==null?void 0:n.target)instanceof a&&(n==null?void 0:n.target.isContentEditable),!(t&&e==="keyboard"&&n instanceof s&&!gp[n.key])}function Sp(t,e,n){yo(),f.useEffect(()=>{let r=(i,o)=>{bp(!!(n!=null&&n.isTextInput),i,o)&&t(ra())};return vo.add(r),()=>{vo.delete(r)}},e)}function ia(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=t,o=f.useRef({isFocusWithin:!1}),a=f.useCallback(u=>{o.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,o]),s=xu(a),l=f.useCallback(u=>{!o.current.isFocusWithin&&document.activeElement===u.target&&(r&&r(u),i&&i(!0),o.current.isFocusWithin=!0,s(u))},[r,i,s]);return e?{focusWithinProps:{onFocus:void 0,onBlur:void 0}}:{focusWithinProps:{onFocus:l,onBlur:a}}}let Rr=!1,Oi=0;function bo(){Rr=!0,setTimeout(()=>{Rr=!1},50)}function ss(t){t.pointerType==="touch"&&bo()}function Ep(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",ss):document.addEventListener("touchend",bo),Oi++,()=>{Oi--,!(Oi>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",ss):document.removeEventListener("touchend",bo))}}function oa(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:i}=t,[o,a]=f.useState(!1),s=f.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;f.useEffect(Ep,[]);let{hoverProps:l,triggerHoverEnd:u}=f.useMemo(()=>{let c=(g,m)=>{if(s.pointerType=m,i||m==="touch"||s.isHovered||!g.currentTarget.contains(g.target))return;s.isHovered=!0;let p=g.currentTarget;s.target=p,e&&e({type:"hoverstart",target:p,pointerType:m}),n&&n(!0),a(!0)},d=(g,m)=>{if(s.pointerType="",s.target=null,m==="touch"||!s.isHovered)return;s.isHovered=!1;let p=g.currentTarget;r&&r({type:"hoverend",target:p,pointerType:m}),n&&n(!1),a(!1)},h={};return typeof PointerEvent<"u"?(h.onPointerEnter=g=>{Rr&&g.pointerType==="mouse"||c(g,g.pointerType)},h.onPointerLeave=g=>{!i&&g.currentTarget.contains(g.target)&&d(g,g.pointerType)}):(h.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},h.onMouseEnter=g=>{!s.ignoreEmulatedMouseEvents&&!Rr&&c(g,"mouse"),s.ignoreEmulatedMouseEvents=!1},h.onMouseLeave=g=>{!i&&g.currentTarget.contains(g.target)&&d(g,"mouse")}),{hoverProps:h,triggerHoverEnd:d}},[e,n,r,i,s]);return f.useEffect(()=>{i&&u({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:l,isHovered:o}}function wp(t){let{ref:e,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=t,o=f.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=ke(l=>{n&&rr(l,e)&&(i&&i(l),o.current.isPointerDown=!0)}),s=ke(l=>{n&&n(l)});f.useEffect(()=>{let l=o.current;if(r)return;const u=e.current,c=ce(u);if(typeof PointerEvent<"u"){let d=h=>{l.isPointerDown&&rr(h,e)&&s(h),l.isPointerDown=!1};return c.addEventListener("pointerdown",a,!0),c.addEventListener("pointerup",d,!0),()=>{c.removeEventListener("pointerdown",a,!0),c.removeEventListener("pointerup",d,!0)}}else{let d=g=>{l.ignoreEmulatedMouseEvents?l.ignoreEmulatedMouseEvents=!1:l.isPointerDown&&rr(g,e)&&s(g),l.isPointerDown=!1},h=g=>{l.ignoreEmulatedMouseEvents=!0,l.isPointerDown&&rr(g,e)&&s(g),l.isPointerDown=!1};return c.addEventListener("mousedown",a,!0),c.addEventListener("mouseup",d,!0),c.addEventListener("touchstart",a,!0),c.addEventListener("touchend",h,!0),()=>{c.removeEventListener("mousedown",a,!0),c.removeEventListener("mouseup",d,!0),c.removeEventListener("touchstart",a,!0),c.removeEventListener("touchend",h,!0)}}},[e,r,a,s])}function rr(t,e){if(t.button>0)return!1;if(t.target){const n=t.target.ownerDocument;if(!n||!n.documentElement.contains(t.target)||t.target.closest("[data-react-aria-top-layer]"))return!1}return e.current&&!e.current.contains(t.target)}function ls(t){if(!t)return;let e=!0;return n=>{let r={...n,preventDefault(){n.preventDefault()},isDefaultPrevented(){return n.isDefaultPrevented()},stopPropagation(){e?console.error("stopPropagation is now the default behavior for events in React Spectrum. You can use continuePropagation() to revert this behavior."):e=!0},continuePropagation(){e=!1},isPropagationStopped(){return e}};t(r),e&&n.stopPropagation()}}function xp(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:ls(t.onKeyDown),onKeyUp:ls(t.onKeyUp)}}}const $p=500;function Cp(t){let{isDisabled:e,onLongPressStart:n,onLongPressEnd:r,onLongPress:i,threshold:o=$p,accessibilityDescription:a}=t;const s=f.useRef(void 0);let{addGlobalListener:l,removeGlobalListener:u}=cu(),{pressProps:c}=ea({isDisabled:e,onPressStart(h){if(h.continuePropagation(),(h.pointerType==="mouse"||h.pointerType==="touch")&&(n&&n({...h,type:"longpressstart"}),s.current=setTimeout(()=>{h.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),i&&i({...h,type:"longpress"}),s.current=void 0},o),h.pointerType==="touch")){let g=m=>{m.preventDefault()};l(h.target,"contextmenu",g,{once:!0}),l(window,"pointerup",()=>{setTimeout(()=>{u(h.target,"contextmenu",g)},30)},{once:!0})}},onPressEnd(h){s.current&&clearTimeout(s.current),r&&(h.pointerType==="mouse"||h.pointerType==="touch")&&r({...h,type:"longpressend"})}}),d=Mh(i&&!e?a:void 0);return{longPressProps:Ee(c,d)}}function Mr(t){const e=ce(t);if(Nr()==="virtual"){let n=e.activeElement;uu(()=>{e.activeElement===n&&t.isConnected&&nt(t)})}else nt(t)}function Tp(t){const e=We(t);if(!(t instanceof e.HTMLElement)&&!(t instanceof e.SVGElement))return!1;let{display:n,visibility:r}=t.style,i=n!=="none"&&r!=="hidden"&&r!=="collapse";if(i){const{getComputedStyle:o}=t.ownerDocument.defaultView;let{display:a,visibility:s}=o(t);i=a!=="none"&&s!=="hidden"&&s!=="collapse"}return i}function Dp(t,e){return!t.hasAttribute("hidden")&&!t.hasAttribute("data-react-aria-prevent-focus")&&(t.nodeName==="DETAILS"&&e&&e.nodeName!=="SUMMARY"?t.hasAttribute("open"):!0)}function Ou(t,e){return t.nodeName!=="#comment"&&Tp(t)&&Dp(t,e)&&(!t.parentElement||Ou(t.parentElement,t))}const us=f.createContext(null),So="react-aria-focus-scope-restore";let ue=null;function Iu(t){let{children:e,contain:n,restoreFocus:r,autoFocus:i}=t,o=f.useRef(null),a=f.useRef(null),s=f.useRef([]),{parentNode:l}=f.useContext(us)||{},u=f.useMemo(()=>new wo({scopeRef:s}),[s]);ae(()=>{let h=l||ge.root;if(ge.getTreeNode(h.scopeRef)&&ue&&!Ar(ue,h.scopeRef)){let g=ge.getTreeNode(ue);g&&(h=g)}h.addChild(u),ge.addNode(u)},[u,l]),ae(()=>{let h=ge.getTreeNode(s);h&&(h.contain=!!n)},[n]),ae(()=>{var h;let g=(h=o.current)===null||h===void 0?void 0:h.nextSibling,m=[],p=v=>v.stopPropagation();for(;g&&g!==a.current;)m.push(g),g.addEventListener(So,p),g=g.nextSibling;return s.current=m,()=>{for(let v of m)v.removeEventListener(So,p)}},[e]),Rp(s,r,n),_p(s,n),Mp(s,r,n),Np(s,i),f.useEffect(()=>{const h=ce(s.current?s.current[0]:void 0).activeElement;let g=null;if(je(h,s.current)){for(let m of ge.traverse())m.scopeRef&&je(h,m.scopeRef.current)&&(g=m);g===ge.getTreeNode(s)&&(ue=g.scopeRef)}},[s]),ae(()=>()=>{var h,g,m;let p=(m=(g=ge.getTreeNode(s))===null||g===void 0||(h=g.parent)===null||h===void 0?void 0:h.scopeRef)!==null&&m!==void 0?m:null;(s===ue||Ar(s,ue))&&(!p||ge.getTreeNode(p))&&(ue=p),ge.removeTreeNode(s)},[s]);let c=f.useMemo(()=>Pp(s),[]),d=f.useMemo(()=>({focusManager:c,parentNode:u}),[u,c]);return f.createElement(us.Provider,{value:d},f.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:o}),e,f.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:a}))}function Pp(t){return{focusNext(e={}){let n=t.current,{from:r,tabbable:i,wrap:o,accept:a}=e,s=r||ce(n[0]).activeElement,l=n[0].previousElementSibling,u=Et(n),c=Xe(u,{tabbable:i,accept:a},n);c.currentNode=je(s,n)?s:l;let d=c.nextNode();return!d&&o&&(c.currentNode=l,d=c.nextNode()),d&&rt(d,!0),d},focusPrevious(e={}){let n=t.current,{from:r,tabbable:i,wrap:o,accept:a}=e,s=r||ce(n[0]).activeElement,l=n[n.length-1].nextElementSibling,u=Et(n),c=Xe(u,{tabbable:i,accept:a},n);c.currentNode=je(s,n)?s:l;let d=c.previousNode();return!d&&o&&(c.currentNode=l,d=c.previousNode()),d&&rt(d,!0),d},focusFirst(e={}){let n=t.current,{tabbable:r,accept:i}=e,o=Et(n),a=Xe(o,{tabbable:r,accept:i},n);a.currentNode=n[0].previousElementSibling;let s=a.nextNode();return s&&rt(s,!0),s},focusLast(e={}){let n=t.current,{tabbable:r,accept:i}=e,o=Et(n),a=Xe(o,{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let s=a.previousNode();return s&&rt(s,!0),s}}}const aa=["input:not([disabled]):not([type=hidden])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","summary","iframe","object","embed","audio[controls]","video[controls]",'[contenteditable]:not([contenteditable^="false"])'],Op=aa.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";aa.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Ip=aa.join(':not([hidden]):not([tabindex="-1"]),');function Et(t){return t[0].parentElement}function On(t){let e=ge.getTreeNode(ue);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function _p(t,e){let n=f.useRef(void 0),r=f.useRef(void 0);ae(()=>{let i=t.current;if(!e){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const o=ce(i?i[0]:void 0);let a=u=>{if(u.key!=="Tab"||u.altKey||u.ctrlKey||u.metaKey||!On(t)||u.isComposing)return;let c=o.activeElement,d=t.current;if(!d||!je(c,d))return;let h=Et(d),g=Xe(h,{tabbable:!0},d);if(!c)return;g.currentNode=c;let m=u.shiftKey?g.previousNode():g.nextNode();m||(g.currentNode=u.shiftKey?d[d.length-1].nextElementSibling:d[0].previousElementSibling,m=u.shiftKey?g.previousNode():g.nextNode()),u.preventDefault(),m&&rt(m,!0)},s=u=>{(!ue||Ar(ue,t))&&je(u.target,t.current)?(ue=t,n.current=u.target):On(t)&&!ft(u.target,t)?n.current?n.current.focus():ue&&ue.current&&Eo(ue.current):On(t)&&(n.current=u.target)},l=u=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let c=Nr();if(!((c==="virtual"||c===null)&&Vo()&&su())&&o.activeElement&&On(t)&&!ft(o.activeElement,t))if(ue=t,o.body.contains(u.target)){var h;n.current=u.target,(h=n.current)===null||h===void 0||h.focus()}else ue.current&&Eo(ue.current)})};return o.addEventListener("keydown",a,!1),o.addEventListener("focusin",s,!1),i==null||i.forEach(u=>u.addEventListener("focusin",s,!1)),i==null||i.forEach(u=>u.addEventListener("focusout",l,!1)),()=>{o.removeEventListener("keydown",a,!1),o.removeEventListener("focusin",s,!1),i==null||i.forEach(u=>u.removeEventListener("focusin",s,!1)),i==null||i.forEach(u=>u.removeEventListener("focusout",l,!1))}},[t,e]),ae(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function _u(t){return ft(t)}function je(t,e){return!t||!e?!1:e.some(n=>n.contains(t))}function ft(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of ge.traverse(ge.getTreeNode(e)))if(n&&je(t,n.current))return!0;return!1}function kp(t){return ft(t,ue)}function Ar(t,e){var n;let r=(n=ge.getTreeNode(e))===null||n===void 0?void 0:n.parent;for(;r;){if(r.scopeRef===t)return!0;r=r.parent}return!1}function rt(t,e=!1){if(t!=null&&!e)try{Mr(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function ku(t,e=!0){let n=t[0].previousElementSibling,r=Et(t),i=Xe(r,{tabbable:e},t);i.currentNode=n;let o=i.nextNode();return e&&!o&&(r=Et(t),i=Xe(r,{tabbable:!1},t),i.currentNode=n,o=i.nextNode()),o}function Eo(t,e=!0){rt(ku(t,e))}function Np(t,e){const n=f.useRef(e);f.useEffect(()=>{if(n.current){ue=t;const r=ce(t.current?t.current[0]:void 0);!je(r.activeElement,ue.current)&&t.current&&Eo(t.current)}n.current=!1},[t])}function Rp(t,e,n){ae(()=>{if(e||n)return;let r=t.current;const i=ce(r?r[0]:void 0);let o=a=>{let s=a.target;je(s,t.current)?ue=t:_u(s)||(ue=null)};return i.addEventListener("focusin",o,!1),r==null||r.forEach(a=>a.addEventListener("focusin",o,!1)),()=>{i.removeEventListener("focusin",o,!1),r==null||r.forEach(a=>a.removeEventListener("focusin",o,!1))}},[t,e,n])}function cs(t){let e=ge.getTreeNode(ue);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return(e==null?void 0:e.scopeRef)===t}function Mp(t,e,n){const r=f.useRef(typeof document<"u"?ce(t.current?t.current[0]:void 0).activeElement:null);ae(()=>{let i=t.current;const o=ce(i?i[0]:void 0);if(!e||n)return;let a=()=>{(!ue||Ar(ue,t))&&je(o.activeElement,t.current)&&(ue=t)};return o.addEventListener("focusin",a,!1),i==null||i.forEach(s=>s.addEventListener("focusin",a,!1)),()=>{o.removeEventListener("focusin",a,!1),i==null||i.forEach(s=>s.removeEventListener("focusin",a,!1))}},[t,n]),ae(()=>{const i=ce(t.current?t.current[0]:void 0);if(!e)return;let o=a=>{if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey||!On(t)||a.isComposing)return;let s=i.activeElement;if(!ft(s,t)||!cs(t))return;let l=ge.getTreeNode(t);if(!l)return;let u=l.nodeToRestore,c=Xe(i.body,{tabbable:!0});c.currentNode=s;let d=a.shiftKey?c.previousNode():c.nextNode();if((!u||!i.body.contains(u)||u===i.body)&&(u=void 0,l.nodeToRestore=void 0),(!d||!ft(d,t))&&u){c.currentNode=u;do d=a.shiftKey?c.previousNode():c.nextNode();while(ft(d,t));a.preventDefault(),a.stopPropagation(),d?rt(d,!0):_u(u)?rt(u,!0):s.blur()}};return n||i.addEventListener("keydown",o,!0),()=>{n||i.removeEventListener("keydown",o,!0)}},[t,e,n]),ae(()=>{const i=ce(t.current?t.current[0]:void 0);if(!e)return;let o=ge.getTreeNode(t);if(o){var a;return o.nodeToRestore=(a=r.current)!==null&&a!==void 0?a:void 0,()=>{let s=ge.getTreeNode(t);if(!s)return;let l=s.nodeToRestore;if(e&&l&&(i.activeElement&&ft(i.activeElement,t)||i.activeElement===i.body&&cs(t))){let u=ge.clone();requestAnimationFrame(()=>{if(i.activeElement===i.body){let c=u.getTreeNode(t);for(;c;){if(c.nodeToRestore&&c.nodeToRestore.isConnected){ds(c.nodeToRestore);return}c=c.parent}for(c=u.getTreeNode(t);c;){if(c.scopeRef&&c.scopeRef.current&&ge.getTreeNode(c.scopeRef)){let d=ku(c.scopeRef.current,!0);ds(d);return}c=c.parent}}})}}}},[t,e])}function ds(t){t.dispatchEvent(new CustomEvent(So,{bubbles:!0,cancelable:!0}))&&rt(t)}function Xe(t,e,n){let r=e!=null&&e.tabbable?Ip:Op,i=ce(t).createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode(o){var a;return!(e==null||(a=e.from)===null||a===void 0)&&a.contains(o)?NodeFilter.FILTER_REJECT:o.matches(r)&&Ou(o)&&(!n||je(o,n))&&(!(e!=null&&e.accept)||e.accept(o))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});return e!=null&&e.from&&(i.currentNode=e.from),i}class sa{get size(){return this.fastMap.size}getTreeNode(e){return this.fastMap.get(e)}addTreeNode(e,n,r){let i=this.fastMap.get(n??null);if(!i)return;let o=new wo({scopeRef:e});i.addChild(o),o.parent=i,this.fastMap.set(e,o),r&&(o.nodeToRestore=r)}addNode(e){this.fastMap.set(e.scopeRef,e)}removeTreeNode(e){if(e===null)return;let n=this.fastMap.get(e);if(!n)return;let r=n.parent;for(let o of this.traverse())o!==n&&n.nodeToRestore&&o.nodeToRestore&&n.scopeRef&&n.scopeRef.current&&je(o.nodeToRestore,n.scopeRef.current)&&(o.nodeToRestore=n.nodeToRestore);let i=n.children;r&&(r.removeChild(n),i.size>0&&i.forEach(o=>r&&r.addChild(o))),this.fastMap.delete(n.scopeRef)}*traverse(e=this.root){if(e.scopeRef!=null&&(yield e),e.children.size>0)for(let n of e.children)yield*this.traverse(n)}clone(){var e;let n=new sa;var r;for(let i of this.traverse())n.addTreeNode(i.scopeRef,(r=(e=i.parent)===null||e===void 0?void 0:e.scopeRef)!==null&&r!==void 0?r:null,i.nodeToRestore);return n}constructor(){this.fastMap=new Map,this.root=new wo({scopeRef:null}),this.fastMap.set(null,this.root)}}class wo{addChild(e){this.children.add(e),e.parent=this}removeChild(e){this.children.delete(e),e.parent=void 0}constructor(e){this.children=new Set,this.contain=!1,this.scopeRef=e.scopeRef}}let ge=new sa;function Jr(t={}){let{autoFocus:e=!1,isTextInput:n,within:r}=t,i=f.useRef({isFocused:!1,isFocusVisible:e||ra()}),[o,a]=f.useState(!1),[s,l]=f.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=f.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),c=f.useCallback(g=>{i.current.isFocused=g,a(g),u()},[u]);Sp(g=>{i.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:d}=$u({isDisabled:r,onFocusChange:c}),{focusWithinProps:h}=ia({isDisabled:!r,onFocusWithinChange:c});return{isFocused:o,isFocusVisible:s,focusProps:r?h:d}}function Ap(t,e){let n=e==null?void 0:e.isDisabled,[r,i]=f.useState(!1);return ae(()=>{if(t!=null&&t.current&&!n){let o=()=>{if(t.current){let s=Xe(t.current,{tabbable:!0});i(!!s.nextNode())}};o();let a=new MutationObserver(o);return a.observe(t.current,{subtree:!0,childList:!0,attributes:!0,attributeFilter:["tabIndex","disabled"]}),()=>{a.disconnect()}}}),n?!1:r}const Lp=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),Kp=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function Fp(t){if(Intl.Locale){let n=new Intl.Locale(t).maximize(),r=typeof n.getTextInfo=="function"?n.getTextInfo():n.textInfo;if(r)return r.direction==="rtl";if(n.script)return Lp.has(n.script)}let e=t.split("-")[0];return Kp.has(e)}const jp=Symbol.for("react-aria.i18n.locale");function Nu(){let t=typeof window<"u"&&window[jp]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:Fp(t)?"rtl":"ltr"}}let xo=Nu(),In=new Set;function fs(){xo=Nu();for(let t of In)t(xo)}function zp(){let t=yn(),[e,n]=f.useState(xo);return f.useEffect(()=>(In.size===0&&window.addEventListener("languagechange",fs),In.add(n),()=>{In.delete(n),In.size===0&&window.removeEventListener("languagechange",fs)}),[]),t?{locale:"en-US",direction:"ltr"}:e}const Hp=f.createContext(null);function qn(){let t=zp();return f.useContext(Hp)||t}var Ye=function(){return Ye=Object.assign||function(e){for(var n,r=1,i=arguments.length;r<i;r++){n=arguments[r];for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(e[o]=n[o])}return e},Ye.apply(this,arguments)};function Ru(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n}function Bp(t,e,n){if(n||arguments.length===2)for(var r=0,i=e.length,o;r<i;r++)(o||!(r in e))&&(o||(o=Array.prototype.slice.call(e,0,r)),o[r]=e[r]);return t.concat(o||Array.prototype.slice.call(e))}const Wp=Symbol.for("react-aria.i18n.locale"),Up=Symbol.for("react-aria.i18n.strings");let Ht;class Qr{getStringForLocale(e,n){let i=this.getStringsForLocale(n)[e];if(!i)throw new Error(`Could not find intl message ${e} in ${n} locale`);return i}getStringsForLocale(e){let n=this.strings[e];return n||(n=Vp(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[Wp];if(Ht===void 0){let i=window[Up];if(!i)return null;Ht={};for(let o in i)Ht[o]=new Qr({[n]:i[o]},n)}let r=Ht==null?void 0:Ht[e];if(!r)throw new Error(`Strings for package "${e}" were not included by LocalizedStringProvider. Please add it to the list passed to createLocalizedStringDictionary.`);return r}constructor(e,n="en-US"){this.strings=Object.fromEntries(Object.entries(e).filter(([,r])=>r)),this.defaultLocale=n}}function Vp(t,e,n="en-US"){if(e[t])return e[t];let r=Gp(t);if(e[r])return e[r];for(let i in e)if(i.startsWith(r+"-"))return e[i];return e[n]}function Gp(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}const hs=new Map,ps=new Map;class qp{format(e,n){let r=this.strings.getStringForLocale(e,this.locale);return typeof r=="function"?r(n,this):r}plural(e,n,r="cardinal"){let i=n["="+e];if(i)return typeof i=="function"?i():i;let o=this.locale+":"+r,a=hs.get(o);a||(a=new Intl.PluralRules(this.locale,{type:r}),hs.set(o,a));let s=a.select(e);return i=n[s]||n.other,typeof i=="function"?i():i}number(e){let n=ps.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),ps.set(this.locale,n)),n.format(e)}select(e,n){let r=e[n]||e.other;return typeof r=="function"?r():r}constructor(e,n){this.locale=e,this.strings=n}}const gs=new WeakMap;function Yp(t){let e=gs.get(t);return e||(e=new Qr(t),gs.set(t,e)),e}function Xp(t,e){return e&&Qr.getGlobalDictionaryForPackage(e)||Yp(t)}function Jp(t,e){let{locale:n}=qn(),r=Xp(t,e);return f.useMemo(()=>new qp(n,r),[n,r])}let Ii=new Map;function Qp(t){let{locale:e}=qn(),n=e+(t?Object.entries(t).sort((i,o)=>i[0]<o[0]?-1:1).join():"");if(Ii.has(n))return Ii.get(n);let r=new Intl.Collator(e,t);return Ii.set(n,r),r}const vs={border:0,clip:"rect(0 0 0 0)",clipPath:"inset(50%)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"};function Zp(t={}){let{style:e,isFocusable:n}=t,[r,i]=f.useState(!1),{focusWithinProps:o}=ia({isDisabled:!n,onFocusWithinChange:s=>i(s)}),a=f.useMemo(()=>r?e:e?{...vs,...e}:vs,[r]);return{visuallyHiddenProps:{...o,style:a}}}function eg(t){let{children:e,elementType:n="div",isFocusable:r,style:i,...o}=t,{visuallyHiddenProps:a}=Zp(t);return f.createElement(n,Ee(o,a),e)}const Je={top:"top",bottom:"top",left:"left",right:"left"},Lr={top:"bottom",bottom:"top",left:"right",right:"left"},tg={top:"left",left:"top"},$o={top:"height",left:"width"},Mu={width:"totalWidth",height:"totalHeight"},ir={};let me=typeof document<"u"?window.visualViewport:null;function ms(t){let e=0,n=0,r=0,i=0,o=0,a=0,s={};var l;let u=((l=me==null?void 0:me.scale)!==null&&l!==void 0?l:1)>1;if(t.tagName==="BODY"){let m=document.documentElement;r=m.clientWidth,i=m.clientHeight;var c;e=(c=me==null?void 0:me.width)!==null&&c!==void 0?c:r;var d;n=(d=me==null?void 0:me.height)!==null&&d!==void 0?d:i,s.top=m.scrollTop||t.scrollTop,s.left=m.scrollLeft||t.scrollLeft,me&&(o=me.offsetTop,a=me.offsetLeft)}else({width:e,height:n,top:o,left:a}=un(t)),s.top=t.scrollTop,s.left=t.scrollLeft,r=e,i=n;if(au()&&(t.tagName==="BODY"||t.tagName==="HTML")&&u){s.top=0,s.left=0;var h;o=(h=me==null?void 0:me.pageTop)!==null&&h!==void 0?h:0;var g;a=(g=me==null?void 0:me.pageLeft)!==null&&g!==void 0?g:0}return{width:e,height:n,totalWidth:r,totalHeight:i,scroll:s,top:o,left:a}}function ng(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function ys(t,e,n,r,i,o,a){var s;let l=(s=i.scroll[t])!==null&&s!==void 0?s:0,u=r[$o[t]],c=r.scroll[Je[t]]+o,d=u+r.scroll[Je[t]]-o,h=e-l+a[t]-r[Je[t]],g=e-l+n+a[t]-r[Je[t]];return h<c?c-h:g>d?Math.max(d-g,c-h):0}function rg(t){let e=window.getComputedStyle(t);return{top:parseInt(e.marginTop,10)||0,bottom:parseInt(e.marginBottom,10)||0,left:parseInt(e.marginLeft,10)||0,right:parseInt(e.marginRight,10)||0}}function bs(t){if(ir[t])return ir[t];let[e,n]=t.split(" "),r=Je[e]||"right",i=tg[r];Je[n]||(n="center");let o=$o[r],a=$o[i];return ir[t]={placement:e,crossPlacement:n,axis:r,crossAxis:i,size:o,crossSize:a},ir[t]}function _i(t,e,n,r,i,o,a,s,l,u){let{placement:c,crossPlacement:d,axis:h,crossAxis:g,size:m,crossSize:p}=r,v={};var y;v[g]=(y=t[g])!==null&&y!==void 0?y:0;var w,$,P,D;d==="center"?v[g]+=(((w=t[p])!==null&&w!==void 0?w:0)-(($=n[p])!==null&&$!==void 0?$:0))/2:d!==g&&(v[g]+=((P=t[p])!==null&&P!==void 0?P:0)-((D=n[p])!==null&&D!==void 0?D:0)),v[g]+=o;const O=t[g]-n[p]+l+u,I=t[g]+t[p]-l-u;if(v[g]=ho(v[g],O,I),c===h){const b=s?a[m]:e[Mu[m]];v[Lr[h]]=Math.floor(b-t[h]+i)}else v[h]=Math.floor(t[h]+t[m]+i);return v}function ig(t,e,n,r,i,o,a,s){const l=r?n.height:e[Mu.height];var u;let c=t.top!=null?n.top+t.top:n.top+(l-((u=t.bottom)!==null&&u!==void 0?u:0)-a);var d,h,g,m,p,v;let y=s!=="top"?Math.max(0,e.height+e.top+((d=e.scroll.top)!==null&&d!==void 0?d:0)-c-(((h=i.top)!==null&&h!==void 0?h:0)+((g=i.bottom)!==null&&g!==void 0?g:0)+o)):Math.max(0,c+a-(e.top+((m=e.scroll.top)!==null&&m!==void 0?m:0))-(((p=i.top)!==null&&p!==void 0?p:0)+((v=i.bottom)!==null&&v!==void 0?v:0)+o));return Math.min(e.height-o*2,y)}function Ss(t,e,n,r,i,o){let{placement:a,axis:s,size:l}=o;var u,c;if(a===s)return Math.max(0,n[s]-t[s]-((u=t.scroll[s])!==null&&u!==void 0?u:0)+e[s]-((c=r[s])!==null&&c!==void 0?c:0)-r[Lr[s]]-i);var d;return Math.max(0,t[l]+t[s]+t.scroll[s]-e[s]-n[s]-n[l]-((d=r[s])!==null&&d!==void 0?d:0)-r[Lr[s]]-i)}function og(t,e,n,r,i,o,a,s,l,u,c,d,h,g,m,p){let v=bs(t),{size:y,crossAxis:w,crossSize:$,placement:P,crossPlacement:D}=v,O=_i(e,s,n,v,c,d,u,h,m,p),I=c,b=Ss(s,u,e,i,o+c,v);if(a&&r[y]>b){let F=bs(`${Lr[P]} ${D}`),A=_i(e,s,n,F,c,d,u,h,m,p);Ss(s,u,e,i,o+c,F)>b&&(v=F,O=A,I=c)}let R="bottom";v.axis==="top"?v.placement==="top"?R="top":v.placement==="bottom"&&(R="bottom"):v.crossAxis==="top"&&(v.crossPlacement==="top"?R="bottom":v.crossPlacement==="bottom"&&(R="top"));let V=ys(w,O[w],n[$],s,l,o,u);O[w]+=V;let k=ig(O,s,u,h,i,o,n.height,R);g&&g<k&&(k=g),n.height=Math.min(n.height,k),O=_i(e,s,n,v,I,d,u,h,m,p),V=ys(w,O[w],n[$],s,l,o,u),O[w]+=V;let B={},E=e[w]+.5*e[$]-O[w]-i[Je[w]];const T=m/2+p;var j,W,Y,N;const X=Je[w]==="left"?((j=i.left)!==null&&j!==void 0?j:0)+((W=i.right)!==null&&W!==void 0?W:0):((Y=i.top)!==null&&Y!==void 0?Y:0)+((N=i.bottom)!==null&&N!==void 0?N:0),ie=n[$]-X-m/2-p,de=e[w]+m/2-(O[w]+i[Je[w]]),M=e[w]+e[$]-m/2-(O[w]+i[Je[w]]),_=ho(E,de,M);return B[w]=ho(_,T,ie),{position:O,maxHeight:k,arrowOffsetLeft:B.left,arrowOffsetTop:B.top,placement:v.placement}}function ag(t){let{placement:e,targetNode:n,overlayNode:r,scrollNode:i,padding:o,shouldFlip:a,boundaryElement:s,offset:l,crossOffset:u,maxHeight:c,arrowSize:d=0,arrowBoundaryOffset:h=0}=t,g=r instanceof HTMLElement?sg(r):document.documentElement,m=g===document.documentElement;const p=window.getComputedStyle(g).position;let v=!!p&&p!=="static",y=m?un(n):Es(n,g);if(!m){let{marginTop:B,marginLeft:E}=window.getComputedStyle(n);y.top+=parseInt(B,10)||0,y.left+=parseInt(E,10)||0}let w=un(r),$=rg(r);var P,D;w.width+=((P=$.left)!==null&&P!==void 0?P:0)+((D=$.right)!==null&&D!==void 0?D:0);var O,I;w.height+=((O=$.top)!==null&&O!==void 0?O:0)+((I=$.bottom)!==null&&I!==void 0?I:0);let b=ng(i),R=ms(s),V=ms(g),k=s.tagName==="BODY"?un(g):Es(g,s);return g.tagName==="HTML"&&s.tagName==="BODY"&&(V.scroll.top=0,V.scroll.left=0),og(e,y,w,b,$,o,a,R,V,k,l,u,v,c,d,h)}function un(t){let{top:e,left:n,width:r,height:i}=t.getBoundingClientRect(),{scrollTop:o,scrollLeft:a,clientTop:s,clientLeft:l}=document.documentElement;return{top:e+o-s,left:n+a-l,width:r,height:i}}function Es(t,e){let n=window.getComputedStyle(t),r;if(n.position==="fixed"){let{top:i,left:o,width:a,height:s}=t.getBoundingClientRect();r={top:i,left:o,width:a,height:s}}else{r=un(t);let i=un(e),o=window.getComputedStyle(e);i.top+=(parseInt(o.borderTopWidth,10)||0)-e.scrollTop,i.left+=(parseInt(o.borderLeftWidth,10)||0)-e.scrollLeft,r.top-=i.top,r.left-=i.left}return r.top-=parseInt(n.marginTop,10)||0,r.left-=parseInt(n.marginLeft,10)||0,r}function sg(t){let e=t.offsetParent;if(e&&e===document.body&&window.getComputedStyle(e).position==="static"&&!ws(e)&&(e=document.documentElement),e==null)for(e=t.parentElement;e&&!ws(e);)e=e.parentElement;return e||document.documentElement}function ws(t){let e=window.getComputedStyle(t);return e.transform!=="none"||/transform|perspective/.test(e.willChange)||e.filter!=="none"||e.contain==="paint"||"backdropFilter"in e&&e.backdropFilter!=="none"||"WebkitBackdropFilter"in e&&e.WebkitBackdropFilter!=="none"}const lg=new WeakMap;function ug(t){let{triggerRef:e,isOpen:n,onClose:r}=t;f.useEffect(()=>{if(!n||r===null)return;let i=o=>{let a=o.target;if(!e.current||a instanceof Node&&!a.contains(e.current)||o.target instanceof HTMLInputElement||o.target instanceof HTMLTextAreaElement)return;let s=r||lg.get(e.current);s&&s()};return window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("scroll",i,!0)}},[n,r,e])}let he=typeof document<"u"?window.visualViewport:null;function cg(t){let{direction:e}=qn(),{arrowSize:n=0,targetRef:r,overlayRef:i,scrollRef:o=i,placement:a="bottom",containerPadding:s=12,shouldFlip:l=!0,boundaryElement:u=typeof document<"u"?document.body:null,offset:c=0,crossOffset:d=0,shouldUpdatePosition:h=!0,isOpen:g=!0,onClose:m,maxHeight:p,arrowBoundaryOffset:v=0}=t,[y,w]=f.useState(null),$=[h,a,i.current,r.current,o.current,s,l,u,c,d,g,e,p,v,n],P=f.useRef(he==null?void 0:he.scale);f.useEffect(()=>{g&&(P.current=he==null?void 0:he.scale)},[g]);let D=f.useCallback(()=>{if(h===!1||!g||!i.current||!r.current||!u||(he==null?void 0:he.scale)!==P.current)return;let V=null;if(o.current&&o.current.contains(document.activeElement)){var k;let N=(k=document.activeElement)===null||k===void 0?void 0:k.getBoundingClientRect(),X=o.current.getBoundingClientRect();var B;if(V={type:"top",offset:((B=N==null?void 0:N.top)!==null&&B!==void 0?B:0)-X.top},V.offset>X.height/2){V.type="bottom";var E;V.offset=((E=N==null?void 0:N.bottom)!==null&&E!==void 0?E:0)-X.bottom}}let T=i.current;if(!p&&i.current){var j;T.style.top="0px",T.style.bottom="";var W;T.style.maxHeight=((W=(j=window.visualViewport)===null||j===void 0?void 0:j.height)!==null&&W!==void 0?W:window.innerHeight)+"px"}let Y=ag({placement:fg(a,e),overlayNode:i.current,targetNode:r.current,scrollNode:o.current||i.current,padding:s,shouldFlip:l,boundaryElement:u,offset:c,crossOffset:d,maxHeight:p,arrowSize:n,arrowBoundaryOffset:v});if(Y.position){if(T.style.top="",T.style.bottom="",T.style.left="",T.style.right="",Object.keys(Y.position).forEach(N=>T.style[N]=Y.position[N]+"px"),T.style.maxHeight=Y.maxHeight!=null?Y.maxHeight+"px":"",V&&document.activeElement&&o.current){let N=document.activeElement.getBoundingClientRect(),X=o.current.getBoundingClientRect(),ie=N[V.type]-X[V.type];o.current.scrollTop+=ie-V.offset}w(Y)}},$);ae(D,$),dg(D),qa({ref:i,onResize:D}),qa({ref:r,onResize:D});let O=f.useRef(!1);ae(()=>{let V,k=()=>{O.current=!0,clearTimeout(V),V=setTimeout(()=>{O.current=!1},500),D()},B=()=>{O.current&&k()};return he==null||he.addEventListener("resize",k),he==null||he.addEventListener("scroll",B),()=>{he==null||he.removeEventListener("resize",k),he==null||he.removeEventListener("scroll",B)}},[D]);let I=f.useCallback(()=>{O.current||m==null||m()},[m,O]);ug({triggerRef:r,isOpen:g,onClose:m&&I});var b,R;return{overlayProps:{style:{position:"absolute",zIndex:1e5,...y==null?void 0:y.position,maxHeight:(b=y==null?void 0:y.maxHeight)!==null&&b!==void 0?b:"100vh"}},placement:(R=y==null?void 0:y.placement)!==null&&R!==void 0?R:null,arrowProps:{"aria-hidden":"true",role:"presentation",style:{left:y==null?void 0:y.arrowOffsetLeft,top:y==null?void 0:y.arrowOffsetTop}},updatePosition:D}}function dg(t){ae(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function fg(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}const Ze=[];function hg(t,e){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:o=!1,isKeyboardDismissDisabled:a=!1,shouldCloseOnInteractOutside:s}=t;f.useEffect(()=>(i&&Ze.push(e),()=>{let m=Ze.indexOf(e);m>=0&&Ze.splice(m,1)}),[i,e]);let l=()=>{Ze[Ze.length-1]===e&&n&&n()},u=m=>{(!s||s(m.target))&&Ze[Ze.length-1]===e&&(m.stopPropagation(),m.preventDefault())},c=m=>{(!s||s(m.target))&&(Ze[Ze.length-1]===e&&(m.stopPropagation(),m.preventDefault()),l())},d=m=>{m.key==="Escape"&&!a&&!m.nativeEvent.isComposing&&(m.stopPropagation(),m.preventDefault(),l())};wp({ref:e,onInteractOutside:o&&i?c:void 0,onInteractOutsideStart:u});let{focusWithinProps:h}=ia({isDisabled:!r,onBlurWithin:m=>{!m.relatedTarget||kp(m.relatedTarget)||(!s||s(m.relatedTarget))&&(n==null||n())}}),g=m=>{m.target===m.currentTarget&&m.preventDefault()};return{overlayProps:{onKeyDown:d,...h},underlayProps:{onPointerDown:g}}}const ki=typeof document<"u"&&window.visualViewport,pg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let or=0,Ni;function gg(t={}){let{isDisabled:e}=t;ae(()=>{if(!e)return or++,or===1&&(qr()?Ni=mg():Ni=vg()),()=>{or--,or===0&&Ni()}},[e])}function vg(){return An(an(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),an(document.documentElement,"overflow","hidden"))}function mg(){let t,e,n=u=>{t=du(u.target,!0),!(t===document.documentElement&&t===document.body)&&t instanceof HTMLElement&&window.getComputedStyle(t).overscrollBehavior==="auto"&&(e=an(t,"overscrollBehavior","contain"))},r=u=>{if(!t||t===document.documentElement||t===document.body){u.preventDefault();return}t.scrollHeight===t.clientHeight&&t.scrollWidth===t.clientWidth&&u.preventDefault()},i=()=>{e&&e()},o=u=>{let c=u.target;yg(c)&&(s(),c.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{c.style.transform="",ki&&(ki.height<window.innerHeight?requestAnimationFrame(()=>{xs(c)}):ki.addEventListener("resize",()=>xs(c),{once:!0}))}))},a=null,s=()=>{if(a)return;let u=()=>{window.scrollTo(0,0)},c=window.pageXOffset,d=window.pageYOffset;a=An(xn(window,"scroll",u),an(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),an(document.documentElement,"overflow","hidden"),an(document.body,"marginTop",`-${d}px`),()=>{window.scrollTo(c,d)}),window.scrollTo(0,0)},l=An(xn(document,"touchstart",n,{passive:!1,capture:!0}),xn(document,"touchmove",r,{passive:!1,capture:!0}),xn(document,"touchend",i,{passive:!1,capture:!0}),xn(document,"focus",o,!0));return()=>{e==null||e(),a==null||a(),l()}}function an(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function xn(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function xs(t){let e=document.scrollingElement||document.documentElement,n=t;for(;n&&n!==e;){let r=du(n);if(r!==document.documentElement&&r!==document.body&&r!==n){let i=r.getBoundingClientRect().top,o=n.getBoundingClientRect().top;o>i+n.clientHeight&&(r.scrollTop+=o-i)}n=r.parentElement}}function yg(t){return t instanceof HTMLInputElement&&!pg.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}var Au={};Au={dismiss:"تجاهل"};var Lu={};Lu={dismiss:"Отхвърляне"};var Ku={};Ku={dismiss:"Odstranit"};var Fu={};Fu={dismiss:"Luk"};var ju={};ju={dismiss:"Schließen"};var zu={};zu={dismiss:"Απόρριψη"};var Hu={};Hu={dismiss:"Dismiss"};var Bu={};Bu={dismiss:"Descartar"};var Wu={};Wu={dismiss:"Lõpeta"};var Uu={};Uu={dismiss:"Hylkää"};var Vu={};Vu={dismiss:"Rejeter"};var Gu={};Gu={dismiss:"התעלם"};var qu={};qu={dismiss:"Odbaci"};var Yu={};Yu={dismiss:"Elutasítás"};var Xu={};Xu={dismiss:"Ignora"};var Ju={};Ju={dismiss:"閉じる"};var Qu={};Qu={dismiss:"무시"};var Zu={};Zu={dismiss:"Atmesti"};var ec={};ec={dismiss:"Nerādīt"};var tc={};tc={dismiss:"Lukk"};var nc={};nc={dismiss:"Negeren"};var rc={};rc={dismiss:"Zignoruj"};var ic={};ic={dismiss:"Descartar"};var oc={};oc={dismiss:"Dispensar"};var ac={};ac={dismiss:"Revocare"};var sc={};sc={dismiss:"Пропустить"};var lc={};lc={dismiss:"Zrušiť"};var uc={};uc={dismiss:"Opusti"};var cc={};cc={dismiss:"Odbaci"};var dc={};dc={dismiss:"Avvisa"};var fc={};fc={dismiss:"Kapat"};var hc={};hc={dismiss:"Скасувати"};var pc={};pc={dismiss:"取消"};var gc={};gc={dismiss:"關閉"};var vc={};vc={"ar-AE":Au,"bg-BG":Lu,"cs-CZ":Ku,"da-DK":Fu,"de-DE":ju,"el-GR":zu,"en-US":Hu,"es-ES":Bu,"et-EE":Wu,"fi-FI":Uu,"fr-FR":Vu,"he-IL":Gu,"hr-HR":qu,"hu-HU":Yu,"it-IT":Xu,"ja-JP":Ju,"ko-KR":Qu,"lt-LT":Zu,"lv-LV":ec,"nb-NO":tc,"nl-NL":nc,"pl-PL":rc,"pt-BR":ic,"pt-PT":oc,"ro-RO":ac,"ru-RU":sc,"sk-SK":lc,"sl-SI":uc,"sr-SP":cc,"sv-SE":dc,"tr-TR":fc,"uk-UA":hc,"zh-CN":pc,"zh-TW":gc};function bg(t){return t&&t.__esModule?t.default:t}function $s(t){let{onDismiss:e,...n}=t,r=Jp(bg(vc),"@react-aria/overlays"),i=Go(n,r.format("dismiss")),o=()=>{e&&e()};return f.createElement(eg,null,f.createElement("button",{...i,tabIndex:-1,onClick:o,style:{width:1,height:1}}))}let $n=new WeakMap,Me=[];function Sg(t,e=document.body){let n=new Set(t),r=new Set,i=l=>{for(let h of l.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(h);let u=h=>{if(n.has(h)||h.parentElement&&r.has(h.parentElement)&&h.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let g of n)if(h.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),d=u(l);if(d===NodeFilter.FILTER_ACCEPT&&o(l),d!==NodeFilter.FILTER_REJECT){let h=c.nextNode();for(;h!=null;)o(h),h=c.nextNode()}},o=l=>{var u;let c=(u=$n.get(l))!==null&&u!==void 0?u:0;l.getAttribute("aria-hidden")==="true"&&c===0||(c===0&&l.setAttribute("aria-hidden","true"),r.add(l),$n.set(l,c+1))};Me.length&&Me[Me.length-1].disconnect(),i(e);let a=new MutationObserver(l=>{for(let u of l)if(!(u.type!=="childList"||u.addedNodes.length===0)&&![...n,...r].some(c=>c.contains(u.target))){for(let c of u.removedNodes)c instanceof Element&&(n.delete(c),r.delete(c));for(let c of u.addedNodes)(c instanceof HTMLElement||c instanceof SVGElement)&&(c.dataset.liveAnnouncer==="true"||c.dataset.reactAriaTopLayer==="true")?n.add(c):c instanceof Element&&i(c)}});a.observe(e,{childList:!0,subtree:!0});let s={observe(){a.observe(e,{childList:!0,subtree:!0})},disconnect(){a.disconnect()}};return Me.push(s),()=>{a.disconnect();for(let l of r){let u=$n.get(l);u!=null&&(u===1?(l.removeAttribute("aria-hidden"),$n.delete(l)):$n.set(l,u-1))}s===Me[Me.length-1]?(Me.pop(),Me.length&&Me[Me.length-1].observe()):Me.splice(Me.indexOf(s),1)}}function Eg(t,e){let{triggerRef:n,popoverRef:r,isNonModal:i,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:a,...s}=t,{overlayProps:l,underlayProps:u}=hg({isOpen:e.isOpen&&!s["data-react-aria-top-layer"],onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!i,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:a},r),{overlayProps:c,arrowProps:d,placement:h}=cg({...s,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:i?e.close:null});return gg({isDisabled:i||!e.isOpen}),ae(()=>{if(e.isOpen&&!i&&r.current)return Sg([r.current])},[i,e.isOpen,r]),{popoverProps:Ee(l,c),arrowProps:d,underlayProps:u,placement:h}}const wg=f.createContext({});function xg(){var t;return(t=f.useContext(wg))!==null&&t!==void 0?t:{}}const $g=f.createContext(null);function Cg(t){let e=yn(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[i,o]=f.useState(!1),a=f.useMemo(()=>({contain:i,setContain:o}),[i,o]),{getContainer:s}=xg();if(!t.portalContainer&&s&&(n=s()),!n)return null;let l=t.children;return t.disableFocusManagement||(l=f.createElement(Iu,{restoreFocus:!0,contain:i&&!r},l)),l=f.createElement($g.Provider,{value:a},f.createElement(hp,null,l)),Mt.createPortal(l,n)}function Co(t){return Th()?t.altKey:t.ctrlKey}const Tg=1e3;function Dg(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,i=f.useRef({search:"",timeout:void 0}).current,o=a=>{let s=Pg(a.key);if(!(!s||a.ctrlKey||a.metaKey||!a.currentTarget.contains(a.target))){if(s===" "&&i.search.trim().length>0&&(a.preventDefault(),"continuePropagation"in a||a.stopPropagation()),i.search+=s,e.getKeyForSearch!=null){let l=e.getKeyForSearch(i.search,n.focusedKey);l==null&&(l=e.getKeyForSearch(i.search)),l!=null&&(n.setFocusedKey(l),r&&r(l))}clearTimeout(i.timeout),i.timeout=setTimeout(()=>{i.search=""},Tg)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?o:void 0}}}function Pg(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function mc(t){let{selectionManager:e,keyboardDelegate:n,ref:r,autoFocus:i=!1,shouldFocusWrap:o=!1,disallowEmptySelection:a=!1,disallowSelectAll:s=!1,selectOnFocus:l=e.selectionBehavior==="replace",disallowTypeAhead:u=!1,shouldUseVirtualFocus:c,allowsTabNavigation:d=!1,isVirtualized:h,scrollRef:g=r,linkBehavior:m="action"}=t,{direction:p}=qn(),v=Yr(),y=E=>{var T;if(E.altKey&&E.key==="Tab"&&E.preventDefault(),!(!((T=r.current)===null||T===void 0)&&T.contains(E.target)))return;const j=(L,q)=>{if(L!=null){if(e.isLink(L)&&m==="selection"&&l&&!Co(E)){var Q;Mt.flushSync(()=>{e.setFocusedKey(L,q)});let ye=(Q=g.current)===null||Q===void 0?void 0:Q.querySelector(`[data-key="${CSS.escape(L.toString())}"]`),ve=e.getItemProps(L);ye&&v.open(ye,E,ve.href,ve.routerOptions);return}if(e.setFocusedKey(L,q),e.isLink(L)&&m==="override")return;E.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):l&&!Co(E)&&e.replaceSelection(L)}};switch(E.key){case"ArrowDown":if(n.getKeyBelow){var W,Y,N;let L=e.focusedKey!=null?(W=n.getKeyBelow)===null||W===void 0?void 0:W.call(n,e.focusedKey):(Y=n.getFirstKey)===null||Y===void 0?void 0:Y.call(n);L==null&&o&&(L=(N=n.getFirstKey)===null||N===void 0?void 0:N.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),j(L))}break;case"ArrowUp":if(n.getKeyAbove){var X,ie,de;let L=e.focusedKey!=null?(X=n.getKeyAbove)===null||X===void 0?void 0:X.call(n,e.focusedKey):(ie=n.getLastKey)===null||ie===void 0?void 0:ie.call(n);L==null&&o&&(L=(de=n.getLastKey)===null||de===void 0?void 0:de.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),j(L))}break;case"ArrowLeft":if(n.getKeyLeftOf){var M,_,F;let L=e.focusedKey!=null?(M=n.getKeyLeftOf)===null||M===void 0?void 0:M.call(n,e.focusedKey):null;L==null&&o&&(L=p==="rtl"?(_=n.getFirstKey)===null||_===void 0?void 0:_.call(n,e.focusedKey):(F=n.getLastKey)===null||F===void 0?void 0:F.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),j(L,p==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var A,z,H;let L=e.focusedKey!=null?(A=n.getKeyRightOf)===null||A===void 0?void 0:A.call(n,e.focusedKey):null;L==null&&o&&(L=p==="rtl"?(z=n.getLastKey)===null||z===void 0?void 0:z.call(n,e.focusedKey):(H=n.getFirstKey)===null||H===void 0?void 0:H.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),j(L,p==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&E.shiftKey)return;E.preventDefault();let L=n.getFirstKey(e.focusedKey,tn(E));e.setFocusedKey(L),L!=null&&(tn(E)&&E.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):l&&e.replaceSelection(L))}break;case"End":if(n.getLastKey){if(e.focusedKey===null&&E.shiftKey)return;E.preventDefault();let L=n.getLastKey(e.focusedKey,tn(E));e.setFocusedKey(L),L!=null&&(tn(E)&&E.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):l&&e.replaceSelection(L))}break;case"PageDown":if(n.getKeyPageBelow&&e.focusedKey!=null){let L=n.getKeyPageBelow(e.focusedKey);L!=null&&(E.preventDefault(),j(L))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let L=n.getKeyPageAbove(e.focusedKey);L!=null&&(E.preventDefault(),j(L))}break;case"a":tn(E)&&e.selectionMode==="multiple"&&s!==!0&&(E.preventDefault(),e.selectAll());break;case"Escape":!a&&e.selectedKeys.size!==0&&(E.stopPropagation(),E.preventDefault(),e.clearSelection());break;case"Tab":if(!d){if(E.shiftKey)r.current.focus();else{let L=Xe(r.current,{tabbable:!0}),q,Q;do Q=L.lastChild(),Q&&(q=Q);while(Q);q&&!q.contains(document.activeElement)&&nt(q)}break}}},w=f.useRef({top:0,left:0});Qn(g,"scroll",h?void 0:()=>{var E,T,j,W;w.current={top:(j=(E=g.current)===null||E===void 0?void 0:E.scrollTop)!==null&&j!==void 0?j:0,left:(W=(T=g.current)===null||T===void 0?void 0:T.scrollLeft)!==null&&W!==void 0?W:0}});let $=E=>{if(e.isFocused){E.currentTarget.contains(E.target)||e.setFocused(!1);return}if(E.currentTarget.contains(E.target)){if(e.setFocused(!0),e.focusedKey==null){var T,j;let N=ie=>{ie!=null&&(e.setFocusedKey(ie),l&&e.replaceSelection(ie))},X=E.relatedTarget;var W,Y;X&&E.currentTarget.compareDocumentPosition(X)&Node.DOCUMENT_POSITION_FOLLOWING?N((W=e.lastSelectedKey)!==null&&W!==void 0?W:(T=n.getLastKey)===null||T===void 0?void 0:T.call(n)):N((Y=e.firstSelectedKey)!==null&&Y!==void 0?Y:(j=n.getFirstKey)===null||j===void 0?void 0:j.call(n))}else!h&&g.current&&(g.current.scrollTop=w.current.top,g.current.scrollLeft=w.current.left);if(e.focusedKey!=null&&g.current){let N=g.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);N&&(N.contains(document.activeElement)||nt(N),Nr()==="keyboard"&&Xa(N,{containingElement:r.current}))}}},P=E=>{E.currentTarget.contains(E.relatedTarget)||e.setFocused(!1)},D=f.useRef(!1);Qn(r,Kh,c?E=>{let{detail:T}=E;E.stopPropagation(),e.setFocused(!0),(T==null?void 0:T.focusStrategy)==="first"&&(D.current=!0)}:void 0);let O=ke(()=>{var E,T;let j=(T=(E=n.getFirstKey)===null||E===void 0?void 0:E.call(n))!==null&&T!==void 0?T:null;if(j==null){var W;(W=r.current)===null||W===void 0||W.dispatchEvent(new CustomEvent(hu,{cancelable:!0,bubbles:!0})),e.collection.size>0&&(D.current=!1)}else e.setFocusedKey(j),D.current=!1});Ga(()=>{D.current&&O()},[e.collection,O]);let I=ke(()=>{e.collection.size>0&&(D.current=!1)});Ga(()=>{I()},[e.focusedKey,I]),Qn(r,Lh,c?E=>{E.stopPropagation(),e.setFocused(!1),e.setFocusedKey(null)}:void 0);const b=f.useRef(i);f.useEffect(()=>{if(b.current){var E,T;let Y=null;var j;i==="first"&&(Y=(j=(E=n.getFirstKey)===null||E===void 0?void 0:E.call(n))!==null&&j!==void 0?j:null);var W;i==="last"&&(Y=(W=(T=n.getLastKey)===null||T===void 0?void 0:T.call(n))!==null&&W!==void 0?W:null);let N=e.selectedKeys;if(N.size){for(let X of N)if(e.canSelectItem(X)){Y=X;break}}e.setFocused(!0),e.setFocusedKey(Y),Y==null&&!c&&r.current&&Mr(r.current)}},[]);let R=f.useRef(e.focusedKey);f.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==R.current||b.current)&&g.current&&r.current){let E=Nr(),T=r.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);if(!T)return;(E==="keyboard"||b.current)&&(fu(g.current,T),E!=="virtual"&&Xa(T,{containingElement:r.current}))}!c&&e.isFocused&&e.focusedKey==null&&R.current!=null&&r.current&&Mr(r.current),R.current=e.focusedKey,b.current=!1}),Qn(r,"react-aria-focus-scope-restore",E=>{E.preventDefault(),e.setFocused(!0)});let V={onKeyDown:y,onFocus:$,onBlur:P,onMouseDown(E){g.current===E.target&&E.preventDefault()}},{typeSelectProps:k}=Dg({keyboardDelegate:n,selectionManager:e});u||(V=Ee(k,V));let B;return c?B=-1:B=e.focusedKey==null?0:-1,{collectionProps:{...V,tabIndex:B}}}function yc(t){let{id:e,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:o,shouldUseVirtualFocus:a,focus:s,isDisabled:l,onAction:u,allowsDifferentPressOrigin:c,linkBehavior:d="action"}=t,h=Yr();e=Un(e);let g=N=>{if(N.pointerType==="keyboard"&&Co(N))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(d==="selection"&&i.current){let X=n.getItemProps(r);h.open(i.current,N,X.href,X.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(d==="override"||d==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):N&&N.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||N&&(tn(N)||N.pointerType==="touch"||N.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};f.useEffect(()=>{if(r===n.focusedKey&&n.isFocused)if(!a)s?s():document.activeElement!==i.current&&i.current&&Mr(i.current);else{var X;let ie=new CustomEvent(hu,{cancelable:!0,bubbles:!0});(X=i.current)===null||X===void 0||X.dispatchEvent(ie)}},[i,r,n.focusedKey,n.childFocusStrategy,n.isFocused,a]),l=l||n.isDisabled(r);let m={};!a&&!l?m={tabIndex:r===n.focusedKey?0:-1,onFocus(N){N.target===i.current&&n.setFocusedKey(r)}}:l&&(m.onMouseDown=N=>{N.preventDefault()});let p=n.isLink(r)&&d==="override",v=n.isLink(r)&&d!=="selection"&&d!=="none",y=!l&&n.canSelectItem(r)&&!p,w=(u||v)&&!l,$=w&&(n.selectionBehavior==="replace"?!y:!y||n.isEmpty),P=w&&y&&n.selectionBehavior==="replace",D=$||P,O=f.useRef(null),I=D&&y,b=f.useRef(!1),R=f.useRef(!1),V=N=>{if(u&&u(),v&&i.current){let X=n.getItemProps(r);h.open(i.current,N,X.href,X.routerOptions)}},k={};o?(k.onPressStart=N=>{O.current=N.pointerType,b.current=I,N.pointerType==="keyboard"&&(!D||Ts())&&g(N)},c?(k.onPressUp=$?void 0:N=>{N.pointerType==="mouse"&&y&&g(N)},k.onPress=$?V:N=>{N.pointerType!=="keyboard"&&N.pointerType!=="mouse"&&y&&g(N)}):k.onPress=N=>{if($||P&&N.pointerType!=="mouse"){if(N.pointerType==="keyboard"&&!Cs())return;V(N)}else N.pointerType!=="keyboard"&&y&&g(N)}):(k.onPressStart=N=>{O.current=N.pointerType,b.current=I,R.current=$,y&&(N.pointerType==="mouse"&&!$||N.pointerType==="keyboard"&&(!w||Ts()))&&g(N)},k.onPress=N=>{(N.pointerType==="touch"||N.pointerType==="pen"||N.pointerType==="virtual"||N.pointerType==="keyboard"&&D&&Cs()||N.pointerType==="mouse"&&R.current)&&(D?V(N):y&&g(N))}),m["data-key"]=r,k.preventFocusOnPress=a;let{pressProps:B,isPressed:E}=ea(k),T=P?N=>{O.current==="mouse"&&(N.stopPropagation(),N.preventDefault(),V(N))}:void 0,{longPressProps:j}=Cp({isDisabled:!I,onLongPress(N){N.pointerType==="touch"&&(g(N),n.setSelectionBehavior("toggle"))}}),W=N=>{O.current==="touch"&&b.current&&N.preventDefault()},Y=n.isLink(r)?N=>{Dt.isOpening||N.preventDefault()}:void 0;return{itemProps:Ee(m,y||$?B:{},I?j:{},{onDoubleClick:T,onDragStartCapture:W,onClick:Y,id:e}),isPressed:E,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:l,allowsSelection:y,hasAction:D}}function Cs(){let t=window.event;return(t==null?void 0:t.key)==="Enter"}function Ts(){let t=window.event;return(t==null?void 0:t.key)===" "||(t==null?void 0:t.code)==="Space"}class Ds{getItemRect(e){let n=this.ref.current;if(!n)return null;let r=e!=null?n.querySelector(`[data-key="${CSS.escape(e.toString())}"]`):null;if(!r)return null;let i=n.getBoundingClientRect(),o=r.getBoundingClientRect();return{x:o.left-i.left+n.scrollLeft,y:o.top-i.top+n.scrollTop,width:o.width,height:o.height}}getContentSize(){let e=this.ref.current;var n,r;return{width:(n=e==null?void 0:e.scrollWidth)!==null&&n!==void 0?n:0,height:(r=e==null?void 0:e.scrollHeight)!==null&&r!==void 0?r:0}}getVisibleRect(){let e=this.ref.current;var n,r,i,o;return{x:(n=e==null?void 0:e.scrollLeft)!==null&&n!==void 0?n:0,y:(r=e==null?void 0:e.scrollTop)!==null&&r!==void 0?r:0,width:(i=e==null?void 0:e.offsetWidth)!==null&&i!==void 0?i:0,height:(o=e==null?void 0:e.offsetHeight)!==null&&o!==void 0?o:0}}constructor(e){this.ref=e}}class Og{isDisabled(e){var n;return this.disabledBehavior==="all"&&(((n=e.props)===null||n===void 0?void 0:n.isDisabled)||this.disabledKeys.has(e.key))}findNextNonDisabled(e,n){let r=e;for(;r!=null;){let i=this.collection.getItem(r);if((i==null?void 0:i.type)==="item"&&!this.isDisabled(i))return r;r=n(r)}return null}getNextKey(e){let n=e;return n=this.collection.getKeyAfter(n),this.findNextNonDisabled(n,r=>this.collection.getKeyAfter(r))}getPreviousKey(e){let n=e;return n=this.collection.getKeyBefore(n),this.findNextNonDisabled(n,r=>this.collection.getKeyBefore(r))}findKey(e,n,r){let i=e,o=this.layoutDelegate.getItemRect(i);if(!o||i==null)return null;let a=o;do{if(i=n(i),i==null)break;o=this.layoutDelegate.getItemRect(i)}while(o&&r(a,o)&&i!=null);return i}isSameRow(e,n){return e.y===n.y||e.x!==n.x}isSameColumn(e,n){return e.x===n.x||e.y!==n.y}getKeyBelow(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getNextKey(n),this.isSameRow):this.getNextKey(e)}getKeyAbove(e){return this.layout==="grid"&&this.orientation==="vertical"?this.findKey(e,n=>this.getPreviousKey(n),this.isSameRow):this.getPreviousKey(e)}getNextColumn(e,n){return n?this.getPreviousKey(e):this.getNextKey(e)}getKeyRightOf(e){let n=this.direction==="ltr"?"getKeyRightOf":"getKeyLeftOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="rtl"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="rtl"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="rtl"):null}getKeyLeftOf(e){let n=this.direction==="ltr"?"getKeyLeftOf":"getKeyRightOf";return this.layoutDelegate[n]?(e=this.layoutDelegate[n](e),this.findNextNonDisabled(e,r=>this.layoutDelegate[n](r))):this.layout==="grid"?this.orientation==="vertical"?this.getNextColumn(e,this.direction==="ltr"):this.findKey(e,r=>this.getNextColumn(r,this.direction==="ltr"),this.isSameColumn):this.orientation==="horizontal"?this.getNextColumn(e,this.direction==="ltr"):null}getFirstKey(){let e=this.collection.getFirstKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyAfter(n))}getLastKey(){let e=this.collection.getLastKey();return this.findNextNonDisabled(e,n=>this.collection.getKeyBefore(n))}getKeyPageAbove(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!Ln(n))return this.getFirstKey();let i=e;if(this.orientation==="horizontal"){let o=Math.max(0,r.x+r.width-this.layoutDelegate.getVisibleRect().width);for(;r&&r.x>o&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let o=Math.max(0,r.y+r.height-this.layoutDelegate.getVisibleRect().height);for(;r&&r.y>o&&i!=null;)i=this.getKeyAbove(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getFirstKey()}getKeyPageBelow(e){let n=this.ref.current,r=this.layoutDelegate.getItemRect(e);if(!r)return null;if(n&&!Ln(n))return this.getLastKey();let i=e;if(this.orientation==="horizontal"){let o=Math.min(this.layoutDelegate.getContentSize().width,r.y-r.width+this.layoutDelegate.getVisibleRect().width);for(;r&&r.x<o&&i!=null;)i=this.getKeyBelow(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}else{let o=Math.min(this.layoutDelegate.getContentSize().height,r.y-r.height+this.layoutDelegate.getVisibleRect().height);for(;r&&r.y<o&&i!=null;)i=this.getKeyBelow(i),r=i==null?null:this.layoutDelegate.getItemRect(i)}return i??this.getLastKey()}getKeyForSearch(e,n){if(!this.collator)return null;let r=this.collection,i=n||this.getFirstKey();for(;i!=null;){let o=r.getItem(i);if(!o)return null;let a=o.textValue.slice(0,e.length);if(o.textValue&&this.collator.compare(a,e)===0)return i;i=this.getNextKey(i)}return null}constructor(...e){if(e.length===1){let n=e[0];this.collection=n.collection,this.ref=n.ref,this.collator=n.collator,this.disabledKeys=n.disabledKeys||new Set,this.disabledBehavior=n.disabledBehavior||"all",this.orientation=n.orientation||"vertical",this.direction=n.direction,this.layout=n.layout||"stack",this.layoutDelegate=n.layoutDelegate||new Ds(n.ref)}else this.collection=e[0],this.disabledKeys=e[1],this.ref=e[2],this.collator=e[3],this.layout="stack",this.orientation="vertical",this.disabledBehavior="all",this.layoutDelegate=new Ds(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}}function Ig(t){let{selectionManager:e,collection:n,disabledKeys:r,ref:i,keyboardDelegate:o,layoutDelegate:a}=t,s=Qp({usage:"search",sensitivity:"base"}),l=e.disabledBehavior,u=f.useMemo(()=>o||new Og({collection:n,disabledKeys:r,disabledBehavior:l,ref:i,collator:s,layoutDelegate:a}),[o,a,n,r,i,s,l]),{collectionProps:c}=mc({...t,ref:i,selectionManager:e,keyboardDelegate:u});return{listProps:c}}class _g{build(e,n){return this.context=n,Ps(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(f.isValidElement(n)&&n.type===f.Fragment)yield*this.iterateCollection({children:n.props.children,items:r});else if(typeof n=="function"){if(!r)throw new Error("props.children was a function but props.items is missing");let i=0;for(let o of r)yield*this.getFullNode({value:o,index:i},{renderer:n}),i++}else{let i=[];f.Children.forEach(n,a=>{a&&i.push(a)});let o=0;for(let a of i){let s=this.getFullNode({element:a,index:o},{});for(let l of s)o++,yield l}}}getKey(e,n,r,i){if(e.key!=null)return e.key;if(n.type==="cell"&&n.key!=null)return`${i}${n.key}`;let o=n.value;if(o!=null){var a;let s=(a=o.key)!==null&&a!==void 0?a:o.id;if(s==null)throw new Error("No key found for item");return s}return i?`${i}.${n.index}`:`$.${n.index}`}getChildState(e,n){return{renderer:n.renderer||e.renderer}}*getFullNode(e,n,r,i){if(f.isValidElement(e.element)&&e.element.type===f.Fragment){let v=[];f.Children.forEach(e.element.props.children,w=>{v.push(w)});var o;let y=(o=e.index)!==null&&o!==void 0?o:0;for(const w of v)yield*this.getFullNode({element:w,index:y++},n,r,i);return}let a=e.element;if(!a&&e.value&&n&&n.renderer){let v=this.cache.get(e.value);if(v&&(!v.shouldInvalidate||!v.shouldInvalidate(this.context))){v.index=e.index,v.parentKey=i?i.key:null,yield v;return}a=n.renderer(e.value)}if(f.isValidElement(a)){let v=a.type;if(typeof v!="function"&&typeof v.getCollectionNode!="function"){let P=a.type;throw new Error(`Unknown element <${P}> in collection.`)}let y=v.getCollectionNode(a.props,this.context);var s;let w=(s=e.index)!==null&&s!==void 0?s:0,$=y.next();for(;!$.done&&$.value;){let P=$.value;e.index=w;var l;let D=(l=P.key)!==null&&l!==void 0?l:null;D==null&&(D=P.element?null:this.getKey(a,e,n,r));let I=[...this.getFullNode({...P,key:D,index:w,wrapper:kg(e.wrapper,P.wrapper)},this.getChildState(n,P),r?`${r}${a.key}`:a.key,i)];for(let b of I){var u,c;b.value=(c=(u=P.value)!==null&&u!==void 0?u:e.value)!==null&&c!==void 0?c:null,b.value&&this.cache.set(b.value,b);var d;if(e.type&&b.type!==e.type)throw new Error(`Unsupported type <${Ri(b.type)}> in <${Ri((d=i==null?void 0:i.type)!==null&&d!==void 0?d:"unknown parent type")}>. Only <${Ri(e.type)}> is supported.`);w++,yield b}$=y.next(I)}return}if(e.key==null||e.type==null)return;let h=this;var g,m;let p={type:e.type,props:e.props,key:e.key,parentKey:i?i.key:null,value:(g=e.value)!==null&&g!==void 0?g:null,level:i?i.level+1:0,index:e.index,rendered:e.rendered,textValue:(m=e.textValue)!==null&&m!==void 0?m:"","aria-label":e["aria-label"],wrapper:e.wrapper,shouldInvalidate:e.shouldInvalidate,hasChildNodes:e.hasChildNodes||!1,childNodes:Ps(function*(){if(!e.hasChildNodes||!e.childNodes)return;let v=0;for(let y of e.childNodes()){y.key!=null&&(y.key=`${p.key}${y.key}`);let w=h.getFullNode({...y,index:v},h.getChildState(n,y),p.key,p);for(let $ of w)v++,yield $}})};yield p}constructor(){this.cache=new WeakMap}}function Ps(t){let e=[],n=null;return{*[Symbol.iterator](){for(let r of e)yield r;n||(n=t());for(let r of n)e.push(r),yield r}}}function kg(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function Ri(t){return t[0].toUpperCase()+t.slice(1)}function bc(t,e,n){let r=f.useMemo(()=>new _g,[]),{children:i,items:o,collection:a}=t;return f.useMemo(()=>{if(a)return a;let l=r.build({children:i,items:o},n);return e(l)},[r,i,o,a,n,e])}function Sc(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Ng(t){return Rg(t)}function Rg(t,e){for(let n of t)return n}function Mi(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...Os(t,e),e],i=[...Os(t,n),n],o=r.slice(0,i.length).findIndex((a,s)=>a!==i[s]);return o!==-1?(e=r[o],n=i[o],e.index-n.index):r.findIndex(a=>a===n)>=0?1:(i.findIndex(a=>a===e)>=0,-1)}function Os(t,e){let n=[],r=e;for(;(r==null?void 0:r.parentKey)!=null;)r=t.getItem(r.parentKey),r&&n.unshift(r);return n}const Is=new WeakMap;function Mg(t){let e=Is.get(t);if(e!=null)return e;let n=0,r=i=>{for(let o of i)o.type==="section"?r(Sc(o,t)):n++};return r(t),Is.set(t,n),n}const Ec=new WeakMap;function Ag(t,e,n){let{shouldFocusWrap:r=!0,onKeyDown:i,onKeyUp:o,...a}=t;!t["aria-label"]&&!t["aria-labelledby"]&&console.warn("An aria-label or aria-labelledby prop is required for accessibility.");let s=Ve(t,{labelable:!0}),{listProps:l}=Ig({...a,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,shouldFocusWrap:r,linkBehavior:"override"});return Ec.set(e,{onClose:t.onClose,onAction:t.onAction,shouldUseVirtualFocus:t.shouldUseVirtualFocus}),{menuProps:Ee(s,{onKeyDown:i,onKeyUp:o},{role:"menu",...l,onKeyDown:u=>{var c;(u.key!=="Escape"||t.shouldUseVirtualFocus)&&((c=l.onKeyDown)===null||c===void 0||c.call(l,u))}})}}function Lg(t,e,n){let{id:r,key:i,closeOnSelect:o,isVirtualized:a,"aria-haspopup":s,onPressStart:l,onPressUp:u,onPress:c,onPressChange:d,onPressEnd:h,onHoverStart:g,onHoverChange:m,onHoverEnd:p,onKeyDown:v,onKeyUp:y,onFocus:w,onFocusChange:$,onBlur:P,selectionManager:D=e.selectionManager}=t,O=!!s,I=O&&t["aria-expanded"]==="true";var b;let R=(b=t.isDisabled)!==null&&b!==void 0?b:D.isDisabled(i);var V;let k=(V=t.isSelected)!==null&&V!==void 0?V:D.isSelected(i),B=Ec.get(e),E=e.collection.getItem(i),T=t.onClose||B.onClose,j=Yr(),W=ne=>{var De;if(!O){if(!(E==null||(De=E.props)===null||De===void 0)&&De.onAction?E.props.onAction():t.onAction&&t.onAction(i),B.onAction){let at=B.onAction;at(i)}ne.target instanceof HTMLAnchorElement&&E&&j.open(ne.target,ne,E.props.href,E.props.routerOptions)}},Y="menuitem";O||(D.selectionMode==="single"?Y="menuitemradio":D.selectionMode==="multiple"&&(Y="menuitemcheckbox"));let N=wi(),X=wi(),ie=wi(),de={id:r,"aria-disabled":R||void 0,role:Y,"aria-label":t["aria-label"],"aria-labelledby":N,"aria-describedby":[X,ie].filter(Boolean).join(" ")||void 0,"aria-controls":t["aria-controls"],"aria-haspopup":s,"aria-expanded":t["aria-expanded"]};D.selectionMode!=="none"&&!O&&(de["aria-checked"]=k),a&&(de["aria-posinset"]=E==null?void 0:E.index,de["aria-setsize"]=Mg(e.collection));let M=ne=>{ne.pointerType==="keyboard"&&W(ne),l==null||l(ne)},_=()=>{!O&&T&&(o??(D.selectionMode!=="multiple"||D.isLink(i)))&&T()},F=ne=>{ne.pointerType==="mouse"&&(W(ne),_()),u==null||u(ne)},A=ne=>{ne.pointerType!=="keyboard"&&ne.pointerType!=="mouse"&&(W(ne),_()),c==null||c(ne)},{itemProps:z,isFocused:H}=yc({id:r,selectionManager:D,key:i,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:B.shouldUseVirtualFocus}),{pressProps:L,isPressed:q}=ea({onPressStart:M,onPress:A,onPressUp:F,onPressChange:d,onPressEnd:h,isDisabled:R}),{hoverProps:Q}=oa({isDisabled:R,onHoverStart(ne){!ra()&&!(I&&s==="dialog")&&(D.setFocused(!0),D.setFocusedKey(i)),g==null||g(ne)},onHoverChange:m,onHoverEnd:p}),{keyboardProps:ye}=xp({onKeyDown:ne=>{if(ne.repeat){ne.continuePropagation();return}switch(ne.key){case" ":!R&&D.selectionMode==="none"&&!O&&o!==!1&&T&&T();break;case"Enter":!R&&o!==!1&&!O&&T&&T();break;default:O||ne.continuePropagation(),v==null||v(ne);break}},onKeyUp:y}),{focusProps:ve}=$u({onBlur:P,onFocus:w,onFocusChange:$}),se=Ve(E==null?void 0:E.props);delete se.id;let Ce=lu(E==null?void 0:E.props);return{menuItemProps:{...de,...Ee(se,Ce,O?{onFocus:z.onFocus,"data-key":z["data-key"]}:z,L,Q,ye,ve),tabIndex:z.tabIndex!=null&&I?-1:z.tabIndex},labelProps:{id:N},descriptionProps:{id:X},keyboardShortcutProps:{id:ie},isFocused:H,isSelected:k,isPressed:q,isDisabled:R}}function Kg(t){let{heading:e,"aria-label":n}=t,r=Un();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}function Fg(t){let e=Ve(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}const wc=new WeakMap;function Kr(t,e,n){return t?(typeof e=="string"&&(e=e.replace(/\s+/g,"")),`${wc.get(t)}-${n}-${e}`):""}function jg(t,e,n){let{key:r,isDisabled:i,shouldSelectOnPressUp:o}=t,{selectionManager:a,selectedKey:s}=e,l=r===s,u=i||e.isDisabled||e.selectionManager.isDisabled(r),{itemProps:c,isPressed:d}=yc({selectionManager:a,key:r,ref:n,isDisabled:u,shouldSelectOnPressUp:o,linkBehavior:"selection"}),h=Kr(e,r,"tab"),g=Kr(e,r,"tabpanel"),{tabIndex:m}=c,p=e.collection.getItem(r),v=Ve(p==null?void 0:p.props,{labelable:!0});delete v.id;let y=lu(p==null?void 0:p.props);return{tabProps:Ee(v,y,c,{id:h,"aria-selected":l,"aria-disabled":u||void 0,"aria-controls":l?g:void 0,tabIndex:u?void 0:m,role:"tab"}),isSelected:l,isDisabled:u,isPressed:d}}function zg(t,e,n){let r=Ap(n)?void 0:0;var i;const o=Kr(e,(i=t.id)!==null&&i!==void 0?i:e==null?void 0:e.selectedKey,"tabpanel"),a=Go({...t,id:o,"aria-labelledby":Kr(e,e==null?void 0:e.selectedKey,"tab")});return{tabPanelProps:Ee(a,{tabIndex:r,role:"tabpanel","aria-describedby":t["aria-describedby"],"aria-details":t["aria-details"]})}}class Hg{getKeyLeftOf(e){return this.flipDirection?this.getNextKey(e):this.getPreviousKey(e)}getKeyRightOf(e){return this.flipDirection?this.getPreviousKey(e):this.getNextKey(e)}isDisabled(e){var n,r;return this.disabledKeys.has(e)||!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled)}getFirstKey(){let e=this.collection.getFirstKey();return e!=null&&this.isDisabled(e)&&(e=this.getNextKey(e)),e}getLastKey(){let e=this.collection.getLastKey();return e!=null&&this.isDisabled(e)&&(e=this.getPreviousKey(e)),e}getKeyAbove(e){return this.tabDirection?null:this.getPreviousKey(e)}getKeyBelow(e){return this.tabDirection?null:this.getNextKey(e)}getNextKey(e){do e=this.collection.getKeyAfter(e),e==null&&(e=this.collection.getFirstKey());while(this.isDisabled(e));return e}getPreviousKey(e){do e=this.collection.getKeyBefore(e),e==null&&(e=this.collection.getLastKey());while(this.isDisabled(e));return e}constructor(e,n,r,i=new Set){this.collection=e,this.flipDirection=n==="rtl"&&r==="horizontal",this.disabledKeys=i,this.tabDirection=r==="horizontal"}}function Bg(t,e,n){let{orientation:r="horizontal",keyboardActivation:i="automatic"}=t,{collection:o,selectionManager:a,disabledKeys:s}=e,{direction:l}=qn(),u=f.useMemo(()=>new Hg(o,l,r,s),[o,s,r,l]),{collectionProps:c}=mc({ref:n,selectionManager:a,keyboardDelegate:u,selectOnFocus:i==="automatic",disallowEmptySelection:!0,scrollRef:n,linkBehavior:"selection"}),d=Un();wc.set(e,d);let h=Go({...t,id:d});return{tabListProps:{...Ee(c,h),role:"tablist","aria-orientation":r,tabIndex:void 0}}}const Wg=f.createContext({});class _s{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(e){let n=this.keyMap.get(e);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}getChildren(e){let n=this.keyMap.get(e);return(n==null?void 0:n.childNodes)||[]}constructor(e){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e;let n=a=>{if(this.keyMap.set(a.key,a),a.childNodes&&a.type==="section")for(let s of a.childNodes)n(s)};for(let a of e)n(a);let r=null,i=0;for(let[a,s]of this.keyMap)r?(r.nextKey=a,s.prevKey=r.key):(this.firstKey=a,s.prevKey=void 0),s.type==="item"&&(s.index=i++),r=s,r.nextKey=void 0;var o;this.lastKey=(o=r==null?void 0:r.key)!==null&&o!==void 0?o:null}}class Be extends Set{constructor(e,n,r){super(e),e instanceof Be?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}function Ug(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function la(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:o="all"}=t,a=f.useRef(!1),[,s]=f.useState(!1),l=f.useRef(null),u=f.useRef(null),[,c]=f.useState(null),d=f.useMemo(()=>ks(t.selectedKeys),[t.selectedKeys]),h=f.useMemo(()=>ks(t.defaultSelectedKeys,new Be),[t.defaultSelectedKeys]),[g,m]=Xr(d,h,t.onSelectionChange),p=f.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,y]=f.useState(i);i==="replace"&&v==="toggle"&&typeof g=="object"&&g.size===0&&y("replace");let w=f.useRef(i);return f.useEffect(()=>{i!==w.current&&(y(i),w.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return a.current},setFocused($){a.current=$,s($)},get focusedKey(){return l.current},get childFocusStrategy(){return u.current},setFocusedKey($,P="first"){l.current=$,u.current=P,c($)},selectedKeys:g,setSelectedKeys($){(r||!Ug($,g))&&m($)},disabledKeys:p,disabledBehavior:o}}function ks(t,e){return t?t==="all"?"all":new Be(t):e}class ua{get selectionMode(){return this.state.selectionMode}get disallowEmptySelection(){return this.state.disallowEmptySelection}get selectionBehavior(){return this.state.selectionBehavior}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}get isFocused(){return this.state.isFocused}setFocused(e){this.state.setFocused(e)}get focusedKey(){return this.state.focusedKey}get childFocusStrategy(){return this.state.childFocusStrategy}setFocusedKey(e,n){(e==null||this.collection.getItem(e))&&this.state.setFocusedKey(e,n)}get selectedKeys(){return this.state.selectedKeys==="all"?new Set(this.getSelectAllKeys()):this.state.selectedKeys}get rawSelection(){return this.state.selectedKeys}isSelected(e){if(this.state.selectionMode==="none")return!1;let n=this.getKey(e);return n==null?!1:this.state.selectedKeys==="all"?this.canSelectItem(n):this.state.selectedKeys.has(n)}get isEmpty(){return this.state.selectedKeys!=="all"&&this.state.selectedKeys.size===0}get isSelectAll(){if(this.isEmpty)return!1;if(this.state.selectedKeys==="all")return!0;if(this._isSelectAll!=null)return this._isSelectAll;let e=this.getSelectAllKeys(),n=this.state.selectedKeys;return this._isSelectAll=e.every(r=>n.has(r)),this._isSelectAll}get firstSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&Mi(this.collection,i,e)<0)&&(e=i)}var n;return(n=e==null?void 0:e.key)!==null&&n!==void 0?n:null}get lastSelectedKey(){let e=null;for(let r of this.state.selectedKeys){let i=this.collection.getItem(r);(!e||i&&Mi(this.collection,i,e)>0)&&(e=i)}var n;return(n=e==null?void 0:e.key)!==null&&n!==void 0?n:null}get disabledKeys(){return this.state.disabledKeys}get disabledBehavior(){return this.state.disabledBehavior}extendSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r;if(this.state.selectedKeys==="all")r=new Be([n],n,n);else{let a=this.state.selectedKeys;var i;let s=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new Be(a,s,n);var o;for(let l of this.getKeyRange(s,(o=a.currentKey)!==null&&o!==void 0?o:n))r.delete(l);for(let l of this.getKeyRange(n,s))this.canSelectItem(l)&&r.add(l)}this.state.setSelectedKeys(r)}getKeyRange(e,n){let r=this.collection.getItem(e),i=this.collection.getItem(n);return r&&i?Mi(this.collection,r,i)<=0?this.getKeyRangeInternal(e,n):this.getKeyRangeInternal(n,e):[]}getKeyRangeInternal(e,n){var r;if(!((r=this.layoutDelegate)===null||r===void 0)&&r.getKeyRange)return this.layoutDelegate.getKeyRange(e,n);let i=[],o=e;for(;o!=null;){let a=this.collection.getItem(o);if(a&&(a.type==="item"||a.type==="cell"&&this.allowsCellSelection)&&i.push(o),o===n)return i;o=this.collection.getKeyAfter(o)}return[]}getKey(e){let n=this.collection.getItem(e);if(!n||n.type==="cell"&&this.allowsCellSelection)return e;for(;n&&n.type!=="item"&&n.parentKey!=null;)n=this.collection.getItem(n.parentKey);return!n||n.type!=="item"?null:n.key}toggleSelection(e){if(this.selectionMode==="none")return;if(this.selectionMode==="single"&&!this.isSelected(e)){this.replaceSelection(e);return}let n=this.getKey(e);if(n==null)return;let r=new Be(this.state.selectedKeys==="all"?this.getSelectAllKeys():this.state.selectedKeys);r.has(n)?r.delete(n):this.canSelectItem(n)&&(r.add(n),r.anchorKey=n,r.currentKey=n),!(this.disallowEmptySelection&&r.size===0)&&this.state.setSelectedKeys(r)}replaceSelection(e){if(this.selectionMode==="none")return;let n=this.getKey(e);if(n==null)return;let r=this.canSelectItem(n)?new Be([n],n,n):new Be;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new Be;for(let r of e){let i=this.getKey(r);if(i!=null&&(n.add(i),this.selectionMode==="single"))break}this.state.setSelectedKeys(n)}getSelectAllKeys(){let e=[],n=r=>{for(;r!=null;){if(this.canSelectItem(r)){var i;let a=this.collection.getItem(r);(a==null?void 0:a.type)==="item"&&e.push(r);var o;a!=null&&a.hasChildNodes&&(this.allowsCellSelection||a.type!=="item")&&n((o=(i=Ng(Sc(a,this.collection)))===null||i===void 0?void 0:i.key)!==null&&o!==void 0?o:null)}r=this.collection.getKeyAfter(r)}};return n(this.collection.getFirstKey()),e}selectAll(){!this.isSelectAll&&this.selectionMode==="multiple"&&this.state.setSelectedKeys("all")}clearSelection(){!this.disallowEmptySelection&&(this.state.selectedKeys==="all"||this.state.selectedKeys.size>0)&&this.state.setSelectedKeys(new Be)}toggleSelectAll(){this.isSelectAll?this.clearSelection():this.selectAll()}select(e,n){this.selectionMode!=="none"&&(this.selectionMode==="single"?this.isSelected(e)&&!this.disallowEmptySelection?this.toggleSelection(e):this.replaceSelection(e):this.selectionBehavior==="toggle"||n&&(n.pointerType==="touch"||n.pointerType==="virtual")?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys)return!0;let n=this.selectedKeys;if(e.size!==n.size)return!1;for(let r of e)if(!n.has(r))return!1;for(let r of n)if(!e.has(r))return!1;return!0}canSelectItem(e){var n;if(this.state.selectionMode==="none"||this.state.disabledKeys.has(e))return!1;let r=this.collection.getItem(e);return!(!r||!(r==null||(n=r.props)===null||n===void 0)&&n.isDisabled||r.type==="cell"&&!this.allowsCellSelection)}isDisabled(e){var n,r;return this.state.disabledBehavior==="all"&&(this.state.disabledKeys.has(e)||!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.isDisabled))}isLink(e){var n,r;return!!(!((r=this.collection.getItem(e))===null||r===void 0||(n=r.props)===null||n===void 0)&&n.href)}getItemProps(e){var n;return(n=this.collection.getItem(e))===null||n===void 0?void 0:n.props}constructor(e,n,r){this.collection=e,this.state=n;var i;this.allowsCellSelection=(i=r==null?void 0:r.allowsCellSelection)!==null&&i!==void 0?i:!1,this._isSelectAll=null,this.layoutDelegate=(r==null?void 0:r.layoutDelegate)||null}}function Vg(t){let{filter:e,layoutDelegate:n}=t,r=la(t),i=f.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=f.useCallback(c=>e?new _s(e(c)):new _s(c),[e]),a=f.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),s=bc(t,o,a),l=f.useMemo(()=>new ua(s,r,{layoutDelegate:n}),[s,r,n]);const u=f.useRef(null);return f.useEffect(()=>{if(r.focusedKey!=null&&!s.getItem(r.focusedKey)&&u.current){const y=u.current.getItem(r.focusedKey),w=[...u.current.getKeys()].map(b=>{const R=u.current.getItem(b);return(R==null?void 0:R.type)==="item"?R:null}).filter(b=>b!==null),$=[...s.getKeys()].map(b=>{const R=s.getItem(b);return(R==null?void 0:R.type)==="item"?R:null}).filter(b=>b!==null);var c,d;const P=((c=w==null?void 0:w.length)!==null&&c!==void 0?c:0)-((d=$==null?void 0:$.length)!==null&&d!==void 0?d:0);var h,g,m;let D=Math.min(P>1?Math.max(((h=y==null?void 0:y.index)!==null&&h!==void 0?h:0)-P+1,0):(g=y==null?void 0:y.index)!==null&&g!==void 0?g:0,((m=$==null?void 0:$.length)!==null&&m!==void 0?m:0)-1),O=null,I=!1;for(;D>=0;){if(!l.isDisabled($[D].key)){O=$[D];break}if(D<$.length-1&&!I)D++;else{I=!0;var p,v;D>((p=y==null?void 0:y.index)!==null&&p!==void 0?p:0)&&(D=(v=y==null?void 0:y.index)!==null&&v!==void 0?v:0),D--}}r.setFocusedKey(O?O.key:null)}u.current=s},[s,l,r,r.focusedKey]),{collection:s,disabledKeys:i,selectionManager:l}}function Gg(t){var e;let[n,r]=Xr(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),i=f.useMemo(()=>n!=null?[n]:[],[n]),{collection:o,disabledKeys:a,selectionManager:s}=Vg({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:u=>{if(u==="all")return;var c;let d=(c=u.values().next().value)!==null&&c!==void 0?c:null;d===n&&t.onSelectionChange&&t.onSelectionChange(d),r(d)}}),l=n!=null?o.getItem(n):null;return{collection:o,disabledKeys:a,selectionManager:s,selectedKey:n,setSelectedKey:r,selectedItem:l}}function qg(t){let[e,n]=Xr(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=f.useCallback(()=>{n(!0)},[n]),i=f.useCallback(()=>{n(!1)},[n]),o=f.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:i,toggle:o}}function Yg(t){var e,n;let r=Gg({...t,suppressTextValueWarning:!0,defaultSelectedKey:(n=(e=t.defaultSelectedKey)!==null&&e!==void 0?e:Ns(t.collection,t.disabledKeys?new Set(t.disabledKeys):new Set))!==null&&n!==void 0?n:void 0}),{selectionManager:i,collection:o,selectedKey:a}=r,s=f.useRef(a);return f.useEffect(()=>{let l=a;(i.isEmpty||l==null||!o.getItem(l))&&(l=Ns(o,r.disabledKeys),l!=null&&i.setSelectedKeys([l])),(l!=null&&i.focusedKey==null||!i.isFocused&&l!==s.current)&&i.setFocusedKey(l),s.current=l}),{...r,isDisabled:t.isDisabled||!1}}function Ns(t,e){let n=null;if(t){var r,i,o,a;for(n=t.getFirstKey();n!=null&&(e.has(n)||!((i=t.getItem(n))===null||i===void 0||(r=i.props)===null||r===void 0)&&r.isDisabled)&&n!==t.getLastKey();)n=t.getKeyAfter(n);n!=null&&(e.has(n)||!((a=t.getItem(n))===null||a===void 0||(o=a.props)===null||o===void 0)&&o.isDisabled)&&n===t.getLastKey()&&(n=t.getFirstKey())}return n}class Xg{*[Symbol.iterator](){yield*this.iterable}get size(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){let n=this.keyMap.get(e);var r;return n&&(r=n.prevKey)!==null&&r!==void 0?r:null}getKeyAfter(e){let n=this.keyMap.get(e);var r;return n&&(r=n.nextKey)!==null&&r!==void 0?r:null}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){var n;return(n=this.keyMap.get(e))!==null&&n!==void 0?n:null}at(e){const n=[...this.getKeys()];return this.getItem(n[e])}constructor(e,{expandedKeys:n}={}){this.keyMap=new Map,this.firstKey=null,this.lastKey=null,this.iterable=e,n=n||new Set;let r=s=>{if(this.keyMap.set(s.key,s),s.childNodes&&(s.type==="section"||n.has(s.key)))for(let l of s.childNodes)r(l)};for(let s of e)r(s);let i=null,o=0;for(let[s,l]of this.keyMap)i?(i.nextKey=s,l.prevKey=i.key):(this.firstKey=s,l.prevKey=void 0),l.type==="item"&&(l.index=o++),i=l,i.nextKey=void 0;var a;this.lastKey=(a=i==null?void 0:i.key)!==null&&a!==void 0?a:null}}function Jg(t){let{onExpandedChange:e}=t,[n,r]=Xr(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),i=la(t),o=f.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),a=bc(t,f.useCallback(l=>new Xg(l,{expandedKeys:n}),[n]),null);return f.useEffect(()=>{i.focusedKey!=null&&!a.getItem(i.focusedKey)&&i.setFocusedKey(null)},[a,i.focusedKey]),{collection:a,expandedKeys:n,disabledKeys:o,toggleKey:l=>{r(Qg(n,l))},setExpandedKeys:r,selectionManager:new ua(a,i)}}function Qg(t,e){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}const Zg=f.createContext(null),ev=f.createContext(null),xc={CollectionRoot({collection:t,renderDropIndicator:e}){return Rs(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return Rs(t,e,n)}};function Rs(t,e,n){return vu({items:e?t.getChildren(e.key):t,dependencies:[n],children(r){var i;let o=r.render(r);if(!n||r.type!=="item")return o;let a=r.key,s=t.getKeyAfter(a);return f.createElement(f.Fragment,null,n({type:"item",key:a,dropPosition:"before"}),o,(s==null||((i=t.getItem(s))===null||i===void 0?void 0:i.type)!=="item")&&n({type:"item",key:a,dropPosition:"after"}))}})}const Zr=f.createContext(xc);function $c(t){return f.useMemo(()=>t!=null?new Set([t]):null,[t])}const tv=f.createContext({}),Cc=f.createContext({}),nv=Qo("separator",function(e,n){[e,n]=Gn(e,n,Cc);let{elementType:r,orientation:i,style:o,className:a}=e,s=r||"hr";s==="hr"&&i==="vertical"&&(s="div");let{separatorProps:l}=Fg({elementType:r,orientation:i});return f.createElement(s,{...Ve(e),...l,style:o,className:a??"react-aria-Separator",ref:n,slot:e.slot||void 0})}),rv=f.createContext({placement:"bottom"}),iv=f.createContext(null),ov=f.forwardRef(function(e,n){[e,n]=Gn(e,n,iv);let r=f.useContext(vv),i=qg(e),o=e.isOpen!=null||e.defaultOpen!=null||!r?i:r,a=jh(n,o.isOpen)||e.isExiting||!1;if(Vh()){let l=e.children;return typeof l=="function"&&(l=l({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),f.createElement(f.Fragment,null,l)}return o&&!o.isOpen&&!a?null:f.createElement(av,{...e,triggerRef:e.triggerRef,state:o,popoverRef:n,isExiting:a})});function av({state:t,isExiting:e,UNSTABLE_portalContainer:n,...r}){let i=f.useRef(null),[o,a]=f.useState(0);ae(()=>{i.current&&t.isOpen&&a(i.current.getBoundingClientRect().width)},[t.isOpen,i]);var s;let{popoverProps:l,underlayProps:u,arrowProps:c,placement:d}=Eg({...r,offset:(s=r.offset)!==null&&s!==void 0?s:8,arrowSize:o},t),h=r.popoverRef,g=Fh(h,!!d)||r.isEntering||!1,m=pt({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:d,isEntering:g,isExiting:e}}),p={...l.style,...m.style};return f.createElement(Cg,{...r,isExiting:e,portalContainer:n},!r.isNonModal&&t.isOpen&&f.createElement("div",{"data-testid":"underlay",...u,style:{position:"fixed",inset:0}}),f.createElement("div",{...Ee(Ve(r),l),...m,ref:h,slot:r.slot||void 0,style:p,"data-trigger":r.trigger,"data-placement":d,"data-entering":g||void 0,"data-exiting":e||void 0},!r.isNonModal&&f.createElement($s,{onDismiss:t.close}),f.createElement(rv.Provider,{value:{...c,placement:d,ref:i}},m.children),f.createElement($s,{onDismiss:t.close})))}const sv=f.createContext({}),lv=f.createContext(null),ca=f.createContext(null),uv=f.createContext(null),Fr=f.createContext(null),cv=f.createContext(null),dv=f.forwardRef(function(e,n){return[e,n]=Gn(e,n,lv),f.createElement(yu,{content:f.createElement(bu,e)},r=>r.size>0&&f.createElement(fv,{props:e,collection:r,menuRef:n}))});function fv({props:t,collection:e,menuRef:n}){let{filterFn:r,collectionProps:i,collectionRef:o}=f.useContext(Zg)||{};n=bn(f.useMemo(()=>iu(n,o!==void 0?o:null),[o,n]));let a=f.useMemo(()=>r?e.filter(r):e,[e,r]),s=Jg({...t,collection:a,children:void 0}),l=f.useContext(uv),{isVirtualized:u,CollectionRoot:c}=f.useContext(Zr),{menuProps:d}=Ag({...t,...i,isVirtualized:u,onClose:t.onClose||(l==null?void 0:l.close)},s,n),h=pt({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return f.createElement(Iu,null,f.createElement("div",{...Ve(t),...d,...h,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},f.createElement(Vn,{values:[[ca,s],[Cc,{elementType:"div"}],[ev,{name:"MenuSection",render:pv}],[cv,{parentMenuRef:n}],[To,null],[Fr,s.selectionManager]]},f.createElement(c,{collection:s.collection,persistedKeys:$c(s.selectionManager.focusedKey),scrollRef:n}))))}class hv extends ua{get focusedKey(){return this.parent.focusedKey}get isFocused(){return this.parent.isFocused}setFocusedKey(e,n){return this.parent.setFocusedKey(e,n)}setFocused(e){this.parent.setFocused(e)}get childFocusStrategy(){return this.parent.childFocusStrategy}constructor(e,n){super(e.collection,n),this.parent=e}}function pv(t,e,n,r="react-aria-MenuSection"){var i,o;let a=f.useContext(ca),{CollectionBranch:s}=f.useContext(Zr),[l,u]=zh();var c;let{headingProps:d,groupProps:h}=Kg({heading:u,"aria-label":(c=n.props["aria-label"])!==null&&c!==void 0?c:void 0}),g=pt({defaultClassName:r,className:(i=n.props)===null||i===void 0?void 0:i.className,style:(o=n.props)===null||o===void 0?void 0:o.style,values:{}}),m=f.useContext(Fr),p=la(t),v=t.selectionMode!=null?new hv(m,p):m;return f.createElement("section",{...Ve(t),...h,...g,ref:e},f.createElement(Vn,{values:[[tv,{...d,ref:l}],[Fr,v]]},f.createElement(s,{collection:a.collection,parent:n})))}const To=f.createContext(null),gv=Qo("item",function(e,n,r){var i;[e,n]=Gn(e,n,To);let o=(i=qo(To))===null||i===void 0?void 0:i.id,a=f.useContext(ca),s=bn(n),l=f.useContext(Fr),{menuItemProps:u,labelProps:c,descriptionProps:d,keyboardShortcutProps:h,...g}=Lg({...e,id:o,key:r.key,selectionManager:l},a,s),{isFocusVisible:m,focusProps:p}=Jr(),{hoverProps:v,isHovered:y}=oa({isDisabled:g.isDisabled}),w=pt({...e,id:void 0,children:r.rendered,defaultClassName:"react-aria-MenuItem",values:{...g,isHovered:y,isFocusVisible:m,selectionMode:l.selectionMode,selectionBehavior:l.selectionBehavior,hasSubmenu:!!e["aria-haspopup"],isOpen:e["aria-expanded"]==="true"}}),$=e.href?"a":"div";return f.createElement($,{...Ee(u,p,v),...w,ref:s,"data-disabled":g.isDisabled||void 0,"data-hovered":y||void 0,"data-focused":g.isFocused||void 0,"data-focus-visible":m||void 0,"data-pressed":g.isPressed||void 0,"data-selected":g.isSelected||void 0,"data-selection-mode":l.selectionMode==="none"?void 0:l.selectionMode,"data-has-submenu":!!e["aria-haspopup"]||void 0,"data-open":e["aria-expanded"]==="true"||void 0},f.createElement(Vn,{values:[[Wg,{slots:{label:c,description:d}}],[sv,h]]},w.children))}),vv=f.createContext(null),ei=f.createContext(null),pn=f.createContext(null),mv=f.forwardRef(function(e,n){[e,n]=Gn(e,n,ei);let{children:r,orientation:i="horizontal"}=e;return r=f.useMemo(()=>typeof r=="function"?r({orientation:i,defaultChildren:null}):r,[r,i]),f.createElement(yu,{content:r},o=>f.createElement(yv,{props:e,collection:o,tabsRef:n}))});function yv({props:t,tabsRef:e,collection:n}){let{orientation:r="horizontal"}=t,i=Yg({...t,collection:n,children:void 0}),{focusProps:o,isFocused:a,isFocusVisible:s}=Jr({within:!0}),l=f.useMemo(()=>({orientation:r,isFocusWithin:a,isFocusVisible:s}),[r,a,s]),u=pt({...t,defaultClassName:"react-aria-Tabs",values:l});return f.createElement("div",{...Ve(t),...o,...u,ref:e,slot:t.slot||void 0,"data-focused":a||void 0,"data-orientation":r,"data-focus-visible":s||void 0,"data-disabled":i.isDisabled||void 0},f.createElement(Vn,{values:[[ei,t],[pn,i]]},u.children))}const bv=f.forwardRef(function(e,n){return f.useContext(pn)?f.createElement(Sv,{props:e,forwardedRef:n}):f.createElement(bu,e)});function Sv({props:t,forwardedRef:e}){let n=f.useContext(pn),{CollectionRoot:r}=f.useContext(Zr),{orientation:i="horizontal",keyboardActivation:o="automatic"}=qo(ei),a=bn(e),{tabListProps:s}=Bg({...t,orientation:i,keyboardActivation:o},n,a),l=pt({...t,children:null,defaultClassName:"react-aria-TabList",values:{orientation:i,state:n}}),u=Ve(t);return delete u.id,f.createElement("div",{...u,...s,ref:a,...l,"data-orientation":i||void 0},f.createElement(r,{collection:n.collection,persistedKeys:$c(n.selectionManager.focusedKey)}))}const Ev=Qo("item",(t,e,n)=>{let r=f.useContext(pn),i=bn(e),{tabProps:o,isSelected:a,isDisabled:s,isPressed:l}=jg({key:n.key,...t},r,i),{focusProps:u,isFocused:c,isFocusVisible:d}=Jr(),{hoverProps:h,isHovered:g}=oa({isDisabled:s,onHoverStart:t.onHoverStart,onHoverEnd:t.onHoverEnd,onHoverChange:t.onHoverChange}),m=pt({...t,id:void 0,defaultClassName:"react-aria-Tab",values:{isSelected:a,isDisabled:s,isFocused:c,isFocusVisible:d,isPressed:l,isHovered:g}}),p=n.props.href?"a":"div";return f.createElement(p,{...Ee(o,u,h,m),ref:i,"data-selected":a||void 0,"data-disabled":s||void 0,"data-focused":c||void 0,"data-focus-visible":d||void 0,"data-pressed":l||void 0,"data-hovered":g||void 0})}),wv=Uh(function(e,n){const r=f.useContext(pn);let i=bn(n),{tabPanelProps:o}=zg(e,r,i),{focusProps:a,isFocused:s,isFocusVisible:l}=Jr(),u=r.selectedKey===e.id,c=pt({...e,defaultClassName:"react-aria-TabPanel",values:{isFocused:s,isFocusVisible:l,isInert:!u,state:r}});if(!u&&!e.shouldForceMount)return null;let d=Ve(e);delete d.id;let h=u?Ee(d,o,a,c):c;return f.createElement("div",{...h,ref:i,"data-focused":s||void 0,"data-focus-visible":l||void 0,inert:u?void 0:"true","data-inert":u?void 0:"true"},f.createElement(Vn,{values:[[ei,null],[pn,null]]},f.createElement(Zr.Provider,{value:xc},c.children)))}),Tc=({options:t,isOpen:e=!1,onOpenChange:n,children:r,selectedValues:i=[],onSelectValue:o})=>{const a=l=>{n==null||n(l)},s=f.useRef(null);return C.jsxs(C.Fragment,{children:[C.jsx("div",{className:"c__dropdown-menu-trigger",ref:s,onClick:l=>{l.stopPropagation(),l.preventDefault()},children:r}),C.jsx(ov,{triggerRef:s,style:{marginTop:"0px"},isOpen:e,onOpenChange:a,children:C.jsx(dv,{className:"c__dropdown-menu",children:t.map(l=>C.jsxs(f.Fragment,{children:[C.jsxs(gv,{className:"c__dropdown-menu-item","aria-label":l.label,onAction:()=>{var u;l.value&&(o==null||o(l.value)),(u=l.callback)==null||u.call(l),a(!1)},isDisabled:l.isDisabled,children:[l.icon,C.jsx("div",{className:"c__dropdown-menu-item__label","aria-label":l.label,children:l.label}),(l.isChecked||l.value&&i.includes(l.value))&&C.jsx("span",{className:"material-icons checked",children:"check"})]},l.label),l.showSeparator&&C.jsx(nv,{})]},l.label))})})]})},Dc=()=>{const[t,e]=f.useState(!1);return{isOpen:t,setIsOpen:e}},Pc=({languages:t})=>{const{isOpen:e,setIsOpen:n}=Dc();return C.jsx(Tc,{options:t,isOpen:e,onOpenChange:n,children:C.jsxs(hn.Button,{onClick:()=>n(!e),color:"primary-text",className:"c__language-picker",children:[C.jsx("span",{className:"material-icons",children:"translate"}),C.jsx("span",{className:"c__language-picker__label",children:"Français"}),C.jsx("span",{className:"material-icons",children:e?"arrow_drop_up":"arrow_drop_down"})]})})},Oc=({leftIcon:t,rightIcon:e,languages:n,onTogglePanel:r,isPanelOpen:i})=>{const{t:o}=hn.useCunningham();return C.jsxs("div",{className:"c__header",children:[C.jsx("div",{className:"c__header__toggle-menu",children:C.jsx(hn.Button,{size:"medium",onClick:r,"aria-label":o(i?"Close the menu":"Open the menu"),color:"tertiary-text",icon:C.jsx("span",{className:"material-icons clr-primary-800",children:i?"close":"menu"})})}),C.jsx("div",{className:"c__header__left",children:t}),C.jsxs("div",{className:"c__header__right",children:[n&&C.jsx("div",{className:"c__header__right__language-picker",children:C.jsx(Pc,{languages:n})}),e]})]})},Do={themes:{default:{theme:{colors:{"primary-text":"#000091","primary-050":"#F5F5FE","primary-100":"#ECECFE","primary-150":"#F4F4FD","primary-200":"#E3E3FD","primary-300":"#CACAFB","primary-400":"#8585F6","primary-500":"#6A6AF4","primary-600":"#313178","primary-700":"#272747","primary-800":"#000091","primary-900":"#21213F","secondary-text":"#fff","secondary-100":"#fee9ea","secondary-200":"#fedfdf","secondary-300":"#fdbfbf","secondary-400":"#e1020f","secondary-500":"#c91a1f","secondary-600":"#5e2b2b","secondary-700":"#3b2424","secondary-800":"#341f1f","secondary-900":"#2b1919","greyscale-text":"#303C4B","greyscale-000":"#fff","greyscale-050":"#F6F6F6","greyscale-100":"#eee","greyscale-200":"#E5E5E5","greyscale-250":"#ddd","greyscale-300":"#CECECE","greyscale-350":"#ddd","greyscale-400":"#929292","greyscale-500":"#7C7C7C","greyscale-600":"#666666","greyscale-700":"#3A3A3A","greyscale-750":"#353535","greyscale-800":"#2A2A2A","greyscale-900":"#242424","greyscale-950":"#1E1E1E","greyscale-1000":"#161616","success-text":"#1f8d49","success-100":"#dffee6","success-200":"#b8fec9","success-300":"#88fdaa","success-400":"#3bea7e","success-500":"#1f8d49","success-600":"#18753c","success-700":"#204129","success-800":"#1e2e22","success-900":"#19281d","info-text":"#0078f3","info-100":"#E8EDFF","info-200":"#DDE5FF","info-300":"#BCCDFF","info-400":"#518FFF","info-500":"#0078F3","info-600":"#0063CB","info-700":"#273961","info-800":"#222A3F","info-900":"#1D2437","warning-text":"#d64d00","warning-100":"#fff4f3","warning-200":"#ffe9e6","warning-300":"#ffded9","warning-400":"#ffbeb4","warning-500":"#d64d00","warning-600":"#b34000","warning-700":"#5e2c21","warning-800":"#3e241e","warning-900":"#361e19","danger-text":"#FFF","danger-100":"#FFE9E9","danger-200":"#FFDDDD","danger-300":"#FFBDBD","danger-400":"#FF5655","danger-500":"#F60700","danger-600":"#CE0500","danger-700":"#642626","danger-800":"#412121","danger-900":"#391C1C"},font:{sizes:{xs:"0.75rem",sm:"0.875rem",md:"1rem",lg:"1.125rem",ml:"0.938rem",xl:"1.25rem",t:"0.6875rem",s:"0.75rem",h1:"2rem",h2:"1.75rem",h3:"1.5rem",h4:"1.375rem",h5:"1.25rem",h6:"1.125rem","xl-alt":"5rem","lg-alt":"4.5rem","md-alt":"4rem","sm-alt":"3.5rem","xs-alt":"3rem"},weights:{thin:100,extrabold:800,black:900},families:{accent:"Marianne",base:"Marianne"}},logo:{src:"/assets/logo-gouv.svg",widthHeader:"110px",widthFooter:"220px",alt:"Gouvernement Logo"},spacings:{0:"0",none:"0",auto:"auto",bx:"2.2rem",full:"100%","4xs":"0.125rem","3xs":"0.25rem","2xs":"0.375rem",xs:"0.5rem",sm:"0.75rem",base:"1rem",md:"1.5rem",lg:"2rem",xl:"2.5rem",xxl:"3rem",xxxl:"3.5rem","4xl":"4rem","5xl":"4.5rem","6xl":"6rem","7xl":"7.5rem"},breakpoints:{xxs:"320px",xs:"480px",mobile:"768px",tablet:"1024px"}},components:{modal:{"width-small":"342px"},button:{"medium-height":"40px","medium-text-height":"40px","border-radius":"4px","small-height":"26px",primary:{"background--color":"var(--c--theme--colors--primary-text)","background--color-hover":"#1212ff","background--color-active":"#2323ff","background--color-disabled":"var(--c--theme--colors--greyscale-100)",color:"#fff","color-hover":"#fff","color-active":"#fff","color-focus-visible":"#fff",disabled:"var(--c--theme--colors--greyscale-500)"},"primary-text":{"background--color":"var(--c--theme--colors--primary-text)","background--color-hover":"var(--c--theme--colors--greyscale-100)","background--color-active":"var(--c--theme--colors--primary-100)","background--color-focus-visible":"#fff","background--color-disabled":"var(--c--theme--colors--greyscale-000)",color:"var(--c--theme--colors--primary-800)","color-hover":"var(--c--theme--colors--primary-800)",disabled:"var(--c--theme--colors--greyscale-400)"},secondary:{"background--color-hover":"#F6F6F6","background--color-active":"#EDEDED","background--color-focus-visible":"var(--c--theme--colors--greyscale-000)","background--disabled":"var(--c--theme--colors--greyscale-000)",color:"var(--c--theme--colors--primary-800)","border--color":"var(--c--theme--colors--greyscale-300)","border--color-hover":"var(--c--theme--colors--greyscale-300)","border--color-disabled":"var(--c--theme--colors--greyscale-300)",disabled:"var(--c--theme--colors--greyscale-400)"},tertiary:{"background--color":"var(--c--theme--colors--primary-100)","background--color-focus-visible":"var(--c--theme--colors--primary-100)","background--color-hover":"var(--c--theme--colors--primary-300)","background--color-active":"var(--c--theme--colors--primary-300)","background--disabled":"var(--c--theme--colors--primary-050)",color:"var(--c--theme--colors--primary-800)",disabled:"var(--c--theme--colors--primary-300)"},"tertiary-text":{"background--color-hover":"var(--c--theme--colors--greyscale-100)","color-hover":"var(--c--theme--colors--primary-text)",color:"var(--c--theme--colors--primary-600)"},danger:{"color-hover":"white","background--color":"var(--c--theme--colors--danger-600)","background--color-hover":"#FF2725","background--color-focus-visible":"var(--c--theme--colors--danger-600)","background--color-disabled":"var(--c--theme--colors--greyscale-100)","color-disabled":"var(--c--theme--colors--greyscale-400)"}},datagrid:{"header--color":"ref(theme.colors.greyscale-600)","header--size":"12px","header--weight":"500","body--background-color-hover":"ref(theme.colors.greyscale-100)"},"forms-checkbox":{"border-radius":"4px","border-color":"var(--c--theme--colors--primary-800)","background-color--hover":"var(--c--theme--colors--greyscale-100)","border--color-disabled":"var(--c--theme--colors--greyscale-200)","border--color":"var(--c--theme--colors--primary-800)","background--disabled":"var(--c--theme--colors--greyscale-200)","background--enable":"var(--c--theme--colors--primary-800)","check--disabled":"var(--c--theme--colors--greyscale-300)","check--enable":"var(--c--theme--colors--greyscale-000)",color:"var(--c--theme--colors--primary-text)","label--color":"var(--c--theme--colors--greyscale-1000)","label--size":"var(--c--theme--font--sizes--sm)","label--weight":"500","text--color":"var(--c--theme--colors--greyscale-600)","text--size":"var(--c--theme--font--sizes--s)","text--weight":"400","text--color-disabled":"var(--c--theme--colors--greyscale-300)"},"forms-labelledbox":{"label-color--small":"ref(theme.colors.greyscale-950)","label-color--small--disabled":"ref(theme.colors.greyscale-300)","label-color--big":"ref(theme.colors.greyscale-950)","label-color--big--disabled":"ref(theme.colors.greyscale-300)"},"forms-radio":{"border-color":"var(--c--theme--colors--primary-800)","background-color":"var(--c--theme--colors--greyscale-000)","accent-color":"var(--c--theme--colors--primary-800)","accent-color-disabled":"var(--c--theme--colors--greyscale-300)"},"forms-switch":{"border--color-disabled":"var(--c--theme--colors--greyscale-300)","border--color":"var(--c--theme--colors--primary-800)","handle-background-color":"white","handle-background-color--disabled":"var(--c--theme--colors--greyscale-000)","rail-background-color--disabled":"var(--c--theme--colors--greyscale-000)","accent-color":"var(--c--theme--colors--primary-800)"},"forms-textarea":{"label-color--focus":"ref(theme.colors.greyscale-1000)","border-radius":"4px","border-color":"ref(theme.colors.greyscale-400)","box-shadow--color--hover":"ref(theme.colors.greyscale-400)","box-shadow--color--focus":"ref(theme.colors.primary-800)","value-color":"ref(theme.colors.greyscale-950)","value-color--disabled":"ref(theme.colors.greyscale-300)","font-size":"14px"},"forms-input":{"label-color--focus":"ref(theme.colors.greyscale-1000)","border-radius":"4px","border-color":"ref(theme.colors.greyscale-400)","box-shadow--color--hover":"ref(theme.colors.greyscale-400)","box-shadow--color--focus":"ref(theme.colors.primary-800)","value-color":"ref(theme.colors.greyscale-950)","value-color--disabled":"ref(theme.colors.greyscale-300)","font-size":"14px"},"forms-select":{"label-color--focus":"ref(theme.colors.greyscale-1000)","item-font-size":"14px","border-radius":"4px","border-radius-hover":"4px","border-color":"ref(theme.colors.greyscale-400)","box-shadow--color--hover":"ref(theme.colors.greyscale-400)","box-shadow--color--focus":"ref(theme.colors.primary-800)","value-color":"ref(theme.colors.greyscale-950)","font-size":"14px"}}}}},ti=()=>{const[t,e]=f.useState(window.innerWidth),n=parseInt(Do.themes.default.theme.breakpoints.mobile.replace("px","")),r=parseInt(Do.themes.default.theme.breakpoints.tablet.replace("px","")),i=()=>{e(window.innerWidth)};f.useEffect(()=>(window.addEventListener("resize",i),()=>{window.removeEventListener("resize",i)}),[]);const o=t<=n,a=t<=r,s=t>r;return{isMobile:o,isTablet:a,isDesktop:s}},Ic=({children:t,isOpen:e=!1})=>{const{isDesktop:n}=ti();return n?C.jsx("div",{className:"c__left-panel",children:t}):C.jsx("div",{className:At("c__left-panel__mobile",{open:e}),children:t})},{createElement:gn,createContext:xv,createRef:Ex,forwardRef:_c,useCallback:Oe,useContext:kc,useEffect:xt,useImperativeHandle:Nc,useLayoutEffect:$v,useMemo:Cv,useRef:Ie,useState:cn}=x,Ms=x[`useId${Math.random()}`.slice(0,5)],Tv=$v,ni=xv(null);ni.displayName="PanelGroupContext";const $t=Tv,Dv=typeof Ms=="function"?Ms:()=>null;let Pv=0;function da(t=null){const e=Dv(),n=Ie(t||e||null);return n.current===null&&(n.current=""+Pv++),t??n.current}function Rc({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:a,maxSize:s,minSize:l,onCollapse:u,onExpand:c,onResize:d,order:h,style:g,tagName:m="div",...p}){const v=kc(ni);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:w,getPanelSize:$,getPanelStyle:P,groupId:D,isPanelCollapsed:O,reevaluatePanelConstraints:I,registerPanel:b,resizePanel:R,unregisterPanel:V}=v,k=da(a),B=Ie({callbacks:{onCollapse:u,onExpand:c,onResize:d},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:s,minSize:l},id:k,idIsFromProps:a!==void 0,order:h});Ie({didLogMissingDefaultSizeWarning:!1}),$t(()=>{const{callbacks:T,constraints:j}=B.current,W={...j};B.current.id=k,B.current.idIsFromProps=a!==void 0,B.current.order=h,T.onCollapse=u,T.onExpand=c,T.onResize=d,j.collapsedSize=n,j.collapsible=r,j.defaultSize=i,j.maxSize=s,j.minSize=l,(W.collapsedSize!==j.collapsedSize||W.collapsible!==j.collapsible||W.maxSize!==j.maxSize||W.minSize!==j.minSize)&&I(B.current,W)}),$t(()=>{const T=B.current;return b(T),()=>{V(T)}},[h,k,b,V]),Nc(o,()=>({collapse:()=>{y(B.current)},expand:T=>{w(B.current,T)},getId(){return k},getSize(){return $(B.current)},isCollapsed(){return O(B.current)},isExpanded(){return!O(B.current)},resize:T=>{R(B.current,T)}}),[y,w,$,O,k,R]);const E=P(B.current,i);return gn(m,{...p,children:t,className:e,id:a,style:{...E,...g},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":D,"data-panel-id":k,"data-panel-size":parseFloat(""+E.flexGrow).toFixed(1)})}const Po=_c((t,e)=>gn(Rc,{...t,forwardedRef:e}));Rc.displayName="Panel";Po.displayName="forwardRef(Panel)";let Oo=null,wt=null;function Ov(t,e){if(e){const n=(e&Fc)!==0,r=(e&jc)!==0,i=(e&zc)!==0,o=(e&Hc)!==0;if(n)return i?"se-resize":o?"ne-resize":"e-resize";if(r)return i?"sw-resize":o?"nw-resize":"w-resize";if(i)return"s-resize";if(o)return"n-resize"}switch(t){case"horizontal":return"ew-resize";case"intersection":return"move";case"vertical":return"ns-resize"}}function Iv(){wt!==null&&(document.head.removeChild(wt),Oo=null,wt=null)}function Ai(t,e){const n=Ov(t,e);Oo!==n&&(Oo=n,wt===null&&(wt=document.createElement("style"),document.head.appendChild(wt)),wt.innerHTML=`*{cursor: ${n}!important;}`)}function Mc(t){return t.type==="keydown"}function Ac(t){return t.type.startsWith("pointer")}function Lc(t){return t.type.startsWith("mouse")}function ri(t){if(Ac(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(Lc(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function _v(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function kv(t,e,n){return t.x<e.x+e.width&&t.x+t.width>e.x&&t.y<e.y+e.height&&t.y+t.height>e.y}function Nv(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Ks(t),b:Ks(e)};let r;for(;n.a.at(-1)===n.b.at(-1);)t=n.a.pop(),e=n.b.pop(),r=t;Z(r,"Stacking order can only be calculated for elements with a common ancestor");const i={a:Ls(As(n.a)),b:Ls(As(n.b))};if(i.a===i.b){const o=r.childNodes,a={a:n.a.at(-1),b:n.b.at(-1)};let s=o.length;for(;s--;){const l=o[s];if(l===a.a)return 1;if(l===a.b)return-1}}return Math.sign(i.a-i.b)}const Rv=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function Mv(t){var e;const n=getComputedStyle((e=Kc(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function Av(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||Mv(t))||+e.opacity<1||"transform"in e&&e.transform!=="none"||"webkitTransform"in e&&e.webkitTransform!=="none"||"mixBlendMode"in e&&e.mixBlendMode!=="normal"||"filter"in e&&e.filter!=="none"||"webkitFilter"in e&&e.webkitFilter!=="none"||"isolation"in e&&e.isolation==="isolate"||Rv.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function As(t){let e=t.length;for(;e--;){const n=t[e];if(Z(n,"Missing node"),Av(n))return n}return null}function Ls(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Ks(t){const e=[];for(;t;)e.push(t),t=Kc(t);return e}function Kc(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const Fc=1,jc=2,zc=4,Hc=8,Lv=_v()==="coarse";let Ue=[],dn=!1,dt=new Map,ii=new Map;const jn=new Set;function Kv(t,e,n,r,i){var o;const{ownerDocument:a}=e,s={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},l=(o=dt.get(a))!==null&&o!==void 0?o:0;return dt.set(a,l+1),jn.add(s),jr(),function(){var c;ii.delete(t),jn.delete(s);const d=(c=dt.get(a))!==null&&c!==void 0?c:1;if(dt.set(a,d-1),jr(),d===1&&dt.delete(a),Ue.includes(s)){const h=Ue.indexOf(s);h>=0&&Ue.splice(h,1),ha(),i("up",!0,null)}}}function Fs(t){const{target:e}=t,{x:n,y:r}=ri(t);dn=!0,fa({target:e,x:n,y:r}),jr(),Ue.length>0&&(zr("down",t),t.preventDefault(),t.stopPropagation())}function Cn(t){const{x:e,y:n}=ri(t);if(dn&&t.buttons===0&&(dn=!1,zr("up",t)),!dn){const{target:r}=t;fa({target:r,x:e,y:n})}zr("move",t),ha(),Ue.length>0&&t.preventDefault()}function Bt(t){const{target:e}=t,{x:n,y:r}=ri(t);ii.clear(),dn=!1,Ue.length>0&&t.preventDefault(),zr("up",t),fa({target:e,x:n,y:r}),ha(),jr()}function fa({target:t,x:e,y:n}){Ue.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),jn.forEach(i=>{const{element:o,hitAreaMargins:a}=i,s=o.getBoundingClientRect(),{bottom:l,left:u,right:c,top:d}=s,h=Lv?a.coarse:a.fine;if(e>=u-h&&e<=c+h&&n>=d-h&&n<=l+h){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&Nv(r,o)>0){let m=r,p=!1;for(;m&&!m.contains(o);){if(kv(m.getBoundingClientRect(),s)){p=!0;break}m=m.parentElement}if(p)return}Ue.push(i)}})}function Li(t,e){ii.set(t,e)}function ha(){let t=!1,e=!1;Ue.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;ii.forEach(r=>{n|=r}),t&&e?Ai("intersection",n):t?Ai("horizontal",n):e?Ai("vertical",n):Iv()}function jr(){dt.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Bt),n.removeEventListener("pointerdown",Fs),n.removeEventListener("pointerleave",Cn),n.removeEventListener("pointermove",Cn)}),window.removeEventListener("pointerup",Bt),window.removeEventListener("pointercancel",Bt),jn.size>0&&(dn?(Ue.length>0&&dt.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Bt),n.addEventListener("pointerleave",Cn),n.addEventListener("pointermove",Cn))}),window.addEventListener("pointerup",Bt),window.addEventListener("pointercancel",Bt)):dt.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",Fs,{capture:!0}),n.addEventListener("pointermove",Cn))}))}function zr(t,e){jn.forEach(n=>{const{setResizeHandlerState:r}=n,i=Ue.includes(n);r(t,i,e)})}function Fv(){const[t,e]=cn(0);return Oe(()=>e(n=>n+1),[])}function Z(t,e){if(!t)throw console.error(e),Error(e)}const pa=10;function Ot(t,e,n=pa){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function tt(t,e,n=pa){return Ot(t,e,n)===0}function _e(t,e,n){return Ot(t,e,n)===0}function jv(t,e,n){if(t.length!==e.length)return!1;for(let r=0;r<t.length;r++){const i=t[r],o=e[r];if(!_e(i,o,n))return!1}return!0}function sn({panelConstraints:t,panelIndex:e,size:n}){const r=t[e];Z(r!=null,`Panel constraints not found for index ${e}`);let{collapsedSize:i=0,collapsible:o,maxSize:a=100,minSize:s=0}=r;if(Ot(n,s)<0)if(o){const l=(i+s)/2;Ot(n,l)<0?n=i:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(pa)),n}function _n({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(_e(t,0))return e;const a=[...e],[s,l]=r;Z(s!=null,"Invalid first pivot index"),Z(l!=null,"Invalid second pivot index");let u=0;if(o==="keyboard"){{const d=t<0?l:s,h=n[d];Z(h,`Panel constraints not found for index ${d}`);const{collapsedSize:g=0,collapsible:m,minSize:p=0}=h;if(m){const v=e[d];if(Z(v!=null,`Previous layout not found for panel index ${d}`),_e(v,g)){const y=p-v;Ot(y,Math.abs(t))>0&&(t=t<0?0-y:y)}}}{const d=t<0?s:l,h=n[d];Z(h,`No panel constraints found for index ${d}`);const{collapsedSize:g=0,collapsible:m,minSize:p=0}=h;if(m){const v=e[d];if(Z(v!=null,`Previous layout not found for panel index ${d}`),_e(v,p)){const y=v-g;Ot(y,Math.abs(t))>0&&(t=t<0?0-y:y)}}}}{const d=t<0?1:-1;let h=t<0?l:s,g=0;for(;;){const p=e[h];Z(p!=null,`Previous layout not found for panel index ${h}`);const y=sn({panelConstraints:n,panelIndex:h,size:100})-p;if(g+=y,h+=d,h<0||h>=n.length)break}const m=Math.min(Math.abs(t),Math.abs(g));t=t<0?0-m:m}{let h=t<0?s:l;for(;h>=0&&h<n.length;){const g=Math.abs(t)-Math.abs(u),m=e[h];Z(m!=null,`Previous layout not found for panel index ${h}`);const p=m-g,v=sn({panelConstraints:n,panelIndex:h,size:p});if(!_e(m,v)&&(u+=m-v,a[h]=v,u.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?h--:h++}}if(jv(i,a))return i;{const d=t<0?l:s,h=e[d];Z(h!=null,`Previous layout not found for panel index ${d}`);const g=h+u,m=sn({panelConstraints:n,panelIndex:d,size:g});if(a[d]=m,!_e(m,g)){let p=g-m,y=t<0?l:s;for(;y>=0&&y<n.length;){const w=a[y];Z(w!=null,`Previous layout not found for panel index ${y}`);const $=w+p,P=sn({panelConstraints:n,panelIndex:y,size:$});if(_e(w,P)||(p-=P-w,a[y]=P),_e(p,0))break;t>0?y--:y++}}}const c=a.reduce((d,h)=>h+d,0);return _e(c,100)?a:i}function zv({layout:t,panelsArray:e,pivotIndices:n}){let r=0,i=100,o=0,a=0;const s=n[0];Z(s!=null,"No pivot index found"),e.forEach((d,h)=>{const{constraints:g}=d,{maxSize:m=100,minSize:p=0}=g;h===s?(r=p,i=m):(o+=p,a+=m)});const l=Math.min(i,100-o),u=Math.max(r,100-a),c=t[s];return{valueMax:l,valueMin:u,valueNow:c}}function zn(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function Bc(t,e,n=document){const i=zn(t,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===e);return i??null}function Wc(t,e,n){const r=Bc(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function Uc(t,e=document){var n;if(e instanceof HTMLElement&&(e==null||(n=e.dataset)===null||n===void 0?void 0:n.panelGroupId)==t)return e;const r=e.querySelector(`[data-panel-group][data-panel-group-id="${t}"]`);return r||null}function oi(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function Hv(t,e,n,r=document){var i,o,a,s;const l=oi(e,r),u=zn(t,r),c=l?u.indexOf(l):-1,d=(i=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,h=(a=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null;return[d,h]}function Bv({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:a}){Ie({didWarnAboutMissingResizeHandle:!1}),$t(()=>{if(!o)return;const s=zn(n,o);for(let l=0;l<i.length-1;l++){const{valueMax:u,valueMin:c,valueNow:d}=zv({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),h=s[l];if(h!=null){const g=i[l];Z(g,`No panel data found for index "${l}"`),h.setAttribute("aria-controls",g.id),h.setAttribute("aria-valuemax",""+Math.round(u)),h.setAttribute("aria-valuemin",""+Math.round(c)),h.setAttribute("aria-valuenow",d!=null?""+Math.round(d):"")}}return()=>{s.forEach((l,u)=>{l.removeAttribute("aria-controls"),l.removeAttribute("aria-valuemax"),l.removeAttribute("aria-valuemin"),l.removeAttribute("aria-valuenow")})}},[n,r,i,o]),xt(()=>{if(!o)return;const s=e.current;Z(s,"Eager values not found");const{panelDataArray:l}=s,u=Uc(n,o);Z(u!=null,`No group found for id "${n}"`);const c=zn(n,o);Z(c,`No resize handles found for group id "${n}"`);const d=c.map(h=>{const g=h.getAttribute("data-panel-resize-handle-id");Z(g,"Resize handle element has no handle id attribute");const[m,p]=Hv(n,g,l,o);if(m==null||p==null)return()=>{};const v=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const w=l.findIndex($=>$.id===m);if(w>=0){const $=l[w];Z($,`No panel data found for index ${w}`);const P=r[w],{collapsedSize:D=0,collapsible:O,minSize:I=0}=$.constraints;if(P!=null&&O){const b=_n({delta:_e(P,D)?I-D:D-P,initialLayout:r,panelConstraints:l.map(R=>R.constraints),pivotIndices:Wc(n,g,o),prevLayout:r,trigger:"keyboard"});r!==b&&a(b)}}break}}};return h.addEventListener("keydown",v),()=>{h.removeEventListener("keydown",v)}});return()=>{d.forEach(h=>h())}},[o,t,e,n,r,i,a])}function js(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!==e[n])return!1;return!0}function Vc(t,e){const n=t==="horizontal",{x:r,y:i}=ri(e);return n?r:i}function Wv(t,e,n,r,i){const o=n==="horizontal",a=oi(e,i);Z(a,`No resize handle element found for id "${e}"`);const s=a.getAttribute("data-panel-group-id");Z(s,"Resize handle element has no group id attribute");let{initialCursorPosition:l}=r;const u=Vc(n,t),c=Uc(s,i);Z(c,`No group element found for id "${s}"`);const d=c.getBoundingClientRect(),h=o?d.width:d.height;return(u-l)/h*100}function Uv(t,e,n,r,i,o){if(Mc(t)){const a=n==="horizontal";let s=0;t.shiftKey?s=100:i!=null?s=i:s=10;let l=0;switch(t.key){case"ArrowDown":l=a?0:s;break;case"ArrowLeft":l=a?-s:0;break;case"ArrowRight":l=a?s:0;break;case"ArrowUp":l=a?0:-s;break;case"End":l=100;break;case"Home":l=-100;break}return l}else return r==null?0:Wv(t,e,n,r,o)}function Vv({panelDataArray:t}){const e=Array(t.length),n=t.map(o=>o.constraints);let r=0,i=100;for(let o=0;o<t.length;o++){const a=n[o];Z(a,`Panel constraints not found for index ${o}`);const{defaultSize:s}=a;s!=null&&(r++,e[o]=s,i-=s)}for(let o=0;o<t.length;o++){const a=n[o];Z(a,`Panel constraints not found for index ${o}`);const{defaultSize:s}=a;if(s!=null)continue;const l=t.length-r,u=i/l;r++,e[o]=u,i-=u}return e}function Wt(t,e,n){e.forEach((r,i)=>{const o=t[i];Z(o,`Panel data not found for index ${i}`);const{callbacks:a,constraints:s,id:l}=o,{collapsedSize:u=0,collapsible:c}=s,d=n[l];if(d==null||r!==d){n[l]=r;const{onCollapse:h,onExpand:g,onResize:m}=a;m&&m(r,d),c&&(h||g)&&(g&&(d==null||tt(d,u))&&!tt(r,u)&&g(),h&&(d==null||!tt(d,u))&&tt(r,u)&&h())}})}function ar(t,e){if(t.length!==e.length)return!1;for(let n=0;n<t.length;n++)if(t[n]!=e[n])return!1;return!0}function Gv({defaultSize:t,dragState:e,layout:n,panelData:r,panelIndex:i,precision:o=3}){const a=n[i];let s;return a==null?s=t!=null?t.toPrecision(o):"1":r.length===1?s="1":s=a.toPrecision(o),{flexBasis:0,flexGrow:s,flexShrink:1,overflow:"hidden",pointerEvents:e!==null?"none":void 0}}function qv(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function zs(t){try{if(typeof localStorage<"u")t.getItem=e=>localStorage.getItem(e),t.setItem=(e,n)=>{localStorage.setItem(e,n)};else throw new Error("localStorage not supported in this environment")}catch(e){console.error(e),t.getItem=()=>null,t.setItem=()=>{}}}function Gc(t){return`react-resizable-panels:${t}`}function qc(t){return t.map(e=>{const{constraints:n,id:r,idIsFromProps:i,order:o}=e;return i?r:o?`${o}:${JSON.stringify(n)}`:JSON.stringify(n)}).sort((e,n)=>e.localeCompare(n)).join(",")}function Yc(t,e){try{const n=Gc(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Yv(t,e,n){var r,i;const o=(r=Yc(t,n))!==null&&r!==void 0?r:{},a=qc(e);return(i=o[a])!==null&&i!==void 0?i:null}function Xv(t,e,n,r,i){var o;const a=Gc(t),s=qc(e),l=(o=Yc(t,i))!==null&&o!==void 0?o:{};l[s]={expandToSizes:Object.fromEntries(n.entries()),layout:r};try{i.setItem(a,JSON.stringify(l))}catch(u){console.error(u)}}function Hs({layout:t,panelConstraints:e}){const n=[...t],r=n.reduce((o,a)=>o+a,0);if(n.length!==e.length)throw Error(`Invalid ${e.length} panel layout: ${n.map(o=>`${o}%`).join(", ")}`);if(!_e(r,100)&&n.length>0)for(let o=0;o<e.length;o++){const a=n[o];Z(a!=null,`No layout data found for index ${o}`);const s=100/r*a;n[o]=s}let i=0;for(let o=0;o<e.length;o++){const a=n[o];Z(a!=null,`No layout data found for index ${o}`);const s=sn({panelConstraints:e,panelIndex:o,size:a});a!=s&&(i+=a-s,n[o]=s)}if(!_e(i,0))for(let o=0;o<e.length;o++){const a=n[o];Z(a!=null,`No layout data found for index ${o}`);const s=a+i,l=sn({panelConstraints:e,panelIndex:o,size:s});if(a!==l&&(i-=l-a,n[o]=l,_e(i,0)))break}return n}const Jv=100,kn={getItem:t=>(zs(kn),kn.getItem(t)),setItem:(t,e)=>{zs(kn),kn.setItem(t,e)}},Bs={};function Xc({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=kn,style:u,tagName:c="div",...d}){const h=da(o),g=Ie(null),[m,p]=cn(null),[v,y]=cn([]),w=Fv(),$=Ie({}),P=Ie(new Map),D=Ie(0),O=Ie({autoSaveId:t,direction:r,dragState:m,id:h,keyboardResizeBy:s,onLayout:a,storage:l}),I=Ie({layout:v,panelDataArray:[],panelDataArrayChanged:!1});Ie({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),Nc(i,()=>({getId:()=>O.current.id,getLayout:()=>{const{layout:_}=I.current;return _},setLayout:_=>{const{onLayout:F}=O.current,{layout:A,panelDataArray:z}=I.current,H=Hs({layout:_,panelConstraints:z.map(L=>L.constraints)});js(A,H)||(y(H),I.current.layout=H,F&&F(H),Wt(z,H,$.current))}}),[]),$t(()=>{O.current.autoSaveId=t,O.current.direction=r,O.current.dragState=m,O.current.id=h,O.current.onLayout=a,O.current.storage=l}),Bv({committedValuesRef:O,eagerValuesRef:I,groupId:h,layout:v,panelDataArray:I.current.panelDataArray,setLayout:y,panelGroupElement:g.current}),xt(()=>{const{panelDataArray:_}=I.current;if(t){if(v.length===0||v.length!==_.length)return;let F=Bs[t];F==null&&(F=qv(Xv,Jv),Bs[t]=F);const A=[..._],z=new Map(P.current);F(t,A,z,v,l)}},[t,v,l]),xt(()=>{});const b=Oe(_=>{const{onLayout:F}=O.current,{layout:A,panelDataArray:z}=I.current;if(_.constraints.collapsible){const H=z.map(ye=>ye.constraints),{collapsedSize:L=0,panelSize:q,pivotIndices:Q}=yt(z,_,A);if(Z(q!=null,`Panel size not found for panel "${_.id}"`),!tt(q,L)){P.current.set(_.id,q);const ve=nn(z,_)===z.length-1?q-L:L-q,se=_n({delta:ve,initialLayout:A,panelConstraints:H,pivotIndices:Q,prevLayout:A,trigger:"imperative-api"});ar(A,se)||(y(se),I.current.layout=se,F&&F(se),Wt(z,se,$.current))}}},[]),R=Oe((_,F)=>{const{onLayout:A}=O.current,{layout:z,panelDataArray:H}=I.current;if(_.constraints.collapsible){const L=H.map(Ce=>Ce.constraints),{collapsedSize:q=0,panelSize:Q=0,minSize:ye=0,pivotIndices:ve}=yt(H,_,z),se=F??ye;if(tt(Q,q)){const Ce=P.current.get(_.id),ne=Ce!=null&&Ce>=se?Ce:se,at=nn(H,_)===H.length-1?Q-ne:ne-Q,be=_n({delta:at,initialLayout:z,panelConstraints:L,pivotIndices:ve,prevLayout:z,trigger:"imperative-api"});ar(z,be)||(y(be),I.current.layout=be,A&&A(be),Wt(H,be,$.current))}}},[]),V=Oe(_=>{const{layout:F,panelDataArray:A}=I.current,{panelSize:z}=yt(A,_,F);return Z(z!=null,`Panel size not found for panel "${_.id}"`),z},[]),k=Oe((_,F)=>{const{panelDataArray:A}=I.current,z=nn(A,_);return Gv({defaultSize:F,dragState:m,layout:v,panelData:A,panelIndex:z})},[m,v]),B=Oe(_=>{const{layout:F,panelDataArray:A}=I.current,{collapsedSize:z=0,collapsible:H,panelSize:L}=yt(A,_,F);return Z(L!=null,`Panel size not found for panel "${_.id}"`),H===!0&&tt(L,z)},[]),E=Oe(_=>{const{layout:F,panelDataArray:A}=I.current,{collapsedSize:z=0,collapsible:H,panelSize:L}=yt(A,_,F);return Z(L!=null,`Panel size not found for panel "${_.id}"`),!H||Ot(L,z)>0},[]),T=Oe(_=>{const{panelDataArray:F}=I.current;F.push(_),F.sort((A,z)=>{const H=A.order,L=z.order;return H==null&&L==null?0:H==null?-1:L==null?1:H-L}),I.current.panelDataArrayChanged=!0,w()},[w]);$t(()=>{if(I.current.panelDataArrayChanged){I.current.panelDataArrayChanged=!1;const{autoSaveId:_,onLayout:F,storage:A}=O.current,{layout:z,panelDataArray:H}=I.current;let L=null;if(_){const Q=Yv(_,H,A);Q&&(P.current=new Map(Object.entries(Q.expandToSizes)),L=Q.layout)}L==null&&(L=Vv({panelDataArray:H}));const q=Hs({layout:L,panelConstraints:H.map(Q=>Q.constraints)});js(z,q)||(y(q),I.current.layout=q,F&&F(q),Wt(H,q,$.current))}}),$t(()=>{const _=I.current;return()=>{_.layout=[]}},[]);const j=Oe(_=>{let F=!1;const A=g.current;return A&&window.getComputedStyle(A,null).getPropertyValue("direction")==="rtl"&&(F=!0),function(H){H.preventDefault();const L=g.current;if(!L)return()=>null;const{direction:q,dragState:Q,id:ye,keyboardResizeBy:ve,onLayout:se}=O.current,{layout:Ce,panelDataArray:ne}=I.current,{initialLayout:De}=Q??{},at=Wc(ye,_,L);let be=Uv(H,_,q,Q,ve,L);const gt=q==="horizontal";gt&&F&&(be=-be);const pi=ne.map(gi=>gi.constraints),vt=_n({delta:be,initialLayout:De??Ce,panelConstraints:pi,pivotIndices:at,prevLayout:Ce,trigger:Mc(H)?"keyboard":"mouse-or-touch"}),Ft=!ar(Ce,vt);(Ac(H)||Lc(H))&&D.current!=be&&(D.current=be,!Ft&&be!==0?gt?Li(_,be<0?Fc:jc):Li(_,be<0?zc:Hc):Li(_,0)),Ft&&(y(vt),I.current.layout=vt,se&&se(vt),Wt(ne,vt,$.current))}},[]),W=Oe((_,F)=>{const{onLayout:A}=O.current,{layout:z,panelDataArray:H}=I.current,L=H.map(Ce=>Ce.constraints),{panelSize:q,pivotIndices:Q}=yt(H,_,z);Z(q!=null,`Panel size not found for panel "${_.id}"`);const ve=nn(H,_)===H.length-1?q-F:F-q,se=_n({delta:ve,initialLayout:z,panelConstraints:L,pivotIndices:Q,prevLayout:z,trigger:"imperative-api"});ar(z,se)||(y(se),I.current.layout=se,A&&A(se),Wt(H,se,$.current))},[]),Y=Oe((_,F)=>{const{layout:A,panelDataArray:z}=I.current,{collapsedSize:H=0,collapsible:L}=F,{collapsedSize:q=0,collapsible:Q,maxSize:ye=100,minSize:ve=0}=_.constraints,{panelSize:se}=yt(z,_,A);se!=null&&(L&&Q&&tt(se,H)?tt(H,q)||W(_,q):se<ve?W(_,ve):se>ye&&W(_,ye))},[W]),N=Oe((_,F)=>{const{direction:A}=O.current,{layout:z}=I.current;if(!g.current)return;const H=oi(_,g.current);Z(H,`Drag handle element not found for id "${_}"`);const L=Vc(A,F);p({dragHandleId:_,dragHandleRect:H.getBoundingClientRect(),initialCursorPosition:L,initialLayout:z})},[]),X=Oe(()=>{p(null)},[]),ie=Oe(_=>{const{panelDataArray:F}=I.current,A=nn(F,_);A>=0&&(F.splice(A,1),delete $.current[_.id],I.current.panelDataArrayChanged=!0,w())},[w]),de=Cv(()=>({collapsePanel:b,direction:r,dragState:m,expandPanel:R,getPanelSize:V,getPanelStyle:k,groupId:h,isPanelCollapsed:B,isPanelExpanded:E,reevaluatePanelConstraints:Y,registerPanel:T,registerResizeHandle:j,resizePanel:W,startDragging:N,stopDragging:X,unregisterPanel:ie,panelGroupElement:g.current}),[b,m,r,R,V,k,h,B,E,Y,T,j,W,N,X,ie]),M={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return gn(ni.Provider,{value:de},gn(c,{...d,children:e,className:n,id:o,ref:g,style:{...M,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":h}))}const Jc=_c((t,e)=>gn(Xc,{...t,forwardedRef:e}));Xc.displayName="PanelGroup";Jc.displayName="forwardRef(PanelGroup)";function nn(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function yt(t,e,n){const r=nn(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:o}}function Qv({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){xt(()=>{if(t||n==null||r==null)return;const i=oi(e,r);if(i==null)return;const o=a=>{if(!a.defaultPrevented)switch(a.key){case"ArrowDown":case"ArrowLeft":case"ArrowRight":case"ArrowUp":case"End":case"Home":{a.preventDefault(),n(a);break}case"F6":{a.preventDefault();const s=i.getAttribute("data-panel-group-id");Z(s,`No group element found for id "${s}"`);const l=zn(s,r),u=Bc(s,e,r);Z(u!==null,`No resize element found for id "${e}"`);const c=a.shiftKey?u>0?u-1:l.length-1:u+1<l.length?u+1:0;l[c].focus();break}}};return i.addEventListener("keydown",o),()=>{i.removeEventListener("keydown",o)}},[r,t,e,n])}function Qc({children:t=null,className:e="",disabled:n=!1,hitAreaMargins:r,id:i,onBlur:o,onDragging:a,onFocus:s,style:l={},tabIndex:u=0,tagName:c="div",...d}){var h,g;const m=Ie(null),p=Ie({onDragging:a});xt(()=>{p.current.onDragging=a});const v=kc(ni);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:w,registerResizeHandle:$,startDragging:P,stopDragging:D,panelGroupElement:O}=v,I=da(i),[b,R]=cn("inactive"),[V,k]=cn(!1),[B,E]=cn(null),T=Ie({state:b});$t(()=>{T.current.state=b}),xt(()=>{if(n)E(null);else{const N=$(I);E(()=>N)}},[n,I,$]);const j=(h=r==null?void 0:r.coarse)!==null&&h!==void 0?h:15,W=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;return xt(()=>{if(n||B==null)return;const N=m.current;return Z(N,"Element ref not attached"),Kv(I,N,y,{coarse:j,fine:W},(ie,de,M)=>{if(de)switch(ie){case"down":{R("drag"),Z(M,'Expected event to be defined for "down" action'),P(I,M);const{onDragging:_}=p.current;_&&_(!0);break}case"move":{const{state:_}=T.current;_!=="drag"&&R("hover"),Z(M,'Expected event to be defined for "move" action'),B(M);break}case"up":{R("hover"),D();const{onDragging:_}=p.current;_&&_(!1);break}}else R("inactive")})},[j,y,n,W,$,I,B,P,D]),Qv({disabled:n,handleId:I,resizeHandler:B,panelGroupElement:O}),gn(c,{...d,children:t,className:e,id:i,onBlur:()=>{k(!1),o==null||o()},onFocus:()=>{k(!0),s==null||s()},ref:m,role:"separator",style:{...{touchAction:"none",userSelect:"none"},...l},tabIndex:u,"data-panel-group-direction":y,"data-panel-group-id":w,"data-resize-handle":"","data-resize-handle-active":b==="drag"?"pointer":V?"keyboard":void 0,"data-resize-handle-state":b,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":I})}Qc.displayName="PanelResizeHandle";const Zv=({icon:t,children:e,leftPanelContent:n,rightHeaderContent:r,languages:i,enableResize:o=!1})=>{const[a,s]=f.useState(!1),{isDesktop:l}=ti(),[u,c]=f.useState(sr(300,l)),[d,h]=f.useState(sr(450,l)),g=()=>{s(!a)};return f.useEffect(()=>{const m=()=>{const p=sr(300,l),v=Math.min(sr(450,l),40);c(l?p:0),h(o?v:p)};return m(),window.addEventListener("resize",()=>{m()}),()=>{window.removeEventListener("resize",m)}},[l,o]),C.jsxs("div",{className:"c__main-layout",children:[C.jsx("div",{className:"c__main-layout__header",children:C.jsx(Oc,{onTogglePanel:g,isPanelOpen:a,rightIcon:r,leftIcon:t,languages:i})}),C.jsx("div",{className:"c__main-layout__content",children:C.jsxs(Jc,{direction:"horizontal",children:[C.jsx(Po,{defaultSize:u,minSize:u,maxSize:d,children:C.jsx(Ic,{isOpen:a,children:n})}),l&&C.jsx(Qc,{className:"bg-greyscale-200",style:{width:"1px"}}),C.jsx(Po,{children:C.jsx("div",{className:"c__main-layout__content__children",children:e})})]})})]})},sr=(t,e)=>{if(!e)return 0;const n=window.innerWidth;return t/n*100},em=52,ga=({size:t="sm"})=>C.jsx("div",{className:["c__spinner",t].join(" ")}),Zc=({children:t,text:e,...n})=>C.jsxs("div",{className:"suite__label__container",children:[C.jsx("label",{...n,children:t}),e&&C.jsx("span",{className:"suite__label__container__description",children:e})]}),tm=({label:t,text:e,labelSide:n="right",children:r})=>C.jsxs("div",{className:At("c__with-label",{[n]:!0}),children:[C.jsx(Zc,{children:t,text:e}),r]});var Ws=1,nm=.9,rm=.8,im=.17,Ki=.1,Fi=.999,om=.9999,am=.99,sm=/[\\\/_+.#"@\[\(\{&]/,lm=/[\\\/_+.#"@\[\(\{&]/g,um=/[\s-]/,ed=/[\s-]/g;function Io(t,e,n,r,i,o,a){if(o===e.length)return i===t.length?Ws:am;var s=`${i},${o}`;if(a[s]!==void 0)return a[s];for(var l=r.charAt(o),u=n.indexOf(l,i),c=0,d,h,g,m;u>=0;)d=Io(t,e,n,r,u+1,o+1,a),d>c&&(u===i?d*=Ws:sm.test(t.charAt(u-1))?(d*=rm,g=t.slice(i,u-1).match(lm),g&&i>0&&(d*=Math.pow(Fi,g.length))):um.test(t.charAt(u-1))?(d*=nm,m=t.slice(i,u-1).match(ed),m&&i>0&&(d*=Math.pow(Fi,m.length))):(d*=im,i>0&&(d*=Math.pow(Fi,u-i))),t.charAt(u)!==e.charAt(o)&&(d*=om)),(d<Ki&&n.charAt(u-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(u-1)!==r.charAt(o))&&(h=Io(t,e,n,r,u+1,o+2,a),h*Ki>d&&(d=h*Ki)),d>c&&(c=d),u=n.indexOf(l,u+1);return a[s]=c,c}function Us(t){return t.toLowerCase().replace(ed," ")}function cm(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Io(t,e,Us(t),Us(e),0,0,{})}function ht(t,e,{checkForDefaultPrevented:n=!0}={}){return function(i){if(t==null||t(i),n===!1||!i.defaultPrevented)return e==null?void 0:e(i)}}function Vs(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function td(...t){return e=>{let n=!1;const r=t.map(i=>{const o=Vs(i,e);return!n&&typeof o=="function"&&(n=!0),o});if(n)return()=>{for(let i=0;i<r.length;i++){const o=r[i];typeof o=="function"?o():Vs(t[i],null)}}}}function Lt(...t){return x.useCallback(td(...t),t)}function dm(t,e){const n=x.createContext(e),r=o=>{const{children:a,...s}=o,l=x.useMemo(()=>s,Object.values(s));return C.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(o){const a=x.useContext(n);if(a)return a;if(e!==void 0)return e;throw new Error(`\`${o}\` must be used within \`${t}\``)}return[r,i]}function fm(t,e=[]){let n=[];function r(o,a){const s=x.createContext(a),l=n.length;n=[...n,a];const u=d=>{var y;const{scope:h,children:g,...m}=d,p=((y=h==null?void 0:h[t])==null?void 0:y[l])||s,v=x.useMemo(()=>m,Object.values(m));return C.jsx(p.Provider,{value:v,children:g})};u.displayName=o+"Provider";function c(d,h){var p;const g=((p=h==null?void 0:h[t])==null?void 0:p[l])||s,m=x.useContext(g);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${d}\` must be used within \`${o}\``)}return[u,c]}const i=()=>{const o=n.map(a=>x.createContext(a));return function(s){const l=(s==null?void 0:s[t])||o;return x.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return i.scopeName=t,[r,hm(i,...e)]}function hm(...t){const e=t[0];if(t.length===1)return e;const n=()=>{const r=t.map(i=>({useScope:i(),scopeName:i.scopeName}));return function(o){const a=r.reduce((s,{useScope:l,scopeName:u})=>{const d=l(o)[`__scope${u}`];return{...s,...d}},{});return x.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var Hr=globalThis!=null&&globalThis.document?x.useLayoutEffect:()=>{},pm=x.useId||(()=>{}),gm=0;function it(t){const[e,n]=x.useState(pm());return Hr(()=>{n(r=>r??String(gm++))},[t]),e?`radix-${e}`:""}function It(t){const e=x.useRef(t);return x.useEffect(()=>{e.current=t}),x.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function vm({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=mm({defaultProp:e,onChange:n}),o=t!==void 0,a=o?t:r,s=It(n),l=x.useCallback(u=>{if(o){const d=typeof u=="function"?u(t):u;d!==t&&s(d)}else i(u)},[o,t,i,s]);return[a,l]}function mm({defaultProp:t,onChange:e}){const n=x.useState(t),[r]=n,i=x.useRef(r),o=It(e);return x.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var va=x.forwardRef((t,e)=>{const{children:n,...r}=t,i=x.Children.toArray(n),o=i.find(bm);if(o){const a=o.props.children,s=i.map(l=>l===o?x.Children.count(a)>1?x.Children.only(null):x.isValidElement(a)?a.props.children:null:l);return C.jsx(_o,{...r,ref:e,children:x.isValidElement(a)?x.cloneElement(a,void 0,s):null})}return C.jsx(_o,{...r,ref:e,children:n})});va.displayName="Slot";var _o=x.forwardRef((t,e)=>{const{children:n,...r}=t;if(x.isValidElement(n)){const i=Em(n),o=Sm(r,n.props);return n.type!==x.Fragment&&(o.ref=e?td(e,i):i),x.cloneElement(n,o)}return x.Children.count(n)>1?x.Children.only(null):null});_o.displayName="SlotClone";var ym=({children:t})=>C.jsx(C.Fragment,{children:t});function bm(t){return x.isValidElement(t)&&t.type===ym}function Sm(t,e){const n={...e};for(const r in e){const i=t[r],o=e[r];/^on[A-Z]/.test(r)?i&&o?n[r]=(...s)=>{o(...s),i(...s)}:i&&(n[r]=i):r==="style"?n[r]={...i,...o}:r==="className"&&(n[r]=[i,o].filter(Boolean).join(" "))}return{...t,...n}}function Em(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var wm=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],we=wm.reduce((t,e)=>{const n=x.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?va:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),C.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function xm(t,e){t&&Gf.flushSync(()=>t.dispatchEvent(e))}function $m(t,e=globalThis==null?void 0:globalThis.document){const n=It(t);x.useEffect(()=>{const r=i=>{i.key==="Escape"&&n(i)};return e.addEventListener("keydown",r,{capture:!0}),()=>e.removeEventListener("keydown",r,{capture:!0})},[n,e])}var Cm="DismissableLayer",ko="dismissableLayer.update",Tm="dismissableLayer.pointerDownOutside",Dm="dismissableLayer.focusOutside",Gs,nd=x.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),rd=x.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=t,u=x.useContext(nd),[c,d]=x.useState(null),h=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=x.useState({}),m=Lt(e,I=>d(I)),p=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=p.indexOf(v),w=c?p.indexOf(c):-1,$=u.layersWithOutsidePointerEventsDisabled.size>0,P=w>=y,D=Im(I=>{const b=I.target,R=[...u.branches].some(V=>V.contains(b));!P||R||(i==null||i(I),a==null||a(I),I.defaultPrevented||s==null||s())},h),O=_m(I=>{const b=I.target;[...u.branches].some(V=>V.contains(b))||(o==null||o(I),a==null||a(I),I.defaultPrevented||s==null||s())},h);return $m(I=>{w===u.layers.size-1&&(r==null||r(I),!I.defaultPrevented&&s&&(I.preventDefault(),s()))},h),x.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(Gs=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),qs(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(h.body.style.pointerEvents=Gs)}},[c,h,n,u]),x.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),qs())},[c,u]),x.useEffect(()=>{const I=()=>g({});return document.addEventListener(ko,I),()=>document.removeEventListener(ko,I)},[]),C.jsx(we.div,{...l,ref:m,style:{pointerEvents:$?P?"auto":"none":void 0,...t.style},onFocusCapture:ht(t.onFocusCapture,O.onFocusCapture),onBlurCapture:ht(t.onBlurCapture,O.onBlurCapture),onPointerDownCapture:ht(t.onPointerDownCapture,D.onPointerDownCapture)})});rd.displayName=Cm;var Pm="DismissableLayerBranch",Om=x.forwardRef((t,e)=>{const n=x.useContext(nd),r=x.useRef(null),i=Lt(e,r);return x.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),C.jsx(we.div,{...t,ref:i})});Om.displayName=Pm;function Im(t,e=globalThis==null?void 0:globalThis.document){const n=It(t),r=x.useRef(!1),i=x.useRef(()=>{});return x.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){id(Tm,n,u,{discrete:!0})};const u={originalEvent:s};s.pointerType==="touch"?(e.removeEventListener("click",i.current),i.current=l,e.addEventListener("click",i.current,{once:!0})):l()}else e.removeEventListener("click",i.current);r.current=!1},a=window.setTimeout(()=>{e.addEventListener("pointerdown",o)},0);return()=>{window.clearTimeout(a),e.removeEventListener("pointerdown",o),e.removeEventListener("click",i.current)}},[e,n]),{onPointerDownCapture:()=>r.current=!0}}function _m(t,e=globalThis==null?void 0:globalThis.document){const n=It(t),r=x.useRef(!1);return x.useEffect(()=>{const i=o=>{o.target&&!r.current&&id(Dm,n,{originalEvent:o},{discrete:!1})};return e.addEventListener("focusin",i),()=>e.removeEventListener("focusin",i)},[e,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}function qs(){const t=new CustomEvent(ko);document.dispatchEvent(t)}function id(t,e,n,{discrete:r}){const i=n.originalEvent.target,o=new CustomEvent(t,{bubbles:!1,cancelable:!0,detail:n});e&&i.addEventListener(t,e,{once:!0}),r?xm(i,o):i.dispatchEvent(o)}var ji="focusScope.autoFocusOnMount",zi="focusScope.autoFocusOnUnmount",Ys={bubbles:!1,cancelable:!0},km="FocusScope",od=x.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=t,[s,l]=x.useState(null),u=It(i),c=It(o),d=x.useRef(null),h=Lt(e,p=>l(p)),g=x.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;x.useEffect(()=>{if(r){let p=function($){if(g.paused||!s)return;const P=$.target;s.contains(P)?d.current=P:lt(d.current,{select:!0})},v=function($){if(g.paused||!s)return;const P=$.relatedTarget;P!==null&&(s.contains(P)||lt(d.current,{select:!0}))},y=function($){if(document.activeElement===document.body)for(const D of $)D.removedNodes.length>0&<(s)};document.addEventListener("focusin",p),document.addEventListener("focusout",v);const w=new MutationObserver(y);return s&&w.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",p),document.removeEventListener("focusout",v),w.disconnect()}}},[r,s,g.paused]),x.useEffect(()=>{if(s){Js.add(g);const p=document.activeElement;if(!s.contains(p)){const y=new CustomEvent(ji,Ys);s.addEventListener(ji,u),s.dispatchEvent(y),y.defaultPrevented||(Nm(Km(ad(s)),{select:!0}),document.activeElement===p&<(s))}return()=>{s.removeEventListener(ji,u),setTimeout(()=>{const y=new CustomEvent(zi,Ys);s.addEventListener(zi,c),s.dispatchEvent(y),y.defaultPrevented||lt(p??document.body,{select:!0}),s.removeEventListener(zi,c),Js.remove(g)},0)}}},[s,u,c,g]);const m=x.useCallback(p=>{if(!n&&!r||g.paused)return;const v=p.key==="Tab"&&!p.altKey&&!p.ctrlKey&&!p.metaKey,y=document.activeElement;if(v&&y){const w=p.currentTarget,[$,P]=Rm(w);$&&P?!p.shiftKey&&y===P?(p.preventDefault(),n&<($,{select:!0})):p.shiftKey&&y===$&&(p.preventDefault(),n&<(P,{select:!0})):y===w&&p.preventDefault()}},[n,r,g.paused]);return C.jsx(we.div,{tabIndex:-1,...a,ref:h,onKeyDown:m})});od.displayName=km;function Nm(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(lt(r,{select:e}),document.activeElement!==n)return}function Rm(t){const e=ad(t),n=Xs(e,t),r=Xs(e.reverse(),t);return[n,r]}function ad(t){const e=[],n=document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT,{acceptNode:r=>{const i=r.tagName==="INPUT"&&r.type==="hidden";return r.disabled||r.hidden||i?NodeFilter.FILTER_SKIP:r.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP}});for(;n.nextNode();)e.push(n.currentNode);return e}function Xs(t,e){for(const n of t)if(!Mm(n,{upTo:e}))return n}function Mm(t,{upTo:e}){if(getComputedStyle(t).visibility==="hidden")return!0;for(;t;){if(e!==void 0&&t===e)return!1;if(getComputedStyle(t).display==="none")return!0;t=t.parentElement}return!1}function Am(t){return t instanceof HTMLInputElement&&"select"in t}function lt(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&Am(t)&&e&&t.select()}}var Js=Lm();function Lm(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=Qs(t,e),t.unshift(e)},remove(e){var n;t=Qs(t,e),(n=t[0])==null||n.resume()}}}function Qs(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Km(t){return t.filter(e=>e.tagName!=="A")}var Fm="Portal",sd=x.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[i,o]=x.useState(!1);Hr(()=>o(!0),[]);const a=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?Mt.createPortal(C.jsx(we.div,{...r,ref:e}),a):null});sd.displayName=Fm;function jm(t,e){return x.useReducer((n,r)=>e[n][r]??n,t)}var ai=t=>{const{present:e,children:n}=t,r=zm(e),i=typeof n=="function"?n({present:r.isPresent}):x.Children.only(n),o=Lt(r.ref,Hm(i));return typeof n=="function"||r.isPresent?x.cloneElement(i,{ref:o}):null};ai.displayName="Presence";function zm(t){const[e,n]=x.useState(),r=x.useRef({}),i=x.useRef(t),o=x.useRef("none"),a=t?"mounted":"unmounted",[s,l]=jm(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return x.useEffect(()=>{const u=lr(r.current);o.current=s==="mounted"?u:"none"},[s]),Hr(()=>{const u=r.current,c=i.current;if(c!==t){const h=o.current,g=lr(u);t?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&h!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),Hr(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,d=g=>{const p=lr(r.current).includes(g.animationName);if(g.target===e&&p&&(l("ANIMATION_END"),!i.current)){const v=e.style.animationFillMode;e.style.animationFillMode="forwards",u=c.setTimeout(()=>{e.style.animationFillMode==="forwards"&&(e.style.animationFillMode=v)})}},h=g=>{g.target===e&&(o.current=lr(r.current))};return e.addEventListener("animationstart",h),e.addEventListener("animationcancel",d),e.addEventListener("animationend",d),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",h),e.removeEventListener("animationcancel",d),e.removeEventListener("animationend",d)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:x.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function lr(t){return(t==null?void 0:t.animationName)||"none"}function Hm(t){var r,i;let e=(r=Object.getOwnPropertyDescriptor(t.props,"ref"))==null?void 0:r.get,n=e&&"isReactWarning"in e&&e.isReactWarning;return n?t.ref:(e=(i=Object.getOwnPropertyDescriptor(t,"ref"))==null?void 0:i.get,n=e&&"isReactWarning"in e&&e.isReactWarning,n?t.props.ref:t.props.ref||t.ref)}var Hi=0;function Bm(){x.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??Zs()),document.body.insertAdjacentElement("beforeend",t[1]??Zs()),Hi++,()=>{Hi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Hi--}},[])}function Zs(){const t=document.createElement("span");return t.setAttribute("data-radix-focus-guard",""),t.tabIndex=0,t.style.outline="none",t.style.opacity="0",t.style.position="fixed",t.style.pointerEvents="none",t}var yr="right-scroll-bar-position",br="width-before-scroll-bar",Wm="with-scroll-bars-hidden",Um="--removed-body-scroll-bar-size";function Bi(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Vm(t,e){var n=f.useState(function(){return{value:t,callback:e,facade:{get current(){return n.value},set current(r){var i=n.value;i!==r&&(n.value=r,n.callback(r,i))}}}})[0];return n.callback=e,n.facade}var Gm=typeof window<"u"?x.useLayoutEffect:x.useEffect,el=new WeakMap;function qm(t,e){var n=Vm(null,function(r){return t.forEach(function(i){return Bi(i,r)})});return Gm(function(){var r=el.get(n);if(r){var i=new Set(r),o=new Set(t),a=n.current;i.forEach(function(s){o.has(s)||Bi(s,null)}),o.forEach(function(s){i.has(s)||Bi(s,a)})}el.set(n,t)},[t]),n}function Ym(t){return t}function Xm(t,e){e===void 0&&(e=Ym);var n=[],r=!1,i={read:function(){if(r)throw new Error("Sidecar: could not `read` from an `assigned` medium. `read` could be used only with `useMedium`.");return n.length?n[n.length-1]:t},useMedium:function(o){var a=e(o,r);return n.push(a),function(){n=n.filter(function(s){return s!==a})}},assignSyncMedium:function(o){for(r=!0;n.length;){var a=n;n=[],a.forEach(o)}n={push:function(s){return o(s)},filter:function(){return n}}},assignMedium:function(o){r=!0;var a=[];if(n.length){var s=n;n=[],s.forEach(o),a=n}var l=function(){var c=a;a=[],c.forEach(o)},u=function(){return Promise.resolve().then(l)};u(),n={push:function(c){a.push(c),u()},filter:function(c){return a=a.filter(c),n}}}};return i}function Jm(t){t===void 0&&(t={});var e=Xm(null);return e.options=Ye({async:!0,ssr:!1},t),e}var ld=function(t){var e=t.sideCar,n=Ru(t,["sideCar"]);if(!e)throw new Error("Sidecar: please provide `sideCar` property to import the right car");var r=e.read();if(!r)throw new Error("Sidecar medium not found");return x.createElement(r,Ye({},n))};ld.isSideCarExport=!0;function Qm(t,e){return t.useMedium(e),ld}var ud=Jm(),Wi=function(){},si=x.forwardRef(function(t,e){var n=x.useRef(null),r=x.useState({onScrollCapture:Wi,onWheelCapture:Wi,onTouchMoveCapture:Wi}),i=r[0],o=r[1],a=t.forwardProps,s=t.children,l=t.className,u=t.removeScrollBar,c=t.enabled,d=t.shards,h=t.sideCar,g=t.noIsolation,m=t.inert,p=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,w=t.gapMode,$=Ru(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),P=h,D=qm([n,e]),O=Ye(Ye({},$),i);return x.createElement(x.Fragment,null,c&&x.createElement(P,{sideCar:ud,removeScrollBar:u,shards:d,noIsolation:g,inert:m,setCallbacks:o,allowPinchZoom:!!p,lockRef:n,gapMode:w}),a?x.cloneElement(x.Children.only(s),Ye(Ye({},O),{ref:D})):x.createElement(y,Ye({},O,{className:l,ref:D}),s))});si.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};si.classNames={fullWidth:br,zeroRight:yr};var Zm=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function ey(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=Zm();return e&&t.setAttribute("nonce",e),t}function ty(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function ny(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var ry=function(){var t=0,e=null;return{add:function(n){t==0&&(e=ey())&&(ty(e,n),ny(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},iy=function(){var t=ry();return function(e,n){x.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},cd=function(){var t=iy(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},oy={left:0,top:0,right:0,gap:0},Ui=function(t){return parseInt(t||"",10)||0},ay=function(t){var e=window.getComputedStyle(document.body),n=e[t==="padding"?"paddingLeft":"marginLeft"],r=e[t==="padding"?"paddingTop":"marginTop"],i=e[t==="padding"?"paddingRight":"marginRight"];return[Ui(n),Ui(r),Ui(i)]},sy=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return oy;var e=ay(t),n=document.documentElement.clientWidth,r=window.innerWidth;return{left:e[0],top:e[1],right:e[2],gap:Math.max(0,r-n+e[2]-e[0])}},ly=cd(),fn="data-scroll-locked",uy=function(t,e,n,r){var i=t.left,o=t.top,a=t.right,s=t.gap;return n===void 0&&(n="margin"),`
|
|
47
|
+
.`.concat(Wm,` {
|
|
48
|
+
overflow: hidden `).concat(r,`;
|
|
49
|
+
padding-right: `).concat(s,"px ").concat(r,`;
|
|
50
|
+
}
|
|
51
|
+
body[`).concat(fn,`] {
|
|
52
|
+
overflow: hidden `).concat(r,`;
|
|
53
|
+
overscroll-behavior: contain;
|
|
54
|
+
`).concat([e&&"position: relative ".concat(r,";"),n==="margin"&&`
|
|
55
|
+
padding-left: `.concat(i,`px;
|
|
56
|
+
padding-top: `).concat(o,`px;
|
|
57
|
+
padding-right: `).concat(a,`px;
|
|
58
|
+
margin-left:0;
|
|
59
|
+
margin-top:0;
|
|
60
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
61
|
+
`),n==="padding"&&"padding-right: ".concat(s,"px ").concat(r,";")].filter(Boolean).join(""),`
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
.`).concat(yr,` {
|
|
65
|
+
right: `).concat(s,"px ").concat(r,`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
.`).concat(br,` {
|
|
69
|
+
margin-right: `).concat(s,"px ").concat(r,`;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
.`).concat(yr," .").concat(yr,` {
|
|
73
|
+
right: 0 `).concat(r,`;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
.`).concat(br," .").concat(br,` {
|
|
77
|
+
margin-right: 0 `).concat(r,`;
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
body[`).concat(fn,`] {
|
|
81
|
+
`).concat(Um,": ").concat(s,`px;
|
|
82
|
+
}
|
|
83
|
+
`)},tl=function(){var t=parseInt(document.body.getAttribute(fn)||"0",10);return isFinite(t)?t:0},cy=function(){x.useEffect(function(){return document.body.setAttribute(fn,(tl()+1).toString()),function(){var t=tl()-1;t<=0?document.body.removeAttribute(fn):document.body.setAttribute(fn,t.toString())}},[])},dy=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;cy();var o=x.useMemo(function(){return sy(i)},[i]);return x.createElement(ly,{styles:uy(o,!e,i,n?"":"!important")})},No=!1;if(typeof window<"u")try{var ur=Object.defineProperty({},"passive",{get:function(){return No=!0,!0}});window.addEventListener("test",ur,ur),window.removeEventListener("test",ur,ur)}catch{No=!1}var Ut=No?{passive:!1}:!1,fy=function(t){return t.tagName==="TEXTAREA"},dd=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!fy(t)&&n[e]==="visible")},hy=function(t){return dd(t,"overflowY")},py=function(t){return dd(t,"overflowX")},nl=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=fd(t,r);if(i){var o=hd(t,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},gy=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},vy=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},fd=function(t,e){return t==="v"?hy(e):py(e)},hd=function(t,e){return t==="v"?gy(e):vy(e)},my=function(t,e){return t==="h"&&e==="rtl"?-1:1},yy=function(t,e,n,r,i){var o=my(t,window.getComputedStyle(e).direction),a=o*r,s=n.target,l=e.contains(s),u=!1,c=a>0,d=0,h=0;do{var g=hd(t,s),m=g[0],p=g[1],v=g[2],y=p-v-o*m;(m||y)&&fd(t,s)&&(d+=y,h+=m),s instanceof ShadowRoot?s=s.host:s=s.parentNode}while(!l&&s!==document.body||l&&(e.contains(s)||e===s));return(c&&Math.abs(d)<1||!c&&Math.abs(h)<1)&&(u=!0),u},cr=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},rl=function(t){return[t.deltaX,t.deltaY]},il=function(t){return t&&"current"in t?t.current:t},by=function(t,e){return t[0]===e[0]&&t[1]===e[1]},Sy=function(t){return`
|
|
84
|
+
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
85
|
+
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
86
|
+
`)},Ey=0,Vt=[];function wy(t){var e=x.useRef([]),n=x.useRef([0,0]),r=x.useRef(),i=x.useState(Ey++)[0],o=x.useState(cd)[0],a=x.useRef(t);x.useEffect(function(){a.current=t},[t]),x.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var p=Bp([t.lockRef.current],(t.shards||[]).map(il),!0).filter(Boolean);return p.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),p.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=x.useCallback(function(p,v){if("touches"in p&&p.touches.length===2||p.type==="wheel"&&p.ctrlKey)return!a.current.allowPinchZoom;var y=cr(p),w=n.current,$="deltaX"in p?p.deltaX:w[0]-y[0],P="deltaY"in p?p.deltaY:w[1]-y[1],D,O=p.target,I=Math.abs($)>Math.abs(P)?"h":"v";if("touches"in p&&I==="h"&&O.type==="range")return!1;var b=nl(I,O);if(!b)return!0;if(b?D=I:(D=I==="v"?"h":"v",b=nl(I,O)),!b)return!1;if(!r.current&&"changedTouches"in p&&($||P)&&(r.current=D),!D)return!0;var R=r.current||D;return yy(R,v,p,R==="h"?$:P)},[]),l=x.useCallback(function(p){var v=p;if(!(!Vt.length||Vt[Vt.length-1]!==o)){var y="deltaY"in v?rl(v):cr(v),w=e.current.filter(function(D){return D.name===v.type&&(D.target===v.target||v.target===D.shadowParent)&&by(D.delta,y)})[0];if(w&&w.should){v.cancelable&&v.preventDefault();return}if(!w){var $=(a.current.shards||[]).map(il).filter(Boolean).filter(function(D){return D.contains(v.target)}),P=$.length>0?s(v,$[0]):!a.current.noIsolation;P&&v.cancelable&&v.preventDefault()}}},[]),u=x.useCallback(function(p,v,y,w){var $={name:p,delta:v,target:y,should:w,shadowParent:xy(y)};e.current.push($),setTimeout(function(){e.current=e.current.filter(function(P){return P!==$})},1)},[]),c=x.useCallback(function(p){n.current=cr(p),r.current=void 0},[]),d=x.useCallback(function(p){u(p.type,rl(p),p.target,s(p,t.lockRef.current))},[]),h=x.useCallback(function(p){u(p.type,cr(p),p.target,s(p,t.lockRef.current))},[]);x.useEffect(function(){return Vt.push(o),t.setCallbacks({onScrollCapture:d,onWheelCapture:d,onTouchMoveCapture:h}),document.addEventListener("wheel",l,Ut),document.addEventListener("touchmove",l,Ut),document.addEventListener("touchstart",c,Ut),function(){Vt=Vt.filter(function(p){return p!==o}),document.removeEventListener("wheel",l,Ut),document.removeEventListener("touchmove",l,Ut),document.removeEventListener("touchstart",c,Ut)}},[]);var g=t.removeScrollBar,m=t.inert;return x.createElement(x.Fragment,null,m?x.createElement(o,{styles:Sy(i)}):null,g?x.createElement(dy,{gapMode:t.gapMode}):null)}function xy(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const $y=Qm(ud,wy);var pd=x.forwardRef(function(t,e){return x.createElement(si,Ye({},t,{ref:e,sideCar:$y}))});pd.classNames=si.classNames;var Cy=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Gt=new WeakMap,dr=new WeakMap,fr={},Vi=0,gd=function(t){return t&&(t.host||gd(t.parentNode))},Ty=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=gd(n);return r&&t.contains(r)?r:(console.error("aria-hidden",n,"in not contained inside",t,". Doing nothing"),null)}).filter(function(n){return!!n})},Dy=function(t,e,n,r){var i=Ty(e,Array.isArray(t)?t:[t]);fr[n]||(fr[n]=new WeakMap);var o=fr[n],a=[],s=new Set,l=new Set(i),u=function(d){!d||s.has(d)||(s.add(d),u(d.parentNode))};i.forEach(u);var c=function(d){!d||l.has(d)||Array.prototype.forEach.call(d.children,function(h){if(s.has(h))c(h);else try{var g=h.getAttribute(r),m=g!==null&&g!=="false",p=(Gt.get(h)||0)+1,v=(o.get(h)||0)+1;Gt.set(h,p),o.set(h,v),a.push(h),p===1&&m&&dr.set(h,!0),v===1&&h.setAttribute(n,"true"),m||h.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",h,y)}})};return c(e),s.clear(),Vi++,function(){a.forEach(function(d){var h=Gt.get(d)-1,g=o.get(d)-1;Gt.set(d,h),o.set(d,g),h||(dr.has(d)||d.removeAttribute(r),dr.delete(d)),g||d.removeAttribute(n)}),Vi--,Vi||(Gt=new WeakMap,Gt=new WeakMap,dr=new WeakMap,fr={})}},Py=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=Cy(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),Dy(r,i,n,"aria-hidden")):function(){return null}},ma="Dialog",[vd,wx]=fm(ma),[Oy,Ge]=vd(ma),md=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,s=x.useRef(null),l=x.useRef(null),[u=!1,c]=vm({prop:r,defaultProp:i,onChange:o});return C.jsx(Oy,{scope:e,triggerRef:s,contentRef:l,contentId:it(),titleId:it(),descriptionId:it(),open:u,onOpenChange:c,onOpenToggle:x.useCallback(()=>c(d=>!d),[c]),modal:a,children:n})};md.displayName=ma;var yd="DialogTrigger",Iy=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Ge(yd,n),o=Lt(e,i.triggerRef);return C.jsx(we.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":Sa(i.open),...r,ref:o,onClick:ht(t.onClick,i.onOpenToggle)})});Iy.displayName=yd;var ya="DialogPortal",[_y,bd]=vd(ya,{forceMount:void 0}),Sd=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=Ge(ya,e);return C.jsx(_y,{scope:e,forceMount:n,children:x.Children.map(r,a=>C.jsx(ai,{present:n||o.open,children:C.jsx(sd,{asChild:!0,container:i,children:a})}))})};Sd.displayName=ya;var Br="DialogOverlay",Ed=x.forwardRef((t,e)=>{const n=bd(Br,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Ge(Br,t.__scopeDialog);return o.modal?C.jsx(ai,{present:r||o.open,children:C.jsx(ky,{...i,ref:e})}):null});Ed.displayName=Br;var ky=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Ge(Br,n);return C.jsx(pd,{as:va,allowPinchZoom:!0,shards:[i.contentRef],children:C.jsx(we.div,{"data-state":Sa(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),_t="DialogContent",wd=x.forwardRef((t,e)=>{const n=bd(_t,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=Ge(_t,t.__scopeDialog);return C.jsx(ai,{present:r||o.open,children:o.modal?C.jsx(Ny,{...i,ref:e}):C.jsx(Ry,{...i,ref:e})})});wd.displayName=_t;var Ny=x.forwardRef((t,e)=>{const n=Ge(_t,t.__scopeDialog),r=x.useRef(null),i=Lt(e,n.contentRef,r);return x.useEffect(()=>{const o=r.current;if(o)return Py(o)},[]),C.jsx(xd,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:ht(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:ht(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:ht(t.onFocusOutside,o=>o.preventDefault())})}),Ry=x.forwardRef((t,e)=>{const n=Ge(_t,t.__scopeDialog),r=x.useRef(!1),i=x.useRef(!1);return C.jsx(xd,{...t,ref:e,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:o=>{var a,s;(a=t.onCloseAutoFocus)==null||a.call(t,o),o.defaultPrevented||(r.current||(s=n.triggerRef.current)==null||s.focus(),o.preventDefault()),r.current=!1,i.current=!1},onInteractOutside:o=>{var l,u;(l=t.onInteractOutside)==null||l.call(t,o),o.defaultPrevented||(r.current=!0,o.detail.originalEvent.type==="pointerdown"&&(i.current=!0));const a=o.target;((u=n.triggerRef.current)==null?void 0:u.contains(a))&&o.preventDefault(),o.detail.originalEvent.type==="focusin"&&i.current&&o.preventDefault()}})}),xd=x.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=t,s=Ge(_t,n),l=x.useRef(null),u=Lt(e,l);return Bm(),C.jsxs(C.Fragment,{children:[C.jsx(od,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:C.jsx(rd,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":Sa(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),C.jsxs(C.Fragment,{children:[C.jsx(Ky,{titleId:s.titleId}),C.jsx(jy,{contentRef:l,descriptionId:s.descriptionId})]})]})}),ba="DialogTitle",My=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Ge(ba,n);return C.jsx(we.h2,{id:i.titleId,...r,ref:e})});My.displayName=ba;var $d="DialogDescription",Ay=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Ge($d,n);return C.jsx(we.p,{id:i.descriptionId,...r,ref:e})});Ay.displayName=$d;var Cd="DialogClose",Ly=x.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=Ge(Cd,n);return C.jsx(we.button,{type:"button",...r,ref:e,onClick:ht(t.onClick,()=>i.onOpenChange(!1))})});Ly.displayName=Cd;function Sa(t){return t?"open":"closed"}var Td="DialogTitleWarning",[xx,Dd]=dm(Td,{contentName:_t,titleName:ba,docsSlug:"dialog"}),Ky=({titleId:t})=>{const e=Dd(Td),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
87
|
+
|
|
88
|
+
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
89
|
+
|
|
90
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return x.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Fy="DialogDescriptionWarning",jy=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${Dd(Fy).contentName}}.`;return x.useEffect(()=>{var o;const i=(o=t.current)==null?void 0:o.getAttribute("aria-describedby");e&&i&&(document.getElementById(e)||console.warn(r))},[r,t,e]),null},zy=md,Hy=Sd,By=Ed,Wy=wd,Tn='[cmdk-group=""]',Gi='[cmdk-group-items=""]',Uy='[cmdk-group-heading=""]',Ea='[cmdk-item=""]',ol=`${Ea}:not([aria-disabled="true"])`,Ro="cmdk-item-select",bt="data-value",Vy=(t,e,n)=>cm(t,e,n),Pd=x.createContext(void 0),Yn=()=>x.useContext(Pd),Od=x.createContext(void 0),wa=()=>x.useContext(Od),Id=x.createContext(void 0),_d=x.forwardRef((t,e)=>{let n=rn(()=>{var M,_;return{search:"",value:(_=(M=t.value)!=null?M:t.defaultValue)!=null?_:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=rn(()=>new Set),i=rn(()=>new Map),o=rn(()=>new Map),a=rn(()=>new Set),s=kd(t),{label:l,children:u,value:c,onValueChange:d,filter:h,shouldFilter:g,loop:m,disablePointerSelection:p=!1,vimBindings:v=!0,...y}=t,w=it(),$=it(),P=it(),D=x.useRef(null),O=rb();kt(()=>{if(c!==void 0){let M=c.trim();n.current.value=M,I.emit()}},[c]),kt(()=>{O(6,E)},[]);let I=x.useMemo(()=>({subscribe:M=>(a.current.add(M),()=>a.current.delete(M)),snapshot:()=>n.current,setState:(M,_,F)=>{var A,z,H;if(!Object.is(n.current[M],_)){if(n.current[M]=_,M==="search")B(),V(),O(1,k);else if(M==="value"&&(F||O(5,E),((A=s.current)==null?void 0:A.value)!==void 0)){let L=_??"";(H=(z=s.current).onValueChange)==null||H.call(z,L);return}I.emit()}},emit:()=>{a.current.forEach(M=>M())}}),[]),b=x.useMemo(()=>({value:(M,_,F)=>{var A;_!==((A=o.current.get(M))==null?void 0:A.value)&&(o.current.set(M,{value:_,keywords:F}),n.current.filtered.items.set(M,R(_,F)),O(2,()=>{V(),I.emit()}))},item:(M,_)=>(r.current.add(M),_&&(i.current.has(_)?i.current.get(_).add(M):i.current.set(_,new Set([M]))),O(3,()=>{B(),V(),n.current.value||k(),I.emit()}),()=>{o.current.delete(M),r.current.delete(M),n.current.filtered.items.delete(M);let F=T();O(4,()=>{B(),(F==null?void 0:F.getAttribute("id"))===M&&k(),I.emit()})}),group:M=>(i.current.has(M)||i.current.set(M,new Set),()=>{o.current.delete(M),i.current.delete(M)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:w,inputId:P,labelId:$,listInnerRef:D}),[]);function R(M,_){var F,A;let z=(A=(F=s.current)==null?void 0:F.filter)!=null?A:Vy;return M?z(M,n.current.search,_):0}function V(){if(!n.current.search||s.current.shouldFilter===!1)return;let M=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(A=>{let z=i.current.get(A),H=0;z.forEach(L=>{let q=M.get(L);H=Math.max(q,H)}),_.push([A,H])});let F=D.current;j().sort((A,z)=>{var H,L;let q=A.getAttribute("id"),Q=z.getAttribute("id");return((H=M.get(Q))!=null?H:0)-((L=M.get(q))!=null?L:0)}).forEach(A=>{let z=A.closest(Gi);z?z.appendChild(A.parentElement===z?A:A.closest(`${Gi} > *`)):F.appendChild(A.parentElement===F?A:A.closest(`${Gi} > *`))}),_.sort((A,z)=>z[1]-A[1]).forEach(A=>{var z;let H=(z=D.current)==null?void 0:z.querySelector(`${Tn}[${bt}="${encodeURIComponent(A[0])}"]`);H==null||H.parentElement.appendChild(H)})}function k(){let M=j().find(F=>F.getAttribute("aria-disabled")!=="true"),_=M==null?void 0:M.getAttribute(bt);I.setState("value",_||void 0)}function B(){var M,_,F,A;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let z=0;for(let H of r.current){let L=(_=(M=o.current.get(H))==null?void 0:M.value)!=null?_:"",q=(A=(F=o.current.get(H))==null?void 0:F.keywords)!=null?A:[],Q=R(L,q);n.current.filtered.items.set(H,Q),Q>0&&z++}for(let[H,L]of i.current)for(let q of L)if(n.current.filtered.items.get(q)>0){n.current.filtered.groups.add(H);break}n.current.filtered.count=z}function E(){var M,_,F;let A=T();A&&(((M=A.parentElement)==null?void 0:M.firstChild)===A&&((F=(_=A.closest(Tn))==null?void 0:_.querySelector(Uy))==null||F.scrollIntoView({block:"nearest"})),A.scrollIntoView({block:"nearest"}))}function T(){var M;return(M=D.current)==null?void 0:M.querySelector(`${Ea}[aria-selected="true"]`)}function j(){var M;return Array.from(((M=D.current)==null?void 0:M.querySelectorAll(ol))||[])}function W(M){let _=j()[M];_&&I.setState("value",_.getAttribute(bt))}function Y(M){var _;let F=T(),A=j(),z=A.findIndex(L=>L===F),H=A[z+M];(_=s.current)!=null&&_.loop&&(H=z+M<0?A[A.length-1]:z+M===A.length?A[0]:A[z+M]),H&&I.setState("value",H.getAttribute(bt))}function N(M){let _=T(),F=_==null?void 0:_.closest(Tn),A;for(;F&&!A;)F=M>0?tb(F,Tn):nb(F,Tn),A=F==null?void 0:F.querySelector(ol);A?I.setState("value",A.getAttribute(bt)):Y(M)}let X=()=>W(j().length-1),ie=M=>{M.preventDefault(),M.metaKey?X():M.altKey?N(1):Y(1)},de=M=>{M.preventDefault(),M.metaKey?W(0):M.altKey?N(-1):Y(-1)};return x.createElement(we.div,{ref:e,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:M=>{var _;if((_=y.onKeyDown)==null||_.call(y,M),!M.defaultPrevented)switch(M.key){case"n":case"j":{v&&M.ctrlKey&&ie(M);break}case"ArrowDown":{ie(M);break}case"p":case"k":{v&&M.ctrlKey&&de(M);break}case"ArrowUp":{de(M);break}case"Home":{M.preventDefault(),W(0);break}case"End":{M.preventDefault(),X();break}case"Enter":if(!M.nativeEvent.isComposing&&M.keyCode!==229){M.preventDefault();let F=T();if(F){let A=new Event(Ro);F.dispatchEvent(A)}}}}},x.createElement("label",{"cmdk-label":"",htmlFor:b.inputId,id:b.labelId,style:ob},l),li(t,M=>x.createElement(Od.Provider,{value:I},x.createElement(Pd.Provider,{value:b},M))))}),Gy=x.forwardRef((t,e)=>{var n,r;let i=it(),o=x.useRef(null),a=x.useContext(Id),s=Yn(),l=kd(t),u=(r=(n=l.current)==null?void 0:n.forceMount)!=null?r:a==null?void 0:a.forceMount;kt(()=>{if(!u)return s.item(i,a==null?void 0:a.id)},[u]);let c=Nd(i,o,[t.value,t.children,o],t.keywords),d=wa(),h=Nt(O=>O.value&&O.value===c.current),g=Nt(O=>u||s.filter()===!1?!0:O.search?O.filtered.items.get(i)>0:!0);x.useEffect(()=>{let O=o.current;if(!(!O||t.disabled))return O.addEventListener(Ro,m),()=>O.removeEventListener(Ro,m)},[g,t.onSelect,t.disabled]);function m(){var O,I;p(),(I=(O=l.current).onSelect)==null||I.call(O,c.current)}function p(){d.setState("value",c.current,!0)}if(!g)return null;let{disabled:v,value:y,onSelect:w,forceMount:$,keywords:P,...D}=t;return x.createElement(we.div,{ref:Bn([o,e]),...D,id:i,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!h,"data-disabled":!!v,"data-selected":!!h,onPointerMove:v||s.getDisablePointerSelection()?void 0:p,onClick:v?void 0:m},t.children)}),qy=x.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...o}=t,a=it(),s=x.useRef(null),l=x.useRef(null),u=it(),c=Yn(),d=Nt(g=>i||c.filter()===!1?!0:g.search?g.filtered.groups.has(a):!0);kt(()=>c.group(a),[]),Nd(a,s,[t.value,t.heading,l]);let h=x.useMemo(()=>({id:a,forceMount:i}),[i]);return x.createElement(we.div,{ref:Bn([s,e]),...o,"cmdk-group":"",role:"presentation",hidden:d?void 0:!0},n&&x.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),li(t,g=>x.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},x.createElement(Id.Provider,{value:h},g))))}),Yy=x.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=x.useRef(null),o=Nt(a=>!a.search);return!n&&!o?null:x.createElement(we.div,{ref:Bn([i,e]),...r,"cmdk-separator":"",role:"separator"})}),Xy=x.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=wa(),a=Nt(c=>c.search),s=Nt(c=>c.value),l=Yn(),u=x.useMemo(()=>{var c;let d=(c=l.listInnerRef.current)==null?void 0:c.querySelector(`${Ea}[${bt}="${encodeURIComponent(s)}"]`);return d==null?void 0:d.getAttribute("id")},[]);return x.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),x.createElement(we.input,{ref:e,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":l.listId,"aria-labelledby":l.labelId,"aria-activedescendant":u,id:l.inputId,type:"text",value:i?t.value:a,onChange:c=>{i||o.setState("search",c.target.value),n==null||n(c.target.value)}})}),Jy=x.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,o=x.useRef(null),a=x.useRef(null),s=Yn();return x.useEffect(()=>{if(a.current&&o.current){let l=a.current,u=o.current,c,d=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let h=l.offsetHeight;u.style.setProperty("--cmdk-list-height",h.toFixed(1)+"px")})});return d.observe(l),()=>{cancelAnimationFrame(c),d.unobserve(l)}}},[]),x.createElement(we.div,{ref:Bn([o,e]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:s.listId},li(t,l=>x.createElement("div",{ref:Bn([a,s.listInnerRef]),"cmdk-list-sizer":""},l)))}),Qy=x.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=t;return x.createElement(zy,{open:n,onOpenChange:r},x.createElement(Hy,{container:a},x.createElement(By,{"cmdk-overlay":"",className:i}),x.createElement(Wy,{"aria-label":t.label,"cmdk-dialog":"",className:o},x.createElement(_d,{ref:e,...s}))))}),Zy=x.forwardRef((t,e)=>Nt(n=>n.filtered.count===0)?x.createElement(we.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),eb=x.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...o}=t;return x.createElement(we.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},li(t,a=>x.createElement("div",{"aria-hidden":!0},a)))}),Hn=Object.assign(_d,{List:Jy,Item:Gy,Input:Xy,Group:qy,Separator:Yy,Dialog:Qy,Empty:Zy,Loading:eb});function tb(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function nb(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function kd(t){let e=x.useRef(t);return kt(()=>{e.current=t}),e}var kt=typeof window>"u"?x.useEffect:x.useLayoutEffect;function rn(t){let e=x.useRef();return e.current===void 0&&(e.current=t()),e}function Bn(t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function Nt(t){let e=wa(),n=()=>t(e.snapshot());return Jo.useSyncExternalStore(e.subscribe,n,n)}function Nd(t,e,n,r=[]){let i=x.useRef(),o=Yn();return kt(()=>{var a;let s=(()=>{var u;for(let c of n){if(typeof c=="string")return c.trim();if(typeof c=="object"&&"current"in c)return c.current?(u=c.current.textContent)==null?void 0:u.trim():i.current}})(),l=r.map(u=>u.trim());o.value(t,s,l),(a=e.current)==null||a.setAttribute(bt,s),i.current=s}),i}var rb=()=>{let[t,e]=x.useState(),n=rn(()=>new Map);return kt(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function ib(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function li({asChild:t,children:e},n){return t&&x.isValidElement(e)?x.cloneElement(ib(e),{ref:e.ref},n(e.props.children)):n(e)}var ob={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const Mo=({withPadding:t=!0})=>C.jsx("div",{className:At("c__horizontal-separator",{"with-padding":t})}),Rd=({loading:t,inputValue:e,onFilter:n,placeholder:r,children:i,withSeparator:o=!0})=>{const{t:a}=hn.useCunningham();return i?C.jsxs(C.Fragment,{children:[i,o&&C.jsx(Mo,{})]}):C.jsxs(C.Fragment,{children:[C.jsxs("div",{className:"quick-search-input-container",children:[!t&&C.jsx("span",{className:"material-icons",children:"search"}),t&&C.jsx("div",{children:C.jsx(ga,{size:"sm"})}),C.jsx(Hn.Input,{autoFocus:!0,"aria-label":a("Quick search input"),onClick:s=>{s.stopPropagation()},role:"combobox",value:e,placeholder:r,onValueChange:n})]}),o&&C.jsx(Mo,{withPadding:!1})]})},ab=t=>{let e=!1;return f.Children.forEach(t,n=>{e=e||!!n}),e},sb=({onFilter:t,inputContent:e,inputValue:n,loading:r,showInput:i=!0,label:o,placeholder:a,children:s})=>{const l=f.useRef(null);return C.jsx(C.Fragment,{children:C.jsx("div",{className:"quick-search-container",children:C.jsxs(Hn,{label:o,shouldFilter:!1,ref:l,children:[i&&C.jsx(Rd,{loading:r,withSeparator:ab(s),inputValue:n,onFilter:t,placeholder:a,children:e}),C.jsx(Hn.List,{children:C.jsx("div",{children:s})})]})})})},Sr=({children:t,onSelect:e,id:n})=>C.jsx(Hn.Item,{value:n,onSelect:e,children:t}),lb=({group:t,onSelect:e,renderElement:n})=>{var r,i;return!t.showWhenEmpty&&t.elements.length===0?null:C.jsx("div",{className:"pt-base",children:C.jsxs(Hn.Group,{heading:t.groupName,forceMount:!1,children:[(r=t.startActions)==null?void 0:r.map((o,a)=>C.jsx(Sr,{onSelect:o.onSelect,children:o.content},`${t.groupName}-action-${a}`)),t.elements.map((o,a)=>C.jsx(Sr,{id:`${t.groupName}-element-${a}`,onSelect:()=>{e==null||e(o)},children:n==null?void 0:n(o)},`${t.groupName}-element-${a}`)),(i=t.endActions)==null?void 0:i.map((o,a)=>C.jsx(Sr,{onSelect:o.onSelect,children:o.content},`${t.groupName}-action-${a}`)),t.emptyString&&t.elements.length===0&&C.jsx("span",{className:"ml-b clr-greyscale-500",children:t.emptyString})]},t.groupName)})},ub=({alwaysShowRight:t,left:e,right:n})=>{const{isDesktop:r}=ti();return C.jsxs("div",{className:"c__quick-search-item-template",children:[C.jsx("div",{className:"c__quick-search-item-template__left",children:e}),r&&n&&C.jsx("div",{className:At("c__quick-search-item-template__right",{"show-right-on-focus":t}),children:n})]})},cb=({tabs:t,defaultSelectedTab:e,fullWidth:n=!1})=>t.length===0?null:C.jsx("div",{className:At("c__tabs",{"c__tabs__full-width":n}),children:C.jsxs(mv,{defaultSelectedKey:e,children:[C.jsx(bv,{"aria-label":"History of Ancient Rome",children:t.map(r=>C.jsxs(Ev,{id:r.id,children:[r.icon&&C.jsx("span",{className:"material-icons",children:r.icon}),r.label]},r.id))}),t.map(r=>C.jsx(wv,{id:r.id,children:r.content},r.id))]})}),Md=f.createContext(null);function Ne(){const t=f.useContext(Md);if(t===null)throw new Error("No Tree Api Provided");return t}const Ad=f.createContext(null);function db(){const t=f.useContext(Ad);if(t===null)throw new Error("Provide a NodesContext");return t}const Ld=f.createContext(null);function fb(){const t=f.useContext(Ld);if(t===null)throw new Error("Provide a DnDContext");return t}const Kd=f.createContext(0);function Fd(){f.useContext(Kd)}function Er(t,e,n){return Math.max(Math.min(t,n),e)}function jd(t){return t&&t.isLeaf}function zd(t){return t&&t.isInternal&&!t.isOpen}function Hd(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const Bd=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},Wd=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function hb(){}function xa(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=xa(n,e);if(r)return r}return null}function Wr(t,e){if(e(t),t.children)for(let n of t.children)Wr(n,e)}function Ud(t){const e=Gd(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=pb(e,r);break}n==null||n.focus()}function Vd(t){const e=Gd(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=gb(e,r);break}n==null||n.focus()}function pb(t,e){return e+1<t.length?t[e+1]:t[0]}function gb(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function Gd(t){return Array.from(document.querySelectorAll('button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"]):not([disabled]), details:not([disabled]), summary:not(:disabled)')).filter(e=>e===t||!t.contains(e))}function Nn(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function qd(t){return t===null?null:St(t)}function St(t){return typeof t=="string"?t:t.id}function vb(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function Yd(t,...e){if(t)return t(...e)}function Xd(t){return new Promise((e,n)=>{let r=0;function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)}i()})}function Jd(t){var e,n;const r=t.focusedNode;return r?r.isOpen?0:r.parent?r.childIndex+1:0:(n=(e=t.root.children)===null||e===void 0?void 0:e.length)!==null&&n!==void 0?n:0}function Qd(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const mb=Object.freeze(Object.defineProperty({__proto__:null,access:Nn,bound:Er,dfs:xa,focusNextElement:Ud,focusPrevElement:Vd,getInsertIndex:Jd,getInsertParentId:Qd,identify:St,identifyNull:qd,indexOf:Wd,isClosed:zd,isDescendant:Bd,isItem:jd,isOpenWithEmptyChildren:Hd,mergeRefs:vb,noop:hb,safeRun:Yd,waitFor:Xd,walk:Wr},Symbol.toStringTag,{value:"Module"})),yb={display:"flex",alignItems:"center",zIndex:1},bb={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},Sb={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},Eb=f.memo(function({top:e,left:n,indent:r}){const i={position:"absolute",pointerEvents:"none",top:e-2+"px",left:n+"px",right:r+"px"};return C.jsxs("div",{style:Object.assign(Object.assign({},yb),i),children:[C.jsx("div",{style:Object.assign({},Sb)}),C.jsx("div",{style:Object.assign({},bb)})]})});function wb({node:t,attrs:e,innerRef:n,children:r}){return C.jsx("div",Object.assign({},e,{ref:n,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:r}))}function xb(t){return C.jsxs("div",{ref:t.dragHandle,style:t.style,children:[C.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"🌳":t.node.isOpen?"🗁":"🗀"})," ",t.node.isEditing?C.jsx(Cb,Object.assign({},t)):C.jsx($b,Object.assign({},t))]})}function $b(t){return C.jsx(C.Fragment,{children:C.jsx("span",{children:t.node.data.name})})}function Cb({node:t}){const e=f.useRef();return f.useEffect(()=>{var n,r;(n=e.current)===null||n===void 0||n.focus(),(r=e.current)===null||r===void 0||r.select()},[]),C.jsx("input",{ref:e,defaultValue:t.data.name,onBlur:()=>t.reset(),onKeyDown:n=>{var r;n.key==="Escape"&&t.reset(),n.key==="Enter"&&t.submit(((r=e.current)===null||r===void 0?void 0:r.value)||"")}})}function qi(t){return{type:"EDIT",id:t}}function Tb(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t}function qt(t){return{type:"FOCUS",id:t}}function Db(){return{type:"TREE_BLUR"}}function Pb(t={id:null,treeFocused:!1},e){return e.type==="FOCUS"?Object.assign(Object.assign({},t),{id:e.id,treeFocused:!0}):e.type==="TREE_BLUR"?Object.assign(Object.assign({},t),{treeFocused:!1}):t}class Ur{constructor(e){this.handleClick=n=>{n.metaKey&&!this.tree.props.disableMultiSelection?this.isSelected?this.deselect():this.selectMulti():n.shiftKey&&!this.tree.props.disableMultiSelection?this.selectContiguous():(this.select(),this.activate())},this.tree=e.tree,this.id=e.id,this.data=e.data,this.level=e.level,this.children=e.children,this.parent=e.parent,this.isDraggable=e.isDraggable,this.rowIndex=e.rowIndex}get isRoot(){return this.id===Wn}get isLeaf(){return!Array.isArray(this.children)}get isInternal(){return!this.isLeaf}get isOpen(){return this.isLeaf?!1:this.tree.isOpen(this.id)}get isClosed(){return this.isLeaf?!1:!this.tree.isOpen(this.id)}get isEditable(){return this.tree.isEditable(this.data)}get isEditing(){return this.tree.editingId===this.id}get isSelected(){return this.tree.isSelected(this.id)}get isOnlySelection(){return this.isSelected&&this.tree.hasOneSelection}get isSelectedStart(){var e;return this.isSelected&&!(!((e=this.prev)===null||e===void 0)&&e.isSelected)}get isSelectedEnd(){var e;return this.isSelected&&!(!((e=this.next)===null||e===void 0)&&e.isSelected)}get isFocused(){return this.tree.isFocused(this.id)}get isDragging(){return this.tree.isDragging(this.id)}get willReceiveDrop(){return this.tree.willReceiveDrop(this.id)}get state(){return{isClosed:this.isClosed,isDragging:this.isDragging,isEditing:this.isEditing,isFocused:this.isFocused,isInternal:this.isInternal,isLeaf:this.isLeaf,isOpen:this.isOpen,isSelected:this.isSelected,isSelectedEnd:this.isSelectedEnd,isSelectedStart:this.isSelectedStart,willReceiveDrop:this.willReceiveDrop}}get childIndex(){return this.parent&&this.parent.children?this.parent.children.findIndex(e=>e.id===this.id):-1}get next(){return this.rowIndex===null?null:this.tree.at(this.rowIndex+1)}get prev(){return this.rowIndex===null?null:this.tree.at(this.rowIndex-1)}get nextSibling(){var e,n;const r=this.childIndex;return(n=(e=this.parent)===null||e===void 0?void 0:e.children[r+1])!==null&&n!==void 0?n:null}isAncestorOf(e){if(!e)return!1;let n=e;for(;n;){if(n.id===this.id)return!0;n=n.parent}return!1}select(){this.tree.select(this)}deselect(){this.tree.deselect(this)}selectMulti(){this.tree.selectMulti(this)}selectContiguous(){this.tree.selectContiguous(this)}activate(){this.tree.activate(this)}focus(){this.tree.focus(this)}toggle(){this.tree.toggle(this)}open(){this.tree.open(this)}openParents(){this.tree.openParents(this)}close(){this.tree.close(this)}submit(e){this.tree.submit(this,e)}reset(){this.tree.reset()}clone(){return new Ur(Object.assign({},this))}edit(){return this.tree.edit(this)}}const Wn="__REACT_ARBORIST_INTERNAL_ROOT__";function al(t){var e;function n(o,a,s){const l=t.accessId(o),u=new Ur({tree:t,data:o,level:a,parent:s,id:l,children:null,isDraggable:t.isDraggable(o),rowIndex:null}),c=t.accessChildren(o);return c&&(u.children=c.map(d=>n(d,a+1,u))),u}const r=new Ur({tree:t,id:Wn,data:{id:Wn},level:-1,parent:null,children:null,isDraggable:!0,rowIndex:null}),i=(e=t.props.data)!==null&&e!==void 0?e:[];return r.children=i.map(o=>n(o,0,r)),r}const Ao={open(t,e){return{type:"VISIBILITY_OPEN",id:t,filtered:e}},close(t,e){return{type:"VISIBILITY_CLOSE",id:t,filtered:e}},toggle(t,e){return{type:"VISIBILITY_TOGGLE",id:t,filtered:e}},clear(t){return{type:"VISIBILITY_CLEAR",filtered:t}}};function sl(t={},e){if(e.type==="VISIBILITY_OPEN")return Object.assign(Object.assign({},t),{[e.id]:!0});if(e.type==="VISIBILITY_CLOSE")return Object.assign(Object.assign({},t),{[e.id]:!1});if(e.type==="VISIBILITY_TOGGLE"){const n=t[e.id];return Object.assign(Object.assign({},t),{[e.id]:!n})}else return e.type==="VISIBILITY_CLEAR"?{}:t}function Ob(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:sl(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:sl(t.unfiltered,e)}):t}const vn=t=>{var e;return{nodes:{open:{filtered:{},unfiltered:(e=t==null?void 0:t.initialOpenState)!==null&&e!==void 0?e:{}},focus:{id:null,treeFocused:!1},edit:{id:null},drag:{id:null,selectedIds:[],destinationParentId:null,destinationIndex:null},selection:{ids:new Set,anchor:null,mostRecent:null}},dnd:{cursor:{type:"none"},dragId:null,dragIds:[],parentId:null,index:-1}}},ze={clear:()=>({type:"SELECTION_CLEAR"}),only:t=>({type:"SELECTION_ONLY",id:St(t)}),add:t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(St)}),remove:t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(St)}),set:t=>Object.assign({type:"SELECTION_SET"},t),mostRecent:t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:St(t)}),anchor:t=>({type:"SELECTION_ANCHOR",id:t===null?null:St(t)})};function Ib(t=vn().nodes.selection,e){const n=t.ids;switch(e.type){case"SELECTION_CLEAR":return Object.assign(Object.assign({},t),{ids:new Set});case"SELECTION_ONLY":return Object.assign(Object.assign({},t),{ids:new Set([e.id])});case"SELECTION_ADD":return e.ids.length===0?t:(e.ids.forEach(r=>n.add(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_REMOVE":return e.ids.length===0?t:(e.ids.forEach(r=>n.delete(r)),Object.assign(Object.assign({},t),{ids:new Set(n)}));case"SELECTION_SET":return Object.assign(Object.assign({},t),{ids:e.ids,mostRecent:e.mostRecent,anchor:e.anchor});case"SELECTION_MOST_RECENT":return Object.assign(Object.assign({},t),{mostRecent:e.id});case"SELECTION_ANCHOR":return Object.assign(Object.assign({},t),{anchor:e.id});default:return t}}const mn={cursor(t){return{type:"DND_CURSOR",cursor:t}},dragStart(t,e){return{type:"DND_DRAG_START",id:t,dragIds:e}},dragEnd(){return{type:"DND_DRAG_END"}},hovering(t,e){return{type:"DND_HOVERING",parentId:t,index:e}}};function _b(t=vn().dnd,e){switch(e.type){case"DND_CURSOR":return Object.assign(Object.assign({},t),{cursor:e.cursor});case"DND_DRAG_START":return Object.assign(Object.assign({},t),{dragId:e.id,dragIds:e.dragIds});case"DND_DRAG_END":return vn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}const kb={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},Nb=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},Rb=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function Zd({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return C.jsxs(Mb,{isDragging:i,children:[C.jsx(Ab,{offset:t,children:C.jsx(Kb,{id:n,dragIds:r})}),C.jsx(Lb,{mouse:e,count:r.length})]})}const Mb=f.memo(function(e){return e.isDragging?C.jsx("div",{style:kb,children:e.children}):null});function Ab(t){return C.jsx("div",{className:"row preview",style:Nb(t.offset),children:t.children})}function Lb(t){const{count:e,mouse:n}=t;return e>1?C.jsx("div",{className:"selected-count",style:Rb(n),children:e}):null}const Kb=f.memo(function(e){const n=Ne(),r=n.get(e.id);return r?C.jsx(n.renderNode,{preview:!0,node:r,style:{paddingLeft:r.level*n.indent,opacity:.2,background:"transparent"},tree:n}):null});function Lo(){return Lo=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)({}).hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},Lo.apply(null,arguments)}function ll(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Ko(t,e){return Ko=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Ko(t,e)}function Fb(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Ko(t,e)}var ul=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function jb(t,e){return!!(t===e||ul(t)&&ul(e))}function zb(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!jb(t[n],e[n]))return!1;return!0}function Yi(t,e){e===void 0&&(e=zb);var n,r=[],i,o=!1;function a(){for(var s=[],l=0;l<arguments.length;l++)s[l]=arguments[l];return o&&n===this&&e(s,r)||(i=t.apply(this,s),o=!0,n=this,r=s),i}return a}var Hb=typeof performance=="object"&&typeof performance.now=="function",cl=Hb?function(){return performance.now()}:function(){return Date.now()};function dl(t){cancelAnimationFrame(t.id)}function Bb(t,e){var n=cl();function r(){cl()-n>=e?t.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var Xi=-1;function fl(t){if(t===void 0&&(t=!1),Xi===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),Xi=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return Xi}var Yt=null;function hl(t){if(t===void 0&&(t=!1),Yt===null||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",n.direction="rtl";var r=document.createElement("div"),i=r.style;return i.width="100px",i.height="100px",e.appendChild(r),document.body.appendChild(e),e.scrollLeft>0?Yt="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?Yt="negative":Yt="positive-ascending"),document.body.removeChild(e),Yt}return Yt}process.env.NODE_ENV;var Wb=150,Ub=function(e,n){return e},wr=null,xr=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(wr=new WeakSet,xr=new WeakSet);function Vb(t){var e,n=t.getItemOffset,r=t.getEstimatedTotalSize,i=t.getItemSize,o=t.getOffsetForIndexAndAlignment,a=t.getStartIndexForOffset,s=t.getStopIndexForStartIndex,l=t.initInstanceProps,u=t.shouldResetStyleCacheOnItemSizeChange,c=t.validateProps;return e=function(d){Fb(h,d);function h(m){var p;return p=d.call(this,m)||this,p._instanceProps=l(p.props,ll(p)),p._outerRef=void 0,p._resetIsScrollingTimeoutId=null,p.state={instance:ll(p),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof p.props.initialScrollOffset=="number"?p.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},p._callOnItemsRendered=void 0,p._callOnItemsRendered=Yi(function(v,y,w,$){return p.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:w,visibleStopIndex:$})}),p._callOnScroll=void 0,p._callOnScroll=Yi(function(v,y,w){return p.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:w})}),p._getItemStyle=void 0,p._getItemStyle=function(v){var y=p.props,w=y.direction,$=y.itemSize,P=y.layout,D=p._getItemStyleCache(u&&$,u&&P,u&&w),O;if(D.hasOwnProperty(v))O=D[v];else{var I=n(p.props,v,p._instanceProps),b=i(p.props,v,p._instanceProps),R=w==="horizontal"||P==="horizontal",V=w==="rtl",k=R?I:0;D[v]=O={position:"absolute",left:V?void 0:k,right:V?k:void 0,top:R?0:I,height:R?"100%":b,width:R?b:"100%"}}return O},p._getItemStyleCache=void 0,p._getItemStyleCache=Yi(function(v,y,w){return{}}),p._onScrollHorizontal=function(v){var y=v.currentTarget,w=y.clientWidth,$=y.scrollLeft,P=y.scrollWidth;p.setState(function(D){if(D.scrollOffset===$)return null;var O=p.props.direction,I=$;if(O==="rtl")switch(hl()){case"negative":I=-$;break;case"positive-descending":I=P-w-$;break}return I=Math.max(0,Math.min(I,P-w)),{isScrolling:!0,scrollDirection:D.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._onScrollVertical=function(v){var y=v.currentTarget,w=y.clientHeight,$=y.scrollHeight,P=y.scrollTop;p.setState(function(D){if(D.scrollOffset===P)return null;var O=Math.max(0,Math.min(P,$-w));return{isScrolling:!0,scrollDirection:D.scrollOffset<O?"forward":"backward",scrollOffset:O,scrollUpdateWasRequested:!1}},p._resetIsScrollingDebounced)},p._outerRefSetter=function(v){var y=p.props.outerRef;p._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},p._resetIsScrollingDebounced=function(){p._resetIsScrollingTimeoutId!==null&&dl(p._resetIsScrollingTimeoutId),p._resetIsScrollingTimeoutId=Bb(p._resetIsScrolling,Wb)},p._resetIsScrolling=function(){p._resetIsScrollingTimeoutId=null,p.setState({isScrolling:!1},function(){p._getItemStyleCache(-1,null)})},p}h.getDerivedStateFromProps=function(p,v){return Gb(p,v),c(p),null};var g=h.prototype;return g.scrollTo=function(p){p=Math.max(0,p),this.setState(function(v){return v.scrollOffset===p?null:{scrollDirection:v.scrollOffset<p?"forward":"backward",scrollOffset:p,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(p,v){v===void 0&&(v="auto");var y=this.props,w=y.itemCount,$=y.layout,P=this.state.scrollOffset;p=Math.max(0,Math.min(p,w-1));var D=0;if(this._outerRef){var O=this._outerRef;$==="vertical"?D=O.scrollWidth>O.clientWidth?fl():0:D=O.scrollHeight>O.clientHeight?fl():0}this.scrollTo(o(this.props,p,v,P,this._instanceProps,D))},g.componentDidMount=function(){var p=this.props,v=p.direction,y=p.initialScrollOffset,w=p.layout;if(typeof y=="number"&&this._outerRef!=null){var $=this._outerRef;v==="horizontal"||w==="horizontal"?$.scrollLeft=y:$.scrollTop=y}this._callPropsCallbacks()},g.componentDidUpdate=function(){var p=this.props,v=p.direction,y=p.layout,w=this.state,$=w.scrollOffset,P=w.scrollUpdateWasRequested;if(P&&this._outerRef!=null){var D=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(hl()){case"negative":D.scrollLeft=-$;break;case"positive-ascending":D.scrollLeft=$;break;default:var O=D.clientWidth,I=D.scrollWidth;D.scrollLeft=I-O-$;break}else D.scrollLeft=$;else D.scrollTop=$}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&dl(this._resetIsScrollingTimeoutId)},g.render=function(){var p=this.props,v=p.children,y=p.className,w=p.direction,$=p.height,P=p.innerRef,D=p.innerElementType,O=p.innerTagName,I=p.itemCount,b=p.itemData,R=p.itemKey,V=R===void 0?Ub:R,k=p.layout,B=p.outerElementType,E=p.outerTagName,T=p.style,j=p.useIsScrolling,W=p.width,Y=this.state.isScrolling,N=w==="horizontal"||k==="horizontal",X=N?this._onScrollHorizontal:this._onScrollVertical,ie=this._getRangeToRender(),de=ie[0],M=ie[1],_=[];if(I>0)for(var F=de;F<=M;F++)_.push(f.createElement(v,{data:b,key:V(F,b),index:F,isScrolling:j?Y:void 0,style:this._getItemStyle(F)}));var A=r(this.props,this._instanceProps);return f.createElement(B||E||"div",{className:y,onScroll:X,ref:this._outerRefSetter,style:Lo({position:"relative",height:$,width:W,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:w},T)},f.createElement(D||O||"div",{children:_,ref:P,style:{height:N?"100%":A,pointerEvents:Y?"none":void 0,width:N?A:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var p=this.props.itemCount;if(p>0){var v=this._getRangeToRender(),y=v[0],w=v[1],$=v[2],P=v[3];this._callOnItemsRendered(y,w,$,P)}}if(typeof this.props.onScroll=="function"){var D=this.state,O=D.scrollDirection,I=D.scrollOffset,b=D.scrollUpdateWasRequested;this._callOnScroll(O,I,b)}},g._getRangeToRender=function(){var p=this.props,v=p.itemCount,y=p.overscanCount,w=this.state,$=w.isScrolling,P=w.scrollDirection,D=w.scrollOffset;if(v===0)return[0,0,0,0];var O=a(this.props,D,this._instanceProps),I=s(this.props,O,D,this._instanceProps),b=!$||P==="backward"?Math.max(1,y):1,R=!$||P==="forward"?Math.max(1,y):1;return[Math.max(0,O-b),Math.max(0,Math.min(v-1,I+R)),O,I]},h}(f.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var Gb=function(e,n){var r=e.children,i=e.direction,o=e.height,a=e.layout,s=e.innerTagName,l=e.outerTagName,u=e.width,c=n.instance;if(process.env.NODE_ENV!=="production"){(s!=null||l!=null)&&xr&&!xr.has(c)&&(xr.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var d=i==="horizontal"||a==="horizontal";switch(i){case"horizontal":case"vertical":wr&&!wr.has(c)&&(wr.add(c),console.warn('The direction prop should be either "ltr" (default) or "rtl". Please use the layout prop to specify "vertical" (default) or "horizontal" orientation.'));break;case"ltr":case"rtl":break;default:throw Error('An invalid "direction" prop has been specified. Value should be either "ltr" or "rtl". '+('"'+i+'" was specified.'))}switch(a){case"horizontal":case"vertical":break;default:throw Error('An invalid "layout" prop has been specified. Value should be either "horizontal" or "vertical". '+('"'+a+'" was specified.'))}if(r==null)throw Error('An invalid "children" prop has been specified. Value should be a React component. '+('"'+(r===null?"null":typeof r)+'" was specified.'));if(d&&typeof u!="number")throw Error('An invalid "width" prop has been specified. Horizontal lists must specify a number for width. '+('"'+(u===null?"null":typeof u)+'" was specified.'));if(!d&&typeof o!="number")throw Error('An invalid "height" prop has been specified. Vertical lists must specify a number for height. '+('"'+(o===null?"null":typeof o)+'" was specified.'))}},qb=Vb({getItemOffset:function(e,n){var r=e.itemSize;return n*r},getItemSize:function(e,n){var r=e.itemSize;return r},getEstimatedTotalSize:function(e){var n=e.itemCount,r=e.itemSize;return r*n},getOffsetForIndexAndAlignment:function(e,n,r,i,o,a){var s=e.direction,l=e.height,u=e.itemCount,c=e.itemSize,d=e.layout,h=e.width,g=s==="horizontal"||d==="horizontal",m=g?h:l,p=Math.max(0,u*c-m),v=Math.min(p,n*c),y=Math.max(0,n*c-m+c+a);switch(r==="smart"&&(i>=y-m&&i<=v+m?r="auto":r="center"),r){case"start":return v;case"end":return y;case"center":{var w=Math.round(y+(v-y)/2);return w<Math.ceil(m/2)?0:w>p+Math.floor(m/2)?p:w}case"auto":default:return i>=y&&i<=v?i:i<y?y:v}},getStartIndexForOffset:function(e,n){var r=e.itemCount,i=e.itemSize;return Math.max(0,Math.min(r-1,Math.floor(n/i)))},getStopIndexForStartIndex:function(e,n,r){var i=e.direction,o=e.height,a=e.itemCount,s=e.itemSize,l=e.layout,u=e.width,c=i==="horizontal"||l==="horizontal",d=n*s,h=c?u:o,g=Math.ceil((h+r-d)/s);return Math.max(0,Math.min(a-1,n+g-1))},initInstanceProps:function(e){},shouldResetStyleCacheOnItemSizeChange:!0,validateProps:function(e){var n=e.itemSize;if(process.env.NODE_ENV!=="production"&&typeof n!="number")throw Error('An invalid "itemSize" prop has been specified. Value should be a number. '+('"'+(n===null?"null":typeof n)+'" was specified.'))}});function Yb(){var t,e;const n=Ne(),i=fb().cursor;if(!i||i.type!=="line")return null;const o=n.indent,a=n.rowHeight*i.index+((e=(t=n.props.padding)!==null&&t!==void 0?t:n.props.paddingTop)!==null&&e!==void 0?e:0),s=o*i.level,l=n.renderCursor;return C.jsx(l,{top:a,left:s,indent:o})}var Xb=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const Jb=f.forwardRef(function(e,n){const{children:r}=e,i=Xb(e,["children"]),o=Ne();return C.jsxs("div",Object.assign({ref:n},i,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[C.jsx(Qb,{}),r]}))}),Qb=()=>{const t=Ne();return C.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:C.jsx(Yb,{})})};var Zb=function(t,e){var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&e.indexOf(r)<0&&(n[r]=t[r]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,r=Object.getOwnPropertySymbols(t);i<r.length;i++)e.indexOf(r[i])<0&&Object.prototype.propertyIsEnumerable.call(t,r[i])&&(n[r[i]]=t[r[i]]);return n};const eS=f.forwardRef(function(e,n){var r,i,o,a,{style:s}=e,l=Zb(e,["style"]);const u=Ne(),c=(i=(r=u.props.padding)!==null&&r!==void 0?r:u.props.paddingTop)!==null&&i!==void 0?i:0,d=(a=(o=u.props.padding)!==null&&o!==void 0?o:u.props.paddingBottom)!==null&&a!==void 0?a:0;return C.jsx("div",Object.assign({ref:n,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+c+d}px`})},l))});var ef=f.createContext({dragDropManager:void 0}),Fe;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Fe||(Fe={}));function J(t,e){for(var n=arguments.length,r=new Array(n>2?n-2:0),i=2;i<n;i++)r[i-2]=arguments[i];if(process.env.NODE_ENV!=="production"&&e===void 0)throw new Error("invariant requires an error message argument");if(!t){var o;if(e===void 0)o=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var a=0;o=new Error(e.replace(/%s/g,function(){return r[a++]})),o.name="Invariant Violation"}throw o.framesToPop=1,o}}var $a="dnd-core/INIT_COORDS",ui="dnd-core/BEGIN_DRAG",Ca="dnd-core/PUBLISH_DRAG_SOURCE",ci="dnd-core/HOVER",di="dnd-core/DROP",fi="dnd-core/END_DRAG";function pl(t,e){return{type:$a,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function $r(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?$r=function(n){return typeof n}:$r=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},$r(t)}function tS(t,e,n){return e.split(".").reduce(function(r,i){return r&&r[i]?r[i]:n},t)}function nS(t,e){return t.filter(function(n){return n!==e})}function tf(t){return $r(t)==="object"}function rS(t,e){var n=new Map,r=function(a){n.set(a,n.has(a)?n.get(a)+1:1)};t.forEach(r),e.forEach(r);var i=[];return n.forEach(function(o,a){o===1&&i.push(a)}),i}function iS(t,e){return t.filter(function(n){return e.indexOf(n)>-1})}var oS={type:$a,payload:{clientOffset:null,sourceClientOffset:null}};function aS(t){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{publishSource:!0},i=r.publishSource,o=i===void 0?!0:i,a=r.clientOffset,s=r.getSourceClientOffset,l=t.getMonitor(),u=t.getRegistry();t.dispatch(pl(a)),sS(n,l,u);var c=cS(n,l);if(c===null){t.dispatch(oS);return}var d=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");lS(s),d=s(c)}t.dispatch(pl(a,d));var h=u.getSource(c),g=h.beginDrag(l,c);if(g!=null){uS(g),u.pinSource(c);var m=u.getSourceType(c);return{type:ui,payload:{itemType:m,item:g,sourceId:c,clientOffset:a||null,sourceClientOffset:d||null,isSourcePublic:!!o}}}}}function sS(t,e,n){J(!e.isDragging(),"Cannot call beginDrag while dragging."),t.forEach(function(r){J(n.getSource(r),"Expected sourceIds to be registered.")})}function lS(t){J(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function uS(t){J(tf(t),"Item must be an object.")}function cS(t,e){for(var n=null,r=t.length-1;r>=0;r--)if(e.canDragSource(t[r])){n=t[r];break}return n}function dS(t){return function(){var n=t.getMonitor();if(n.isDragging())return{type:Ca}}}function Fo(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function fS(t){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.clientOffset;hS(n);var o=n.slice(0),a=t.getMonitor(),s=t.getRegistry();pS(o,a,s);var l=a.getItemType();return gS(o,s,l),vS(o,a,s),{type:ci,payload:{targetIds:o,clientOffset:i||null}}}}function hS(t){J(Array.isArray(t),"Expected targetIds to be an array.")}function pS(t,e,n){J(e.isDragging(),"Cannot call hover while not dragging."),J(!e.didDrop(),"Cannot call hover after drop.");for(var r=0;r<t.length;r++){var i=t[r];J(t.lastIndexOf(i)===r,"Expected targetIds to be unique in the passed array.");var o=n.getTarget(i);J(o,"Expected targetIds to be registered.")}}function gS(t,e,n){for(var r=t.length-1;r>=0;r--){var i=t[r],o=e.getTargetType(i);Fo(o,n)||t.splice(r,1)}}function vS(t,e,n){t.forEach(function(r){var i=n.getTarget(r);i.hover(e,r)})}function gl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function vl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?gl(Object(n),!0).forEach(function(r){mS(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):gl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function mS(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function yS(t){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.getMonitor(),i=t.getRegistry();bS(r);var o=wS(r);o.forEach(function(a,s){var l=SS(a,s,i,r),u={type:di,payload:{dropResult:vl(vl({},n),l)}};t.dispatch(u)})}}function bS(t){J(t.isDragging(),"Cannot call drop while not dragging."),J(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function SS(t,e,n,r){var i=n.getTarget(t),o=i?i.drop(r,t):void 0;return ES(o),typeof o>"u"&&(o=e===0?{}:r.getDropResult()),o}function ES(t){J(typeof t>"u"||tf(t),"Drop result must either be an object or undefined.")}function wS(t){var e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function xS(t){return function(){var n=t.getMonitor(),r=t.getRegistry();$S(n);var i=n.getSourceId();if(i!=null){var o=r.getSource(i,!0);o.endDrag(n,i),r.unpinSource()}return{type:fi}}}function $S(t){J(t.isDragging(),"Cannot call endDrag while not dragging.")}function CS(t){return{beginDrag:aS(t),publishDragSource:dS(t),hover:fS(t),drop:yS(t),endDrag:xS(t)}}function TS(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function DS(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function PS(t,e,n){return DS(t.prototype,e),t}function Dn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var OS=function(){function t(e,n){var r=this;TS(this,t),Dn(this,"store",void 0),Dn(this,"monitor",void 0),Dn(this,"backend",void 0),Dn(this,"isSetUp",!1),Dn(this,"handleRefCountChange",function(){var i=r.store.getState().refCount>0;r.backend&&(i&&!r.isSetUp?(r.backend.setup(),r.isSetUp=!0):!i&&r.isSetUp&&(r.backend.teardown(),r.isSetUp=!1))}),this.store=e,this.monitor=n,e.subscribe(this.handleRefCountChange)}return PS(t,[{key:"receiveBackend",value:function(n){this.backend=n}},{key:"getMonitor",value:function(){return this.monitor}},{key:"getBackend",value:function(){return this.backend}},{key:"getRegistry",value:function(){return this.monitor.registry}},{key:"getActions",value:function(){var n=this,r=this.store.dispatch;function i(a){return function(){for(var s=arguments.length,l=new Array(s),u=0;u<s;u++)l[u]=arguments[u];var c=a.apply(n,l);typeof c<"u"&&r(c)}}var o=CS(this);return Object.keys(o).reduce(function(a,s){var l=o[s];return a[s]=i(l),a},{})}},{key:"dispatch",value:function(n){this.store.dispatch(n)}}]),t}();function Ae(t){return"Minified Redux error #"+t+"; visit https://redux.js.org/Errors?code="+t+" for the full message or use the non-minified dev environment for full errors. "}var ml=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),Ji=function(){return Math.random().toString(36).substring(7).split("").join(".")},yl={INIT:"@@redux/INIT"+Ji(),REPLACE:"@@redux/REPLACE"+Ji(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+Ji()}};function IS(t){if(typeof t!="object"||t===null)return!1;for(var e=t;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}function _S(t){if(t===void 0)return"undefined";if(t===null)return"null";var e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(RS(t))return"date";if(NS(t))return"error";var n=kS(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return e.slice(8,-1).toLowerCase().replace(/\s/g,"")}function kS(t){return typeof t.constructor=="function"?t.constructor.name:null}function NS(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function RS(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Xt(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=_S(t)),e}function nf(t,e,n){var r;if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ae(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?Ae(1):"Expected the enhancer to be a function. Instead, received: '"+Xt(n)+"'");return n(nf)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?Ae(2):"Expected the root reducer to be a function. Instead, received: '"+Xt(t)+"'");var i=t,o=e,a=[],s=a,l=!1;function u(){s===a&&(s=a.slice())}function c(){if(l)throw new Error(process.env.NODE_ENV==="production"?Ae(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return o}function d(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?Ae(4):"Expected the listener to be a function. Instead, received: '"+Xt(p)+"'");if(l)throw new Error(process.env.NODE_ENV==="production"?Ae(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");var v=!0;return u(),s.push(p),function(){if(v){if(l)throw new Error(process.env.NODE_ENV==="production"?Ae(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");v=!1,u();var w=s.indexOf(p);s.splice(w,1),a=null}}}function h(p){if(!IS(p))throw new Error(process.env.NODE_ENV==="production"?Ae(7):"Actions must be plain objects. Instead, the actual type was: '"+Xt(p)+"'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.");if(typeof p.type>"u")throw new Error(process.env.NODE_ENV==="production"?Ae(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(l)throw new Error(process.env.NODE_ENV==="production"?Ae(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,p)}finally{l=!1}for(var v=a=s,y=0;y<v.length;y++){var w=v[y];w()}return p}function g(p){if(typeof p!="function")throw new Error(process.env.NODE_ENV==="production"?Ae(10):"Expected the nextReducer to be a function. Instead, received: '"+Xt(p));i=p,h({type:yl.REPLACE})}function m(){var p,v=d;return p={subscribe:function(w){if(typeof w!="object"||w===null)throw new Error(process.env.NODE_ENV==="production"?Ae(11):"Expected the observer to be an object. Instead, received: '"+Xt(w)+"'");function $(){w.next&&w.next(c())}$();var P=v($);return{unsubscribe:P}}},p[ml]=function(){return this},p}return h({type:yl.INIT}),r={dispatch:h,subscribe:d,getState:c,replaceReducer:g},r[ml]=m,r}var MS=function(e,n){return e===n};function AS(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function LS(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:MS;if(t.length!==e.length)return!1;for(var r=0;r<t.length;++r)if(!n(t[r],e[r]))return!1;return!0}function bl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Sl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?bl(Object(n),!0).forEach(function(r){KS(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):bl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function KS(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var El={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function FS(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:El,e=arguments.length>1?arguments[1]:void 0,n=e.payload;switch(e.type){case $a:case ui:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case ci:return AS(t.clientOffset,n.clientOffset)?t:Sl(Sl({},t),{},{clientOffset:n.clientOffset});case fi:case di:return El;default:return t}}var Ta="dnd-core/ADD_SOURCE",Da="dnd-core/ADD_TARGET",Pa="dnd-core/REMOVE_SOURCE",hi="dnd-core/REMOVE_TARGET";function jS(t){return{type:Ta,payload:{sourceId:t}}}function zS(t){return{type:Da,payload:{targetId:t}}}function HS(t){return{type:Pa,payload:{sourceId:t}}}function BS(t){return{type:hi,payload:{targetId:t}}}function wl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Le(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?wl(Object(n),!0).forEach(function(r){WS(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):wl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function WS(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var US={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function VS(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:US,e=arguments.length>1?arguments[1]:void 0,n=e.payload;switch(e.type){case ui:return Le(Le({},t),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Ca:return Le(Le({},t),{},{isSourcePublic:!0});case ci:return Le(Le({},t),{},{targetIds:n.targetIds});case hi:return t.targetIds.indexOf(n.targetId)===-1?t:Le(Le({},t),{},{targetIds:nS(t.targetIds,n.targetId)});case di:return Le(Le({},t),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case fi:return Le(Le({},t),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function GS(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case Ta:case Da:return t+1;case Pa:case hi:return t-1;default:return t}}var Vr=[],Oa=[];Vr.__IS_NONE__=!0;Oa.__IS_ALL__=!0;function qS(t,e){if(t===Vr)return!1;if(t===Oa||typeof e>"u")return!0;var n=iS(e,t);return n.length>0}function YS(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case ci:break;case Ta:case Da:case hi:case Pa:return Vr;case ui:case Ca:case fi:case di:default:return Oa}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,o=i===void 0?[]:i,a=rS(r,o),s=a.length>0||!LS(r,o);if(!s)return Vr;var l=o[o.length-1],u=r[r.length-1];return l!==u&&(l&&a.push(l),u&&a.push(u)),a}function XS(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t+1}function xl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function $l(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?xl(Object(n),!0).forEach(function(r){JS(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):xl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function JS(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function QS(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:YS(t.dirtyHandlerIds,{type:e.type,payload:$l($l({},e.payload),{},{prevTargetIds:tS(t,"dragOperation.targetIds",[])})}),dragOffset:FS(t.dragOffset,e),refCount:GS(t.refCount,e),dragOperation:VS(t.dragOperation,e),stateId:XS(t.stateId)}}function ZS(t,e){return{x:t.x+e.x,y:t.y+e.y}}function rf(t,e){return{x:t.x-e.x,y:t.y-e.y}}function eE(t){var e=t.clientOffset,n=t.initialClientOffset,r=t.initialSourceClientOffset;return!e||!n||!r?null:rf(ZS(e,r),n)}function tE(t){var e=t.clientOffset,n=t.initialClientOffset;return!e||!n?null:rf(e,n)}function nE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function rE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function iE(t,e,n){return rE(t.prototype,e),t}function Cl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var oE=function(){function t(e,n){nE(this,t),Cl(this,"store",void 0),Cl(this,"registry",void 0),this.store=e,this.registry=n}return iE(t,[{key:"subscribeToStateChange",value:function(n){var r=this,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{handlerIds:void 0},o=i.handlerIds;J(typeof n=="function","listener must be a function."),J(typeof o>"u"||Array.isArray(o),"handlerIds, when specified, must be an array of strings.");var a=this.store.getState().stateId,s=function(){var u=r.store.getState(),c=u.stateId;try{var d=c===a||c===a+1&&!qS(u.dirtyHandlerIds,o);d||n()}finally{a=c}};return this.store.subscribe(s)}},{key:"subscribeToOffsetChange",value:function(n){var r=this;J(typeof n=="function","listener must be a function.");var i=this.store.getState().dragOffset,o=function(){var s=r.store.getState().dragOffset;s!==i&&(i=s,n())};return this.store.subscribe(o)}},{key:"canDragSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n);return J(r,"Expected to find a valid source. sourceId=".concat(n)),this.isDragging()?!1:r.canDrag(this,n)}},{key:"canDropOnTarget",value:function(n){if(!n)return!1;var r=this.registry.getTarget(n);if(J(r,"Expected to find a valid target. targetId=".concat(n)),!this.isDragging()||this.didDrop())return!1;var i=this.registry.getTargetType(n),o=this.getItemType();return Fo(i,o)&&r.canDrop(this,n)}},{key:"isDragging",value:function(){return!!this.getItemType()}},{key:"isDraggingSource",value:function(n){if(!n)return!1;var r=this.registry.getSource(n,!0);if(J(r,"Expected to find a valid source. sourceId=".concat(n)),!this.isDragging()||!this.isSourcePublic())return!1;var i=this.registry.getSourceType(n),o=this.getItemType();return i!==o?!1:r.isDragging(this,n)}},{key:"isOverTarget",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{shallow:!1};if(!n)return!1;var i=r.shallow;if(!this.isDragging())return!1;var o=this.registry.getTargetType(n),a=this.getItemType();if(a&&!Fo(o,a))return!1;var s=this.getTargetIds();if(!s.length)return!1;var l=s.indexOf(n);return i?l===s.length-1:l>-1}},{key:"getItemType",value:function(){return this.store.getState().dragOperation.itemType}},{key:"getItem",value:function(){return this.store.getState().dragOperation.item}},{key:"getSourceId",value:function(){return this.store.getState().dragOperation.sourceId}},{key:"getTargetIds",value:function(){return this.store.getState().dragOperation.targetIds}},{key:"getDropResult",value:function(){return this.store.getState().dragOperation.dropResult}},{key:"didDrop",value:function(){return this.store.getState().dragOperation.didDrop}},{key:"isSourcePublic",value:function(){return!!this.store.getState().dragOperation.isSourcePublic}},{key:"getInitialClientOffset",value:function(){return this.store.getState().dragOffset.initialClientOffset}},{key:"getInitialSourceClientOffset",value:function(){return this.store.getState().dragOffset.initialSourceClientOffset}},{key:"getClientOffset",value:function(){return this.store.getState().dragOffset.clientOffset}},{key:"getSourceClientOffset",value:function(){return eE(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return tE(this.store.getState().dragOffset)}}]),t}(),aE=0;function sE(){return aE++}function Cr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Cr=function(n){return typeof n}:Cr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Cr(t)}function lE(t){J(typeof t.canDrag=="function","Expected canDrag to be a function."),J(typeof t.beginDrag=="function","Expected beginDrag to be a function."),J(typeof t.endDrag=="function","Expected endDrag to be a function.")}function uE(t){J(typeof t.canDrop=="function","Expected canDrop to be a function."),J(typeof t.hover=="function","Expected hover to be a function."),J(typeof t.drop=="function","Expected beginDrag to be a function.")}function jo(t,e){if(e&&Array.isArray(t)){t.forEach(function(n){return jo(n,!1)});return}J(typeof t=="string"||Cr(t)==="symbol",e?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}const Tl=typeof global<"u"?global:self,of=Tl.MutationObserver||Tl.WebKitMutationObserver;function af(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function cE(t){let e=1;const n=new of(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const dE=typeof of=="function"?cE:af;class fE{enqueueTask(e){const{queue:n,requestFlush:r}=this;n.length||(r(),this.flushing=!0),n[n.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const n=this.index;if(this.index++,e[n].call(),this.index>this.capacity){for(let r=0,i=e.length-this.index;r<i;r++)e[r]=e[r+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=dE(this.flush),this.requestErrorThrow=af(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class hE{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,n){this.onError=e,this.release=n,this.task=null}}class pE{create(e){const n=this.freeTasks,r=n.length?n.pop():new hE(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const sf=new fE,gE=new pE(sf.registerPendingError);function vE(t){sf.enqueueTask(gE.create(t))}function mE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function yE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function bE(t,e,n){return yE(t.prototype,e),t}function Jt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function SE(t,e){return $E(t)||xE(t,e)||wE(t,e)||EE()}function EE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
91
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wE(t,e){if(t){if(typeof t=="string")return Dl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Dl(t,e)}}function Dl(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function xE(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function $E(t){if(Array.isArray(t))return t}function CE(t){var e=sE().toString();switch(t){case Fe.SOURCE:return"S".concat(e);case Fe.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function Pl(t){switch(t[0]){case"S":return Fe.SOURCE;case"T":return Fe.TARGET;default:J(!1,"Cannot parse handler ID: ".concat(t))}}function Ol(t,e){var n=t.entries(),r=!1;do{var i=n.next(),o=i.done,a=SE(i.value,2),s=a[1];if(s===e)return!0;r=!!o}while(!r);return!1}var TE=function(){function t(e){mE(this,t),Jt(this,"types",new Map),Jt(this,"dragSources",new Map),Jt(this,"dropTargets",new Map),Jt(this,"pinnedSourceId",null),Jt(this,"pinnedSource",null),Jt(this,"store",void 0),this.store=e}return bE(t,[{key:"addSource",value:function(n,r){jo(n),lE(r);var i=this.addHandler(Fe.SOURCE,n,r);return this.store.dispatch(jS(i)),i}},{key:"addTarget",value:function(n,r){jo(n,!0),uE(r);var i=this.addHandler(Fe.TARGET,n,r);return this.store.dispatch(zS(i)),i}},{key:"containsHandler",value:function(n){return Ol(this.dragSources,n)||Ol(this.dropTargets,n)}},{key:"getSource",value:function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;J(this.isSourceId(n),"Expected a valid source ID.");var i=r&&n===this.pinnedSourceId,o=i?this.pinnedSource:this.dragSources.get(n);return o}},{key:"getTarget",value:function(n){return J(this.isTargetId(n),"Expected a valid target ID."),this.dropTargets.get(n)}},{key:"getSourceType",value:function(n){return J(this.isSourceId(n),"Expected a valid source ID."),this.types.get(n)}},{key:"getTargetType",value:function(n){return J(this.isTargetId(n),"Expected a valid target ID."),this.types.get(n)}},{key:"isSourceId",value:function(n){var r=Pl(n);return r===Fe.SOURCE}},{key:"isTargetId",value:function(n){var r=Pl(n);return r===Fe.TARGET}},{key:"removeSource",value:function(n){var r=this;J(this.getSource(n),"Expected an existing source."),this.store.dispatch(HS(n)),vE(function(){r.dragSources.delete(n),r.types.delete(n)})}},{key:"removeTarget",value:function(n){J(this.getTarget(n),"Expected an existing target."),this.store.dispatch(BS(n)),this.dropTargets.delete(n),this.types.delete(n)}},{key:"pinSource",value:function(n){var r=this.getSource(n);J(r,"Expected an existing source."),this.pinnedSourceId=n,this.pinnedSource=r}},{key:"unpinSource",value:function(){J(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}},{key:"addHandler",value:function(n,r,i){var o=CE(n);return this.types.set(o,r),n===Fe.SOURCE?this.dragSources.set(o,i):n===Fe.TARGET&&this.dropTargets.set(o,i),o}}]),t}();function DE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:void 0,n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},r=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1,i=PE(r),o=new oE(i,new TE(i)),a=new OS(i,o),s=t(a,e,n);return a.receiveBackend(s),a}function PE(t){var e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return nf(QS,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}var OE=["children"];function IE(t,e){return RE(t)||NE(t,e)||kE(t,e)||_E()}function _E(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
92
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function kE(t,e){if(t){if(typeof t=="string")return Il(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Il(t,e)}}function Il(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function NE(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function RE(t){if(Array.isArray(t))return t}function ME(t,e){if(t==null)return{};var n=AE(t,e),r,i;if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(t);for(i=0;i<o.length;i++)r=o[i],!(e.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(t,r)&&(n[r]=t[r])}return n}function AE(t,e){if(t==null)return{};var n={},r=Object.keys(t),i,o;for(o=0;o<r.length;o++)i=r[o],!(e.indexOf(i)>=0)&&(n[i]=t[i]);return n}var _l=0,Tr=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),LE=f.memo(function(e){var n=e.children,r=ME(e,OE),i=KE(r),o=IE(i,2),a=o[0],s=o[1];return f.useEffect(function(){if(s){var l=lf();return++_l,function(){--_l===0&&(l[Tr]=null)}}},[]),C.jsx(ef.Provider,Object.assign({value:a},{children:n}),void 0)});function KE(t){if("manager"in t){var e={dragDropManager:t.manager};return[e,!1]}var n=FE(t.backend,t.context,t.options,t.debugMode),r=!t.context;return[n,r]}function FE(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:lf(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=e;return i[Tr]||(i[Tr]={dragDropManager:DE(t,e,n,r)}),i[Tr]}function lf(){return typeof global<"u"?global:window}function jE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function zE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function HE(t,e,n){return zE(t.prototype,e),t}function kl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Qi=!1,Zi=!1,BE=function(){function t(e){jE(this,t),kl(this,"internalMonitor",void 0),kl(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return HE(t,[{key:"receiveHandlerId",value:function(n){this.sourceId=n}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){J(!Qi,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Qi=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{Qi=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;J(!Zi,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return Zi=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{Zi=!1}}},{key:"subscribeToStateChange",value:function(n,r){return this.internalMonitor.subscribeToStateChange(n,r)}},{key:"isDraggingSource",value:function(n){return this.internalMonitor.isDraggingSource(n)}},{key:"isOverTarget",value:function(n,r){return this.internalMonitor.isOverTarget(n,r)}},{key:"getTargetIds",value:function(){return this.internalMonitor.getTargetIds()}},{key:"isSourcePublic",value:function(){return this.internalMonitor.isSourcePublic()}},{key:"getSourceId",value:function(){return this.internalMonitor.getSourceId()}},{key:"subscribeToOffsetChange",value:function(n){return this.internalMonitor.subscribeToOffsetChange(n)}},{key:"canDragSource",value:function(n){return this.internalMonitor.canDragSource(n)}},{key:"canDropOnTarget",value:function(n){return this.internalMonitor.canDropOnTarget(n)}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t}();function WE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function UE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function VE(t,e,n){return UE(t.prototype,e),t}function Nl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var eo=!1,GE=function(){function t(e){WE(this,t),Nl(this,"internalMonitor",void 0),Nl(this,"targetId",null),this.internalMonitor=e.getMonitor()}return VE(t,[{key:"receiveHandlerId",value:function(n){this.targetId=n}},{key:"getHandlerId",value:function(){return this.targetId}},{key:"subscribeToStateChange",value:function(n,r){return this.internalMonitor.subscribeToStateChange(n,r)}},{key:"canDrop",value:function(){if(!this.targetId)return!1;J(!eo,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return eo=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{eo=!1}}},{key:"isOver",value:function(n){return this.targetId?this.internalMonitor.isOverTarget(this.targetId,n):!1}},{key:"getItemType",value:function(){return this.internalMonitor.getItemType()}},{key:"getItem",value:function(){return this.internalMonitor.getItem()}},{key:"getDropResult",value:function(){return this.internalMonitor.getDropResult()}},{key:"didDrop",value:function(){return this.internalMonitor.didDrop()}},{key:"getInitialClientOffset",value:function(){return this.internalMonitor.getInitialClientOffset()}},{key:"getInitialSourceClientOffset",value:function(){return this.internalMonitor.getInitialSourceClientOffset()}},{key:"getSourceClientOffset",value:function(){return this.internalMonitor.getSourceClientOffset()}},{key:"getClientOffset",value:function(){return this.internalMonitor.getClientOffset()}},{key:"getDifferenceFromInitialOffset",value:function(){return this.internalMonitor.getDifferenceFromInitialOffset()}}]),t}();function qE(t){if(typeof t.type!="string"){var e=t.type.displayName||t.type.name||"the component";throw new Error("Only native element nodes can now be passed to React DnD connectors."+"You can either wrap ".concat(e," into a <div>, or turn it into a ")+"drag source or a drop target itself.")}}function YE(t){return function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:null,n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(!f.isValidElement(e)){var r=e;return t(r,n),r}var i=e;qE(i);var o=n?function(a){return t(a,n)}:t;return XE(i,o)}}function uf(t){var e={};return Object.keys(t).forEach(function(n){var r=t[n];if(n.endsWith("Ref"))e[n]=t[n];else{var i=YE(r);e[n]=function(){return i}}}),e}function Rl(t,e){typeof t=="function"?t(e):t.current=e}function XE(t,e){var n=t.ref;return J(typeof n!="string","Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?f.cloneElement(t,{ref:function(i){Rl(n,i),Rl(e,i)}}):f.cloneElement(t,{ref:e})}function Dr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Dr=function(n){return typeof n}:Dr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Dr(t)}function zo(t){return t!==null&&Dr(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function Ho(t,e,n,r){var i=void 0;if(i!==void 0)return!!i;if(t===e)return!0;if(typeof t!="object"||!t||typeof e!="object"||!e)return!1;var o=Object.keys(t),a=Object.keys(e);if(o.length!==a.length)return!1;for(var s=Object.prototype.hasOwnProperty.bind(e),l=0;l<o.length;l++){var u=o[l];if(!s(u))return!1;var c=t[u],d=e[u];if(i=void 0,i===!1||i===void 0&&c!==d)return!1}return!0}function JE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function QE(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function ZE(t,e,n){return QE(t.prototype,e),t}function xe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ew=function(){function t(e){var n=this;JE(this,t),xe(this,"hooks",uf({dragSource:function(i,o){n.clearDragSource(),n.dragSourceOptions=o||null,zo(i)?n.dragSourceRef=i:n.dragSourceNode=i,n.reconnectDragSource()},dragPreview:function(i,o){n.clearDragPreview(),n.dragPreviewOptions=o||null,zo(i)?n.dragPreviewRef=i:n.dragPreviewNode=i,n.reconnectDragPreview()}})),xe(this,"handlerId",null),xe(this,"dragSourceRef",null),xe(this,"dragSourceNode",void 0),xe(this,"dragSourceOptionsInternal",null),xe(this,"dragSourceUnsubscribe",void 0),xe(this,"dragPreviewRef",null),xe(this,"dragPreviewNode",void 0),xe(this,"dragPreviewOptionsInternal",null),xe(this,"dragPreviewUnsubscribe",void 0),xe(this,"lastConnectedHandlerId",null),xe(this,"lastConnectedDragSource",null),xe(this,"lastConnectedDragSourceOptions",null),xe(this,"lastConnectedDragPreview",null),xe(this,"lastConnectedDragPreviewOptions",null),xe(this,"backend",void 0),this.backend=e}return ZE(t,[{key:"receiveHandlerId",value:function(n){this.handlerId!==n&&(this.handlerId=n,this.reconnect())}},{key:"connectTarget",get:function(){return this.dragSource}},{key:"dragSourceOptions",get:function(){return this.dragSourceOptionsInternal},set:function(n){this.dragSourceOptionsInternal=n}},{key:"dragPreviewOptions",get:function(){return this.dragPreviewOptionsInternal},set:function(n){this.dragPreviewOptionsInternal=n}},{key:"reconnect",value:function(){this.reconnectDragSource(),this.reconnectDragPreview()}},{key:"reconnectDragSource",value:function(){var n=this.dragSource,r=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();if(r&&this.disconnectDragSource(),!!this.handlerId){if(!n){this.lastConnectedDragSource=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=n,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,n,this.dragSourceOptions))}}},{key:"reconnectDragPreview",value:function(){var n=this.dragPreview,r=this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();if(r&&this.disconnectDragPreview(),!!this.handlerId){if(!n){this.lastConnectedDragPreview=n;return}r&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=n,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,n,this.dragPreviewOptions))}}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didConnectedDragSourceChange",value:function(){return this.lastConnectedDragSource!==this.dragSource}},{key:"didConnectedDragPreviewChange",value:function(){return this.lastConnectedDragPreview!==this.dragPreview}},{key:"didDragSourceOptionsChange",value:function(){return!Ho(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!Ho(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}},{key:"disconnectDragSource",value:function(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}},{key:"disconnectDragPreview",value:function(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}},{key:"dragSource",get:function(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}},{key:"dragPreview",get:function(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}},{key:"clearDragSource",value:function(){this.dragSourceNode=null,this.dragSourceRef=null}},{key:"clearDragPreview",value:function(){this.dragPreviewNode=null,this.dragPreviewRef=null}}]),t}();function tw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function nw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function rw(t,e,n){return nw(t.prototype,e),t}function qe(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var iw=function(){function t(e){var n=this;tw(this,t),qe(this,"hooks",uf({dropTarget:function(i,o){n.clearDropTarget(),n.dropTargetOptions=o,zo(i)?n.dropTargetRef=i:n.dropTargetNode=i,n.reconnect()}})),qe(this,"handlerId",null),qe(this,"dropTargetRef",null),qe(this,"dropTargetNode",void 0),qe(this,"dropTargetOptionsInternal",null),qe(this,"unsubscribeDropTarget",void 0),qe(this,"lastConnectedHandlerId",null),qe(this,"lastConnectedDropTarget",null),qe(this,"lastConnectedDropTargetOptions",null),qe(this,"backend",void 0),this.backend=e}return rw(t,[{key:"connectTarget",get:function(){return this.dropTarget}},{key:"reconnect",value:function(){var n=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();n&&this.disconnectDropTarget();var r=this.dropTarget;if(this.handlerId){if(!r){this.lastConnectedDropTarget=r;return}n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=r,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,r,this.dropTargetOptions))}}},{key:"receiveHandlerId",value:function(n){n!==this.handlerId&&(this.handlerId=n,this.reconnect())}},{key:"dropTargetOptions",get:function(){return this.dropTargetOptionsInternal},set:function(n){this.dropTargetOptionsInternal=n}},{key:"didHandlerIdChange",value:function(){return this.lastConnectedHandlerId!==this.handlerId}},{key:"didDropTargetChange",value:function(){return this.lastConnectedDropTarget!==this.dropTarget}},{key:"didOptionsChange",value:function(){return!Ho(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}},{key:"disconnectDropTarget",value:function(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}},{key:"dropTarget",get:function(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}},{key:"clearDropTarget",value:function(){this.dropTargetRef=null,this.dropTargetNode=null}}]),t}();function ow(t,e,n){var r=n.getRegistry(),i=r.addTarget(t,e);return[i,function(){return r.removeTarget(i)}]}function aw(t,e,n){var r=n.getRegistry(),i=r.addSource(t,e);return[i,function(){return r.removeSource(i)}]}var Rt=typeof window<"u"?f.useLayoutEffect:f.useEffect;function Pr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Pr=function(n){return typeof n}:Pr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Pr(t)}function sw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function lw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function uw(t,e,n){return lw(t.prototype,e),t}function to(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var cw=function(){function t(e,n,r){sw(this,t),to(this,"spec",void 0),to(this,"monitor",void 0),to(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return uw(t,[{key:"beginDrag",value:function(){var n,r=this.spec,i=this.monitor,o=null;return Pr(r.item)==="object"?o=r.item:typeof r.item=="function"?o=r.item(i):o={},(n=o)!==null&&n!==void 0?n:null}},{key:"canDrag",value:function(){var n=this.spec,r=this.monitor;return typeof n.canDrag=="boolean"?n.canDrag:typeof n.canDrag=="function"?n.canDrag(r):!0}},{key:"isDragging",value:function(n,r){var i=this.spec,o=this.monitor,a=i.isDragging;return a?a(o):r===n.getSourceId()}},{key:"endDrag",value:function(){var n=this.spec,r=this.monitor,i=this.connector,o=n.end;o&&o(r.getItem(),r),i.reconnect()}}]),t}();function dw(t,e,n){var r=f.useMemo(function(){return new cw(t,e,n)},[e,n]);return f.useEffect(function(){r.spec=t},[t]),r}function Kt(){var t=f.useContext(ef),e=t.dragDropManager;return J(e!=null,"Expected drag drop context"),e}function fw(t){return f.useMemo(function(){var e=t.type;return J(e!=null,"spec.type must be defined"),e},[t])}function hw(t,e){return mw(t)||vw(t,e)||gw(t,e)||pw()}function pw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
93
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function gw(t,e){if(t){if(typeof t=="string")return Ml(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ml(t,e)}}function Ml(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function vw(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function mw(t){if(Array.isArray(t))return t}function yw(t,e,n){var r=Kt(),i=dw(t,e,n),o=fw(t);Rt(function(){if(o!=null){var s=aw(o,i,r),l=hw(s,2),u=l[0],c=l[1];return e.receiveHandlerId(u),n.receiveHandlerId(u),c}},[r,e,n,i,o])}function bw(t){return xw(t)||ww(t)||Ew(t)||Sw()}function Sw(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
94
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Ew(t,e){if(t){if(typeof t=="string")return Bo(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Bo(t,e)}}function ww(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function xw(t){if(Array.isArray(t))return Bo(t)}function Bo(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function cf(t,e){var n=bw(e||[]);return e==null&&typeof t!="function"&&n.push(t),f.useMemo(function(){return typeof t=="function"?t():t},n)}function $w(){var t=Kt();return f.useMemo(function(){return new BE(t)},[t])}function Cw(t,e){var n=Kt(),r=f.useMemo(function(){return new ew(n.getBackend())},[n]);return Rt(function(){return r.dragSourceOptions=t||null,r.reconnect(),function(){return r.disconnectDragSource()}},[r,t]),Rt(function(){return r.dragPreviewOptions=e||null,r.reconnect(),function(){return r.disconnectDragPreview()}},[r,e]),r}var no,Al;function Tw(){return Al||(Al=1,no=function t(e,n){if(e===n)return!0;if(e&&n&&typeof e=="object"&&typeof n=="object"){if(e.constructor!==n.constructor)return!1;var r,i,o;if(Array.isArray(e)){if(r=e.length,r!=n.length)return!1;for(i=r;i--!==0;)if(!t(e[i],n[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===n.source&&e.flags===n.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===n.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===n.toString();if(o=Object.keys(e),r=o.length,r!==Object.keys(n).length)return!1;for(i=r;i--!==0;)if(!Object.prototype.hasOwnProperty.call(n,o[i]))return!1;for(i=r;i--!==0;){var a=o[i];if(!t(e[a],n[a]))return!1}return!0}return e!==e&&n!==n}),no}var Dw=Tw();const Pw=qf(Dw);function Ow(t,e){return Nw(t)||kw(t,e)||_w(t,e)||Iw()}function Iw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
95
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _w(t,e){if(t){if(typeof t=="string")return Ll(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Ll(t,e)}}function Ll(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function kw(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function Nw(t){if(Array.isArray(t))return t}function df(t,e,n){var r=f.useState(function(){return e(t)}),i=Ow(r,2),o=i[0],a=i[1],s=f.useCallback(function(){var l=e(t);Pw(o,l)||(a(l),n&&n())},[o,t,n]);return Rt(s),[o,s]}function Rw(t,e){return Kw(t)||Lw(t,e)||Aw(t,e)||Mw()}function Mw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
96
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Aw(t,e){if(t){if(typeof t=="string")return Kl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return Kl(t,e)}}function Kl(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Lw(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function Kw(t){if(Array.isArray(t))return t}function Fw(t,e,n){var r=df(t,e,n),i=Rw(r,2),o=i[0],a=i[1];return Rt(function(){var l=t.getHandlerId();if(l!=null)return t.subscribeToStateChange(a,{handlerIds:[l]})},[t,a]),o}function ff(t,e,n){return Fw(e,t||function(){return{}},function(){return n.reconnect()})}function jw(t){return f.useMemo(function(){return t.hooks.dragSource()},[t])}function zw(t){return f.useMemo(function(){return t.hooks.dragPreview()},[t])}function Hw(t,e){var n=cf(t,e);J(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");var r=$w(),i=Cw(n.options,n.previewOptions);return yw(n,r,i),[ff(n.collect,r,i),jw(i),zw(i)]}function Bw(t){var e=t.accept;return f.useMemo(function(){return J(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]},[e])}function Ww(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Uw(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function Vw(t,e,n){return Uw(t.prototype,e),t}function Fl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Gw=function(){function t(e,n){Ww(this,t),Fl(this,"spec",void 0),Fl(this,"monitor",void 0),this.spec=e,this.monitor=n}return Vw(t,[{key:"canDrop",value:function(){var n=this.spec,r=this.monitor;return n.canDrop?n.canDrop(r.getItem(),r):!0}},{key:"hover",value:function(){var n=this.spec,r=this.monitor;n.hover&&n.hover(r.getItem(),r)}},{key:"drop",value:function(){var n=this.spec,r=this.monitor;if(n.drop)return n.drop(r.getItem(),r)}}]),t}();function qw(t,e){var n=f.useMemo(function(){return new Gw(t,e)},[e]);return f.useEffect(function(){n.spec=t},[t]),n}function Yw(t,e){return Zw(t)||Qw(t,e)||Jw(t,e)||Xw()}function Xw(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
97
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Jw(t,e){if(t){if(typeof t=="string")return jl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return jl(t,e)}}function jl(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function Qw(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function Zw(t){if(Array.isArray(t))return t}function e0(t,e,n){var r=Kt(),i=qw(t,e),o=Bw(t);Rt(function(){var s=ow(o,i,r),l=Yw(s,2),u=l[0],c=l[1];return e.receiveHandlerId(u),n.receiveHandlerId(u),c},[r,e,i,n,o.map(function(a){return a.toString()}).join("|")])}function t0(){var t=Kt();return f.useMemo(function(){return new GE(t)},[t])}function n0(t){var e=Kt(),n=f.useMemo(function(){return new iw(e.getBackend())},[e]);return Rt(function(){return n.dropTargetOptions=t||null,n.reconnect(),function(){return n.disconnectDropTarget()}},[t]),n}function r0(t){return f.useMemo(function(){return t.hooks.dropTarget()},[t])}function hf(t,e){var n=cf(t,e),r=t0(),i=n0(n.options);return e0(n,r,i),[ff(n.collect,r,i),r0(i)]}function i0(t,e){return l0(t)||s0(t,e)||a0(t,e)||o0()}function o0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
98
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function a0(t,e){if(t){if(typeof t=="string")return zl(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);if(n==="Object"&&t.constructor&&(n=t.constructor.name),n==="Map"||n==="Set")return Array.from(t);if(n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return zl(t,e)}}function zl(t,e){(e==null||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function s0(t,e){var n=t==null?null:typeof Symbol<"u"&&t[Symbol.iterator]||t["@@iterator"];if(n!=null){var r=[],i=!0,o=!1,a,s;try{for(n=n.call(t);!(i=(a=n.next()).done)&&(r.push(a.value),!(e&&r.length===e));i=!0);}catch(l){o=!0,s=l}finally{try{!i&&n.return!=null&&n.return()}finally{if(o)throw s}}return r}}function l0(t){if(Array.isArray(t))return t}function u0(t){var e=Kt(),n=e.getMonitor(),r=df(n,t),i=i0(r,2),o=i[0],a=i[1];return f.useEffect(function(){return n.subscribeToOffsetChange(a)}),f.useEffect(function(){return n.subscribeToStateChange(a)}),o}function pf(t){var e=null,n=function(){return e==null&&(e=t()),e};return n}function c0(t,e){return t.filter(function(n){return n!==e})}function d0(t,e){var n=new Set,r=function(a){return n.add(a)};t.forEach(r),e.forEach(r);var i=[];return n.forEach(function(o){return i.push(o)}),i}function f0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function h0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function p0(t,e,n){return h0(t.prototype,e),t}function Hl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var g0=function(){function t(e){f0(this,t),Hl(this,"entered",[]),Hl(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return p0(t,[{key:"enter",value:function(n){var r=this,i=this.entered.length,o=function(s){return r.isNodeInDocument(s)&&(!s.contains||s.contains(n))};return this.entered=d0(this.entered.filter(o),[n]),i===0&&this.entered.length>0}},{key:"leave",value:function(n){var r=this.entered.length;return this.entered=c0(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),v0=pf(function(){return/firefox/i.test(navigator.userAgent)}),gf=pf(function(){return!!window.safari});function m0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function y0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function b0(t,e,n){return y0(t.prototype,e),t}function Pn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Bl=function(){function t(e,n){m0(this,t),Pn(this,"xs",void 0),Pn(this,"ys",void 0),Pn(this,"c1s",void 0),Pn(this,"c2s",void 0),Pn(this,"c3s",void 0);for(var r=e.length,i=[],o=0;o<r;o++)i.push(o);i.sort(function(b,R){return e[b]<e[R]?-1:1});for(var a=[],s=[],l,u,c=0;c<r-1;c++)l=e[c+1]-e[c],u=n[c+1]-n[c],a.push(l),s.push(u/l);for(var d=[s[0]],h=0;h<a.length-1;h++){var g=s[h],m=s[h+1];if(g*m<=0)d.push(0);else{l=a[h];var p=a[h+1],v=l+p;d.push(3*v/((v+p)/g+(v+l)/m))}}d.push(s[s.length-1]);for(var y=[],w=[],$,P=0;P<d.length-1;P++){$=s[P];var D=d[P],O=1/a[P],I=D+d[P+1]-$-$;y.push(($-D-I)*O),w.push(I*O*O)}this.xs=e,this.ys=n,this.c1s=d,this.c2s=y,this.c3s=w}return b0(t,[{key:"interpolate",value:function(n){var r=this.xs,i=this.ys,o=this.c1s,a=this.c2s,s=this.c3s,l=r.length-1;if(n===r[l])return i[l];for(var u=0,c=s.length-1,d;u<=c;){d=Math.floor(.5*(u+c));var h=r[d];if(h<n)u=d+1;else if(h>n)c=d-1;else return i[d]}l=Math.max(0,c);var g=n-r[l],m=g*g;return i[l]+o[l]*g+a[l]*m+s[l]*g*m}}]),t}(),S0=1;function vf(t){var e=t.nodeType===S0?t:t.parentElement;if(!e)return null;var n=e.getBoundingClientRect(),r=n.top,i=n.left;return{x:i,y:r}}function hr(t){return{x:t.clientX,y:t.clientY}}function E0(t){var e;return t.nodeName==="IMG"&&(v0()||!((e=document.documentElement)!==null&&e!==void 0&&e.contains(t)))}function w0(t,e,n,r){var i=t?e.width:n,o=t?e.height:r;return gf()&&t&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function x0(t,e,n,r,i){var o=E0(e),a=o?t:e,s=vf(a),l={x:n.x-s.x,y:n.y-s.y},u=t.offsetWidth,c=t.offsetHeight,d=r.anchorX,h=r.anchorY,g=w0(o,e,u,c),m=g.dragPreviewWidth,p=g.dragPreviewHeight,v=function(){var I=new Bl([0,.5,1],[l.y,l.y/c*p,l.y+p-c]),b=I.interpolate(h);return gf()&&o&&(b+=(window.devicePixelRatio-1)*p),b},y=function(){var I=new Bl([0,.5,1],[l.x,l.x/u*m,l.x+m-u]);return I.interpolate(d)},w=i.offsetX,$=i.offsetY,P=w===0||w,D=$===0||$;return{x:P?w:y(),y:D?$:v()}}var mf="__NATIVE_FILE__",yf="__NATIVE_URL__",bf="__NATIVE_TEXT__",Sf="__NATIVE_HTML__";const Wl=Object.freeze(Object.defineProperty({__proto__:null,FILE:mf,HTML:Sf,TEXT:bf,URL:yf},Symbol.toStringTag,{value:"Module"}));function ro(t,e,n){var r=e.reduce(function(i,o){return i||t.getData(o)},"");return r??n}var Qt;function pr(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Wo=(Qt={},pr(Qt,mf,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),pr(Qt,Sf,{exposeProperties:{html:function(e,n){return ro(e,n,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),pr(Qt,yf,{exposeProperties:{urls:function(e,n){return ro(e,n,"").split(`
|
|
99
|
+
`)},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),pr(Qt,bf,{exposeProperties:{text:function(e,n){return ro(e,n,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),Qt);function $0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function C0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function T0(t,e,n){return C0(t.prototype,e),t}function Ul(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var D0=function(){function t(e){$0(this,t),Ul(this,"item",void 0),Ul(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return T0(t,[{key:"initializeExposedProperties",value:function(){var n=this;Object.keys(this.config.exposeProperties).forEach(function(r){Object.defineProperty(n.item,r,{configurable:!0,enumerable:!0,get:function(){return console.warn(`Browser doesn't allow reading "`.concat(r,'" until the drop event.')),null}})})}},{key:"loadDataTransfer",value:function(n){var r=this;if(n){var i={};Object.keys(this.config.exposeProperties).forEach(function(o){i[o]={value:r.config.exposeProperties[o](n,r.config.matchesTypes),configurable:!0,enumerable:!0}}),Object.defineProperties(this.item,i)}}},{key:"canDrag",value:function(){return!0}},{key:"beginDrag",value:function(){return this.item}},{key:"isDragging",value:function(n,r){return r===n.getSourceId()}},{key:"endDrag",value:function(){}}]),t}();function P0(t,e){var n=new D0(Wo[t]);return n.loadDataTransfer(e),n}function io(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(Wo).filter(function(n){var r=Wo[n].matchesTypes;return r.some(function(i){return e.indexOf(i)>-1})})[0]||null}function O0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function I0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function _0(t,e,n){return I0(t.prototype,e),t}function oo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var k0=function(){function t(e,n){O0(this,t),oo(this,"ownerDocument",null),oo(this,"globalContext",void 0),oo(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return _0(t,[{key:"window",get:function(){if(this.globalContext)return this.globalContext;if(typeof window<"u")return window}},{key:"document",get:function(){var n;return(n=this.globalContext)!==null&&n!==void 0&&n.document?this.globalContext.document:this.window?this.window.document:void 0}},{key:"rootElement",get:function(){var n;return((n=this.optionsArgs)===null||n===void 0?void 0:n.rootElement)||this.window}}]),t}();function Vl(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(i){return Object.getOwnPropertyDescriptor(t,i).enumerable})),n.push.apply(n,r)}return n}function Gl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Vl(Object(n),!0).forEach(function(r){ee(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Vl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function N0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function R0(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function M0(t,e,n){return R0(t.prototype,e),t}function ee(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var A0=function(){function t(e,n,r){var i=this;N0(this,t),ee(this,"options",void 0),ee(this,"actions",void 0),ee(this,"monitor",void 0),ee(this,"registry",void 0),ee(this,"enterLeaveCounter",void 0),ee(this,"sourcePreviewNodes",new Map),ee(this,"sourcePreviewNodeOptions",new Map),ee(this,"sourceNodes",new Map),ee(this,"sourceNodeOptions",new Map),ee(this,"dragStartSourceIds",null),ee(this,"dropTargetIds",[]),ee(this,"dragEnterTargetIds",[]),ee(this,"currentNativeSource",null),ee(this,"currentNativeHandle",null),ee(this,"currentDragSourceNode",null),ee(this,"altKeyPressed",!1),ee(this,"mouseMoveTimeoutTimer",null),ee(this,"asyncEndDragFrameId",null),ee(this,"dragOverTargetIds",null),ee(this,"lastClientOffset",null),ee(this,"hoverRafId",null),ee(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&vf(a)||null}),ee(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),ee(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),ee(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),ee(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),ee(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var s=hr(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:s});var l=o.dataTransfer,u=io(l);if(i.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){var c=i.monitor.getSourceId(),d=i.sourceNodes.get(c),h=i.sourcePreviewNodes.get(c)||d;if(h){var g=i.getCurrentSourcePreviewNodeOptions(),m=g.anchorX,p=g.anchorY,v=g.offsetX,y=g.offsetY,w={anchorX:m,anchorY:p},$={offsetX:v,offsetY:y},P=x0(d,h,s,w,$);l.setDragImage(h,P.x,P.y)}}try{l==null||l.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target);var D=i.getCurrentSourcePreviewNodeOptions(),O=D.captureDraggingState;O?i.actions.publishDragSource():setTimeout(function(){return i.actions.publishDragSource()},0)}else if(u)i.beginDragNativeItem(u);else{if(l&&!l.types&&(o.target&&!o.target.hasAttribute||!o.target.hasAttribute("draggable")))return;o.preventDefault()}}}),ee(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),ee(this,"handleTopDragEnterCapture",function(o){i.dragEnterTargetIds=[];var a=i.enterLeaveCounter.enter(o.target);if(!(!a||i.monitor.isDragging())){var s=o.dataTransfer,l=io(s);l&&i.beginDragNativeItem(l,s)}}),ee(this,"handleTopDragEnter",function(o){var a=i.dragEnterTargetIds;if(i.dragEnterTargetIds=[],!!i.monitor.isDragging()){i.altKeyPressed=o.altKey,a.length>0&&i.actions.hover(a,{clientOffset:hr(o)});var s=a.some(function(l){return i.monitor.canDropOnTarget(l)});s&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect()))}}),ee(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),ee(this,"handleTopDragOver",function(o){var a=i.dragOverTargetIds;if(i.dragOverTargetIds=[],!i.monitor.isDragging()){o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none");return}i.altKeyPressed=o.altKey,i.lastClientOffset=hr(o),i.hoverRafId===null&&typeof requestAnimationFrame<"u"&&(i.hoverRafId=requestAnimationFrame(function(){i.monitor.isDragging()&&i.actions.hover(a||[],{clientOffset:i.lastClientOffset}),i.hoverRafId=null}));var s=(a||[]).some(function(l){return i.monitor.canDropOnTarget(l)});s?(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect())):i.isDraggingNativeItem()?o.preventDefault():(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect="none"))}),ee(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault();var a=i.enterLeaveCounter.leave(o.target);a&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),ee(this,"handleTopDropCapture",function(o){if(i.dropTargetIds=[],i.isDraggingNativeItem()){var a;o.preventDefault(),(a=i.currentNativeSource)===null||a===void 0||a.loadDataTransfer(o.dataTransfer)}else io(o.dataTransfer)&&o.preventDefault();i.enterLeaveCounter.reset()}),ee(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:hr(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),ee(this,"handleSelectStart",function(o){var a=o.target;typeof a.dragDrop=="function"&&(a.tagName==="INPUT"||a.tagName==="SELECT"||a.tagName==="TEXTAREA"||a.isContentEditable||(o.preventDefault(),a.dragDrop()))}),this.options=new k0(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new g0(this.isNodeInDocument)}return M0(t,[{key:"profile",value:function(){var n,r;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:((n=this.dragStartSourceIds)===null||n===void 0?void 0:n.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:((r=this.dragOverTargetIds)===null||r===void 0?void 0:r.length)||0}}},{key:"window",get:function(){return this.options.window}},{key:"document",get:function(){return this.options.document}},{key:"rootElement",get:function(){return this.options.rootElement}},{key:"setup",value:function(){var n=this.rootElement;if(n!==void 0){if(n.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");n.__isReactDndBackendSetUp=!0,this.addEventListeners(n)}}},{key:"teardown",value:function(){var n=this.rootElement;if(n!==void 0&&(n.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId)){var r;(r=this.window)===null||r===void 0||r.cancelAnimationFrame(this.asyncEndDragFrameId)}}},{key:"connectDragPreview",value:function(n,r,i){var o=this;return this.sourcePreviewNodeOptions.set(n,i),this.sourcePreviewNodes.set(n,r),function(){o.sourcePreviewNodes.delete(n),o.sourcePreviewNodeOptions.delete(n)}}},{key:"connectDragSource",value:function(n,r,i){var o=this;this.sourceNodes.set(n,r),this.sourceNodeOptions.set(n,i);var a=function(u){return o.handleDragStart(u,n)},s=function(u){return o.handleSelectStart(u)};return r.setAttribute("draggable","true"),r.addEventListener("dragstart",a),r.addEventListener("selectstart",s),function(){o.sourceNodes.delete(n),o.sourceNodeOptions.delete(n),r.removeEventListener("dragstart",a),r.removeEventListener("selectstart",s),r.setAttribute("draggable","false")}}},{key:"connectDropTarget",value:function(n,r){var i=this,o=function(u){return i.handleDragEnter(u,n)},a=function(u){return i.handleDragOver(u,n)},s=function(u){return i.handleDrop(u,n)};return r.addEventListener("dragenter",o),r.addEventListener("dragover",a),r.addEventListener("drop",s),function(){r.removeEventListener("dragenter",o),r.removeEventListener("dragover",a),r.removeEventListener("drop",s)}}},{key:"addEventListeners",value:function(n){n.addEventListener&&(n.addEventListener("dragstart",this.handleTopDragStart),n.addEventListener("dragstart",this.handleTopDragStartCapture,!0),n.addEventListener("dragend",this.handleTopDragEndCapture,!0),n.addEventListener("dragenter",this.handleTopDragEnter),n.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.addEventListener("dragover",this.handleTopDragOver),n.addEventListener("dragover",this.handleTopDragOverCapture,!0),n.addEventListener("drop",this.handleTopDrop),n.addEventListener("drop",this.handleTopDropCapture,!0))}},{key:"removeEventListeners",value:function(n){n.removeEventListener&&(n.removeEventListener("dragstart",this.handleTopDragStart),n.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),n.removeEventListener("dragend",this.handleTopDragEndCapture,!0),n.removeEventListener("dragenter",this.handleTopDragEnter),n.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),n.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),n.removeEventListener("dragover",this.handleTopDragOver),n.removeEventListener("dragover",this.handleTopDragOverCapture,!0),n.removeEventListener("drop",this.handleTopDrop),n.removeEventListener("drop",this.handleTopDropCapture,!0))}},{key:"getCurrentSourceNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourceNodeOptions.get(n);return Gl({dropEffect:this.altKeyPressed?"copy":"move"},r||{})}},{key:"getCurrentDropEffect",value:function(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}},{key:"getCurrentSourcePreviewNodeOptions",value:function(){var n=this.monitor.getSourceId(),r=this.sourcePreviewNodeOptions.get(n);return Gl({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(Wl).some(function(r){return Wl[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=P0(n,r),this.currentNativeHandle=this.registry.addSource(n,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}},{key:"setCurrentDragSourceNode",value:function(n){var r=this;this.clearCurrentDragSourceNode(),this.currentDragSourceNode=n;var i=1e3;this.mouseMoveTimeoutTimer=setTimeout(function(){var o;return(o=r.rootElement)===null||o===void 0?void 0:o.addEventListener("mousemove",r.endDragIfSourceWasRemovedFromDOM,!0)},i)}},{key:"clearCurrentDragSourceNode",value:function(){if(this.currentDragSourceNode){if(this.currentDragSourceNode=null,this.rootElement){var n;(n=this.window)===null||n===void 0||n.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)}return this.mouseMoveTimeoutTimer=null,!0}return!1}},{key:"handleDragStart",value:function(n,r){n.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(r))}},{key:"handleDragEnter",value:function(n,r){this.dragEnterTargetIds.unshift(r)}},{key:"handleDragOver",value:function(n,r){this.dragOverTargetIds===null&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(r)}},{key:"handleDrop",value:function(n,r){this.dropTargetIds.unshift(r)}}]),t}(),gr;function L0(){return gr||(gr=new Image,gr.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),gr}var K0=function(e,n,r){return new A0(e,n,r)};function F0(t){const e=Ne(),n=e.selectedIds,[r,i,o]=Hw(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(mn.dragStart(t.id,a)),{id:t.id}},end:()=>{e.hideCursor();let{parentId:a,index:s,dragIds:l}=e.state.dnd;e.canDrop()&&(Yd(e.props.onMove,{dragIds:l,parentId:a===Wn?null:a,index:s===null?0:s,dragNodes:e.dragNodes,parentNode:e.get(a)}),e.open(a)),e.dispatch(mn.dragEnd())}}),[n,t]);return f.useEffect(()=>{o(L0())},[o]),i}function j0(t,e){const n=t.getBoundingClientRect(),r=e.x-Math.round(n.x),i=e.y-Math.round(n.y),o=n.height,a=i<o/2,s=!a,l=o/4,u=i>l&&i<o-l;return{x:r,inTopHalf:a,inBottomHalf:s,inMiddle:u,atTop:!u&&a,atBottom:!u&&s}}function z0(t,e,n,r){return t?t.isInternal?r.atTop?[e,t]:r.inMiddle?[t,t]:[t,n]:r.inTopHalf?[e,t]:[t,n]:[e,null]}function vr(t,e){return{parentId:t||null,index:e}}function Zt(t,e){return{type:"line",index:t,level:e}}function H0(t){return{type:"highlight",id:t}}function ao(t,e){var n;let r=t;for(;r.parent&&r.level>e;)r=r.parent;const i=((n=r.parent)===null||n===void 0?void 0:n.id)||null,o=Wd(r)+1;return{parentId:i,index:o}}function Ef(t){var e;const n=j0(t.element,t.offset),r=t.indent,i=Math.round(Math.max(0,n.x-r)/r),{node:o,nextNode:a,prevNode:s}=t,[l,u]=z0(o,s,a,n);if(o&&o.isInternal&&n.inMiddle)return{drop:vr(o.id,null),cursor:H0(o.id)};if(!l)return{drop:vr((e=u==null?void 0:u.parent)===null||e===void 0?void 0:e.id,0),cursor:Zt(0,0)};if(jd(l)){const c=Er(i,(u==null?void 0:u.level)||0,l.level);return{drop:ao(l,c),cursor:Zt(l.rowIndex+1,c)}}if(zd(l)){const c=Er(i,(u==null?void 0:u.level)||0,l.level);return{drop:ao(l,c),cursor:Zt(l.rowIndex+1,c)}}if(Hd(l)){const c=Er(i,0,l.level+1);return c>l.level?{drop:vr(l.id,0),cursor:Zt(l.rowIndex+1,c)}:{drop:ao(l,c),cursor:Zt(l.rowIndex+1,c)}}return{drop:vr(l==null?void 0:l.id,0),cursor:Zt(l.rowIndex+1,l.level+1)}}function B0(t,e){const n=Ne(),[r,i]=hf(()=>({accept:"NODE",canDrop:()=>n.canDrop(),hover:(o,a)=>{const s=a.getClientOffset();if(!t.current||!s)return;const{cursor:l,drop:u}=Ef({element:t.current,offset:s,indent:n.indent,node:e,prevNode:e.prev,nextNode:e.next});u&&n.dispatch(mn.hovering(u.parentId,u.index)),a.canDrop()?l&&n.showCursor(l):n.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null}}),[e,t.current,n.props]);return i}function W0(t){const e=Ne(),n=e.at(t);if(!n)throw new Error(`Could not find node for index: ${t}`);return f.useMemo(()=>{const r=n.clone();return e.visibleNodes[t]=r,r},[...Object.values(n.state),n])}const U0=f.memo(function({index:e,style:n}){Fd(),db();const r=Ne(),i=W0(e),o=f.useRef(null),a=F0(i),s=B0(o,i),l=f.useCallback(p=>{o.current=p,s(p)},[s]),u=r.indent*i.level,c=f.useMemo(()=>({paddingLeft:u}),[u]),d=f.useMemo(()=>{var p,v;return Object.assign(Object.assign({},n),{top:parseFloat(n.top)+((v=(p=r.props.padding)!==null&&p!==void 0?p:r.props.paddingTop)!==null&&v!==void 0?v:0)})},[n,r.props.padding,r.props.paddingTop]),h={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,style:d,tabIndex:-1,className:r.props.rowClassName};f.useEffect(()=>{var p;!i.isEditing&&i.isFocused&&((p=o.current)===null||p===void 0||p.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,o.current]);const g=r.renderNode,m=r.renderRow;return C.jsx(m,{node:i,innerRef:l,attrs:h,children:C.jsx(g,{node:i,tree:r,style:c,dragHandle:a})})});let so="",ql=null;function wf(){Fd();const t=Ne();return C.jsx("div",{role:"tree",style:{height:t.height,width:t.width,minHeight:0,minWidth:0},onContextMenu:t.props.onContextMenu,onClick:t.props.onClick,tabIndex:0,onFocus:e=>{e.currentTarget.contains(e.relatedTarget)||t.onFocus()},onBlur:e=>{e.currentTarget.contains(e.relatedTarget)||t.onBlur()},onKeyDown:e=>{var n;if(t.isEditing)return;if(e.key==="Backspace"){if(!t.props.onDelete)return;const i=Array.from(t.selectedIds);if(i.length>1){let o=t.mostRecentNode;for(;o&&o.isSelected;)o=o.nextSibling;o||(o=t.lastNode),t.focus(o,{scroll:!1}),t.delete(Array.from(i))}else{const o=t.focusedNode;if(o){const a=o.nextSibling,s=o.parent;t.focus(a||s,{scroll:!1}),t.delete(o)}}return}if(e.key==="Tab"&&!e.shiftKey){e.preventDefault(),Ud(e.currentTarget);return}if(e.key==="Tab"&&e.shiftKey){e.preventDefault(),Vd(e.currentTarget);return}if(e.key==="ArrowDown"){e.preventDefault();const i=t.nextNode;if(e.metaKey){t.select(t.focusedNode),t.activate(t.focusedNode);return}else if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.firstNode);return}}if(e.key==="ArrowUp"){e.preventDefault();const i=t.prevNode;if(!e.shiftKey||t.props.disableMultiSelection){t.focus(i);return}else{if(!i)return;const o=t.focusedNode;o?o.isSelected?t.selectContiguous(i):t.selectMulti(i):t.focus(t.lastNode);return}}if(e.key==="ArrowRight"){const i=t.focusedNode;if(!i)return;i.isInternal&&i.isOpen?t.focus(t.nextNode):i.isInternal&&t.open(i.id);return}if(e.key==="ArrowLeft"){const i=t.focusedNode;if(!i||i.isRoot)return;i.isInternal&&i.isOpen?t.close(i.id):!((n=i.parent)===null||n===void 0)&&n.isRoot||t.focus(i.parent);return}if(e.key==="a"&&e.metaKey&&!t.props.disableMultiSelection){e.preventDefault(),t.selectAll();return}if(e.key==="a"&&!e.metaKey&&t.props.onCreate){t.createLeaf();return}if(e.key==="A"&&!e.metaKey){if(!t.props.onCreate)return;t.createInternal();return}if(e.key==="Home"){e.preventDefault(),t.focus(t.firstNode);return}if(e.key==="End"){e.preventDefault(),t.focus(t.lastNode);return}if(e.key==="Enter"){const i=t.focusedNode;if(!i||!i.isEditable||!t.props.onRename)return;setTimeout(()=>{i&&t.edit(i)});return}if(e.key===" "){e.preventDefault();const i=t.focusedNode;if(!i)return;i.isLeaf?(i.select(),i.activate()):i.toggle();return}if(e.key==="*"){const i=t.focusedNode;if(!i)return;t.openSiblings(i);return}if(e.key==="PageUp"){e.preventDefault(),t.pageUp();return}e.key==="PageDown"&&(e.preventDefault(),t.pageDown()),clearTimeout(ql),so+=e.key,ql=setTimeout(()=>{so=""},600);const r=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"?o.toLowerCase().startsWith(so):!1});r&&t.focus(r.id)},children:C.jsx(qb,{className:t.props.className,outerRef:t.listEl,itemCount:t.visibleNodes.length,height:t.height,width:t.width,itemSize:t.rowHeight,overscanCount:t.overscanCount,itemKey:e=>{var n;return((n=t.visibleNodes[e])===null||n===void 0?void 0:n.id)||e},outerElementType:Jb,innerElementType:eS,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:U0})})}function Yl(t){return t.isFiltered?G0(t.root,t.isMatch.bind(t)):V0(t.root)}function V0(t){const e=[];function n(r){var i;r.level>=0&&e.push(r),r.isOpen&&((i=r.children)===null||i===void 0||i.forEach(n))}return n(t),e.forEach(xf),e}function G0(t,e){const n={},r=[];function i(a){if(!a.isRoot&&e(a)){n[a.id]=!0;let l=a.parent;for(;l;)n[l.id]=!0,l=l.parent}if(a.children)for(let l of a.children)i(l)}function o(a){var s;a.level>=0&&n[a.id]&&r.push(a),a.isOpen&&((s=a.children)===null||s===void 0||s.forEach(o))}return i(t),o(t),r.forEach(xf),r}function xf(t,e){t.rowIndex=e}const Xl=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var lo=function(t,e,n,r){function i(o){return o instanceof n?o:new n(function(a){a(o)})}return new(n||(n=Promise))(function(o,a){function s(c){try{u(r.next(c))}catch(d){a(d)}}function l(c){try{u(r.throw(c))}catch(d){a(d)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(t,e||[])).next())})};const{safeRun:Se,identify:et,identifyNull:He}=mb;class Mn{constructor(e,n,r,i){this.store=e,this.props=n,this.list=r,this.listEl=i,this.visibleStartIndex=0,this.visibleStopIndex=0,this.root=al(this),this.visibleNodes=Yl(this),this.idToIndex=Xl(this.visibleNodes)}update(e){this.props=e,this.root=al(this),this.visibleNodes=Yl(this),this.idToIndex=Xl(this.visibleNodes)}dispatch(e){return this.store.dispatch(e)}get state(){return this.store.getState()}get openState(){return this.state.nodes.open.unfiltered}get width(){var e;return(e=this.props.width)!==null&&e!==void 0?e:300}get height(){var e;return(e=this.props.height)!==null&&e!==void 0?e:500}get indent(){var e;return(e=this.props.indent)!==null&&e!==void 0?e:24}get rowHeight(){var e;return(e=this.props.rowHeight)!==null&&e!==void 0?e:24}get overscanCount(){var e;return(e=this.props.overscanCount)!==null&&e!==void 0?e:1}get searchTerm(){return(this.props.searchTerm||"").trim()}get matchFn(){var e;const n=(e=this.props.searchMatch)!==null&&e!==void 0?e:(r,i)=>JSON.stringify(Object.values(r.data)).toLocaleLowerCase().includes(i.toLocaleLowerCase());return r=>n(r,this.searchTerm)}accessChildren(e){var n;const r=this.props.childrenAccessor||"children";return(n=Nn(e,r))!==null&&n!==void 0?n:null}accessId(e){const n=this.props.idAccessor||"id",r=Nn(e,n);if(!r)throw new Error("Data must contain an 'id' property or props.idAccessor must return a string");return r}get firstNode(){var e;return(e=this.visibleNodes[0])!==null&&e!==void 0?e:null}get lastNode(){var e;return(e=this.visibleNodes[this.visibleNodes.length-1])!==null&&e!==void 0?e:null}get focusedNode(){var e;return(e=this.get(this.state.nodes.focus.id))!==null&&e!==void 0?e:null}get mostRecentNode(){var e;return(e=this.get(this.state.nodes.selection.mostRecent))!==null&&e!==void 0?e:null}get nextNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e+1)}get prevNode(){const e=this.indexOf(this.focusedNode);return e===null?null:this.at(e-1)}get(e){return e&&e in this.idToIndex&&this.visibleNodes[this.idToIndex[e]]||null}at(e){return this.visibleNodes[e]||null}nodesBetween(e,n){var r;if(e===null||n===null)return[];const i=(r=this.indexOf(e))!==null&&r!==void 0?r:0,o=this.indexOf(n);if(o===null)return[];const a=Math.min(i,o),s=Math.max(i,o);return this.visibleNodes.slice(a,s+1)}indexOf(e){const n=qd(e);return n?this.idToIndex[n]:null}get editingId(){return this.state.nodes.edit.id}createInternal(){return this.create({type:"internal"})}createLeaf(){return this.create({type:"leaf"})}create(e={}){var n,r;return lo(this,void 0,void 0,function*(){const i=e.parentId===void 0?Qd(this):e.parentId,o=(n=e.index)!==null&&n!==void 0?n:Jd(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",s=yield Se(this.props.onCreate,{type:a,parentId:i,index:o,parentNode:this.get(i)});s&&(this.focus(s),setTimeout(()=>{this.edit(s).then(()=>{this.select(s),this.activate(s)})}))})}delete(e){return lo(this,void 0,void 0,function*(){if(!e)return;const r=(Array.isArray(e)?e:[e]).map(et),i=r.map(o=>this.get(o)).filter(o=>!!o);yield Se(this.props.onDelete,{nodes:i,ids:r})})}edit(e){const n=et(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(qi(n)),new Promise(r=>{Mn.editPromise=r})}submit(e,n){return lo(this,void 0,void 0,function*(){if(!e)return;const r=et(e);yield Se(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(qi(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(qi(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(He(e));n&&Se(this.props.onActivate,n)}resolveEdit(e){const n=Mn.editPromise;n&&n(e),Mn.editPromise=null}get selectedIds(){return this.state.nodes.selection.ids}get selectedNodes(){let e=[];for(let n of Array.from(this.selectedIds)){const r=this.get(n);r&&e.push(r)}return e}focus(e,n={}){e&&(this.props.selectionFollowsFocus?this.select(e):(this.dispatch(qt(et(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&Se(this.props.onFocus,this.focusedNode)))}pageUp(){var e,n;const r=this.visibleStartIndex,o=this.visibleStopIndex-r;let a=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;a>r?a=r:a=Math.max(r-o,0),this.focus(this.at(a))}pageDown(){var e,n;const r=this.visibleStartIndex,i=this.visibleStopIndex,o=i-r;let a=(n=(e=this.focusedNode)===null||e===void 0?void 0:e.rowIndex)!==null&&n!==void 0?n:0;a<i?a=i:a=Math.min(a+o,this.visibleNodes.length-1),this.focus(this.at(a))}select(e,n={}){if(!e)return;const r=n.focus!==!1,i=et(e);r&&this.dispatch(qt(i)),this.dispatch(ze.only(i)),this.dispatch(ze.anchor(i)),this.dispatch(ze.mostRecent(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&Se(this.props.onFocus,this.focusedNode),Se(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=et(e);this.dispatch(ze.remove(n))}selectMulti(e){const n=this.get(He(e));n&&(this.dispatch(qt(n.id)),this.dispatch(ze.add(n.id)),this.dispatch(ze.anchor(n.id)),this.dispatch(ze.mostRecent(n.id)),this.scrollTo(n),this.focusedNode&&Se(this.props.onFocus,this.focusedNode),Se(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=et(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(qt(n)),this.dispatch(ze.remove(this.nodesBetween(r,i))),this.dispatch(ze.add(this.nodesBetween(r,He(n)))),this.dispatch(ze.mostRecent(n)),this.scrollTo(n),this.focusedNode&&Se(this.props.onFocus,this.focusedNode),Se(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),Se(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(qt((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&Se(this.props.onFocus,this.focusedNode),Se(this.props.onSelect,this.selectedNodes)}setSelection(e){var n;const r=new Set((n=e.ids)===null||n===void 0?void 0:n.map(et)),i=He(e.anchor),o=He(e.mostRecent);this.dispatch(ze.set({ids:r,anchor:i,mostRecent:o})),Se(this.props.onSelect,this.selectedNodes)}get cursorParentId(){const{cursor:e}=this.state.dnd;switch(e.type){case"highlight":return e.id;default:return null}}get cursorOverFolder(){return this.state.dnd.cursor.type==="highlight"}get dragNodes(){return this.state.dnd.dragIds.map(e=>this.get(e)).filter(e=>!!e)}get dragNode(){return this.get(this.state.nodes.drag.id)}get dragDestinationParent(){return this.get(this.state.nodes.drag.destinationParentId)}get dragDestinationIndex(){return this.state.nodes.drag.destinationIndex}canDrop(){var e;if(this.isFiltered)return!1;const n=(e=this.get(this.state.dnd.parentId))!==null&&e!==void 0?e:this.root,r=this.dragNodes,i=this.props.disableDrop;for(const o of r)if(!o||!n||o.isInternal&&Bd(n,o))return!1;return typeof i=="function"?!i({parentNode:n,dragNodes:this.dragNodes,index:this.state.dnd.index||0}):typeof i=="string"?!n.data[i]:typeof i=="boolean"?!i:!0}hideCursor(){this.dispatch(mn.cursor({type:"none"}))}showCursor(e){this.dispatch(mn.cursor(e))}open(e){const n=He(e);n&&(this.isOpen(n)||(this.dispatch(Ao.open(n,this.isFiltered)),Se(this.props.onToggle,n)))}close(e){const n=He(e);n&&this.isOpen(n)&&(this.dispatch(Ao.close(n,this.isFiltered)),Se(this.props.onToggle,n))}toggle(e){const n=He(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=He(e);if(!n)return;const r=xa(this.root,n);let i=r==null?void 0:r.parent;for(;i;)this.open(i.id),i=i.parent}openSiblings(e){const n=e.parent;if(!n)this.toggle(e.id);else if(n.children){const r=e.isOpen;for(let i of n.children)i.isInternal&&(r?this.close(i.id):this.open(i.id));this.scrollTo(this.focusedNode)}}openAll(){Wr(this.root,e=>{e.isInternal&&e.open()})}closeAll(){Wr(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=et(e);return this.openParents(r),Xd(()=>r in this.idToIndex).then(()=>{var i;const o=this.idToIndex[r];o!==void 0&&((i=this.list.current)===null||i===void 0||i.scrollToItem(o,n))}).catch(()=>{})}get isEditing(){return this.state.nodes.edit.id!==null}get isFiltered(){var e;return!!(!((e=this.props.searchTerm)===null||e===void 0)&&e.trim())}get hasFocus(){return this.state.nodes.focus.treeFocused}get hasNoSelection(){return this.state.nodes.selection.ids.size===0}get hasOneSelection(){return this.state.nodes.selection.ids.size===1}get hasMultipleSelections(){return this.state.nodes.selection.ids.size>1}isSelected(e){return e?this.state.nodes.selection.ids.has(e):!1}isOpen(e){var n,r,i;if(!e)return!1;if(e===Wn)return!0;const o=(n=this.props.openByDefault)!==null&&n!==void 0?n:!0;return this.isFiltered?(r=this.state.nodes.open.filtered[e])!==null&&r!==void 0?r:!0:(i=this.state.nodes.open.unfiltered[e])!==null&&i!==void 0?i:o}isEditable(e){var n;const r=this.props.disableEdit||(()=>!1);return(n=!Nn(e,r))!==null&&n!==void 0?n:!0}isDraggable(e){var n;const r=this.props.disableDrag||(()=>!1);return(n=!Nn(e,r))!==null&&n!==void 0?n:!0}isDragging(e){const n=He(e);return n?this.state.nodes.drag.id===n:!1}isFocused(e){return this.hasFocus&&this.state.nodes.focus.id===e}isMatch(e){return this.matchFn(e)}willReceiveDrop(e){const n=He(e);if(!n)return!1;const{destinationParentId:r,destinationIndex:i}=this.state.nodes.drag;return n===r&&i===null}onFocus(){const e=this.focusedNode||this.firstNode;e&&this.dispatch(qt(e.id))}onBlur(){this.dispatch(Db())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||wf}get renderRow(){return this.props.renderRow||wb}get renderNode(){return this.props.children||xb}get renderDragPreview(){return this.props.renderDragPreview||Zd}get renderCursor(){return this.props.renderCursor||Eb}}function $e(t){return`Minified Redux error #${t}; visit https://redux.js.org/Errors?code=${t} for the full message or use the non-minified dev environment for full errors. `}var q0=typeof Symbol=="function"&&Symbol.observable||"@@observable",Jl=q0,uo=()=>Math.random().toString(36).substring(7).split("").join("."),Y0={INIT:`@@redux/INIT${uo()}`,REPLACE:`@@redux/REPLACE${uo()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${uo()}`},Ct=Y0;function $f(t){if(typeof t!="object"||t===null)return!1;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e||Object.getPrototypeOf(t)===null}function X0(t){if(t===void 0)return"undefined";if(t===null)return"null";const e=typeof t;switch(e){case"boolean":case"string":case"number":case"symbol":case"function":return e}if(Array.isArray(t))return"array";if(Z0(t))return"date";if(Q0(t))return"error";const n=J0(t);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(t).slice(8,-1).toLowerCase().replace(/\s/g,"")}function J0(t){return typeof t.constructor=="function"?t.constructor.name:null}function Q0(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function Z0(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function ut(t){let e=typeof t;return process.env.NODE_ENV!=="production"&&(e=X0(t)),e}function Cf(t,e,n){if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?$e(2):`Expected the root reducer to be a function. Instead, received: '${ut(t)}'`);if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?$e(0):"It looks like you are passing several store enhancers to createStore(). This is not supported. Instead, compose them together to a single function. See https://redux.js.org/tutorials/fundamentals/part-4-store#creating-a-store-with-enhancers for an example.");if(typeof e=="function"&&typeof n>"u"&&(n=e,e=void 0),typeof n<"u"){if(typeof n!="function")throw new Error(process.env.NODE_ENV==="production"?$e(1):`Expected the enhancer to be a function. Instead, received: '${ut(n)}'`);return n(Cf)(t,e)}let r=t,i=e,o=new Map,a=o,s=0,l=!1;function u(){a===o&&(a=new Map,o.forEach((v,y)=>{a.set(y,v)}))}function c(){if(l)throw new Error(process.env.NODE_ENV==="production"?$e(3):"You may not call store.getState() while the reducer is executing. The reducer has already received the state as an argument. Pass it down from the top reducer instead of reading it from the store.");return i}function d(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?$e(4):`Expected the listener to be a function. Instead, received: '${ut(v)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?$e(5):"You may not call store.subscribe() while the reducer is executing. If you would like to be notified after the store has been updated, subscribe from a component and invoke store.getState() in the callback to access the latest state. See https://redux.js.org/api/store#subscribelistener for more details.");let y=!0;u();const w=s++;return a.set(w,v),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?$e(6):"You may not unsubscribe from a store listener while the reducer is executing. See https://redux.js.org/api/store#subscribelistener for more details.");y=!1,u(),a.delete(w),o=null}}}function h(v){if(!$f(v))throw new Error(process.env.NODE_ENV==="production"?$e(7):`Actions must be plain objects. Instead, the actual type was: '${ut(v)}'. You may need to add middleware to your store setup to handle dispatching other values, such as 'redux-thunk' to handle dispatching functions. See https://redux.js.org/tutorials/fundamentals/part-4-store#middleware and https://redux.js.org/tutorials/fundamentals/part-6-async-logic#using-the-redux-thunk-middleware for examples.`);if(typeof v.type>"u")throw new Error(process.env.NODE_ENV==="production"?$e(8):'Actions may not have an undefined "type" property. You may have misspelled an action type string constant.');if(typeof v.type!="string")throw new Error(process.env.NODE_ENV==="production"?$e(17):`Action "type" property must be a string. Instead, the actual type was: '${ut(v.type)}'. Value was: '${v.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?$e(9):"Reducers may not dispatch actions.");try{l=!0,i=r(i,v)}finally{l=!1}return(o=a).forEach(w=>{w()}),v}function g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?$e(10):`Expected the nextReducer to be a function. Instead, received: '${ut(v)}`);r=v,h({type:Ct.REPLACE})}function m(){const v=d;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?$e(11):`Expected the observer to be an object. Instead, received: '${ut(y)}'`);function w(){const P=y;P.next&&P.next(c())}return w(),{unsubscribe:v(w)}},[Jl](){return this}}}return h({type:Ct.INIT}),{dispatch:h,subscribe:d,getState:c,replaceReducer:g,[Jl]:m}}function Ql(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function ex(t,e,n,r){const i=Object.keys(e),o=n&&n.type===Ct.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(i.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!$f(t))return`The ${o} has unexpected type of "${ut(t)}". Expected argument to be an object with the following keys: "${i.join('", "')}"`;const a=Object.keys(t).filter(s=>!e.hasOwnProperty(s)&&!r[s]);if(a.forEach(s=>{r[s]=!0}),!(n&&n.type===Ct.REPLACE)&&a.length>0)return`Unexpected ${a.length>1?"keys":"key"} "${a.join('", "')}" found in ${o}. Expected to find one of the known reducer keys instead: "${i.join('", "')}". Unexpected keys will be ignored.`}function tx(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:Ct.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?$e(12):`The slice reducer for key "${e}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:Ct.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?$e(13):`The slice reducer for key "${e}" returned undefined when probed with a random type. Don't try to handle '${Ct.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function Zl(t){const e=Object.keys(t),n={};for(let a=0;a<e.length;a++){const s=e[a];process.env.NODE_ENV!=="production"&&typeof t[s]>"u"&&Ql(`No reducer provided for key "${s}"`),typeof t[s]=="function"&&(n[s]=t[s])}const r=Object.keys(n);let i;process.env.NODE_ENV!=="production"&&(i={});let o;try{tx(n)}catch(a){o=a}return function(s={},l){if(o)throw o;if(process.env.NODE_ENV!=="production"){const d=ex(s,n,l,i);d&&Ql(d)}let u=!1;const c={};for(let d=0;d<r.length;d++){const h=r[d],g=n[h],m=s[h],p=g(m,l);if(typeof p>"u"){const v=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?$e(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${h}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}c[h]=p,u=u||p!==m}return u=u||r.length!==Object.keys(s).length,u?c:s}}function nx(t=vn().nodes.drag,e){switch(e.type){case"DND_DRAG_START":return Object.assign(Object.assign({},t),{id:e.id,selectedIds:e.dragIds});case"DND_DRAG_END":return Object.assign(Object.assign({},t),{id:null,destinationParentId:null,destinationIndex:null,selectedIds:[]});case"DND_HOVERING":return e.parentId!==t.destinationParentId||e.index!=t.destinationIndex?Object.assign(Object.assign({},t),{destinationParentId:e.parentId,destinationIndex:e.index}):t;default:return t}}const rx=Zl({nodes:Zl({focus:Pb,edit:Tb,open:Ob,selection:Ib,drag:nx}),dnd:_b}),ix=vn();function ox({treeProps:t,imperativeHandle:e,children:n}){const r=f.useRef(null),i=f.useRef(null),o=f.useRef(Cf(rx,vn(t))),a=Jo.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>ix),s=f.useMemo(()=>new Mn(o.current,t,r,i),[]),l=f.useRef(0);return f.useMemo(()=>{l.current+=1,s.update(t)},[...Object.values(t),a.nodes.open]),f.useImperativeHandle(e,()=>s),f.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),f.useEffect(()=>{s.props.searchTerm||o.current.dispatch(Ao.clear(!0))},[s.props.searchTerm]),C.jsx(Md.Provider,{value:s,children:C.jsx(Kd.Provider,{value:l.current,children:C.jsx(Ad.Provider,{value:a.nodes,children:C.jsx(Ld.Provider,{value:a.dnd,children:C.jsx(LE,Object.assign({backend:K0,options:{rootElement:s.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function ax(){const t=Ne(),[,e]=hf(()=>({accept:"NODE",canDrop:(n,r)=>r.isOver({shallow:!0})?t.canDrop():!1,hover:(n,r)=>{if(!r.isOver({shallow:!0}))return;const i=r.getClientOffset();if(!t.listEl.current||!i)return;const{cursor:o,drop:a}=Ef({element:t.listEl.current,offset:i,indent:t.indent,node:null,prevNode:t.visibleNodes[t.visibleNodes.length-1],nextNode:null});a&&t.dispatch(mn.hovering(a.parentId,a.index)),r.canDrop()?o&&t.showCursor(o):t.hideCursor()}}),[t]);e(t.listEl)}function sx(t){return ax(),t.children}function lx(){const e=Ne().props.renderContainer||wf;return C.jsx(C.Fragment,{children:C.jsx(e,{})})}function ux(){const t=Ne(),{offset:e,mouse:n,item:r,isDragging:i}=u0(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=t.props.renderDragPreview||Zd;return C.jsx(o,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class cx{constructor(e){this.root=dx(e)}get data(){var e,n;return(n=(e=this.root.children)===null||e===void 0?void 0:e.map(r=>r.data))!==null&&n!==void 0?n:[]}create(e){const n=e.parentId?this.find(e.parentId):this.root;if(!n)return null;n.addChild(e.data,e.index)}move(e){const n=this.find(e.id),r=e.parentId?this.find(e.parentId):this.root;!n||!r||(r.addChild(n.data,e.index),n.drop())}update(e){const n=this.find(e.id);n&&n.update(e.changes)}drop(e){const n=this.find(e.id);n&&n.drop()}find(e,n=this.root){if(!n)return null;if(n.id===e)return n;if(n.children){for(let r of n.children){const i=this.find(e,r);if(i)return i}return null}return null}}function dx(t){const e=new Tf({id:"ROOT"},null);return e.children=t.map(n=>Ia(n,e)),e}function Ia(t,e){const n=new Tf(t,e);return t.children&&(n.children=t.children.map(r=>Ia(r,n))),n}class Tf{constructor(e,n){this.data=e,this.parent=n,this.id=e.id}hasParent(){return!!this.parent}get childIndex(){return this.hasParent()?this.parent.children.indexOf(this):-1}addChild(e,n){var r,i;const o=Ia(e,this);this.children=(r=this.children)!==null&&r!==void 0?r:[],this.children.splice(n,0,o),this.data.children=(i=this.data.children)!==null&&i!==void 0?i:[],this.data.children.splice(n,0,e)}removeChild(e){var n,r;(n=this.children)===null||n===void 0||n.splice(e,1),(r=this.data.children)===null||r===void 0||r.splice(e,1)}update(e){if(this.hasParent()){const n=this.childIndex;this.parent.addChild(Object.assign(Object.assign({},this.data),e),n),this.drop()}}drop(){this.hasParent()&&this.parent.removeChild(this.childIndex)}}let fx=0;function hx(t){const[e,n]=f.useState(t),r=f.useMemo(()=>new cx(e),[e]);return[e,{onMove:u=>{for(const c of u.dragIds)r.move({id:c,parentId:u.parentId,index:u.index});n(r.data)},onRename:({name:u,id:c})=>{r.update({id:c,changes:{name:u}}),n(r.data)},onCreate:({parentId:u,index:c,type:d})=>{const h={id:`simple-tree-id-${fx++}`,name:""};return d==="internal"&&(h.children=[]),r.create({parentId:u,index:c,data:h}),n(r.data),h},onDelete:u=>{u.ids.forEach(c=>r.drop({id:c})),n(r.data)}}]}function px(t){if(t.initialData&&t.data)throw new Error("React Arborist Tree => Provide either a data or initialData prop, but not both.");if(t.initialData&&(t.onCreate||t.onDelete||t.onMove||t.onRename))throw new Error(`React Arborist Tree => You passed the initialData prop along with a data handler.
|
|
100
|
+
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=hx(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}else return t}function gx(t,e){const n=px(t);return C.jsxs(ox,{treeProps:n,imperativeHandle:e,children:[C.jsx(sx,{children:C.jsx(lx,{})}),C.jsx(ux,{})]})}const vx=f.forwardRef(gx),Df=({top:t,left:e})=>C.jsx("div",{className:"c__tree-view__cursor",style:{top:t,left:e+10}});var ln=(t=>(t.FIRST_CHILD="first-child",t.LAST_CHILD="last-child",t.LEFT="left",t.RIGHT="right",t))(ln||{});const mx=[{id:"1",name:"Unread"},{id:"2",name:"Threads"},{id:"2.1",name:"load children",childrenCount:1,children:[]},{id:"3",name:"Chat Rooms",children:[{id:"c1",name:"General"},{id:"c2",name:"Random"},{id:"c3",name:"Open Source Projects"}]},{id:"4",name:"Direct Messages",children:[{id:"d1",name:"Alice"},{id:"d2",name:"Bob"},{id:"d3",name:"Charlie"}]}],yx=({treeData:t,selectedNodeId:e,rootNodeId:n,renderNode:r,afterMove:i})=>{const o=s=>{var P;const l=JSON.parse(JSON.stringify(t)),u=s.dragNodes[0].data.id,d=s.dragNodes[0].data.parentId??n,h=s.index,g=s.parentId??n,m=s.parentId?((P=s.parentNode)==null?void 0:P.children)??[]:l;let p=null;h===0&&(p={targetNodeId:g??n,mode:ln.FIRST_CHILD,sourceNodeId:u,oldParentId:d}),h===m.length&&(p={targetNodeId:g??n,mode:ln.LAST_CHILD,sourceNodeId:u,oldParentId:d});const v=h-1,y=m[v];y&&(p={targetNodeId:y.id,mode:ln.RIGHT,sourceNodeId:u,oldParentId:d});const w=h+1,$=m[w];return $&&(p={targetNodeId:$.id,mode:ln.LEFT,sourceNodeId:u,oldParentId:d}),p},a=s=>{const l=JSON.parse(JSON.stringify(t)),u=s.dragIds[0],c=(v,y)=>{var w,$;v.forEach((P,D)=>{if(P.id===u)return{currentIndex:D}});for(let P=0;P<v.length;P++){if(v[P].id===u){const D=P;let O=s.index;return D<O&&(O-=1),{currentIndex:P,parentId:y,newIndex:O,draggedNode:v.splice(P,1)[0]}}if((w=v[P].children)!=null&&w.length){const D=c((($=v[P])==null?void 0:$.children)??[],v[P].id);if(D)return D}}return null},d=c(l),h=d==null?void 0:d.draggedNode,g=(d==null?void 0:d.currentIndex)??-1,m=(d==null?void 0:d.newIndex)??-1;if(!h||g<0||m<0)return;if(!s.parentNode)h.parentId=n,l.splice(m,0,h);else{const v=s.parentNode.data;h.parentId=v.id;const y=w=>{var $;for(const P of w){if(P.id===v.id)return P.children=P.children||[],P.children.splice(d.parentId===v.id?d.newIndex:s.index,0,h),!0;if(($=P.children)!=null&&$.length&&y(P.children))return!0}return!1};y(l)}const p=o(s);p&&(i==null||i(p,l))};return C.jsx(vx,{data:t,openByDefault:!1,disableEdit:!0,onMove:a,rowHeight:35,disableDrop:({parentNode:s})=>{if(s.data.id==="__REACT_ARBORIST_INTERNAL_ROOT__")return!1;const l=s==null?void 0:s.isOpen;let u=s.data.childrenCount&&s.data.childrenCount>0&&(s==null?void 0:s.data.children)&&s.data.children.length>0;return u=u??!0,!(l&&u)},padding:25,overscanCount:20,selection:e,renderCursor:Df,children:s=>r(s)})},bx=({children:t,onClick:e,node:n,dragHandle:r,style:i,loadChildren:o,forceLoading:a})=>{var p,v;const s=f.useRef(null),[l,u]=f.useState(!1),c=a??l,d=n.data.childrenCount!==void 0&&n.data.childrenCount>0||(((p=n.data.children)==null?void 0:p.length)??0)>0,h=((v=n.children)==null?void 0:v.length)??!1,g=n.isLeaf||!d,m=f.useCallback(async()=>{if(!g){if(h){n.toggle();return}u(!0),await(o==null?void 0:o(n.data)),u(!1),n.open()}},[h,o,n,g]);return f.useEffect(()=>{n.willReceiveDrop&&!n.isOpen&&(s.current=setTimeout(()=>{m()},200)),s.current&&!n.willReceiveDrop&&clearTimeout(s.current)},[n,m]),C.jsxs("div",{role:"button",onClick:e,ref:r,style:i,className:At("c__tree-view--node",{willReceiveDrop:n.willReceiveDrop,selected:n.isSelected}),children:[g&&C.jsx("div",{className:"c__tree-view--node__leaf"}),!g&&C.jsxs(C.Fragment,{children:[c&&C.jsx("div",{className:"c__tree-view--node__loading",children:C.jsx(ga,{})}),!c&&C.jsx("span",{onClick:y=>{y.stopPropagation(),m()},className:"c__tree-view--node__arrow material-icons",children:n.isOpen?"keyboard_arrow_down":"keyboard_arrow_right"})]}),t]})},Sx=(t,e)=>{const[n,r]=f.useState(t),[i,o]=f.useState(),a=(h,g)=>{const m=p=>p.map(v=>v.id===h?{...v,children:[...v.children||[],g]}:v.children?{...v,children:m(v.children)}:v);r(m(n))},s=(h,g)=>{const m=p=>p.map(v=>v.id===h?{...v,...g}:v.children?{...v,children:m(v.children)}:v);r(m(n))};return{treeData:n,setTreeData:r,addChild:a,updateNode:s,deleteNode:h=>{const g=m=>m.filter(p=>p.id===h?!1:(p.children&&(p.children=g(p.children)),!0));r(g(n))},addRootNode:h=>{r([...n,h])},selectedNode:i,setSelectedNode:o,refreshNode:async h=>{if(!e){console.error("No refresh callback provided");return}try{const g=await e(h);s(h,g)}catch(g){console.error("error while refreshing node:",g)}},setChildren:(h,g,m="merge")=>{const p=v=>v.map(y=>{if(y.id===h){const w=y.children||[],$=m==="merge"?[...w.filter(P=>!g.some(D=>D.id===P.id)),...g]:g;return{...y,children:$}}return y.children?{...y,children:p(y.children)}:y});r(p(n))}}};exports.CunninghamProvider=ih;exports.CustomTabs=cb;exports.DropdownMenu=Tc;exports.Header=Oc;exports.HorizontalSeparator=Mo;exports.Label=Zc;exports.LanguagePicker=Pc;exports.LeftPanel=Ic;exports.MainLayout=Zv;exports.ProConnectButton=oh;exports.QuickSearch=sb;exports.QuickSearchGroup=lb;exports.QuickSearchInput=Rd;exports.QuickSearchItem=Sr;exports.QuickSearchItemTemplate=ub;exports.Spinner=ga;exports.TreeView=yx;exports.TreeViewItem=bx;exports.TreeViewMoveModeEnum=ln;exports.TreeViewSeparator=Df;exports.WithLabel=tm;exports.cunninghamConfig=Do;exports.getLocales=tu;exports.headerHeight=em;exports.treeDemoData=mx;exports.useDropdownMenu=Dc;exports.useResponsive=ti;exports.useTree=Sx;
|
|
101
|
+
//# sourceMappingURL=index.cjs.map
|