@gouvfr-lasuite/ui-kit 0.1.7 → 0.1.8
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/dist/index.cjs +11 -11
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +1061 -1057
- package/dist/index.js.map +1 -1
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -14,21 +14,21 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var Va;function uh(){return Va||(Va=1,process.env.NODE_ENV!=="production"&&function(){function t($){if($==null)return null;if(typeof $=="function")return $.$$typeof===K?null:$.displayName||$.name||null;if(typeof $=="string")return $;switch($){case I:return"Fragment";case x:return"Portal";case b:return"Profiler";case P:return"StrictMode";case
|
|
17
|
+
*/var Va;function uh(){return Va||(Va=1,process.env.NODE_ENV!=="production"&&function(){function t($){if($==null)return null;if(typeof $=="function")return $.$$typeof===K?null:$.displayName||$.name||null;if(typeof $=="string")return $;switch($){case I:return"Fragment";case x:return"Portal";case b:return"Profiler";case P:return"StrictMode";case H:return"Suspense";case E:return"SuspenseList"}if(typeof $=="object")switch(typeof $.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),$.$$typeof){case W:return($.displayName||"Context")+".Provider";case R:return($._context.displayName||"Context")+".Consumer";case M:var V=$.render;return $=$.displayName,$||($=V.displayName||V.name||"",$=$!==""?"ForwardRef("+$+")":"ForwardRef"),$;case _:return V=$.displayName||null,V!==null?V:t($.type)||"Memo";case z:V=$._payload,$=$._init;try{return t($(V))}catch{}}return null}function e($){return""+$}function n($){try{e($);var V=!1}catch{V=!0}if(V){V=console;var G=V.error,ie=typeof Symbol=="function"&&Symbol.toStringTag&&$[Symbol.toStringTag]||$.constructor.name||"Object";return G.call(V,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",ie),e($)}}function r(){}function i(){if(N===0){A=console.log,F=console.info,B=console.warn,L=console.error,X=console.group,ee=console.groupCollapsed,de=console.groupEnd;var $={configurable:!0,enumerable:!0,value:r,writable:!0};Object.defineProperties(console,{info:$,log:$,warn:$,error:$,group:$,groupCollapsed:$,groupEnd:$})}N++}function o(){if(N--,N===0){var $={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:j({},$,{value:A}),info:j({},$,{value:F}),warn:j({},$,{value:B}),error:j({},$,{value:L}),group:j({},$,{value:X}),groupCollapsed:j({},$,{value:ee}),groupEnd:j({},$,{value:de})})}0>N&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function a($){if(ce===void 0)try{throw Error()}catch(G){var V=G.stack.trim().match(/\n( *(at )?)/);ce=V&&V[1]||"",oe=-1<G.stack.indexOf(`
|
|
18
18
|
at`)?" (<anonymous>)":-1<G.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
19
19
|
`+ce+$+oe}function s($,V){if(!$||ge)return"";var G=ne.get($);if(G!==void 0)return G;ge=!0,G=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var ie=null;ie=q.H,q.H=null,i();try{var Se={DetermineComponentFrameRoot:function(){try{if(V){var lt=function(){throw Error()};if(Object.defineProperty(lt.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(lt,[])}catch(Je){var ur=Je}Reflect.construct($,[],lt)}else{try{lt.call()}catch(Je){ur=Je}$.call(lt.prototype)}}else{try{throw Error()}catch(Je){ur=Je}(lt=$())&&typeof lt.catch=="function"&<.catch(function(){})}}catch(Je){if(Je&&ur&&typeof Je.stack=="string")return[Je.stack,ur.stack]}return[null,null]}};Se.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var se=Object.getOwnPropertyDescriptor(Se.DetermineComponentFrameRoot,"name");se&&se.configurable&&Object.defineProperty(Se.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var Q=Se.DetermineComponentFrameRoot(),Xe=Q[0],Bt=Q[1];if(Xe&&Bt){var $e=Xe.split(`
|
|
20
20
|
`),bt=Bt.split(`
|
|
21
21
|
`);for(Q=se=0;se<$e.length&&!$e[se].includes("DetermineComponentFrameRoot");)se++;for(;Q<bt.length&&!bt[Q].includes("DetermineComponentFrameRoot");)Q++;if(se===$e.length||Q===bt.length)for(se=$e.length-1,Q=bt.length-1;1<=se&&0<=Q&&$e[se]!==bt[Q];)Q--;for(;1<=se&&0<=Q;se--,Q--)if($e[se]!==bt[Q]){if(se!==1||Q!==1)do if(se--,Q--,0>Q||$e[se]!==bt[Q]){var Pn=`
|
|
22
|
-
`+$e[se].replace(" at new "," at ");return $.displayName&&Pn.includes("<anonymous>")&&(Pn=Pn.replace("<anonymous>",$.displayName)),typeof $=="function"&&ne.set($,Pn),Pn}while(1<=se&&0<=Q);break}}}finally{ge=!1,q.H=ie,o(),Error.prepareStackTrace=G}return $e=($e=$?$.displayName||$.name:"")?a($e):"",typeof $=="function"&&ne.set($,$e),$e}function l($){if($==null)return"";if(typeof $=="function"){var V=$.prototype;return s($,!(!V||!V.isReactComponent))}if(typeof $=="string")return a($);switch($){case
|
|
22
|
+
`+$e[se].replace(" at new "," at ");return $.displayName&&Pn.includes("<anonymous>")&&(Pn=Pn.replace("<anonymous>",$.displayName)),typeof $=="function"&&ne.set($,Pn),Pn}while(1<=se&&0<=Q);break}}}finally{ge=!1,q.H=ie,o(),Error.prepareStackTrace=G}return $e=($e=$?$.displayName||$.name:"")?a($e):"",typeof $=="function"&&ne.set($,$e),$e}function l($){if($==null)return"";if(typeof $=="function"){var V=$.prototype;return s($,!(!V||!V.isReactComponent))}if(typeof $=="string")return a($);switch($){case H:return a("Suspense");case E:return a("SuspenseList")}if(typeof $=="object")switch($.$$typeof){case M:return $=s($.render,!1),$;case _:return l($.type);case z:V=$._payload,$=$._init;try{return l($(V))}catch{}}return""}function u(){var $=q.A;return $===null?null:$.getOwner()}function c($){if(re.call($,"key")){var V=Object.getOwnPropertyDescriptor($,"key").get;if(V&&V.isReactWarning)return!1}return $.key!==void 0}function h($,V){function G(){st||(st=!0,console.error("%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://react.dev/link/special-props)",V))}G.isReactWarning=!0,Object.defineProperty($,"key",{get:G,configurable:!0})}function p(){var $=t(this.type);return ve[$]||(ve[$]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),$=this.props.ref,$!==void 0?$:null}function g($,V,G,ie,Se,se){return G=se.ref,$={$$typeof:T,type:$,key:V,props:se,_owner:Se},(G!==void 0?G:null)!==null?Object.defineProperty($,"ref",{enumerable:!1,get:p}):Object.defineProperty($,"ref",{enumerable:!1,value:null}),$._store={},Object.defineProperty($._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty($,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.freeze&&(Object.freeze($.props),Object.freeze($)),$}function m($,V,G,ie,Se,se){if(typeof $=="string"||typeof $=="function"||$===I||$===b||$===P||$===H||$===E||$===U||typeof $=="object"&&$!==null&&($.$$typeof===z||$.$$typeof===_||$.$$typeof===W||$.$$typeof===R||$.$$typeof===M||$.$$typeof===O||$.getModuleId!==void 0)){var Q=V.children;if(Q!==void 0)if(ie)if(k(Q)){for(ie=0;ie<Q.length;ie++)f(Q[ie],$);Object.freeze&&Object.freeze(Q)}else console.error("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 f(Q,$)}else Q="",($===void 0||typeof $=="object"&&$!==null&&Object.keys($).length===0)&&(Q+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),$===null?ie="null":k($)?ie="array":$!==void 0&&$.$$typeof===T?(ie="<"+(t($.type)||"Unknown")+" />",Q=" Did you accidentally export a JSX literal instead of a component?"):ie=typeof $,console.error("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ie,Q);if(re.call(V,"key")){Q=t($);var Xe=Object.keys(V).filter(function($e){return $e!=="key"});ie=0<Xe.length?"{key: someKey, "+Xe.join(": ..., ")+": ...}":"{key: someKey}",Dn[Q+ie]||(Xe=0<Xe.length?"{"+Xe.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
23
23
|
let props = %s;
|
|
24
24
|
<%s {...props} />
|
|
25
25
|
React keys must be passed directly to JSX without using spread:
|
|
26
26
|
let props = %s;
|
|
27
|
-
<%s key={someKey} {...props} />`,ie,Q,Xe,Q),Dn[Q+ie]=!0)}if(Q=null,G!==void 0&&(n(G),Q=""+G),c(V)&&(n(V.key),Q=""+V.key),"key"in V){G={};for(var Bt in V)Bt!=="key"&&(G[Bt]=V[Bt])}else G=V;return Q&&h(G,typeof $=="function"?$.displayName||$.name||"Unknown":$),g($,Q,se,Se,u(),G)}function f($,V){if(typeof $=="object"&&$&&$.$$typeof!==Ue){if(
|
|
27
|
+
<%s key={someKey} {...props} />`,ie,Q,Xe,Q),Dn[Q+ie]=!0)}if(Q=null,G!==void 0&&(n(G),Q=""+G),c(V)&&(n(V.key),Q=""+V.key),"key"in V){G={};for(var Bt in V)Bt!=="key"&&(G[Bt]=V[Bt])}else G=V;return Q&&h(G,typeof $=="function"?$.displayName||$.name||"Unknown":$),g($,Q,se,Se,u(),G)}function f($,V){if(typeof $=="object"&&$&&$.$$typeof!==Ue){if(k($))for(var G=0;G<$.length;G++){var ie=$[G];v(ie)&&y(ie,V)}else if(v($))$._store&&($._store.validated=1);else if($===null||typeof $!="object"?G=null:(G=Y&&$[Y]||$["@@iterator"],G=typeof G=="function"?G:null),typeof G=="function"&&G!==$.entries&&(G=G.call($),G!==$))for(;!($=G.next()).done;)v($.value)&&y($.value,V)}}function v($){return typeof $=="object"&&$!==null&&$.$$typeof===T}function y($,V){if($._store&&!$._store.validated&&$.key==null&&($._store.validated=1,V=S(V),!lr[V])){lr[V]=!0;var G="";$&&$._owner!=null&&$._owner!==u()&&(G=null,typeof $._owner.tag=="number"?G=t($._owner.type):typeof $._owner.name=="string"&&(G=$._owner.name),G=" It was passed a child from "+G+".");var ie=q.getCurrentStack;q.getCurrentStack=function(){var Se=l($.type);return ie&&(Se+=ie()||""),Se},console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',V,G),q.getCurrentStack=ie}}function S($){var V="",G=u();return G&&(G=t(G.type))&&(V=`
|
|
28
28
|
|
|
29
29
|
Check the render method of \``+G+"`."),V||($=t($))&&(V=`
|
|
30
30
|
|
|
31
|
-
Check the top-level render call using <`+$+">."),V}var w=d,D=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),W=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),z=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),k=Symbol.for("react.memo"),H=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),Y=Symbol.iterator,K=Symbol.for("react.client.reference"),q=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=Object.prototype.hasOwnProperty,j=Object.assign,O=Symbol.for("react.client.reference"),_=Array.isArray,N=0,A,F,B,L,X,ee,de;r.__reactDisabledLog=!0;var ce,oe,ge=!1,ne=new(typeof WeakMap=="function"?WeakMap:Map),Ue=Symbol.for("react.client.reference"),st,ve={},Dn={},lr={};In.Fragment=I,In.jsx=function($,V,G,ie,Se){return m($,V,G,!1,ie,Se)},In.jsxs=function($,V,G,ie,Se){return m($,V,G,!0,ie,Se)}}()),In}var Ga;function ch(){return Ga||(Ga=1,process.env.NODE_ENV==="production"?cr.exports=lh():cr.exports=uh()),cr.exports}var T=ch();const dh={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"}}}},fh={components:dh},hh={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"}}},ph={components:hh},gh={},vh={};function Oi(t){return t&&typeof t=="object"&&!Array.isArray(t)}function Wr(t,...e){if(!e.length)return t;const n=e.shift();if(Oi(t)&&Oi(n))for(const r in n)Oi(n[r])?(t[r]||Object.assign(t,{[r]:{}}),Wr(t[r],n[r])):Object.assign(t,{[r]:n[r]});return Wr(t,...e)}function yu(){return{enUS:Wr(fh,gh),frFR:Wr(ph,vh)}}const mh=t=>{const e=yu();return T.jsx(mn.CunninghamProvider,{theme:"dsfr",customLocales:e,...t})},yh=({disabled:t,onClick:e})=>T.jsx(mn.Button,{disabled:t,className:"pro-connect-button",onClick:e}),pe=typeof document<"u"?d.useLayoutEffect:()=>{};function De(t){const e=d.useRef(null);return pe(()=>{e.current=t},[t]),d.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}function bh(t){let[e,n]=d.useState(t),r=d.useRef(null),i=De(()=>{if(!r.current)return;let a=r.current.next();if(a.done){r.current=null;return}e===a.value?i():n(a.value)});pe(()=>{r.current&&i()});let o=De(a=>{r.current=a(e),i()});return[e,o]}const Ur={prefix:String(Math.round(Math.random()*1e10)),current:0},bu=d.createContext(Ur),Sh=d.createContext(!1);let wh=!!(typeof window<"u"&&window.document&&window.document.createElement),Ii=new WeakMap;function Eh(t=!1){let e=d.useContext(bu),n=d.useRef(null);if(n.current===null&&!t){var r,i;let o=(i=d.__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=Ii.get(o);a==null?Ii.set(o,{id:e.current,state:o.memoizedState}):o.memoizedState!==a.state&&(e.current=a.id,Ii.delete(o))}n.current=++e.current}return n.current}function $h(t){let e=d.useContext(bu);e===Ur&&!wh&&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=Eh(!!t),r=e===Ur&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${e.prefix}`;return t||`${r}-${n}`}function xh(t){let e=d.useId(),[n]=d.useState($n()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Ur.prefix}`;return t||`${r}-${e}`}const Ch=typeof d.useId=="function"?xh:$h;function Th(){return!1}function Dh(){return!0}function Ph(t){return()=>{}}function $n(){return typeof d.useSyncExternalStore=="function"?d.useSyncExternalStore(Ph,Th,Dh):d.useContext(Sh)}let Oh=!!(typeof window<"u"&&window.document&&window.document.createElement),ft=new Map;function tr(t){let[e,n]=d.useState(t),r=d.useRef(null),i=Ch(e),o=d.useCallback(a=>{r.current=a},[]);return Oh&&(ft.has(i)&&!ft.get(i).includes(o)?ft.set(i,[...ft.get(i),o]):ft.set(i,[o])),pe(()=>{let a=i;return()=>{ft.delete(a)}},[i]),d.useEffect(()=>{let a=r.current;a&&(r.current=null,n(a))}),i}function Ih(t,e){if(t===e)return t;let n=ft.get(t);if(n)return n.forEach(i=>i(e)),e;let r=ft.get(e);return r?(r.forEach(i=>i(t)),t):e}function _i(t=[]){let e=tr(),[n,r]=bh(e),i=d.useCallback(()=>{r(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,r]);return pe(i,[e,i,...t]),n}function Vn(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const Ke=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},yn=t=>t&&"window"in t&&t.window===t?t:Ke(t).defaultView||window;function Su(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=Su(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function ot(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Su(t))&&(r&&(r+=" "),r+=e);return r}function ye(...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]=Vn(o,a):(i==="className"||i==="UNSAFE_className")&&typeof o=="string"&&typeof a=="string"?e[i]=ot(o,a):i==="id"&&o&&a?e.id=Ih(o,a):e[i]=a!==void 0?a:o}}return e}function wu(...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 _h=new Set(["id"]),kh=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Rh=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),Nh=/^(data-.*)$/;function Be(t,e={}){let{labelable:n,isLink:r,propNames:i}=e,o={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(_h.has(a)||n&&kh.has(a)||r&&Rh.has(a)||i!=null&&i.has(a)||Nh.test(a))&&(o[a]=t[a]);return o}function xt(t){if(Mh())t.focus({preventScroll:!0});else{let e=Ah(t);t.focus(),Kh(e)}}let dr=null;function Mh(){if(dr==null){dr=!1;try{document.createElement("div").focus({get preventScroll(){return dr=!0,!0}})}catch{}}return dr}function Ah(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 Kh(t){for(let{element:e,scrollTop:n,scrollLeft:r}of t)e.scrollTop=n,e.scrollLeft=r}function ci(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 aa(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 at(t){let e=null;return()=>(e==null&&(e=t()),e)}const It=at(function(){return aa(/^Mac/i)}),Lh=at(function(){return aa(/^iPhone/i)}),Eu=at(function(){return aa(/^iPad/i)||It()&&navigator.maxTouchPoints>1}),di=at(function(){return Lh()||Eu()}),Fh=at(function(){return It()||di()}),$u=at(function(){return ci(/AppleWebKit/i)&&!jh()}),jh=at(function(){return ci(/Chrome/i)}),xu=at(function(){return ci(/Android/i)}),zh=at(function(){return ci(/Firefox/i)}),Hh=d.createContext({isNative:!0,open:Wh,useHref:t=>t});function fi(){return d.useContext(Hh)}function _t(t,e,n=!0){var r,i;let{metaKey:o,ctrlKey:a,altKey:s,shiftKey:l}=e;zh()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&t.target==="_blank"&&(It()?o=!0:a=!0);let u=$u()&&It()&&!Eu()?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});_t.isOpening=n,xt(t),t.dispatchEvent(u),_t.isOpening=!1}_t.isOpening=!1;function Bh(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 Wh(t,e){Bh(t,n=>_t(n,e))}function Cu(t){let e=fi();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 nn=new Map,Eo=new Set;function qa(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{if(!t(r)||!r.target)return;let i=nn.get(r.target);i||(i=new Set,nn.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=nn.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),nn.delete(r.target)),nn.size===0)){for(let o of Eo)o();Eo.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?qa():document.addEventListener("DOMContentLoaded",qa));function Uh(t){requestAnimationFrame(()=>{nn.size===0?t():Eo.add(t)})}function Tu(){let t=d.useRef(new Map),e=d.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=d.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=d.useCallback(()=>{t.current.forEach((i,o)=>{n(i.eventTarget,i.type,o,i.options)})},[n]);return d.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}}function sa(t,e){let{id:n,"aria-label":r,"aria-labelledby":i}=t;return n=tr(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 xn(t){const e=d.useRef(null);return d.useMemo(()=>({get current(){return e.current},set current(n){e.current=n,typeof t=="function"?t(n):t&&(t.current=n)}}),[t])}function Ya(t,e){const n=d.useRef(!0),r=d.useRef(null);pe(()=>(n.current=!0,()=>{n.current=!1}),[]),pe(()=>{n.current?n.current=!1:(!r.current||e.some((i,o)=>!Object.is(i,r[o])))&&t(),r.current=e},e)}function Vh(){return typeof window.ResizeObserver<"u"}function Xa(t){const{ref:e,box:n,onResize:r}=t;d.useEffect(()=>{let i=e==null?void 0:e.current;if(i)if(Vh()){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 Gh(t,e){pe(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function Gn(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(Gn(n,e)&&(n=n.parentElement);n&&!Gn(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function qh(t,e){const n=[];for(;t&&t!==document.documentElement;)Gn(t,e)&&n.push(t),t=t.parentElement;return n}let Yh=0;const ki=new Map;function Xh(t){let[e,n]=d.useState();return pe(()=>{if(!t)return;let r=ki.get(t);if(r)n(r.element.id);else{let i=`react-aria-description-${Yh++}`;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},ki.set(t,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),ki.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}function fr(t,e,n,r){let i=De(n),o=n==null;d.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 Pu(t,e){let n=Ja(t,e,"left"),r=Ja(t,e,"top"),i=e.offsetWidth,o=e.offsetHeight,a=t.scrollLeft,s=t.scrollTop,{borderTopWidth:l,borderLeftWidth:u,scrollPaddingTop:c,scrollPaddingRight:h,scrollPaddingBottom:p,scrollPaddingLeft:g}=getComputedStyle(t),m=a+parseInt(u,10),f=s+parseInt(l,10),v=m+t.clientWidth,y=f+t.clientHeight,S=parseInt(c,10)||0,w=parseInt(p,10)||0,D=parseInt(h,10)||0,x=parseInt(g,10)||0;n<=a+x?a=n-parseInt(u,10)-x:n+i>v-D&&(a+=n+i-v+D),r<=f+S?s=r-parseInt(l,10)-S:r+o>y-w&&(s+=r+o-y+w),t.scrollLeft=a,t.scrollTop=s}function Ja(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 Qa(t,e){if(t&&document.contains(t)){let a=document.scrollingElement||document.documentElement;if(window.getComputedStyle(a).overflow==="hidden"){let l=qh(t);for(let u of l)Pu(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:h}=t.getBoundingClientRect();if(Math.abs(l-c)>1||Math.abs(u-h)>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 $o(t){return t.mozInputSource===0&&t.isTrusted?!0:xu()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Jh(t){return!xu()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}const Qh="react-aria-clear-focus",Zh="react-aria-focus",Ou="react-aria-update-activedescendant";function rn(t){return It()?t.metaKey:t.ctrlKey}function ep(t,e=!0){let[n,r]=d.useState(!0),i=n&&e;return pe(()=>{if(i&&t.current&&"getAnimations"in t.current)for(let o of t.current.getAnimations())o instanceof CSSTransition&&o.cancel()},[t,i]),Iu(t,i,d.useCallback(()=>r(!1),[])),i}function tp(t,e){let[n,r]=d.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 Iu(t,i,d.useCallback(()=>{r(o=>o==="exiting"?"closed":o)},[])),i}function Iu(t,e,n){pe(()=>{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||jt.flushSync(()=>{n()})}).catch(()=>{}),()=>{i=!0}}},[t,e,n])}function nr(t,e,n){let[r,i]=d.useState(t||e),o=d.useRef(t!==void 0),a=t!==void 0;d.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=d.useCallback((u,...c)=>{let h=(p,...g)=>{n&&(Object.is(s,p)||n(p,...g)),a||(s=p)};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 f=u(a?s:g,...m);return h(f,...c),a?g:f})):(a||i(u),h(u,...c))},[a,s,n]);return[s,l]}function xo(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}const Za=Symbol("default");function rr({values:t,children:e}){for(let[n,r]of t)e=d.createElement(n.Provider,{value:r},e);return e}function yt(t){let{className:e,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=t;return d.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 la(t,e){let n=d.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[Za])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let i=e||Za;if(!n.slots[i])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[i]}return n}function ir(t,e,n){let r=la(n,t.slot)||{},{ref:i,...o}=r,a=xn(d.useMemo(()=>wu(e,i),[e,i])),s=ye(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},h=typeof t.style=="function"?t.style({...l,defaultStyle:c}):t.style;return{...c,...h}}:s.style={...o.style,...t.style}),[s,a]}function np(){let[t,e]=d.useState(!0),n=d.useRef(!1),r=d.useCallback(i=>{n.current=!0,e(!!i)},[]);return pe(()=>{n.current||e(!1)},[]),[r,t]}class ua{get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new ua(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 ca{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 ca,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 _u{*[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 qn extends _u{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof qn?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 qn?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 ua(e,`react-aria-${++n.nodeId}`),this.ownerDocument.startTransaction()}}class rp extends _u{get isConnected(){return this.isMounted}createElement(e){return new qn(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 qn&&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 ku(t){let{children:e,items:n,idScope:r,addIdAndValue:i,dependencies:o=[]}=t,a=d.useMemo(()=>new WeakMap,o);return d.useMemo(()=>{if(n&&typeof e=="function"){let u=[];for(let c of n){let h=a.get(c);if(!h){h=e(c);var s,l;let p=(l=(s=h.props.id)!==null&&s!==void 0?s:c.key)!==null&&l!==void 0?l:c.id;if(p==null)throw new Error("Could not determine key for item");r&&(p=r+":"+p),h=d.cloneElement(h,i?{key:p,id:p,value:c}:{key:p}),a.set(c,h)}u.push(h)}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 Vr=d.createContext(!1),ip=typeof DocumentFragment<"u"?new DocumentFragment:null;function op(t){let e=d.useContext(Vr),n=$n();if(e)return d.createElement(d.Fragment,null,t.children);let r=d.createElement(Vr.Provider,{value:!0},t.children);return n?d.createElement("template",{"data-react-aria-hidden":!0},r):jt.createPortal(r,ip)}function ap(t){let e=(n,r)=>d.useContext(Vr)?null:t(n,r);return e.displayName=t.displayName||t.name,d.forwardRef(e)}function sp(){return d.useContext(Vr)}const lp=typeof document<"u"?d.useLayoutEffect:()=>{};var hr={exports:{}},Ri={};/**
|
|
31
|
+
Check the top-level render call using <`+$+">."),V}var w=d,T=Symbol.for("react.transitional.element"),x=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),P=Symbol.for("react.strict_mode"),b=Symbol.for("react.profiler"),R=Symbol.for("react.consumer"),W=Symbol.for("react.context"),M=Symbol.for("react.forward_ref"),H=Symbol.for("react.suspense"),E=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),z=Symbol.for("react.lazy"),U=Symbol.for("react.offscreen"),Y=Symbol.iterator,K=Symbol.for("react.client.reference"),q=w.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,re=Object.prototype.hasOwnProperty,j=Object.assign,O=Symbol.for("react.client.reference"),k=Array.isArray,N=0,A,F,B,L,X,ee,de;r.__reactDisabledLog=!0;var ce,oe,ge=!1,ne=new(typeof WeakMap=="function"?WeakMap:Map),Ue=Symbol.for("react.client.reference"),st,ve={},Dn={},lr={};In.Fragment=I,In.jsx=function($,V,G,ie,Se){return m($,V,G,!1,ie,Se)},In.jsxs=function($,V,G,ie,Se){return m($,V,G,!0,ie,Se)}}()),In}var Ga;function ch(){return Ga||(Ga=1,process.env.NODE_ENV==="production"?cr.exports=lh():cr.exports=uh()),cr.exports}var D=ch();const dh={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"}}}},fh={components:dh},hh={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"}}},ph={components:hh},gh={},vh={};function Oi(t){return t&&typeof t=="object"&&!Array.isArray(t)}function Wr(t,...e){if(!e.length)return t;const n=e.shift();if(Oi(t)&&Oi(n))for(const r in n)Oi(n[r])?(t[r]||Object.assign(t,{[r]:{}}),Wr(t[r],n[r])):Object.assign(t,{[r]:n[r]});return Wr(t,...e)}function yu(){return{enUS:Wr(fh,gh),frFR:Wr(ph,vh)}}const mh=t=>{const e=yu();return D.jsx(mn.CunninghamProvider,{theme:"dsfr",customLocales:e,...t})},yh=({disabled:t,onClick:e})=>D.jsx(mn.Button,{disabled:t,className:"pro-connect-button",onClick:e}),pe=typeof document<"u"?d.useLayoutEffect:()=>{};function De(t){const e=d.useRef(null);return pe(()=>{e.current=t},[t]),d.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}function bh(t){let[e,n]=d.useState(t),r=d.useRef(null),i=De(()=>{if(!r.current)return;let a=r.current.next();if(a.done){r.current=null;return}e===a.value?i():n(a.value)});pe(()=>{r.current&&i()});let o=De(a=>{r.current=a(e),i()});return[e,o]}const Ur={prefix:String(Math.round(Math.random()*1e10)),current:0},bu=d.createContext(Ur),Sh=d.createContext(!1);let wh=!!(typeof window<"u"&&window.document&&window.document.createElement),Ii=new WeakMap;function Eh(t=!1){let e=d.useContext(bu),n=d.useRef(null);if(n.current===null&&!t){var r,i;let o=(i=d.__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=Ii.get(o);a==null?Ii.set(o,{id:e.current,state:o.memoizedState}):o.memoizedState!==a.state&&(e.current=a.id,Ii.delete(o))}n.current=++e.current}return n.current}function $h(t){let e=d.useContext(bu);e===Ur&&!wh&&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=Eh(!!t),r=e===Ur&&process.env.NODE_ENV==="test"?"react-aria":`react-aria${e.prefix}`;return t||`${r}-${n}`}function xh(t){let e=d.useId(),[n]=d.useState($n()),r=n||process.env.NODE_ENV==="test"?"react-aria":`react-aria${Ur.prefix}`;return t||`${r}-${e}`}const Ch=typeof d.useId=="function"?xh:$h;function Th(){return!1}function Dh(){return!0}function Ph(t){return()=>{}}function $n(){return typeof d.useSyncExternalStore=="function"?d.useSyncExternalStore(Ph,Th,Dh):d.useContext(Sh)}let Oh=!!(typeof window<"u"&&window.document&&window.document.createElement),ft=new Map;function tr(t){let[e,n]=d.useState(t),r=d.useRef(null),i=Ch(e),o=d.useCallback(a=>{r.current=a},[]);return Oh&&(ft.has(i)&&!ft.get(i).includes(o)?ft.set(i,[...ft.get(i),o]):ft.set(i,[o])),pe(()=>{let a=i;return()=>{ft.delete(a)}},[i]),d.useEffect(()=>{let a=r.current;a&&(r.current=null,n(a))}),i}function Ih(t,e){if(t===e)return t;let n=ft.get(t);if(n)return n.forEach(i=>i(e)),e;let r=ft.get(e);return r?(r.forEach(i=>i(t)),t):e}function _i(t=[]){let e=tr(),[n,r]=bh(e),i=d.useCallback(()=>{r(function*(){yield e,yield document.getElementById(e)?e:void 0})},[e,r]);return pe(i,[e,i,...t]),n}function Vn(...t){return(...e)=>{for(let n of t)typeof n=="function"&&n(...e)}}const Ae=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},yn=t=>t&&"window"in t&&t.window===t?t:Ae(t).defaultView||window;function Su(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=Su(t[e]))&&(r&&(r+=" "),r+=n)}else for(n in t)t[n]&&(r&&(r+=" "),r+=n);return r}function ot(){for(var t,e,n=0,r="",i=arguments.length;n<i;n++)(t=arguments[n])&&(e=Su(t))&&(r&&(r+=" "),r+=e);return r}function ye(...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]=Vn(o,a):(i==="className"||i==="UNSAFE_className")&&typeof o=="string"&&typeof a=="string"?e[i]=ot(o,a):i==="id"&&o&&a?e.id=Ih(o,a):e[i]=a!==void 0?a:o}}return e}function wu(...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 _h=new Set(["id"]),kh=new Set(["aria-label","aria-labelledby","aria-describedby","aria-details"]),Rh=new Set(["href","hrefLang","target","rel","download","ping","referrerPolicy"]),Nh=/^(data-.*)$/;function Be(t,e={}){let{labelable:n,isLink:r,propNames:i}=e,o={};for(const a in t)Object.prototype.hasOwnProperty.call(t,a)&&(_h.has(a)||n&&kh.has(a)||r&&Rh.has(a)||i!=null&&i.has(a)||Nh.test(a))&&(o[a]=t[a]);return o}function xt(t){if(Mh())t.focus({preventScroll:!0});else{let e=Ah(t);t.focus(),Kh(e)}}let dr=null;function Mh(){if(dr==null){dr=!1;try{document.createElement("div").focus({get preventScroll(){return dr=!0,!0}})}catch{}}return dr}function Ah(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 Kh(t){for(let{element:e,scrollTop:n,scrollLeft:r}of t)e.scrollTop=n,e.scrollLeft=r}function ci(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 aa(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 at(t){let e=null;return()=>(e==null&&(e=t()),e)}const It=at(function(){return aa(/^Mac/i)}),Lh=at(function(){return aa(/^iPhone/i)}),Eu=at(function(){return aa(/^iPad/i)||It()&&navigator.maxTouchPoints>1}),di=at(function(){return Lh()||Eu()}),Fh=at(function(){return It()||di()}),$u=at(function(){return ci(/AppleWebKit/i)&&!jh()}),jh=at(function(){return ci(/Chrome/i)}),xu=at(function(){return ci(/Android/i)}),zh=at(function(){return ci(/Firefox/i)}),Hh=d.createContext({isNative:!0,open:Wh,useHref:t=>t});function fi(){return d.useContext(Hh)}function _t(t,e,n=!0){var r,i;let{metaKey:o,ctrlKey:a,altKey:s,shiftKey:l}=e;zh()&&(!((i=window.event)===null||i===void 0||(r=i.type)===null||r===void 0)&&r.startsWith("key"))&&t.target==="_blank"&&(It()?o=!0:a=!0);let u=$u()&&It()&&!Eu()?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});_t.isOpening=n,xt(t),t.dispatchEvent(u),_t.isOpening=!1}_t.isOpening=!1;function Bh(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 Wh(t,e){Bh(t,n=>_t(n,e))}function Cu(t){let e=fi();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 nn=new Map,Eo=new Set;function qa(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{if(!t(r)||!r.target)return;let i=nn.get(r.target);i||(i=new Set,nn.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=nn.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),nn.delete(r.target)),nn.size===0)){for(let o of Eo)o();Eo.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?qa():document.addEventListener("DOMContentLoaded",qa));function Uh(t){requestAnimationFrame(()=>{nn.size===0?t():Eo.add(t)})}function Tu(){let t=d.useRef(new Map),e=d.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=d.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=d.useCallback(()=>{t.current.forEach((i,o)=>{n(i.eventTarget,i.type,o,i.options)})},[n]);return d.useEffect(()=>r,[r]),{addGlobalListener:e,removeGlobalListener:n,removeAllGlobalListeners:r}}function sa(t,e){let{id:n,"aria-label":r,"aria-labelledby":i}=t;return n=tr(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 xn(t){const e=d.useRef(null);return d.useMemo(()=>({get current(){return e.current},set current(n){e.current=n,typeof t=="function"?t(n):t&&(t.current=n)}}),[t])}function Ya(t,e){const n=d.useRef(!0),r=d.useRef(null);pe(()=>(n.current=!0,()=>{n.current=!1}),[]),pe(()=>{n.current?n.current=!1:(!r.current||e.some((i,o)=>!Object.is(i,r[o])))&&t(),r.current=e},e)}function Vh(){return typeof window.ResizeObserver<"u"}function Xa(t){const{ref:e,box:n,onResize:r}=t;d.useEffect(()=>{let i=e==null?void 0:e.current;if(i)if(Vh()){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 Gh(t,e){pe(()=>{if(t&&t.ref&&e)return t.ref.current=e.current,()=>{t.ref&&(t.ref.current=null)}})}function Gn(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(Gn(n,e)&&(n=n.parentElement);n&&!Gn(n,e);)n=n.parentElement;return n||document.scrollingElement||document.documentElement}function qh(t,e){const n=[];for(;t&&t!==document.documentElement;)Gn(t,e)&&n.push(t),t=t.parentElement;return n}let Yh=0;const ki=new Map;function Xh(t){let[e,n]=d.useState();return pe(()=>{if(!t)return;let r=ki.get(t);if(r)n(r.element.id);else{let i=`react-aria-description-${Yh++}`;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},ki.set(t,r)}return r.refCount++,()=>{r&&--r.refCount===0&&(r.element.remove(),ki.delete(t))}},[t]),{"aria-describedby":t?e:void 0}}function fr(t,e,n,r){let i=De(n),o=n==null;d.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 Pu(t,e){let n=Ja(t,e,"left"),r=Ja(t,e,"top"),i=e.offsetWidth,o=e.offsetHeight,a=t.scrollLeft,s=t.scrollTop,{borderTopWidth:l,borderLeftWidth:u,scrollPaddingTop:c,scrollPaddingRight:h,scrollPaddingBottom:p,scrollPaddingLeft:g}=getComputedStyle(t),m=a+parseInt(u,10),f=s+parseInt(l,10),v=m+t.clientWidth,y=f+t.clientHeight,S=parseInt(c,10)||0,w=parseInt(p,10)||0,T=parseInt(h,10)||0,x=parseInt(g,10)||0;n<=a+x?a=n-parseInt(u,10)-x:n+i>v-T&&(a+=n+i-v+T),r<=f+S?s=r-parseInt(l,10)-S:r+o>y-w&&(s+=r+o-y+w),t.scrollLeft=a,t.scrollTop=s}function Ja(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 Qa(t,e){if(t&&document.contains(t)){let a=document.scrollingElement||document.documentElement;if(window.getComputedStyle(a).overflow==="hidden"){let l=qh(t);for(let u of l)Pu(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:h}=t.getBoundingClientRect();if(Math.abs(l-c)>1||Math.abs(u-h)>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 $o(t){return t.mozInputSource===0&&t.isTrusted?!0:xu()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Jh(t){return!xu()&&t.width===0&&t.height===0||t.width===1&&t.height===1&&t.pressure===0&&t.detail===0&&t.pointerType==="mouse"}const Qh="react-aria-clear-focus",Zh="react-aria-focus",Ou="react-aria-update-activedescendant";function rn(t){return It()?t.metaKey:t.ctrlKey}function ep(t,e=!0){let[n,r]=d.useState(!0),i=n&&e;return pe(()=>{if(i&&t.current&&"getAnimations"in t.current)for(let o of t.current.getAnimations())o instanceof CSSTransition&&o.cancel()},[t,i]),Iu(t,i,d.useCallback(()=>r(!1),[])),i}function tp(t,e){let[n,r]=d.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 Iu(t,i,d.useCallback(()=>{r(o=>o==="exiting"?"closed":o)},[])),i}function Iu(t,e,n){pe(()=>{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||jt.flushSync(()=>{n()})}).catch(()=>{}),()=>{i=!0}}},[t,e,n])}function nr(t,e,n){let[r,i]=d.useState(t||e),o=d.useRef(t!==void 0),a=t!==void 0;d.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=d.useCallback((u,...c)=>{let h=(p,...g)=>{n&&(Object.is(s,p)||n(p,...g)),a||(s=p)};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 f=u(a?s:g,...m);return h(f,...c),a?g:f})):(a||i(u),h(u,...c))},[a,s,n]);return[s,l]}function xo(t,e=-1/0,n=1/0){return Math.min(Math.max(t,e),n)}const Za=Symbol("default");function rr({values:t,children:e}){for(let[n,r]of t)e=d.createElement(n.Provider,{value:r},e);return e}function yt(t){let{className:e,style:n,children:r,defaultClassName:i,defaultChildren:o,defaultStyle:a,values:s}=t;return d.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 la(t,e){let n=d.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[Za])throw new Error(`A slot prop is required. Valid slot names are ${r}.`);let i=e||Za;if(!n.slots[i])throw new Error(`Invalid slot "${e}". Valid slot names are ${r}.`);return n.slots[i]}return n}function ir(t,e,n){let r=la(n,t.slot)||{},{ref:i,...o}=r,a=xn(d.useMemo(()=>wu(e,i),[e,i])),s=ye(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},h=typeof t.style=="function"?t.style({...l,defaultStyle:c}):t.style;return{...c,...h}}:s.style={...o.style,...t.style}),[s,a]}function np(){let[t,e]=d.useState(!0),n=d.useRef(!1),r=d.useCallback(i=>{n.current=!0,e(!!i)},[]);return pe(()=>{n.current||e(!1)},[]),[r,t]}class ua{get childNodes(){throw new Error("childNodes is not supported")}clone(){let e=new ua(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 ca{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 ca,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 _u{*[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 qn extends _u{get index(){return this._index}set index(e){this._index=e,this.ownerDocument.markDirty(this)}get level(){return this.parentNode instanceof qn?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 qn?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 ua(e,`react-aria-${++n.nodeId}`),this.ownerDocument.startTransaction()}}class rp extends _u{get isConnected(){return this.isMounted}createElement(e){return new qn(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 qn&&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 ku(t){let{children:e,items:n,idScope:r,addIdAndValue:i,dependencies:o=[]}=t,a=d.useMemo(()=>new WeakMap,o);return d.useMemo(()=>{if(n&&typeof e=="function"){let u=[];for(let c of n){let h=a.get(c);if(!h){h=e(c);var s,l;let p=(l=(s=h.props.id)!==null&&s!==void 0?s:c.key)!==null&&l!==void 0?l:c.id;if(p==null)throw new Error("Could not determine key for item");r&&(p=r+":"+p),h=d.cloneElement(h,i?{key:p,id:p,value:c}:{key:p}),a.set(c,h)}u.push(h)}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 Vr=d.createContext(!1),ip=typeof DocumentFragment<"u"?new DocumentFragment:null;function op(t){let e=d.useContext(Vr),n=$n();if(e)return d.createElement(d.Fragment,null,t.children);let r=d.createElement(Vr.Provider,{value:!0},t.children);return n?d.createElement("template",{"data-react-aria-hidden":!0},r):jt.createPortal(r,ip)}function ap(t){let e=(n,r)=>d.useContext(Vr)?null:t(n,r);return e.displayName=t.displayName||t.name,d.forwardRef(e)}function sp(){return d.useContext(Vr)}const lp=typeof document<"u"?d.useLayoutEffect:()=>{};var hr={exports:{}},Ri={};/**
|
|
32
32
|
* @license React
|
|
33
33
|
* use-sync-external-store-shim.production.js
|
|
34
34
|
*
|
|
@@ -44,7 +44,7 @@ Check the top-level render call using <`+$+">."),V}var w=d,D=Symbol.for("react.t
|
|
|
44
44
|
*
|
|
45
45
|
* This source code is licensed under the MIT license found in the
|
|
46
46
|
* LICENSE file in the root directory of this source tree.
|
|
47
|
-
*/var ts;function cp(){return ts||(ts=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 f=m();if(!h){var v=m();o(f,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}v=a({inst:{value:f,getSnapshot:m}});var y=v[0].inst,S=v[1];return l(function(){y.value=f,y.getSnapshot=m,n(y)&&S({inst:y})},[g,f,m]),s(function(){return n(y)&&S({inst:y}),g(function(){n(y)&&S({inst:y})})},[g]),u(f),f}function n(g){var m=g.getSnapshot;g=g.value;try{var f=m();return!o(g,f)}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=d,o=typeof Object.is=="function"?Object.is:t,a=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,c=!1,h=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;Ni.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ni}var ns;function dp(){return ns||(ns=1,process.env.NODE_ENV==="production"?hr.exports=up():hr.exports=cp()),hr.exports}var da=dp();const Ru=d.createContext(!1),Yn=d.createContext(null);function Nu(t){if(d.useContext(Yn))return t.content;let{collection:n,document:r}=gp(t.createCollection);return d.createElement(d.Fragment,null,d.createElement(op,null,d.createElement(Yn.Provider,{value:r},t.content)),d.createElement(fp,{render:t.children,collection:n}))}function fp({collection:t,render:e}){return e(t)}function hp(t,e,n){let r=$n(),i=d.useRef(r);i.current=r;let o=d.useCallback(()=>i.current?n():e(),[e,n]);return da.useSyncExternalStore(t,o)}const pp=typeof d.useSyncExternalStore=="function"?d.useSyncExternalStore:hp;function gp(t){let[e]=d.useState(()=>new rp((t==null?void 0:t())||new ca)),n=d.useCallback(a=>e.subscribe(a),[e]),r=d.useCallback(()=>{let a=e.getCollection();return e.isSSR&&e.resetAfterSSR(),a},[e]),i=d.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),o=pp(n,r,i);return lp(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:o,document:e}}const Co=d.createContext(null);function vp(t,e,n,r,i,o){let a=d.useCallback(l=>{l==null||l.setProps(e,n,r,o)},[e,n,r,o]),s=d.useContext(Co);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?d.createElement(Co.Provider,{value:l},i):null}return d.createElement(t,{ref:a},i)}function fa(t,e){let n=({node:i})=>e(i.props,i.props.ref,i),r=d.forwardRef((i,o)=>{if(!d.useContext(Ru)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(i,o)}return vp(t,i,o,"children"in i?i.children:null,null,s=>d.createElement(n,{node:s}))});return r.displayName=e.name,r}function mp(t){return ku({...t,addIdAndValue:!0})}const rs=d.createContext(null);function Mu(t){let e=d.useContext(rs),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),i=mp({...t,idScope:r,dependencies:n});return d.useContext(Yn)&&(i=d.createElement(yp,null,i)),e=d.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),d.createElement(rs.Provider,{value:e},i)}function yp({children:t}){let e=d.useContext(Yn),n=d.useMemo(()=>d.createElement(Yn.Provider,{value:null},d.createElement(Ru.Provider,{value:!0},t)),[t]);return $n()?d.createElement(Co.Provider,{value:e},n):jt.createPortal(n,e)}const Pe=typeof document<"u"?d.useLayoutEffect:()=>{};function bp(t){const e=d.useRef(null);return Pe(()=>{e.current=t},[t]),d.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}const me=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},gt=t=>t&&"window"in t&&t.window===t?t:me(t).defaultView||window;function is(t){if(Sp())t.focus({preventScroll:!0});else{let e=wp(t);t.focus(),Ep(e)}}let pr=null;function Sp(){if(pr==null){pr=!1;try{document.createElement("div").focus({get preventScroll(){return pr=!0,!0}})}catch{}}return pr}function wp(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 Ep(t){for(let{element:e,scrollTop:n,scrollLeft:r}of t)e.scrollTop=n,e.scrollLeft=r}function Au(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 $p(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 ha(t){let e=null;return()=>(e==null&&(e=t()),e)}const xp=ha(function(){return $p(/^Mac/i)}),Cp=ha(function(){return Au(/Chrome/i)}),Ku=ha(function(){return Au(/Android/i)});let on=new Map,To=new Set;function os(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{if(!t(r)||!r.target)return;let i=on.get(r.target);i||(i=new Set,on.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=on.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),on.delete(r.target)),on.size===0)){for(let o of To)o();To.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?os():document.addEventListener("DOMContentLoaded",os));function Tp(t){requestAnimationFrame(()=>{on.size===0?t():To.add(t)})}function Dp(t){return t.mozInputSource===0&&t.isTrusted?!0:Ku()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Pp(t,e){return e.get?e.get.call(t):e.value}function Lu(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Op(t,e){var n=Lu(t,e,"get");return Pp(t,n)}function Ip(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _p(t,e,n){Ip(t,e),e.set(t,n)}function kp(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 as(t,e,n){var r=Lu(t,e,"set");return kp(t,r,n),n}let Rp=class{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 Fu(t){let e=d.useRef({isFocused:!1,observer:null});Pe(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=bp(r=>{t==null||t(r)});return d.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 Rp("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 Np(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:i}=t;const o=d.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),a=Fu(o),s=d.useCallback(l=>{const u=me(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 Cn=null,Do=new Set,Bn=new Map,kt=!1,Po=!1;const Mp={Tab:!0,Escape:!0};function pa(t,e){for(let n of Do)n(t,e)}function Ap(t){return!(t.metaKey||!xp()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Gr(t){kt=!0,Ap(t)&&(Cn="keyboard",pa("keyboard",t))}function Re(t){Cn="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(kt=!0,pa("pointer",t))}function ju(t){Dp(t)&&(kt=!0,Cn="virtual")}function zu(t){t.target===window||t.target===document||(!kt&&!Po&&(Cn="virtual",pa("virtual",t)),kt=!1,Po=!1)}function Hu(){kt=!1,Po=!0}function Oo(t){if(typeof window>"u"||Bn.get(gt(t)))return;const e=gt(t),n=me(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){kt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Gr,!0),n.addEventListener("keyup",Gr,!0),n.addEventListener("click",ju,!0),e.addEventListener("focus",zu,!0),e.addEventListener("blur",Hu,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Re,!0),n.addEventListener("pointermove",Re,!0),n.addEventListener("pointerup",Re,!0)):(n.addEventListener("mousedown",Re,!0),n.addEventListener("mousemove",Re,!0),n.addEventListener("mouseup",Re,!0)),e.addEventListener("beforeunload",()=>{Bu(t)},{once:!0}),Bn.set(e,{focus:r})}const Bu=(t,e)=>{const n=gt(t),r=me(t);e&&r.removeEventListener("DOMContentLoaded",e),Bn.has(n)&&(n.HTMLElement.prototype.focus=Bn.get(n).focus,r.removeEventListener("keydown",Gr,!0),r.removeEventListener("keyup",Gr,!0),r.removeEventListener("click",ju,!0),n.removeEventListener("focus",zu,!0),n.removeEventListener("blur",Hu,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Re,!0),r.removeEventListener("pointermove",Re,!0),r.removeEventListener("pointerup",Re,!0)):(r.removeEventListener("mousedown",Re,!0),r.removeEventListener("mousemove",Re,!0),r.removeEventListener("mouseup",Re,!0)),Bn.delete(n))};function Kp(t){const e=me(t);let n;return e.readyState!=="loading"?Oo(t):(n=()=>{Oo(t)},e.addEventListener("DOMContentLoaded",n)),()=>Bu(t,n)}typeof document<"u"&&Kp();function Wu(){return Cn!=="pointer"}function Uu(){return Cn}const Lp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Fp(t,e,n){var r;const i=typeof window<"u"?gt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,o=typeof window<"u"?gt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?gt(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?gt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return t=t||(n==null?void 0:n.target)instanceof i&&!Lp.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&&!Mp[n.key])}function jp(t,e,n){Oo(),d.useEffect(()=>{let r=(i,o)=>{Fp(!!(n!=null&&n.isTextInput),i,o)&&t(Wu())};return Do.add(r),()=>{Do.delete(r)}},e)}function zp(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=t,o=d.useRef({isFocusWithin:!1}),a=d.useCallback(u=>{o.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,o]),s=Fu(a),l=d.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}}}function qr(t){const e=me(t);if(Uu()==="virtual"){let n=e.activeElement;Tp(()=>{e.activeElement===n&&t.isConnected&&is(t)})}else is(t)}function Hp(t){const e=gt(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 Bp(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 Vu(t,e){return t.nodeName!=="#comment"&&Hp(t)&&Bp(t,e)&&(!t.parentElement||Vu(t.parentElement,t))}const ss=d.createContext(null),Io="react-aria-focus-scope-restore";let ae=null;function Gu(t){let{children:e,contain:n,restoreFocus:r,autoFocus:i}=t,o=d.useRef(null),a=d.useRef(null),s=d.useRef([]),{parentNode:l}=d.useContext(ss)||{},u=d.useMemo(()=>new ko({scopeRef:s}),[s]);Pe(()=>{let p=l||ue.root;if(ue.getTreeNode(p.scopeRef)&&ae&&!Yr(ae,p.scopeRef)){let g=ue.getTreeNode(ae);g&&(p=g)}p.addChild(u),ue.addNode(u)},[u,l]),Pe(()=>{let p=ue.getTreeNode(s);p&&(p.contain=!!n)},[n]),Pe(()=>{var p;let g=(p=o.current)===null||p===void 0?void 0:p.nextSibling,m=[],f=v=>v.stopPropagation();for(;g&&g!==a.current;)m.push(g),g.addEventListener(Io,f),g=g.nextSibling;return s.current=m,()=>{for(let v of m)v.removeEventListener(Io,f)}},[e]),Xp(s,r,n),Gp(s,n),Jp(s,r,n),Yp(s,i),d.useEffect(()=>{const p=me(s.current?s.current[0]:void 0).activeElement;let g=null;if(Le(p,s.current)){for(let m of ue.traverse())m.scopeRef&&Le(p,m.scopeRef.current)&&(g=m);g===ue.getTreeNode(s)&&(ae=g.scopeRef)}},[s]),Pe(()=>()=>{var p,g,m;let f=(m=(g=ue.getTreeNode(s))===null||g===void 0||(p=g.parent)===null||p===void 0?void 0:p.scopeRef)!==null&&m!==void 0?m:null;(s===ae||Yr(s,ae))&&(!f||ue.getTreeNode(f))&&(ae=f),ue.removeTreeNode(s)},[s]);let c=d.useMemo(()=>Wp(s),[]),h=d.useMemo(()=>({focusManager:c,parentNode:u}),[u,c]);return d.createElement(ss.Provider,{value:h},d.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:o}),e,d.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:a}))}function Wp(t){return{focusNext(e={}){let n=t.current,{from:r,tabbable:i,wrap:o,accept:a}=e,s=r||me(n[0]).activeElement,l=n[0].previousElementSibling,u=Ct(n),c=qe(u,{tabbable:i,accept:a},n);c.currentNode=Le(s,n)?s:l;let h=c.nextNode();return!h&&o&&(c.currentNode=l,h=c.nextNode()),h&&rt(h,!0),h},focusPrevious(e={}){let n=t.current,{from:r,tabbable:i,wrap:o,accept:a}=e,s=r||me(n[0]).activeElement,l=n[n.length-1].nextElementSibling,u=Ct(n),c=qe(u,{tabbable:i,accept:a},n);c.currentNode=Le(s,n)?s:l;let h=c.previousNode();return!h&&o&&(c.currentNode=l,h=c.previousNode()),h&&rt(h,!0),h},focusFirst(e={}){let n=t.current,{tabbable:r,accept:i}=e,o=Ct(n),a=qe(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=Ct(n),a=qe(o,{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let s=a.previousNode();return s&&rt(s,!0),s}}}const ga=["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"])'],Up=ga.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";ga.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Vp=ga.join(':not([hidden]):not([tabindex="-1"]),');function Ct(t){return t[0].parentElement}function Kn(t){let e=ue.getTreeNode(ae);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function Gp(t,e){let n=d.useRef(void 0),r=d.useRef(void 0);Pe(()=>{let i=t.current;if(!e){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const o=me(i?i[0]:void 0);let a=u=>{if(u.key!=="Tab"||u.altKey||u.ctrlKey||u.metaKey||!Kn(t)||u.isComposing)return;let c=o.activeElement,h=t.current;if(!h||!Le(c,h))return;let p=Ct(h),g=qe(p,{tabbable:!0},h);if(!c)return;g.currentNode=c;let m=u.shiftKey?g.previousNode():g.nextNode();m||(g.currentNode=u.shiftKey?h[h.length-1].nextElementSibling:h[0].previousElementSibling,m=u.shiftKey?g.previousNode():g.nextNode()),u.preventDefault(),m&&rt(m,!0)},s=u=>{(!ae||Yr(ae,t))&&Le(u.target,t.current)?(ae=t,n.current=u.target):Kn(t)&&!vt(u.target,t)?n.current?n.current.focus():ae&&ae.current&&_o(ae.current):Kn(t)&&(n.current=u.target)},l=u=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let c=Uu();if(!((c==="virtual"||c===null)&&Ku()&&Cp())&&o.activeElement&&Kn(t)&&!vt(o.activeElement,t))if(ae=t,o.body.contains(u.target)){var p;n.current=u.target,(p=n.current)===null||p===void 0||p.focus()}else ae.current&&_o(ae.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]),Pe(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function qu(t){return vt(t)}function Le(t,e){return!t||!e?!1:e.some(n=>n.contains(t))}function vt(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of ue.traverse(ue.getTreeNode(e)))if(n&&Le(t,n.current))return!0;return!1}function qp(t){return vt(t,ae)}function Yr(t,e){var n;let r=(n=ue.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{qr(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function Yu(t,e=!0){let n=t[0].previousElementSibling,r=Ct(t),i=qe(r,{tabbable:e},t);i.currentNode=n;let o=i.nextNode();return e&&!o&&(r=Ct(t),i=qe(r,{tabbable:!1},t),i.currentNode=n,o=i.nextNode()),o}function _o(t,e=!0){rt(Yu(t,e))}function Yp(t,e){const n=d.useRef(e);d.useEffect(()=>{if(n.current){ae=t;const r=me(t.current?t.current[0]:void 0);!Le(r.activeElement,ae.current)&&t.current&&_o(t.current)}n.current=!1},[t])}function Xp(t,e,n){Pe(()=>{if(e||n)return;let r=t.current;const i=me(r?r[0]:void 0);let o=a=>{let s=a.target;Le(s,t.current)?ae=t:qu(s)||(ae=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 ls(t){let e=ue.getTreeNode(ae);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return(e==null?void 0:e.scopeRef)===t}function Jp(t,e,n){const r=d.useRef(typeof document<"u"?me(t.current?t.current[0]:void 0).activeElement:null);Pe(()=>{let i=t.current;const o=me(i?i[0]:void 0);if(!e||n)return;let a=()=>{(!ae||Yr(ae,t))&&Le(o.activeElement,t.current)&&(ae=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]),Pe(()=>{const i=me(t.current?t.current[0]:void 0);if(!e)return;let o=a=>{if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey||!Kn(t)||a.isComposing)return;let s=i.activeElement;if(!vt(s,t)||!ls(t))return;let l=ue.getTreeNode(t);if(!l)return;let u=l.nodeToRestore,c=qe(i.body,{tabbable:!0});c.currentNode=s;let h=a.shiftKey?c.previousNode():c.nextNode();if((!u||!i.body.contains(u)||u===i.body)&&(u=void 0,l.nodeToRestore=void 0),(!h||!vt(h,t))&&u){c.currentNode=u;do h=a.shiftKey?c.previousNode():c.nextNode();while(vt(h,t));a.preventDefault(),a.stopPropagation(),h?rt(h,!0):qu(u)?rt(u,!0):s.blur()}};return n||i.addEventListener("keydown",o,!0),()=>{n||i.removeEventListener("keydown",o,!0)}},[t,e,n]),Pe(()=>{const i=me(t.current?t.current[0]:void 0);if(!e)return;let o=ue.getTreeNode(t);if(o){var a;return o.nodeToRestore=(a=r.current)!==null&&a!==void 0?a:void 0,()=>{let s=ue.getTreeNode(t);if(!s)return;let l=s.nodeToRestore;if(e&&l&&(i.activeElement&&vt(i.activeElement,t)||i.activeElement===i.body&&ls(t))){let u=ue.clone();requestAnimationFrame(()=>{if(i.activeElement===i.body){let c=u.getTreeNode(t);for(;c;){if(c.nodeToRestore&&c.nodeToRestore.isConnected){us(c.nodeToRestore);return}c=c.parent}for(c=u.getTreeNode(t);c;){if(c.scopeRef&&c.scopeRef.current&&ue.getTreeNode(c.scopeRef)){let h=Yu(c.scopeRef.current,!0);us(h);return}c=c.parent}}})}}}},[t,e])}function us(t){t.dispatchEvent(new CustomEvent(Io,{bubbles:!0,cancelable:!0}))&&rt(t)}function qe(t,e,n){let r=e!=null&&e.tabbable?Vp:Up,i=me(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)&&Vu(o)&&(!n||Le(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 va{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 ko({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&&Le(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 va;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 ko({scopeRef:null}),this.fastMap.set(null,this.root)}}class ko{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 ue=new va;function hi(t={}){let{autoFocus:e=!1,isTextInput:n,within:r}=t,i=d.useRef({isFocused:!1,isFocusVisible:e||Wu()}),[o,a]=d.useState(!1),[s,l]=d.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=d.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),c=d.useCallback(g=>{i.current.isFocused=g,a(g),u()},[u]);jp(g=>{i.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:h}=Np({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=zp({isDisabled:!r,onFocusWithinChange:c});return{isFocused:o,isFocusVisible:s,focusProps:r?p:h}}function Qp(t,e){let n=e==null?void 0:e.isDisabled,[r,i]=d.useState(!1);return Pe(()=>{if(t!=null&&t.current&&!n){let o=()=>{if(t.current){let s=qe(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}let ln="default",Ro="",kr=new WeakMap;function cs(t){if(di()){if(ln==="default"){const e=Ke(t);Ro=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}ln="disabled"}else(t instanceof HTMLElement||t instanceof SVGElement)&&(kr.set(t,t.style.userSelect),t.style.userSelect="none")}function gr(t){if(di()){if(ln!=="disabled")return;ln="restoring",setTimeout(()=>{Uh(()=>{if(ln==="restoring"){const e=Ke(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=Ro||""),Ro="",ln="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&kr.has(t)){let e=kr.get(t);t.style.userSelect==="none"&&(t.style.userSelect=e),t.getAttribute("style")===""&&t.removeAttribute("style"),kr.delete(t)}}const ma=d.createContext({register:()=>{}});ma.displayName="PressResponderContext";function Zp(t){let e=d.useContext(ma);if(e){let{register:n,...r}=e;t=ye(r,t),n()}return Gh(e,t.ref),t}var vr=new WeakMap;class mr{continuePropagation(){as(this,vr,!1)}get shouldStopPropagation(){return Op(this,vr)}constructor(e,n,r,i){_p(this,vr,{writable:!0,value:void 0}),as(this,vr,!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,h=null;r.clientX!=null&&r.clientY!=null&&(c=r.clientX,h=r.clientY),s&&(c!=null&&h!=null?(l=c-s.left,u=h-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 ds=Symbol("linkClicked");function ya(t){let{onPress:e,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:o,isDisabled:a,isPressed:s,preventFocusOnPress:l,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:c,ref:h,...p}=Zp(t),[g,m]=d.useState(!1),f=d.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:v,removeAllGlobalListeners:y}=Tu(),S=De((b,R)=>{let W=f.current;if(a||W.didFirePressStart)return!1;let M=!0;if(W.isTriggeringEvent=!0,r){let z=new mr("pressstart",R,b);r(z),M=z.shouldStopPropagation}return n&&n(!0),W.isTriggeringEvent=!1,W.didFirePressStart=!0,m(!0),M}),w=De((b,R,W=!0)=>{let M=f.current;if(!M.didFirePressStart)return!1;M.ignoreClickAfterPress=!0,M.didFirePressStart=!1,M.isTriggeringEvent=!0;let z=!0;if(i){let E=new mr("pressend",R,b);i(E),z=E.shouldStopPropagation}if(n&&n(!1),m(!1),e&&W&&!a){let E=new mr("press",R,b);e(E),z&&(z=E.shouldStopPropagation)}return M.isTriggeringEvent=!1,z}),D=De((b,R)=>{let W=f.current;if(a)return!1;if(o){W.isTriggeringEvent=!0;let M=new mr("pressup",R,b);return o(M),W.isTriggeringEvent=!1,M.shouldStopPropagation}return!0}),x=De(b=>{let R=f.current;R.isPressed&&R.target&&(R.isOverTarget&&R.pointerType!=null&&w(Qe(R.target,b),R.pointerType,!1),R.isPressed=!1,R.isOverTarget=!1,R.activePointerId=null,R.pointerType=null,y(),c||gr(R.target))}),I=De(b=>{u&&x(b)}),P=d.useMemo(()=>{let b=f.current,R={onKeyDown(M){if(Mi(M.nativeEvent,M.currentTarget)&&M.currentTarget.contains(M.target)){var z;hs(M.target,M.key)&&M.preventDefault();let E=!0;if(!b.isPressed&&!M.repeat){b.target=M.currentTarget,b.isPressed=!0,E=S(M,"keyboard");let k=M.currentTarget,H=U=>{Mi(U,k)&&!U.repeat&&k.contains(U.target)&&b.target&&D(Qe(b.target,U),"keyboard")};v(Ke(M.currentTarget),"keyup",Vn(H,W),!0)}E&&M.stopPropagation(),M.metaKey&&It()&&((z=b.metaKeyEvents)===null||z===void 0||z.set(M.key,M.nativeEvent))}else M.key==="Meta"&&(b.metaKeyEvents=new Map)},onClick(M){if(!(M&&!M.currentTarget.contains(M.target))&&M&&M.button===0&&!b.isTriggeringEvent&&!_t.isOpening){let z=!0;if(a&&M.preventDefault(),!b.ignoreClickAfterPress&&!b.ignoreEmulatedMouseEvents&&!b.isPressed&&(b.pointerType==="virtual"||$o(M.nativeEvent))){!a&&!l&&xt(M.currentTarget);let E=S(M,"virtual"),k=D(M,"virtual"),H=w(M,"virtual");z=E&&k&&H}b.ignoreEmulatedMouseEvents=!1,b.ignoreClickAfterPress=!1,z&&M.stopPropagation()}}},W=M=>{var z;if(b.isPressed&&b.target&&Mi(M,b.target)){var E;hs(M.target,M.key)&&M.preventDefault();let H=M.target;w(Qe(b.target,M),"keyboard",b.target.contains(H)),y(),M.key!=="Enter"&&ba(b.target)&&b.target.contains(H)&&!M[ds]&&(M[ds]=!0,_t(b.target,M,!1)),b.isPressed=!1,(E=b.metaKeyEvents)===null||E===void 0||E.delete(M.key)}else if(M.key==="Meta"&&(!((z=b.metaKeyEvents)===null||z===void 0)&&z.size)){var k;let H=b.metaKeyEvents;b.metaKeyEvents=void 0;for(let U of H.values())(k=b.target)===null||k===void 0||k.dispatchEvent(new KeyboardEvent("keyup",U))}};if(typeof PointerEvent<"u"){R.onPointerDown=k=>{if(k.button!==0||!k.currentTarget.contains(k.target))return;if(Jh(k.nativeEvent)){b.pointerType="virtual";return}Ki(k.currentTarget)&&k.preventDefault(),b.pointerType=k.pointerType;let H=!0;if(!b.isPressed){b.isPressed=!0,b.isOverTarget=!0,b.activePointerId=k.pointerId,b.target=k.currentTarget,!a&&!l&&xt(k.currentTarget),c||cs(b.target),H=S(k,b.pointerType);let U=k.target;"releasePointerCapture"in U&&U.releasePointerCapture(k.pointerId),v(Ke(k.currentTarget),"pointerup",M,!1),v(Ke(k.currentTarget),"pointercancel",E,!1)}H&&k.stopPropagation()},R.onMouseDown=k=>{k.currentTarget.contains(k.target)&&k.button===0&&(Ki(k.currentTarget)&&k.preventDefault(),k.stopPropagation())},R.onPointerUp=k=>{!k.currentTarget.contains(k.target)||b.pointerType==="virtual"||k.button===0&&D(k,b.pointerType||k.pointerType)},R.onPointerEnter=k=>{k.pointerId===b.activePointerId&&b.target&&!b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!0,S(Qe(b.target,k),b.pointerType))},R.onPointerLeave=k=>{k.pointerId===b.activePointerId&&b.target&&b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!1,w(Qe(b.target,k),b.pointerType,!1),I(k))};let M=k=>{k.pointerId===b.activePointerId&&b.isPressed&&k.button===0&&b.target&&(b.target.contains(k.target)&&b.pointerType!=null?w(Qe(b.target,k),b.pointerType):b.isOverTarget&&b.pointerType!=null&&w(Qe(b.target,k),b.pointerType,!1),b.isPressed=!1,b.isOverTarget=!1,b.activePointerId=null,b.pointerType=null,y(),c||gr(b.target),"ontouchend"in b.target&&k.pointerType!=="mouse"&&v(b.target,"touchend",z,{once:!0}))},z=k=>{Xu(k.currentTarget)&&k.preventDefault()},E=k=>{x(k)};R.onDragStart=k=>{k.currentTarget.contains(k.target)&&x(k)}}else{R.onMouseDown=E=>{if(E.button!==0||!E.currentTarget.contains(E.target))return;if(Ki(E.currentTarget)&&E.preventDefault(),b.ignoreEmulatedMouseEvents){E.stopPropagation();return}b.isPressed=!0,b.isOverTarget=!0,b.target=E.currentTarget,b.pointerType=$o(E.nativeEvent)?"virtual":"mouse",!a&&!l&&xt(E.currentTarget),S(E,b.pointerType)&&E.stopPropagation(),v(Ke(E.currentTarget),"mouseup",M,!1)},R.onMouseEnter=E=>{if(!E.currentTarget.contains(E.target))return;let k=!0;b.isPressed&&!b.ignoreEmulatedMouseEvents&&b.pointerType!=null&&(b.isOverTarget=!0,k=S(E,b.pointerType)),k&&E.stopPropagation()},R.onMouseLeave=E=>{if(!E.currentTarget.contains(E.target))return;let k=!0;b.isPressed&&!b.ignoreEmulatedMouseEvents&&b.pointerType!=null&&(b.isOverTarget=!1,k=w(E,b.pointerType,!1),I(E)),k&&E.stopPropagation()},R.onMouseUp=E=>{E.currentTarget.contains(E.target)&&!b.ignoreEmulatedMouseEvents&&E.button===0&&D(E,b.pointerType||"mouse")};let M=E=>{if(E.button===0){if(b.isPressed=!1,y(),b.ignoreEmulatedMouseEvents){b.ignoreEmulatedMouseEvents=!1;return}b.target&&Ai(E,b.target)&&b.pointerType!=null?w(Qe(b.target,E),b.pointerType):b.target&&b.isOverTarget&&b.pointerType!=null&&w(Qe(b.target,E),b.pointerType,!1),b.isOverTarget=!1}};R.onTouchStart=E=>{if(!E.currentTarget.contains(E.target))return;let k=eg(E.nativeEvent);if(!k)return;b.activePointerId=k.identifier,b.ignoreEmulatedMouseEvents=!0,b.isOverTarget=!0,b.isPressed=!0,b.target=E.currentTarget,b.pointerType="touch",!a&&!l&&xt(E.currentTarget),c||cs(b.target),S(ut(b.target,E),b.pointerType)&&E.stopPropagation(),v(yn(E.currentTarget),"scroll",z,!0)},R.onTouchMove=E=>{if(!E.currentTarget.contains(E.target))return;if(!b.isPressed){E.stopPropagation();return}let k=fs(E.nativeEvent,b.activePointerId),H=!0;k&&Ai(k,E.currentTarget)?!b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!0,H=S(ut(b.target,E),b.pointerType)):b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!1,H=w(ut(b.target,E),b.pointerType,!1),I(ut(b.target,E))),H&&E.stopPropagation()},R.onTouchEnd=E=>{if(!E.currentTarget.contains(E.target))return;if(!b.isPressed){E.stopPropagation();return}let k=fs(E.nativeEvent,b.activePointerId),H=!0;k&&Ai(k,E.currentTarget)&&b.pointerType!=null?(D(ut(b.target,E),b.pointerType),H=w(ut(b.target,E),b.pointerType)):b.isOverTarget&&b.pointerType!=null&&(H=w(ut(b.target,E),b.pointerType,!1)),H&&E.stopPropagation(),b.isPressed=!1,b.activePointerId=null,b.isOverTarget=!1,b.ignoreEmulatedMouseEvents=!0,b.target&&!c&&gr(b.target),y()},R.onTouchCancel=E=>{E.currentTarget.contains(E.target)&&(E.stopPropagation(),b.isPressed&&x(ut(b.target,E)))};let z=E=>{b.isPressed&&E.target.contains(b.target)&&x({currentTarget:b.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};R.onDragStart=E=>{E.currentTarget.contains(E.target)&&x(E)}}return R},[v,a,l,y,c,x,I,w,S,D]);return d.useEffect(()=>()=>{var b;c||gr((b=f.current.target)!==null&&b!==void 0?b:void 0)},[c]),{isPressed:s||g,pressProps:ye(p,P)}}function ba(t){return t.tagName==="A"&&t.hasAttribute("href")}function Mi(t,e){const{key:n,code:r}=t,i=e,o=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof yn(i).HTMLInputElement&&!Ju(i,n)||i instanceof yn(i).HTMLTextAreaElement||i.isContentEditable)&&!((o==="link"||!o&&ba(i))&&n!=="Enter")}function eg(t){const{targetTouches:e}=t;return e.length>0?e[0]:null}function fs(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 ut(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 tg(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 ng(t,e){return!(t.left>e.right||e.left>t.right||t.top>e.bottom||e.top>t.bottom)}function Ai(t,e){let n=e.getBoundingClientRect(),r=tg(t);return ng(n,r)}function Ki(t){return!(t instanceof HTMLElement)||!t.hasAttribute("draggable")}function Xu(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!ba(t)}function hs(t,e){return t instanceof HTMLInputElement?!Ju(t,e):Xu(t)}const rg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ju(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":rg.has(t.type)}function ig({children:t}){let e=d.useMemo(()=>({register:()=>{}}),[]);return d.createElement(ma.Provider,{value:e},t)}class og{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 Qu(t){let e=d.useRef({isFocused:!1,observer:null});pe(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=De(r=>{t==null||t(r)});return d.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 og("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 ag(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:i}=t;const o=d.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),a=Qu(o),s=d.useCallback(l=>{const u=Ke(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 Tn=null,sg=new Set,Wn=new Map,Rt=!1,No=!1;function Sa(t,e){for(let n of sg)n(t,e)}function lg(t){return!(t.metaKey||!It()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Xr(t){Rt=!0,lg(t)&&(Tn="keyboard",Sa("keyboard",t))}function Ne(t){Tn="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(Rt=!0,Sa("pointer",t))}function Zu(t){$o(t)&&(Rt=!0,Tn="virtual")}function ec(t){t.target===window||t.target===document||(!Rt&&!No&&(Tn="virtual",Sa("virtual",t)),Rt=!1,No=!1)}function tc(){Rt=!1,No=!0}function ps(t){if(typeof window>"u"||Wn.get(yn(t)))return;const e=yn(t),n=Ke(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Rt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Xr,!0),n.addEventListener("keyup",Xr,!0),n.addEventListener("click",Zu,!0),e.addEventListener("focus",ec,!0),e.addEventListener("blur",tc,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Ne,!0),n.addEventListener("pointermove",Ne,!0),n.addEventListener("pointerup",Ne,!0)):(n.addEventListener("mousedown",Ne,!0),n.addEventListener("mousemove",Ne,!0),n.addEventListener("mouseup",Ne,!0)),e.addEventListener("beforeunload",()=>{nc(t)},{once:!0}),Wn.set(e,{focus:r})}const nc=(t,e)=>{const n=yn(t),r=Ke(t);e&&r.removeEventListener("DOMContentLoaded",e),Wn.has(n)&&(n.HTMLElement.prototype.focus=Wn.get(n).focus,r.removeEventListener("keydown",Xr,!0),r.removeEventListener("keyup",Xr,!0),r.removeEventListener("click",Zu,!0),n.removeEventListener("focus",ec,!0),n.removeEventListener("blur",tc,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Ne,!0),r.removeEventListener("pointermove",Ne,!0),r.removeEventListener("pointerup",Ne,!0)):(r.removeEventListener("mousedown",Ne,!0),r.removeEventListener("mousemove",Ne,!0),r.removeEventListener("mouseup",Ne,!0)),Wn.delete(n))};function ug(t){const e=Ke(t);let n;return e.readyState!=="loading"?ps(t):(n=()=>{ps(t)},e.addEventListener("DOMContentLoaded",n)),()=>nc(t,n)}typeof document<"u"&&ug();function cg(){return Tn!=="pointer"}function gs(){return Tn}function rc(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=t,o=d.useRef({isFocusWithin:!1}),a=d.useCallback(u=>{o.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,o]),s=Qu(a),l=d.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 Jr=!1,Li=0;function Mo(){Jr=!0,setTimeout(()=>{Jr=!1},50)}function vs(t){t.pointerType==="touch"&&Mo()}function dg(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",vs):document.addEventListener("touchend",Mo),Li++,()=>{Li--,!(Li>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",vs):document.removeEventListener("touchend",Mo))}}function wa(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:i}=t,[o,a]=d.useState(!1),s=d.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d.useEffect(dg,[]);let{hoverProps:l,triggerHoverEnd:u}=d.useMemo(()=>{let c=(g,m)=>{if(s.pointerType=m,i||m==="touch"||s.isHovered||!g.currentTarget.contains(g.target))return;s.isHovered=!0;let f=g.currentTarget;s.target=f,e&&e({type:"hoverstart",target:f,pointerType:m}),n&&n(!0),a(!0)},h=(g,m)=>{if(s.pointerType="",s.target=null,m==="touch"||!s.isHovered)return;s.isHovered=!1;let f=g.currentTarget;r&&r({type:"hoverend",target:f,pointerType:m}),n&&n(!1),a(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=g=>{Jr&&g.pointerType==="mouse"||c(g,g.pointerType)},p.onPointerLeave=g=>{!i&&g.currentTarget.contains(g.target)&&h(g,g.pointerType)}):(p.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=g=>{!s.ignoreEmulatedMouseEvents&&!Jr&&c(g,"mouse"),s.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=g=>{!i&&g.currentTarget.contains(g.target)&&h(g,"mouse")}),{hoverProps:p,triggerHoverEnd:h}},[e,n,r,i,s]);return d.useEffect(()=>{i&&u({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:l,isHovered:o}}function fg(t){let{ref:e,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=t,o=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=De(l=>{n&&yr(l,e)&&(i&&i(l),o.current.isPointerDown=!0)}),s=De(l=>{n&&n(l)});d.useEffect(()=>{let l=o.current;if(r)return;const u=e.current,c=Ke(u);if(typeof PointerEvent<"u"){let h=p=>{l.isPointerDown&&yr(p,e)&&s(p),l.isPointerDown=!1};return c.addEventListener("pointerdown",a,!0),c.addEventListener("pointerup",h,!0),()=>{c.removeEventListener("pointerdown",a,!0),c.removeEventListener("pointerup",h,!0)}}else{let h=g=>{l.ignoreEmulatedMouseEvents?l.ignoreEmulatedMouseEvents=!1:l.isPointerDown&&yr(g,e)&&s(g),l.isPointerDown=!1},p=g=>{l.ignoreEmulatedMouseEvents=!0,l.isPointerDown&&yr(g,e)&&s(g),l.isPointerDown=!1};return c.addEventListener("mousedown",a,!0),c.addEventListener("mouseup",h,!0),c.addEventListener("touchstart",a,!0),c.addEventListener("touchend",p,!0),()=>{c.removeEventListener("mousedown",a,!0),c.removeEventListener("mouseup",h,!0),c.removeEventListener("touchstart",a,!0),c.removeEventListener("touchend",p,!0)}}},[e,r,a,s])}function yr(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 ms(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 hg(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:ms(t.onKeyDown),onKeyUp:ms(t.onKeyUp)}}}const pg=500;function gg(t){let{isDisabled:e,onLongPressStart:n,onLongPressEnd:r,onLongPress:i,threshold:o=pg,accessibilityDescription:a}=t;const s=d.useRef(void 0);let{addGlobalListener:l,removeGlobalListener:u}=Tu(),{pressProps:c}=ya({isDisabled:e,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(n&&n({...p,type:"longpressstart"}),s.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),i&&i({...p,type:"longpress"}),s.current=void 0},o),p.pointerType==="touch")){let g=m=>{m.preventDefault()};l(p.target,"contextmenu",g,{once:!0}),l(window,"pointerup",()=>{setTimeout(()=>{u(p.target,"contextmenu",g)},30)},{once:!0})}},onPressEnd(p){s.current&&clearTimeout(s.current),r&&(p.pointerType==="mouse"||p.pointerType==="touch")&&r({...p,type:"longpressend"})}}),h=Xh(i&&!e?a:void 0);return{longPressProps:ye(c,h)}}const vg=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),mg=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function yg(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 vg.has(n.script)}let e=t.split("-")[0];return mg.has(e)}const bg=Symbol.for("react-aria.i18n.locale");function ic(){let t=typeof window<"u"&&window[bg]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:yg(t)?"rtl":"ltr"}}let Ao=ic(),Ln=new Set;function ys(){Ao=ic();for(let t of Ln)t(Ao)}function Sg(){let t=$n(),[e,n]=d.useState(Ao);return d.useEffect(()=>(Ln.size===0&&window.addEventListener("languagechange",ys),Ln.add(n),()=>{Ln.delete(n),Ln.size===0&&window.removeEventListener("languagechange",ys)}),[]),t?{locale:"en-US",direction:"ltr"}:e}const wg=d.createContext(null);function or(){let t=Sg();return d.useContext(wg)||t}var Ge=function(){return Ge=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},Ge.apply(this,arguments)};function oc(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 Eg(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 $g=Symbol.for("react-aria.i18n.locale"),xg=Symbol.for("react-aria.i18n.strings");let Wt;class pi{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=Cg(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[$g];if(Wt===void 0){let i=window[xg];if(!i)return null;Wt={};for(let o in i)Wt[o]=new pi({[n]:i[o]},n)}let r=Wt==null?void 0:Wt[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 Cg(t,e,n="en-US"){if(e[t])return e[t];let r=Tg(t);if(e[r])return e[r];for(let i in e)if(i.startsWith(r+"-"))return e[i];return e[n]}function Tg(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}const bs=new Map,Ss=new Map;class Dg{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=bs.get(o);a||(a=new Intl.PluralRules(this.locale,{type:r}),bs.set(o,a));let s=a.select(e);return i=n[s]||n.other,typeof i=="function"?i():i}number(e){let n=Ss.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),Ss.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 ws=new WeakMap;function Pg(t){let e=ws.get(t);return e||(e=new pi(t),ws.set(t,e)),e}function Og(t,e){return e&&pi.getGlobalDictionaryForPackage(e)||Pg(t)}function Ig(t,e){let{locale:n}=or(),r=Og(t,e);return d.useMemo(()=>new Dg(n,r),[n,r])}let Fi=new Map;function _g(t){let{locale:e}=or(),n=e+(t?Object.entries(t).sort((i,o)=>i[0]<o[0]?-1:1).join():"");if(Fi.has(n))return Fi.get(n);let r=new Intl.Collator(e,t);return Fi.set(n,r),r}const Es={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 kg(t={}){let{style:e,isFocusable:n}=t,[r,i]=d.useState(!1),{focusWithinProps:o}=rc({isDisabled:!n,onFocusWithinChange:s=>i(s)}),a=d.useMemo(()=>r?e:e?{...Es,...e}:Es,[r]);return{visuallyHiddenProps:{...o,style:a}}}function Rg(t){let{children:e,elementType:n="div",isFocusable:r,style:i,...o}=t,{visuallyHiddenProps:a}=kg(t);return d.createElement(n,ye(o,a),e)}const Ye={top:"top",bottom:"top",left:"left",right:"left"},Qr={top:"bottom",bottom:"top",left:"right",right:"left"},Ng={top:"left",left:"top"},Ko={top:"height",left:"width"},ac={width:"totalWidth",height:"totalHeight"},br={};let fe=typeof document<"u"?window.visualViewport:null;function $s(t){let e=0,n=0,r=0,i=0,o=0,a=0,s={};var l;let u=((l=fe==null?void 0:fe.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=fe==null?void 0:fe.width)!==null&&c!==void 0?c:r;var h;n=(h=fe==null?void 0:fe.height)!==null&&h!==void 0?h:i,s.top=m.scrollTop||t.scrollTop,s.left=m.scrollLeft||t.scrollLeft,fe&&(o=fe.offsetTop,a=fe.offsetLeft)}else({width:e,height:n,top:o,left:a}=fn(t)),s.top=t.scrollTop,s.left=t.scrollLeft,r=e,i=n;if($u()&&(t.tagName==="BODY"||t.tagName==="HTML")&&u){s.top=0,s.left=0;var p;o=(p=fe==null?void 0:fe.pageTop)!==null&&p!==void 0?p:0;var g;a=(g=fe==null?void 0:fe.pageLeft)!==null&&g!==void 0?g:0}return{width:e,height:n,totalWidth:r,totalHeight:i,scroll:s,top:o,left:a}}function Mg(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function xs(t,e,n,r,i,o,a){var s;let l=(s=i.scroll[t])!==null&&s!==void 0?s:0,u=r[Ko[t]],c=r.scroll[Ye[t]]+o,h=u+r.scroll[Ye[t]]-o,p=e-l+a[t]-r[Ye[t]],g=e-l+n+a[t]-r[Ye[t]];return p<c?c-p:g>h?Math.max(h-g,c-p):0}function Ag(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 Cs(t){if(br[t])return br[t];let[e,n]=t.split(" "),r=Ye[e]||"right",i=Ng[r];Ye[n]||(n="center");let o=Ko[r],a=Ko[i];return br[t]={placement:e,crossPlacement:n,axis:r,crossAxis:i,size:o,crossSize:a},br[t]}function ji(t,e,n,r,i,o,a,s,l,u){let{placement:c,crossPlacement:h,axis:p,crossAxis:g,size:m,crossSize:f}=r,v={};var y;v[g]=(y=t[g])!==null&&y!==void 0?y:0;var S,w,D,x;h==="center"?v[g]+=(((S=t[f])!==null&&S!==void 0?S:0)-((w=n[f])!==null&&w!==void 0?w:0))/2:h!==g&&(v[g]+=((D=t[f])!==null&&D!==void 0?D:0)-((x=n[f])!==null&&x!==void 0?x:0)),v[g]+=o;const I=t[g]-n[f]+l+u,P=t[g]+t[f]-l-u;if(v[g]=xo(v[g],I,P),c===p){const b=s?a[m]:e[ac[m]];v[Qr[p]]=Math.floor(b-t[p]+i)}else v[p]=Math.floor(t[p]+t[m]+i);return v}function Kg(t,e,n,r,i,o,a,s){const l=r?n.height:e[ac.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 h,p,g,m,f,v;let y=s!=="top"?Math.max(0,e.height+e.top+((h=e.scroll.top)!==null&&h!==void 0?h:0)-c-(((p=i.top)!==null&&p!==void 0?p: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))-(((f=i.top)!==null&&f!==void 0?f:0)+((v=i.bottom)!==null&&v!==void 0?v:0)+o));return Math.min(e.height-o*2,y)}function Ts(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[Qr[s]]-i);var h;return Math.max(0,t[l]+t[s]+t.scroll[s]-e[s]-n[s]-n[l]-((h=r[s])!==null&&h!==void 0?h:0)-r[Qr[s]]-i)}function Lg(t,e,n,r,i,o,a,s,l,u,c,h,p,g,m,f){let v=Cs(t),{size:y,crossAxis:S,crossSize:w,placement:D,crossPlacement:x}=v,I=ji(e,s,n,v,c,h,u,p,m,f),P=c,b=Ts(s,u,e,i,o+c,v);if(a&&r[y]>b){let N=Cs(`${Qr[D]} ${x}`),A=ji(e,s,n,N,c,h,u,p,m,f);Ts(s,u,e,i,o+c,N)>b&&(v=N,I=A,P=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 W=xs(S,I[S],n[w],s,l,o,u);I[S]+=W;let M=Kg(I,s,u,p,i,o,n.height,R);g&&g<M&&(M=g),n.height=Math.min(n.height,M),I=ji(e,s,n,v,P,h,u,p,m,f),W=xs(S,I[S],n[w],s,l,o,u),I[S]+=W;let z={},E=e[S]+.5*e[w]-I[S]-i[Ye[S]];const k=m/2+f;var H,U,Y,K;const q=Ye[S]==="left"?((H=i.left)!==null&&H!==void 0?H:0)+((U=i.right)!==null&&U!==void 0?U:0):((Y=i.top)!==null&&Y!==void 0?Y:0)+((K=i.bottom)!==null&&K!==void 0?K:0),re=n[w]-q-m/2-f,j=e[S]+m/2-(I[S]+i[Ye[S]]),O=e[S]+e[w]-m/2-(I[S]+i[Ye[S]]),_=xo(E,j,O);return z[S]=xo(_,k,re),{position:I,maxHeight:M,arrowOffsetLeft:z.left,arrowOffsetTop:z.top,placement:v.placement}}function Fg(t){let{placement:e,targetNode:n,overlayNode:r,scrollNode:i,padding:o,shouldFlip:a,boundaryElement:s,offset:l,crossOffset:u,maxHeight:c,arrowSize:h=0,arrowBoundaryOffset:p=0}=t,g=r instanceof HTMLElement?jg(r):document.documentElement,m=g===document.documentElement;const f=window.getComputedStyle(g).position;let v=!!f&&f!=="static",y=m?fn(n):Ds(n,g);if(!m){let{marginTop:z,marginLeft:E}=window.getComputedStyle(n);y.top+=parseInt(z,10)||0,y.left+=parseInt(E,10)||0}let S=fn(r),w=Ag(r);var D,x;S.width+=((D=w.left)!==null&&D!==void 0?D:0)+((x=w.right)!==null&&x!==void 0?x:0);var I,P;S.height+=((I=w.top)!==null&&I!==void 0?I:0)+((P=w.bottom)!==null&&P!==void 0?P:0);let b=Mg(i),R=$s(s),W=$s(g),M=s.tagName==="BODY"?fn(g):Ds(g,s);return g.tagName==="HTML"&&s.tagName==="BODY"&&(W.scroll.top=0,W.scroll.left=0),Lg(e,y,S,b,w,o,a,R,W,M,l,u,v,c,h,p)}function fn(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 Ds(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=fn(t);let i=fn(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 jg(t){let e=t.offsetParent;if(e&&e===document.body&&window.getComputedStyle(e).position==="static"&&!Ps(e)&&(e=document.documentElement),e==null)for(e=t.parentElement;e&&!Ps(e);)e=e.parentElement;return e||document.documentElement}function Ps(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 zg=new WeakMap;function Hg(t){let{triggerRef:e,isOpen:n,onClose:r}=t;d.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||zg.get(e.current);s&&s()};return window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("scroll",i,!0)}},[n,r,e])}let le=typeof document<"u"?window.visualViewport:null;function Bg(t){let{direction:e}=or(),{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:h=0,shouldUpdatePosition:p=!0,isOpen:g=!0,onClose:m,maxHeight:f,arrowBoundaryOffset:v=0}=t,[y,S]=d.useState(null),w=[p,a,i.current,r.current,o.current,s,l,u,c,h,g,e,f,v,n],D=d.useRef(le==null?void 0:le.scale);d.useEffect(()=>{g&&(D.current=le==null?void 0:le.scale)},[g]);let x=d.useCallback(()=>{if(p===!1||!g||!i.current||!r.current||!u||(le==null?void 0:le.scale)!==D.current)return;let W=null;if(o.current&&o.current.contains(document.activeElement)){var M;let K=(M=document.activeElement)===null||M===void 0?void 0:M.getBoundingClientRect(),q=o.current.getBoundingClientRect();var z;if(W={type:"top",offset:((z=K==null?void 0:K.top)!==null&&z!==void 0?z:0)-q.top},W.offset>q.height/2){W.type="bottom";var E;W.offset=((E=K==null?void 0:K.bottom)!==null&&E!==void 0?E:0)-q.bottom}}let k=i.current;if(!f&&i.current){var H;k.style.top="0px",k.style.bottom="";var U;k.style.maxHeight=((U=(H=window.visualViewport)===null||H===void 0?void 0:H.height)!==null&&U!==void 0?U:window.innerHeight)+"px"}let Y=Fg({placement:Ug(a,e),overlayNode:i.current,targetNode:r.current,scrollNode:o.current||i.current,padding:s,shouldFlip:l,boundaryElement:u,offset:c,crossOffset:h,maxHeight:f,arrowSize:n,arrowBoundaryOffset:v});if(Y.position){if(k.style.top="",k.style.bottom="",k.style.left="",k.style.right="",Object.keys(Y.position).forEach(K=>k.style[K]=Y.position[K]+"px"),k.style.maxHeight=Y.maxHeight!=null?Y.maxHeight+"px":"",W&&document.activeElement&&o.current){let K=document.activeElement.getBoundingClientRect(),q=o.current.getBoundingClientRect(),re=K[W.type]-q[W.type];o.current.scrollTop+=re-W.offset}S(Y)}},w);pe(x,w),Wg(x),Xa({ref:i,onResize:x}),Xa({ref:r,onResize:x});let I=d.useRef(!1);pe(()=>{let W,M=()=>{I.current=!0,clearTimeout(W),W=setTimeout(()=>{I.current=!1},500),x()},z=()=>{I.current&&M()};return le==null||le.addEventListener("resize",M),le==null||le.addEventListener("scroll",z),()=>{le==null||le.removeEventListener("resize",M),le==null||le.removeEventListener("scroll",z)}},[x]);let P=d.useCallback(()=>{I.current||m==null||m()},[m,I]);Hg({triggerRef:r,isOpen:g,onClose:m&&P});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:x}}function Wg(t){pe(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function Ug(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}const Ze=[];function Vg(t,e){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:o=!1,isKeyboardDismissDisabled:a=!1,shouldCloseOnInteractOutside:s}=t;d.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())},h=m=>{m.key==="Escape"&&!a&&!m.nativeEvent.isComposing&&(m.stopPropagation(),m.preventDefault(),l())};fg({ref:e,onInteractOutside:o&&i?c:void 0,onInteractOutsideStart:u});let{focusWithinProps:p}=rc({isDisabled:!r,onBlurWithin:m=>{!m.relatedTarget||qp(m.relatedTarget)||(!s||s(m.relatedTarget))&&(n==null||n())}}),g=m=>{m.target===m.currentTarget&&m.preventDefault()};return{overlayProps:{onKeyDown:h,...p},underlayProps:{onPointerDown:g}}}const zi=typeof document<"u"&&window.visualViewport,Gg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Sr=0,Hi;function qg(t={}){let{isDisabled:e}=t;pe(()=>{if(!e)return Sr++,Sr===1&&(di()?Hi=Xg():Hi=Yg()),()=>{Sr--,Sr===0&&Hi()}},[e])}function Yg(){return Vn(un(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),un(document.documentElement,"overflow","hidden"))}function Xg(){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=un(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;Jg(c)&&(s(),c.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{c.style.transform="",zi&&(zi.height<window.innerHeight?requestAnimationFrame(()=>{Os(c)}):zi.addEventListener("resize",()=>Os(c),{once:!0}))}))},a=null,s=()=>{if(a)return;let u=()=>{window.scrollTo(0,0)},c=window.pageXOffset,h=window.pageYOffset;a=Vn(_n(window,"scroll",u),un(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),un(document.documentElement,"overflow","hidden"),un(document.body,"marginTop",`-${h}px`),()=>{window.scrollTo(c,h)}),window.scrollTo(0,0)},l=Vn(_n(document,"touchstart",n,{passive:!1,capture:!0}),_n(document,"touchmove",r,{passive:!1,capture:!0}),_n(document,"touchend",i,{passive:!1,capture:!0}),_n(document,"focus",o,!0));return()=>{e==null||e(),a==null||a(),l()}}function un(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function _n(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function Os(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 Jg(t){return t instanceof HTMLInputElement&&!Gg.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}var sc={};sc={dismiss:"تجاهل"};var lc={};lc={dismiss:"Отхвърляне"};var uc={};uc={dismiss:"Odstranit"};var cc={};cc={dismiss:"Luk"};var dc={};dc={dismiss:"Schließen"};var fc={};fc={dismiss:"Απόρριψη"};var hc={};hc={dismiss:"Dismiss"};var pc={};pc={dismiss:"Descartar"};var gc={};gc={dismiss:"Lõpeta"};var vc={};vc={dismiss:"Hylkää"};var mc={};mc={dismiss:"Rejeter"};var yc={};yc={dismiss:"התעלם"};var bc={};bc={dismiss:"Odbaci"};var Sc={};Sc={dismiss:"Elutasítás"};var wc={};wc={dismiss:"Ignora"};var Ec={};Ec={dismiss:"閉じる"};var $c={};$c={dismiss:"무시"};var xc={};xc={dismiss:"Atmesti"};var Cc={};Cc={dismiss:"Nerādīt"};var Tc={};Tc={dismiss:"Lukk"};var Dc={};Dc={dismiss:"Negeren"};var Pc={};Pc={dismiss:"Zignoruj"};var Oc={};Oc={dismiss:"Descartar"};var Ic={};Ic={dismiss:"Dispensar"};var _c={};_c={dismiss:"Revocare"};var kc={};kc={dismiss:"Пропустить"};var Rc={};Rc={dismiss:"Zrušiť"};var Nc={};Nc={dismiss:"Opusti"};var Mc={};Mc={dismiss:"Odbaci"};var Ac={};Ac={dismiss:"Avvisa"};var Kc={};Kc={dismiss:"Kapat"};var Lc={};Lc={dismiss:"Скасувати"};var Fc={};Fc={dismiss:"取消"};var jc={};jc={dismiss:"關閉"};var zc={};zc={"ar-AE":sc,"bg-BG":lc,"cs-CZ":uc,"da-DK":cc,"de-DE":dc,"el-GR":fc,"en-US":hc,"es-ES":pc,"et-EE":gc,"fi-FI":vc,"fr-FR":mc,"he-IL":yc,"hr-HR":bc,"hu-HU":Sc,"it-IT":wc,"ja-JP":Ec,"ko-KR":$c,"lt-LT":xc,"lv-LV":Cc,"nb-NO":Tc,"nl-NL":Dc,"pl-PL":Pc,"pt-BR":Oc,"pt-PT":Ic,"ro-RO":_c,"ru-RU":kc,"sk-SK":Rc,"sl-SI":Nc,"sr-SP":Mc,"sv-SE":Ac,"tr-TR":Kc,"uk-UA":Lc,"zh-CN":Fc,"zh-TW":jc};function Qg(t){return t&&t.__esModule?t.default:t}function Is(t){let{onDismiss:e,...n}=t,r=Ig(Qg(zc),"@react-aria/overlays"),i=sa(n,r.format("dismiss")),o=()=>{e&&e()};return d.createElement(Rg,null,d.createElement("button",{...i,tabIndex:-1,onClick:o,style:{width:1,height:1}}))}let kn=new WeakMap,Ie=[];function Zg(t,e=document.body){let n=new Set(t),r=new Set,i=l=>{for(let p of l.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(p);let u=p=>{if(n.has(p)||p.parentElement&&r.has(p.parentElement)&&p.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let g of n)if(p.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),h=u(l);if(h===NodeFilter.FILTER_ACCEPT&&o(l),h!==NodeFilter.FILTER_REJECT){let p=c.nextNode();for(;p!=null;)o(p),p=c.nextNode()}},o=l=>{var u;let c=(u=kn.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),kn.set(l,c+1))};Ie.length&&Ie[Ie.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 Ie.push(s),()=>{a.disconnect();for(let l of r){let u=kn.get(l);u!=null&&(u===1?(l.removeAttribute("aria-hidden"),kn.delete(l)):kn.set(l,u-1))}s===Ie[Ie.length-1]?(Ie.pop(),Ie.length&&Ie[Ie.length-1].observe()):Ie.splice(Ie.indexOf(s),1)}}function ev(t,e){let{triggerRef:n,popoverRef:r,isNonModal:i,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:a,...s}=t,{overlayProps:l,underlayProps:u}=Vg({isOpen:e.isOpen&&!s["data-react-aria-top-layer"],onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!i,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:a},r),{overlayProps:c,arrowProps:h,placement:p}=Bg({...s,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:i?e.close:null});return qg({isDisabled:i||!e.isOpen}),pe(()=>{if(e.isOpen&&!i&&r.current)return Zg([r.current])},[i,e.isOpen,r]),{popoverProps:ye(l,c),arrowProps:h,underlayProps:u,placement:p}}const tv=d.createContext({});function nv(){var t;return(t=d.useContext(tv))!==null&&t!==void 0?t:{}}const rv=d.createContext(null);function iv(t){let e=$n(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[i,o]=d.useState(!1),a=d.useMemo(()=>({contain:i,setContain:o}),[i,o]),{getContainer:s}=nv();if(!t.portalContainer&&s&&(n=s()),!n)return null;let l=t.children;return t.disableFocusManagement||(l=d.createElement(Gu,{restoreFocus:!0,contain:i&&!r},l)),l=d.createElement(rv.Provider,{value:a},d.createElement(ig,null,l)),jt.createPortal(l,n)}function Lo(t){return Fh()?t.altKey:t.ctrlKey}const ov=1e3;function av(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,i=d.useRef({search:"",timeout:void 0}).current,o=a=>{let s=sv(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=""},ov)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?o:void 0}}}function sv(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function Hc(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:h=!1,isVirtualized:p,scrollRef:g=r,linkBehavior:m="action"}=t,{direction:f}=or(),v=fi(),y=E=>{var k;if(E.altKey&&E.key==="Tab"&&E.preventDefault(),!(!((k=r.current)===null||k===void 0)&&k.contains(E.target)))return;const H=(L,X)=>{if(L!=null){if(e.isLink(L)&&m==="selection"&&l&&!Lo(E)){var ee;jt.flushSync(()=>{e.setFocusedKey(L,X)});let de=(ee=g.current)===null||ee===void 0?void 0:ee.querySelector(`[data-key="${CSS.escape(L.toString())}"]`),ce=e.getItemProps(L);de&&v.open(de,E,ce.href,ce.routerOptions);return}if(e.setFocusedKey(L,X),e.isLink(L)&&m==="override")return;E.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):l&&!Lo(E)&&e.replaceSelection(L)}};switch(E.key){case"ArrowDown":if(n.getKeyBelow){var U,Y,K;let L=e.focusedKey!=null?(U=n.getKeyBelow)===null||U===void 0?void 0:U.call(n,e.focusedKey):(Y=n.getFirstKey)===null||Y===void 0?void 0:Y.call(n);L==null&&o&&(L=(K=n.getFirstKey)===null||K===void 0?void 0:K.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),H(L))}break;case"ArrowUp":if(n.getKeyAbove){var q,re,j;let L=e.focusedKey!=null?(q=n.getKeyAbove)===null||q===void 0?void 0:q.call(n,e.focusedKey):(re=n.getLastKey)===null||re===void 0?void 0:re.call(n);L==null&&o&&(L=(j=n.getLastKey)===null||j===void 0?void 0:j.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),H(L))}break;case"ArrowLeft":if(n.getKeyLeftOf){var O,_,N;let L=e.focusedKey!=null?(O=n.getKeyLeftOf)===null||O===void 0?void 0:O.call(n,e.focusedKey):null;L==null&&o&&(L=f==="rtl"?(_=n.getFirstKey)===null||_===void 0?void 0:_.call(n,e.focusedKey):(N=n.getLastKey)===null||N===void 0?void 0:N.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),H(L,f==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var A,F,B;let L=e.focusedKey!=null?(A=n.getKeyRightOf)===null||A===void 0?void 0:A.call(n,e.focusedKey):null;L==null&&o&&(L=f==="rtl"?(F=n.getLastKey)===null||F===void 0?void 0:F.call(n,e.focusedKey):(B=n.getFirstKey)===null||B===void 0?void 0:B.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),H(L,f==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&E.shiftKey)return;E.preventDefault();let L=n.getFirstKey(e.focusedKey,rn(E));e.setFocusedKey(L),L!=null&&(rn(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,rn(E));e.setFocusedKey(L),L!=null&&(rn(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(),H(L))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let L=n.getKeyPageAbove(e.focusedKey);L!=null&&(E.preventDefault(),H(L))}break;case"a":rn(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(!h){if(E.shiftKey)r.current.focus();else{let L=qe(r.current,{tabbable:!0}),X,ee;do ee=L.lastChild(),ee&&(X=ee);while(ee);X&&!X.contains(document.activeElement)&&xt(X)}break}}},S=d.useRef({top:0,left:0});fr(g,"scroll",p?void 0:()=>{var E,k,H,U;S.current={top:(H=(E=g.current)===null||E===void 0?void 0:E.scrollTop)!==null&&H!==void 0?H:0,left:(U=(k=g.current)===null||k===void 0?void 0:k.scrollLeft)!==null&&U!==void 0?U:0}});let w=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 k,H;let K=re=>{re!=null&&(e.setFocusedKey(re),l&&e.replaceSelection(re))},q=E.relatedTarget;var U,Y;q&&E.currentTarget.compareDocumentPosition(q)&Node.DOCUMENT_POSITION_FOLLOWING?K((U=e.lastSelectedKey)!==null&&U!==void 0?U:(k=n.getLastKey)===null||k===void 0?void 0:k.call(n)):K((Y=e.firstSelectedKey)!==null&&Y!==void 0?Y:(H=n.getFirstKey)===null||H===void 0?void 0:H.call(n))}else!p&&g.current&&(g.current.scrollTop=S.current.top,g.current.scrollLeft=S.current.left);if(e.focusedKey!=null&&g.current){let K=g.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);K&&(K.contains(document.activeElement)||xt(K),gs()==="keyboard"&&Qa(K,{containingElement:r.current}))}}},D=E=>{E.currentTarget.contains(E.relatedTarget)||e.setFocused(!1)},x=d.useRef(!1);fr(r,Zh,c?E=>{let{detail:k}=E;E.stopPropagation(),e.setFocused(!0),(k==null?void 0:k.focusStrategy)==="first"&&(x.current=!0)}:void 0);let I=De(()=>{var E,k;let H=(k=(E=n.getFirstKey)===null||E===void 0?void 0:E.call(n))!==null&&k!==void 0?k:null;if(H==null){var U;(U=r.current)===null||U===void 0||U.dispatchEvent(new CustomEvent(Ou,{cancelable:!0,bubbles:!0})),e.collection.size>0&&(x.current=!1)}else e.setFocusedKey(H),x.current=!1});Ya(()=>{x.current&&I()},[e.collection,I]);let P=De(()=>{e.collection.size>0&&(x.current=!1)});Ya(()=>{P()},[e.focusedKey,P]),fr(r,Qh,c?E=>{E.stopPropagation(),e.setFocused(!1),e.setFocusedKey(null)}:void 0);const b=d.useRef(i);d.useEffect(()=>{if(b.current){var E,k;let Y=null;var H;i==="first"&&(Y=(H=(E=n.getFirstKey)===null||E===void 0?void 0:E.call(n))!==null&&H!==void 0?H:null);var U;i==="last"&&(Y=(U=(k=n.getLastKey)===null||k===void 0?void 0:k.call(n))!==null&&U!==void 0?U:null);let K=e.selectedKeys;if(K.size){for(let q of K)if(e.canSelectItem(q)){Y=q;break}}e.setFocused(!0),e.setFocusedKey(Y),Y==null&&!c&&r.current&&qr(r.current)}},[]);let R=d.useRef(e.focusedKey);d.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==R.current||b.current)&&g.current&&r.current){let E=gs(),k=r.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);if(!k)return;(E==="keyboard"||b.current)&&(Pu(g.current,k),E!=="virtual"&&Qa(k,{containingElement:r.current}))}!c&&e.isFocused&&e.focusedKey==null&&R.current!=null&&r.current&&qr(r.current),R.current=e.focusedKey,b.current=!1}),fr(r,"react-aria-focus-scope-restore",E=>{E.preventDefault(),e.setFocused(!0)});let W={onKeyDown:y,onFocus:w,onBlur:D,onMouseDown(E){g.current===E.target&&E.preventDefault()}},{typeSelectProps:M}=av({keyboardDelegate:n,selectionManager:e});u||(W=ye(M,W));let z;return c?z=-1:z=e.focusedKey==null?0:-1,{collectionProps:{...W,tabIndex:z}}}function Bc(t){let{id:e,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:o,shouldUseVirtualFocus:a,focus:s,isDisabled:l,onAction:u,allowsDifferentPressOrigin:c,linkBehavior:h="action"}=t,p=fi();e=tr(e);let g=K=>{if(K.pointerType==="keyboard"&&Lo(K))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(h==="selection"&&i.current){let q=n.getItemProps(r);p.open(i.current,K,q.href,q.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(h==="override"||h==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):K&&K.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||K&&(rn(K)||K.pointerType==="touch"||K.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};d.useEffect(()=>{if(r===n.focusedKey&&n.isFocused)if(!a)s?s():document.activeElement!==i.current&&i.current&&qr(i.current);else{var q;let re=new CustomEvent(Ou,{cancelable:!0,bubbles:!0});(q=i.current)===null||q===void 0||q.dispatchEvent(re)}},[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(K){K.target===i.current&&n.setFocusedKey(r)}}:l&&(m.onMouseDown=K=>{K.preventDefault()});let f=n.isLink(r)&&h==="override",v=n.isLink(r)&&h!=="selection"&&h!=="none",y=!l&&n.canSelectItem(r)&&!f,S=(u||v)&&!l,w=S&&(n.selectionBehavior==="replace"?!y:!y||n.isEmpty),D=S&&y&&n.selectionBehavior==="replace",x=w||D,I=d.useRef(null),P=x&&y,b=d.useRef(!1),R=d.useRef(!1),W=K=>{if(u&&u(),v&&i.current){let q=n.getItemProps(r);p.open(i.current,K,q.href,q.routerOptions)}},M={};o?(M.onPressStart=K=>{I.current=K.pointerType,b.current=P,K.pointerType==="keyboard"&&(!x||ks())&&g(K)},c?(M.onPressUp=w?void 0:K=>{K.pointerType==="mouse"&&y&&g(K)},M.onPress=w?W:K=>{K.pointerType!=="keyboard"&&K.pointerType!=="mouse"&&y&&g(K)}):M.onPress=K=>{if(w||D&&K.pointerType!=="mouse"){if(K.pointerType==="keyboard"&&!_s())return;W(K)}else K.pointerType!=="keyboard"&&y&&g(K)}):(M.onPressStart=K=>{I.current=K.pointerType,b.current=P,R.current=w,y&&(K.pointerType==="mouse"&&!w||K.pointerType==="keyboard"&&(!S||ks()))&&g(K)},M.onPress=K=>{(K.pointerType==="touch"||K.pointerType==="pen"||K.pointerType==="virtual"||K.pointerType==="keyboard"&&x&&_s()||K.pointerType==="mouse"&&R.current)&&(x?W(K):y&&g(K))}),m["data-key"]=r,M.preventFocusOnPress=a;let{pressProps:z,isPressed:E}=ya(M),k=D?K=>{I.current==="mouse"&&(K.stopPropagation(),K.preventDefault(),W(K))}:void 0,{longPressProps:H}=gg({isDisabled:!P,onLongPress(K){K.pointerType==="touch"&&(g(K),n.setSelectionBehavior("toggle"))}}),U=K=>{I.current==="touch"&&b.current&&K.preventDefault()},Y=n.isLink(r)?K=>{_t.isOpening||K.preventDefault()}:void 0;return{itemProps:ye(m,y||w?z:{},P?H:{},{onDoubleClick:k,onDragStartCapture:U,onClick:Y,id:e}),isPressed:E,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:l,allowsSelection:y,hasAction:x}}function _s(){let t=window.event;return(t==null?void 0:t.key)==="Enter"}function ks(){let t=window.event;return(t==null?void 0:t.key)===" "||(t==null?void 0:t.code)==="Space"}class Rs{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 lv{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&&!Gn(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&&!Gn(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 Rs(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 Rs(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}}function uv(t){let{selectionManager:e,collection:n,disabledKeys:r,ref:i,keyboardDelegate:o,layoutDelegate:a}=t,s=_g({usage:"search",sensitivity:"base"}),l=e.disabledBehavior,u=d.useMemo(()=>o||new lv({collection:n,disabledKeys:r,disabledBehavior:l,ref:i,collator:s,layoutDelegate:a}),[o,a,n,r,i,s,l]),{collectionProps:c}=Hc({...t,ref:i,selectionManager:e,keyboardDelegate:u});return{listProps:c}}function Wc(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function cv(t){return dv(t)}function dv(t,e){for(let n of t)return n}function Bi(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...Ns(t,e),e],i=[...Ns(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 Ns(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 Ms=new WeakMap;function fv(t){let e=Ms.get(t);if(e!=null)return e;let n=0,r=i=>{for(let o of i)o.type==="section"?r(Wc(o,t)):n++};return r(t),Ms.set(t,n),n}const Uc=new WeakMap;function hv(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=Be(t,{labelable:!0}),{listProps:l}=uv({...a,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,shouldFocusWrap:r,linkBehavior:"override"});return Uc.set(e,{onClose:t.onClose,onAction:t.onAction,shouldUseVirtualFocus:t.shouldUseVirtualFocus}),{menuProps:ye(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 pv(t,e,n){let{id:r,key:i,closeOnSelect:o,isVirtualized:a,"aria-haspopup":s,onPressStart:l,onPressUp:u,onPress:c,onPressChange:h,onPressEnd:p,onHoverStart:g,onHoverChange:m,onHoverEnd:f,onKeyDown:v,onKeyUp:y,onFocus:S,onFocusChange:w,onBlur:D,selectionManager:x=e.selectionManager}=t,I=!!s,P=I&&t["aria-expanded"]==="true";var b;let R=(b=t.isDisabled)!==null&&b!==void 0?b:x.isDisabled(i);var W;let M=(W=t.isSelected)!==null&&W!==void 0?W:x.isSelected(i),z=Uc.get(e),E=e.collection.getItem(i),k=t.onClose||z.onClose,H=fi(),U=ne=>{var Ue;if(!I){if(!(E==null||(Ue=E.props)===null||Ue===void 0)&&Ue.onAction?E.props.onAction():t.onAction&&t.onAction(i),z.onAction){let st=z.onAction;st(i)}ne.target instanceof HTMLAnchorElement&&E&&H.open(ne.target,ne,E.props.href,E.props.routerOptions)}},Y="menuitem";I||(x.selectionMode==="single"?Y="menuitemradio":x.selectionMode==="multiple"&&(Y="menuitemcheckbox"));let K=_i(),q=_i(),re=_i(),j={id:r,"aria-disabled":R||void 0,role:Y,"aria-label":t["aria-label"],"aria-labelledby":K,"aria-describedby":[q,re].filter(Boolean).join(" ")||void 0,"aria-controls":t["aria-controls"],"aria-haspopup":s,"aria-expanded":t["aria-expanded"]};x.selectionMode!=="none"&&!I&&(j["aria-checked"]=M),a&&(j["aria-posinset"]=E==null?void 0:E.index,j["aria-setsize"]=fv(e.collection));let O=ne=>{ne.pointerType==="keyboard"&&U(ne),l==null||l(ne)},_=()=>{!I&&k&&(o??(x.selectionMode!=="multiple"||x.isLink(i)))&&k()},N=ne=>{ne.pointerType==="mouse"&&(U(ne),_()),u==null||u(ne)},A=ne=>{ne.pointerType!=="keyboard"&&ne.pointerType!=="mouse"&&(U(ne),_()),c==null||c(ne)},{itemProps:F,isFocused:B}=Bc({id:r,selectionManager:x,key:i,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:z.shouldUseVirtualFocus}),{pressProps:L,isPressed:X}=ya({onPressStart:O,onPress:A,onPressUp:N,onPressChange:h,onPressEnd:p,isDisabled:R}),{hoverProps:ee}=wa({isDisabled:R,onHoverStart(ne){!cg()&&!(P&&s==="dialog")&&(x.setFocused(!0),x.setFocusedKey(i)),g==null||g(ne)},onHoverChange:m,onHoverEnd:f}),{keyboardProps:de}=hg({onKeyDown:ne=>{if(ne.repeat){ne.continuePropagation();return}switch(ne.key){case" ":!R&&x.selectionMode==="none"&&!I&&o!==!1&&k&&k();break;case"Enter":!R&&o!==!1&&!I&&k&&k();break;default:I||ne.continuePropagation(),v==null||v(ne);break}},onKeyUp:y}),{focusProps:ce}=ag({onBlur:D,onFocus:S,onFocusChange:w}),oe=Be(E==null?void 0:E.props);delete oe.id;let ge=Cu(E==null?void 0:E.props);return{menuItemProps:{...j,...ye(oe,ge,I?{onFocus:F.onFocus,"data-key":F["data-key"]}:F,L,ee,de,ce),tabIndex:F.tabIndex!=null&&P?-1:F.tabIndex},labelProps:{id:K},descriptionProps:{id:q},keyboardShortcutProps:{id:re},isFocused:B,isSelected:M,isPressed:X,isDisabled:R}}function gv(t){let{heading:e,"aria-label":n}=t,r=tr();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}function vv(t){let e=Be(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}const Vc=new WeakMap;function Zr(t,e,n){return t?(typeof e=="string"&&(e=e.replace(/\s+/g,"")),`${Vc.get(t)}-${n}-${e}`):""}function mv(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:h}=Bc({selectionManager:a,key:r,ref:n,isDisabled:u,shouldSelectOnPressUp:o,linkBehavior:"selection"}),p=Zr(e,r,"tab"),g=Zr(e,r,"tabpanel"),{tabIndex:m}=c,f=e.collection.getItem(r),v=Be(f==null?void 0:f.props,{labelable:!0});delete v.id;let y=Cu(f==null?void 0:f.props);return{tabProps:ye(v,y,c,{id:p,"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:h}}function yv(t,e,n){let r=Qp(n)?void 0:0;var i;const o=Zr(e,(i=t.id)!==null&&i!==void 0?i:e==null?void 0:e.selectedKey,"tabpanel"),a=sa({...t,id:o,"aria-labelledby":Zr(e,e==null?void 0:e.selectedKey,"tab")});return{tabPanelProps:ye(a,{tabIndex:r,role:"tabpanel","aria-describedby":t["aria-describedby"],"aria-details":t["aria-details"]})}}class bv{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 Sv(t,e,n){let{orientation:r="horizontal",keyboardActivation:i="automatic"}=t,{collection:o,selectionManager:a,disabledKeys:s}=e,{direction:l}=or(),u=d.useMemo(()=>new bv(o,l,r,s),[o,s,r,l]),{collectionProps:c}=Hc({ref:n,selectionManager:a,keyboardDelegate:u,selectOnFocus:i==="automatic",disallowEmptySelection:!0,scrollRef:n,linkBehavior:"selection"}),h=tr();Vc.set(e,h);let p=sa({...t,id:h});return{tabListProps:{...ye(c,p),role:"tablist","aria-orientation":r,tabIndex:void 0}}}const wv=d.createContext({});function Ev(t){let[e,n]=nr(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=d.useCallback(()=>{n(!0)},[n]),i=d.useCallback(()=>{n(!1)},[n]),o=d.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:i,toggle:o}}class $v{build(e,n){return this.context=n,As(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(d.isValidElement(n)&&n.type===d.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=[];d.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(d.isValidElement(e.element)&&e.element.type===d.Fragment){let v=[];d.Children.forEach(e.element.props.children,S=>{v.push(S)});var o;let y=(o=e.index)!==null&&o!==void 0?o:0;for(const S of v)yield*this.getFullNode({element:S,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(d.isValidElement(a)){let v=a.type;if(typeof v!="function"&&typeof v.getCollectionNode!="function"){let D=a.type;throw new Error(`Unknown element <${D}> in collection.`)}let y=v.getCollectionNode(a.props,this.context);var s;let S=(s=e.index)!==null&&s!==void 0?s:0,w=y.next();for(;!w.done&&w.value;){let D=w.value;e.index=S;var l;let x=(l=D.key)!==null&&l!==void 0?l:null;x==null&&(x=D.element?null:this.getKey(a,e,n,r));let P=[...this.getFullNode({...D,key:x,index:S,wrapper:xv(e.wrapper,D.wrapper)},this.getChildState(n,D),r?`${r}${a.key}`:a.key,i)];for(let b of P){var u,c;b.value=(c=(u=D.value)!==null&&u!==void 0?u:e.value)!==null&&c!==void 0?c:null,b.value&&this.cache.set(b.value,b);var h;if(e.type&&b.type!==e.type)throw new Error(`Unsupported type <${Wi(b.type)}> in <${Wi((h=i==null?void 0:i.type)!==null&&h!==void 0?h:"unknown parent type")}>. Only <${Wi(e.type)}> is supported.`);S++,yield b}w=y.next(P)}return}if(e.key==null||e.type==null)return;let p=this;var g,m;let f={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:As(function*(){if(!e.hasChildNodes||!e.childNodes)return;let v=0;for(let y of e.childNodes()){y.key!=null&&(y.key=`${f.key}${y.key}`);let S=p.getFullNode({...y,index:v},p.getChildState(n,y),f.key,f);for(let w of S)v++,yield w}})};yield f}constructor(){this.cache=new WeakMap}}function As(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 xv(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function Wi(t){return t[0].toUpperCase()+t.slice(1)}function Gc(t,e,n){let r=d.useMemo(()=>new $v,[]),{children:i,items:o,collection:a}=t;return d.useMemo(()=>{if(a)return a;let l=r.build({children:i,items:o},n);return e(l)},[r,i,o,a,n,e])}function Cv(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Tv(t){return Dv(t)}function Dv(t,e){for(let n of t)return n}function Ui(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...Ks(t,e),e],i=[...Ks(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 Ks(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}function Pv(t){let{initialItems:e=[],initialSelectedKeys:n,getKey:r=f=>{var v;return(v=f.id)!==null&&v!==void 0?v:f.key},getChildren:i=f=>f.children}=t,[o,a]=d.useState(()=>h(e,new Map)),{items:s,nodeMap:l}=o,[u,c]=d.useState(new Set(n||[]));function h(f=[],v,y){return f==null&&(f=[]),{items:f.map(S=>{let w={key:r(S),parentKey:y,value:S,children:null};return w.children=h(i(S),v,w.key).items,v.set(w.key,w),w}),nodeMap:v}}function p(f,v,y,S){let w=S.get(v);if(!w)return{items:f,nodeMap:S};let D=new Map(S),x=y(w);for(x==null?m(w,D):g(x,D);w&&w.parentKey;){let P=D.get(w.parentKey),b={key:P.key,parentKey:P.parentKey,value:P.value,children:null},R=P.children;x==null&&R&&(R=R.filter(W=>W!==w));var I;b.children=(I=R==null?void 0:R.map(W=>W===w?x:W))!==null&&I!==void 0?I:null,D.set(b.key,b),x=b,w=P}return x==null&&(f=f.filter(P=>P!==w)),{items:f.map(P=>P===w?x:P),nodeMap:D}}function g(f,v){if(v.set(f.key,f),f.children)for(let y of f.children)g(y,v)}function m(f,v){if(v.delete(f.key),f.children)for(let y of f.children)m(y,v)}return{items:s,selectedKeys:u,setSelectedKeys:c,getItem(f){return l.get(f)},insert(f,v,...y){a(({items:S,nodeMap:w})=>{let{items:D,nodeMap:x}=h(y,w,f);return f==null?{items:[...S.slice(0,v),...D,...S.slice(v)],nodeMap:x}:p(S,f,I=>({key:I.key,parentKey:I.parentKey,value:I.value,children:[...I.children.slice(0,v),...D,...I.children.slice(v)]}),x)})},insertBefore(f,...v){let y=l.get(f);if(!y)return;let S=l.get(y.parentKey),D=(S?S.children:s).indexOf(y);var x;this.insert((x=S==null?void 0:S.key)!==null&&x!==void 0?x:null,D,...v)},insertAfter(f,...v){let y=l.get(f);if(!y)return;let S=l.get(y.parentKey),D=(S?S.children:s).indexOf(y);var x;this.insert((x=S==null?void 0:S.key)!==null&&x!==void 0?x:null,D+1,...v)},prepend(f,...v){this.insert(f,0,...v)},append(f,...v){if(f==null)this.insert(null,s.length,...v);else{let y=l.get(f);if(!y)return;this.insert(f,y.children.length,...v)}},remove(...f){if(f.length===0)return;let v=s,y=l,S;for(let D of f)S=p(v,D,()=>null,y),y=S.nodeMap,v=S.items;a(S);let w=new Set(u);for(let D of u)S.nodeMap.has(D)||w.delete(D);c(w)},removeSelectedItems(){this.remove(...u)},move(f,v,y){a(({items:S,nodeMap:w})=>{let D=w.get(f);if(!D)return{items:S,nodeMap:w};let{items:x,nodeMap:I}=p(S,f,()=>null,w);const P={...D,parentKey:v};return v==null?(I.set(P.key,P),{items:[...x.slice(0,y),P,...x.slice(y)],nodeMap:I}):p(x,v,b=>({key:b.key,parentKey:b.parentKey,value:b.value,children:[...b.children.slice(0,y),P,...b.children.slice(y)]}),I)})},update(f,v){a(({items:y,nodeMap:S})=>p(y,f,w=>{let D={key:w.key,parentKey:w.parentKey,value:v,children:null},x=h(i(v),S,D.key);return D.children=x.items,D},S))}}}class Ls{*[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}}let tt=class qc extends Set{constructor(e,n,r){super(e),e instanceof qc?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Ov(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Yc(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:o="all"}=t,a=d.useRef(!1),[,s]=d.useState(!1),l=d.useRef(null),u=d.useRef(null),[,c]=d.useState(null),h=d.useMemo(()=>Fs(t.selectedKeys),[t.selectedKeys]),p=d.useMemo(()=>Fs(t.defaultSelectedKeys,new tt),[t.defaultSelectedKeys]),[g,m]=nr(h,p,t.onSelectionChange),f=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,y]=d.useState(i);i==="replace"&&v==="toggle"&&typeof g=="object"&&g.size===0&&y("replace");let S=d.useRef(i);return d.useEffect(()=>{i!==S.current&&(y(i),S.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return a.current},setFocused(w){a.current=w,s(w)},get focusedKey(){return l.current},get childFocusStrategy(){return u.current},setFocusedKey(w,D="first"){l.current=w,u.current=D,c(w)},selectedKeys:g,setSelectedKeys(w){(r||!Ov(w,g))&&m(w)},disabledKeys:f,disabledBehavior:o}}function Fs(t,e){return t?t==="all"?"all":new tt(t):e}let Xc=class{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&&Ui(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&&Ui(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 tt([n],n,n);else{let a=this.state.selectedKeys;var i;let s=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new tt(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?Ui(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 tt(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 tt([n],n,n):new tt;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new tt;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=Tv(Cv(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 tt)}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 Iv(t){let{filter:e,layoutDelegate:n}=t,r=Yc(t),i=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=d.useCallback(c=>e?new Ls(e(c)):new Ls(c),[e]),a=d.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),s=Gc(t,o,a),l=d.useMemo(()=>new Xc(s,r,{layoutDelegate:n}),[s,r,n]);const u=d.useRef(null);return d.useEffect(()=>{if(r.focusedKey!=null&&!s.getItem(r.focusedKey)&&u.current){const y=u.current.getItem(r.focusedKey),S=[...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),w=[...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,h;const D=((c=S==null?void 0:S.length)!==null&&c!==void 0?c:0)-((h=w==null?void 0:w.length)!==null&&h!==void 0?h:0);var p,g,m;let x=Math.min(D>1?Math.max(((p=y==null?void 0:y.index)!==null&&p!==void 0?p:0)-D+1,0):(g=y==null?void 0:y.index)!==null&&g!==void 0?g:0,((m=w==null?void 0:w.length)!==null&&m!==void 0?m:0)-1),I=null,P=!1;for(;x>=0;){if(!l.isDisabled(w[x].key)){I=w[x];break}if(x<w.length-1&&!P)x++;else{P=!0;var f,v;x>((f=y==null?void 0:y.index)!==null&&f!==void 0?f:0)&&(x=(v=y==null?void 0:y.index)!==null&&v!==void 0?v:0),x--}}r.setFocusedKey(I?I.key:null)}u.current=s},[s,l,r,r.focusedKey]),{collection:s,disabledKeys:i,selectionManager:l}}function _v(t){var e;let[n,r]=nr(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),i=d.useMemo(()=>n!=null?[n]:[],[n]),{collection:o,disabledKeys:a,selectionManager:s}=Iv({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:u=>{if(u==="all")return;var c;let h=(c=u.values().next().value)!==null&&c!==void 0?c:null;h===n&&t.onSelectionChange&&t.onSelectionChange(h),r(h)}}),l=n!=null?o.getItem(n):null;return{collection:o,disabledKeys:a,selectionManager:s,selectedKey:n,setSelectedKey:r,selectedItem:l}}function kv(t){var e,n;let r=_v({...t,suppressTextValueWarning:!0,defaultSelectedKey:(n=(e=t.defaultSelectedKey)!==null&&e!==void 0?e:js(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=d.useRef(a);return d.useEffect(()=>{let l=a;(i.isEmpty||l==null||!o.getItem(l))&&(l=js(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 js(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 Rv{*[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 Nv(t){let{onExpandedChange:e}=t,[n,r]=nr(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),i=Yc(t),o=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),a=Gc(t,d.useCallback(l=>new Rv(l,{expandedKeys:n}),[n]),null);return d.useEffect(()=>{i.focusedKey!=null&&!a.getItem(i.focusedKey)&&i.setFocusedKey(null)},[a,i.focusedKey]),{collection:a,expandedKeys:n,disabledKeys:o,toggleKey:l=>{r(Mv(n,l))},setExpandedKeys:r,selectionManager:new Xc(a,i)}}function Mv(t,e){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}const Av=d.createContext(null),Kv=d.createContext(null),Jc={CollectionRoot({collection:t,renderDropIndicator:e}){return zs(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return zs(t,e,n)}};function zs(t,e,n){return ku({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 d.createElement(d.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 gi=d.createContext(Jc);function Qc(t){return d.useMemo(()=>t!=null?new Set([t]):null,[t])}const Lv=d.createContext({}),Zc=d.createContext({}),Fv=fa("separator",function(e,n){[e,n]=ir(e,n,Zc);let{elementType:r,orientation:i,style:o,className:a}=e,s=r||"hr";s==="hr"&&i==="vertical"&&(s="div");let{separatorProps:l}=vv({elementType:r,orientation:i});return d.createElement(s,{...Be(e),...l,style:o,className:a??"react-aria-Separator",ref:n,slot:e.slot||void 0})}),jv=d.createContext({placement:"bottom"}),zv=d.createContext(null),Hv=d.forwardRef(function(e,n){[e,n]=ir(e,n,zv);let r=d.useContext(nm),i=Ev(e),o=e.isOpen!=null||e.defaultOpen!=null||!r?i:r,a=tp(n,o.isOpen)||e.isExiting||!1;if(sp()){let l=e.children;return typeof l=="function"&&(l=l({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),d.createElement(d.Fragment,null,l)}return o&&!o.isOpen&&!a?null:d.createElement(Bv,{...e,triggerRef:e.triggerRef,state:o,popoverRef:n,isExiting:a})});function Bv({state:t,isExiting:e,UNSTABLE_portalContainer:n,...r}){let i=d.useRef(null),[o,a]=d.useState(0);pe(()=>{i.current&&t.isOpen&&a(i.current.getBoundingClientRect().width)},[t.isOpen,i]);var s;let{popoverProps:l,underlayProps:u,arrowProps:c,placement:h}=ev({...r,offset:(s=r.offset)!==null&&s!==void 0?s:8,arrowSize:o},t),p=r.popoverRef,g=ep(p,!!h)||r.isEntering||!1,m=yt({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:h,isEntering:g,isExiting:e}}),f={...l.style,...m.style};return d.createElement(iv,{...r,isExiting:e,portalContainer:n},!r.isNonModal&&t.isOpen&&d.createElement("div",{"data-testid":"underlay",...u,style:{position:"fixed",inset:0}}),d.createElement("div",{...ye(Be(r),l),...m,ref:p,slot:r.slot||void 0,style:f,"data-trigger":r.trigger,"data-placement":h,"data-entering":g||void 0,"data-exiting":e||void 0},!r.isNonModal&&d.createElement(Is,{onDismiss:t.close}),d.createElement(jv.Provider,{value:{...c,placement:h,ref:i}},m.children),d.createElement(Is,{onDismiss:t.close})))}const Wv=d.createContext({});class ze extends Set{constructor(e,n,r){super(e),e instanceof ze?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}function Uv(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Vv(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:o="all"}=t,a=d.useRef(!1),[,s]=d.useState(!1),l=d.useRef(null),u=d.useRef(null),[,c]=d.useState(null),h=d.useMemo(()=>Hs(t.selectedKeys),[t.selectedKeys]),p=d.useMemo(()=>Hs(t.defaultSelectedKeys,new ze),[t.defaultSelectedKeys]),[g,m]=nr(h,p,t.onSelectionChange),f=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,y]=d.useState(i);i==="replace"&&v==="toggle"&&typeof g=="object"&&g.size===0&&y("replace");let S=d.useRef(i);return d.useEffect(()=>{i!==S.current&&(y(i),S.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return a.current},setFocused(w){a.current=w,s(w)},get focusedKey(){return l.current},get childFocusStrategy(){return u.current},setFocusedKey(w,D="first"){l.current=w,u.current=D,c(w)},selectedKeys:g,setSelectedKeys(w){(r||!Uv(w,g))&&m(w)},disabledKeys:f,disabledBehavior:o}}function Hs(t,e){return t?t==="all"?"all":new ze(t):e}class Gv{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&&Bi(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&&Bi(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 ze([n],n,n);else{let a=this.state.selectedKeys;var i;let s=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new ze(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?Bi(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 ze(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 ze([n],n,n):new ze;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new ze;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=cv(Wc(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 ze)}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}}const qv=d.createContext(null),Ea=d.createContext(null),Yv=d.createContext(null),ei=d.createContext(null),Xv=d.createContext(null),Jv=d.forwardRef(function(e,n){return[e,n]=ir(e,n,qv),d.createElement(Nu,{content:d.createElement(Mu,e)},r=>r.size>0&&d.createElement(Qv,{props:e,collection:r,menuRef:n}))});function Qv({props:t,collection:e,menuRef:n}){let{filterFn:r,collectionProps:i,collectionRef:o}=d.useContext(Av)||{};n=xn(d.useMemo(()=>wu(n,o!==void 0?o:null),[o,n]));let a=d.useMemo(()=>r?e.filter(r):e,[e,r]),s=Nv({...t,collection:a,children:void 0}),l=d.useContext(Yv),{isVirtualized:u,CollectionRoot:c}=d.useContext(gi),{menuProps:h}=hv({...t,...i,isVirtualized:u,onClose:t.onClose||(l==null?void 0:l.close)},s,n),p=yt({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return d.createElement(Gu,null,d.createElement("div",{...Be(t),...h,...p,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},d.createElement(rr,{values:[[Ea,s],[Zc,{elementType:"div"}],[Kv,{name:"MenuSection",render:em}],[Xv,{parentMenuRef:n}],[Fo,null],[ei,s.selectionManager]]},d.createElement(c,{collection:s.collection,persistedKeys:Qc(s.selectionManager.focusedKey),scrollRef:n}))))}class Zv extends Gv{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 em(t,e,n,r="react-aria-MenuSection"){var i,o;let a=d.useContext(Ea),{CollectionBranch:s}=d.useContext(gi),[l,u]=np();var c;let{headingProps:h,groupProps:p}=gv({heading:u,"aria-label":(c=n.props["aria-label"])!==null&&c!==void 0?c:void 0}),g=yt({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=d.useContext(ei),f=Vv(t),v=t.selectionMode!=null?new Zv(m,f):m;return d.createElement("section",{...Be(t),...p,...g,ref:e},d.createElement(rr,{values:[[Lv,{...h,ref:l}],[ei,v]]},d.createElement(s,{collection:a.collection,parent:n})))}const Fo=d.createContext(null),tm=fa("item",function(e,n,r){var i;[e,n]=ir(e,n,Fo);let o=(i=la(Fo))===null||i===void 0?void 0:i.id,a=d.useContext(Ea),s=xn(n),l=d.useContext(ei),{menuItemProps:u,labelProps:c,descriptionProps:h,keyboardShortcutProps:p,...g}=pv({...e,id:o,key:r.key,selectionManager:l},a,s),{isFocusVisible:m,focusProps:f}=hi(),{hoverProps:v,isHovered:y}=wa({isDisabled:g.isDisabled}),S=yt({...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"}}),w=e.href?"a":"div";return d.createElement(w,{...ye(u,f,v),...S,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},d.createElement(rr,{values:[[wv,{slots:{label:c,description:h}}],[Wv,p]]},S.children))}),nm=d.createContext(null),vi=d.createContext(null),bn=d.createContext(null),rm=d.forwardRef(function(e,n){[e,n]=ir(e,n,vi);let{children:r,orientation:i="horizontal"}=e;return r=d.useMemo(()=>typeof r=="function"?r({orientation:i,defaultChildren:null}):r,[r,i]),d.createElement(Nu,{content:r},o=>d.createElement(im,{props:e,collection:o,tabsRef:n}))});function im({props:t,tabsRef:e,collection:n}){let{orientation:r="horizontal"}=t,i=kv({...t,collection:n,children:void 0}),{focusProps:o,isFocused:a,isFocusVisible:s}=hi({within:!0}),l=d.useMemo(()=>({orientation:r,isFocusWithin:a,isFocusVisible:s}),[r,a,s]),u=yt({...t,defaultClassName:"react-aria-Tabs",values:l});return d.createElement("div",{...Be(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},d.createElement(rr,{values:[[vi,t],[bn,i]]},u.children))}const om=d.forwardRef(function(e,n){return d.useContext(bn)?d.createElement(am,{props:e,forwardedRef:n}):d.createElement(Mu,e)});function am({props:t,forwardedRef:e}){let n=d.useContext(bn),{CollectionRoot:r}=d.useContext(gi),{orientation:i="horizontal",keyboardActivation:o="automatic"}=la(vi),a=xn(e),{tabListProps:s}=Sv({...t,orientation:i,keyboardActivation:o},n,a),l=yt({...t,children:null,defaultClassName:"react-aria-TabList",values:{orientation:i,state:n}}),u=Be(t);return delete u.id,d.createElement("div",{...u,...s,ref:a,...l,"data-orientation":i||void 0},d.createElement(r,{collection:n.collection,persistedKeys:Qc(n.selectionManager.focusedKey)}))}const sm=fa("item",(t,e,n)=>{let r=d.useContext(bn),i=xn(e),{tabProps:o,isSelected:a,isDisabled:s,isPressed:l}=mv({key:n.key,...t},r,i),{focusProps:u,isFocused:c,isFocusVisible:h}=hi(),{hoverProps:p,isHovered:g}=wa({isDisabled:s,onHoverStart:t.onHoverStart,onHoverEnd:t.onHoverEnd,onHoverChange:t.onHoverChange}),m=yt({...t,id:void 0,defaultClassName:"react-aria-Tab",values:{isSelected:a,isDisabled:s,isFocused:c,isFocusVisible:h,isPressed:l,isHovered:g}}),f=n.props.href?"a":"div";return d.createElement(f,{...ye(o,u,p,m),ref:i,"data-selected":a||void 0,"data-disabled":s||void 0,"data-focused":c||void 0,"data-focus-visible":h||void 0,"data-pressed":l||void 0,"data-hovered":g||void 0})}),lm=ap(function(e,n){const r=d.useContext(bn);let i=xn(n),{tabPanelProps:o}=yv(e,r,i),{focusProps:a,isFocused:s,isFocusVisible:l}=hi(),u=r.selectedKey===e.id,c=yt({...e,defaultClassName:"react-aria-TabPanel",values:{isFocused:s,isFocusVisible:l,isInert:!u,state:r}});if(!u&&!e.shouldForceMount)return null;let h=Be(e);delete h.id;let p=u?ye(h,o,a,c):c;return d.createElement("div",{...p,ref:i,"data-focused":s||void 0,"data-focus-visible":l||void 0,inert:u?void 0:"true","data-inert":u?void 0:"true"},d.createElement(rr,{values:[[vi,null],[bn,null]]},d.createElement(gi.Provider,{value:Jc},c.children)))}),ed=({options:t,isOpen:e=!1,onOpenChange:n,children:r,selectedValues:i=[],onSelectValue:o})=>{const a=d.useId(),s=u=>{n==null||n(u)},l=d.useRef(null);return T.jsxs(T.Fragment,{children:[T.jsx("div",{className:"c__dropdown-menu-trigger",ref:l,id:a,onClick:u=>{u.stopPropagation(),u.preventDefault()},children:r}),T.jsx(Hv,{triggerRef:l,style:{marginTop:"0px"},isOpen:e,onOpenChange:s,children:T.jsx(Jv,{className:"c__dropdown-menu","aria-labelledby":a,children:t.map(u=>T.jsxs(d.Fragment,{children:[T.jsxs(tm,{className:"c__dropdown-menu-item","aria-label":u.label,onAction:()=>{var c;u.value&&(o==null||o(u.value)),(c=u.callback)==null||c.call(u),s(!1)},isDisabled:u.isDisabled,children:[u.icon,T.jsx("div",{className:"c__dropdown-menu-item__label","aria-label":u.label,children:u.label}),(u.isChecked||u.value&&i.includes(u.value))&&T.jsx("span",{className:"material-icons checked",children:"check"})]},u.label),u.showSeparator&&T.jsx(Fv,{})]},u.label))})})]})},td=()=>{const[t,e]=d.useState(!1);return{isOpen:t,setIsOpen:e}},nd=({languages:t})=>{const{isOpen:e,setIsOpen:n}=td();return T.jsx(ed,{options:t,isOpen:e,onOpenChange:n,children:T.jsxs(mn.Button,{onClick:()=>n(!e),color:"primary-text",className:"c__language-picker",children:[T.jsx("span",{className:"material-icons",children:"translate"}),T.jsx("span",{className:"c__language-picker__label",children:"Français"}),T.jsx("span",{className:"material-icons",children:e?"arrow_drop_up":"arrow_drop_down"})]})})},rd=({leftIcon:t,rightIcon:e,languages:n,onTogglePanel:r,isPanelOpen:i})=>{const{t:o}=mn.useCunningham();return T.jsxs("div",{className:"c__header",children:[T.jsx("div",{className:"c__header__toggle-menu",children:T.jsx(mn.Button,{size:"medium",onClick:r,"aria-label":o(i?"Close the menu":"Open the menu"),color:"tertiary-text",icon:T.jsx("span",{className:"material-icons clr-primary-800",children:i?"close":"menu"})})}),T.jsx("div",{className:"c__header__left",children:t}),T.jsxs("div",{className:"c__header__right",children:[n&&T.jsx("div",{className:"c__header__right__language-picker",children:T.jsx(nd,{languages:n})}),e]})]})},jo={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-050":"#FFF4F4","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"},tooltip:{padding:"4px 8px","background-color":"var(--c--theme--colors--greyscale-1000)"},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"}}}}},ar=()=>{const[t,e]=d.useState(window.innerWidth),n=parseInt(jo.themes.default.theme.breakpoints.mobile.replace("px","")),r=parseInt(jo.themes.default.theme.breakpoints.tablet.replace("px","")),i=()=>{e(window.innerWidth)};d.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}},id=({children:t,isOpen:e=!1})=>{const{isDesktop:n}=ar();return n?T.jsx("div",{className:"c__left-panel",children:t}):T.jsx("div",{className:ot("c__left-panel__mobile",{open:e}),children:t})},{createElement:Sn,createContext:um,createRef:Px,forwardRef:od,useCallback:xe,useContext:ad,useEffect:Dt,useImperativeHandle:sd,useLayoutEffect:cm,useMemo:dm,useRef:Ce,useState:hn}=C,Bs=C[`useId${Math.random()}`.slice(0,5)],fm=cm,mi=um(null);mi.displayName="PanelGroupContext";const Pt=fm,hm=typeof Bs=="function"?Bs:()=>null;let pm=0;function $a(t=null){const e=hm(),n=Ce(t||e||null);return n.current===null&&(n.current=""+pm++),t??n.current}function ld({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:a,maxSize:s,minSize:l,onCollapse:u,onExpand:c,onResize:h,order:p,style:g,tagName:m="div",...f}){const v=ad(mi);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:S,getPanelSize:w,getPanelStyle:D,groupId:x,isPanelCollapsed:I,reevaluatePanelConstraints:P,registerPanel:b,resizePanel:R,unregisterPanel:W}=v,M=$a(a),z=Ce({callbacks:{onCollapse:u,onExpand:c,onResize:h},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:s,minSize:l},id:M,idIsFromProps:a!==void 0,order:p});Ce({didLogMissingDefaultSizeWarning:!1}),Pt(()=>{const{callbacks:k,constraints:H}=z.current,U={...H};z.current.id=M,z.current.idIsFromProps=a!==void 0,z.current.order=p,k.onCollapse=u,k.onExpand=c,k.onResize=h,H.collapsedSize=n,H.collapsible=r,H.defaultSize=i,H.maxSize=s,H.minSize=l,(U.collapsedSize!==H.collapsedSize||U.collapsible!==H.collapsible||U.maxSize!==H.maxSize||U.minSize!==H.minSize)&&P(z.current,U)}),Pt(()=>{const k=z.current;return b(k),()=>{W(k)}},[p,M,b,W]),sd(o,()=>({collapse:()=>{y(z.current)},expand:k=>{S(z.current,k)},getId(){return M},getSize(){return w(z.current)},isCollapsed(){return I(z.current)},isExpanded(){return!I(z.current)},resize:k=>{R(z.current,k)}}),[y,S,w,I,M,R]);const E=D(z.current,i);return Sn(m,{...f,children:t,className:e,id:a,style:{...E,...g},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":x,"data-panel-id":M,"data-panel-size":parseFloat(""+E.flexGrow).toFixed(1)})}const zo=od((t,e)=>Sn(ld,{...t,forwardedRef:e}));ld.displayName="Panel";zo.displayName="forwardRef(Panel)";let Ho=null,Tt=null;function gm(t,e){if(e){const n=(e&hd)!==0,r=(e&pd)!==0,i=(e&gd)!==0,o=(e&vd)!==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 vm(){Tt!==null&&(document.head.removeChild(Tt),Ho=null,Tt=null)}function Vi(t,e){const n=gm(t,e);Ho!==n&&(Ho=n,Tt===null&&(Tt=document.createElement("style"),document.head.appendChild(Tt)),Tt.innerHTML=`*{cursor: ${n}!important;}`)}function ud(t){return t.type==="keydown"}function cd(t){return t.type.startsWith("pointer")}function dd(t){return t.type.startsWith("mouse")}function yi(t){if(cd(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(dd(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function mm(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function ym(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 bm(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Vs(t),b:Vs(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:Us(Ws(n.a)),b:Us(Ws(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 Sm=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function wm(t){var e;const n=getComputedStyle((e=fd(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function Em(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||wm(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"||Sm.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ws(t){let e=t.length;for(;e--;){const n=t[e];if(Z(n,"Missing node"),Em(n))return n}return null}function Us(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Vs(t){const e=[];for(;t;)e.push(t),t=fd(t);return e}function fd(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const hd=1,pd=2,gd=4,vd=8,$m=mm()==="coarse";let He=[],pn=!1,pt=new Map,bi=new Map;const Xn=new Set;function xm(t,e,n,r,i){var o;const{ownerDocument:a}=e,s={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},l=(o=pt.get(a))!==null&&o!==void 0?o:0;return pt.set(a,l+1),Xn.add(s),ti(),function(){var c;bi.delete(t),Xn.delete(s);const h=(c=pt.get(a))!==null&&c!==void 0?c:1;if(pt.set(a,h-1),ti(),h===1&&pt.delete(a),He.includes(s)){const p=He.indexOf(s);p>=0&&He.splice(p,1),Ca(),i("up",!0,null)}}}function Gs(t){const{target:e}=t,{x:n,y:r}=yi(t);pn=!0,xa({target:e,x:n,y:r}),ti(),He.length>0&&(ni("down",t),t.preventDefault(),t.stopPropagation())}function Rn(t){const{x:e,y:n}=yi(t);if(pn&&t.buttons===0&&(pn=!1,ni("up",t)),!pn){const{target:r}=t;xa({target:r,x:e,y:n})}ni("move",t),Ca(),He.length>0&&t.preventDefault()}function Ut(t){const{target:e}=t,{x:n,y:r}=yi(t);bi.clear(),pn=!1,He.length>0&&t.preventDefault(),ni("up",t),xa({target:e,x:n,y:r}),Ca(),ti()}function xa({target:t,x:e,y:n}){He.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),Xn.forEach(i=>{const{element:o,hitAreaMargins:a}=i,s=o.getBoundingClientRect(),{bottom:l,left:u,right:c,top:h}=s,p=$m?a.coarse:a.fine;if(e>=u-p&&e<=c+p&&n>=h-p&&n<=l+p){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&bm(r,o)>0){let m=r,f=!1;for(;m&&!m.contains(o);){if(ym(m.getBoundingClientRect(),s)){f=!0;break}m=m.parentElement}if(f)return}He.push(i)}})}function Gi(t,e){bi.set(t,e)}function Ca(){let t=!1,e=!1;He.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;bi.forEach(r=>{n|=r}),t&&e?Vi("intersection",n):t?Vi("horizontal",n):e?Vi("vertical",n):vm()}function ti(){pt.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Ut),n.removeEventListener("pointerdown",Gs),n.removeEventListener("pointerleave",Rn),n.removeEventListener("pointermove",Rn)}),window.removeEventListener("pointerup",Ut),window.removeEventListener("pointercancel",Ut),Xn.size>0&&(pn?(He.length>0&&pt.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Ut),n.addEventListener("pointerleave",Rn),n.addEventListener("pointermove",Rn))}),window.addEventListener("pointerup",Ut),window.addEventListener("pointercancel",Ut)):pt.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",Gs,{capture:!0}),n.addEventListener("pointermove",Rn))}))}function ni(t,e){Xn.forEach(n=>{const{setResizeHandlerState:r}=n,i=He.includes(n);r(t,i,e)})}function Cm(){const[t,e]=hn(0);return xe(()=>e(n=>n+1),[])}function Z(t,e){if(!t)throw console.error(e),Error(e)}const Ta=10;function Nt(t,e,n=Ta){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function nt(t,e,n=Ta){return Nt(t,e,n)===0}function Te(t,e,n){return Nt(t,e,n)===0}function Tm(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(!Te(i,o,n))return!1}return!0}function cn({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(Nt(n,s)<0)if(o){const l=(i+s)/2;Nt(n,l)<0?n=i:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(Ta)),n}function Fn({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(Te(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 h=t<0?l:s,p=n[h];Z(p,`Panel constraints not found for index ${h}`);const{collapsedSize:g=0,collapsible:m,minSize:f=0}=p;if(m){const v=e[h];if(Z(v!=null,`Previous layout not found for panel index ${h}`),Te(v,g)){const y=f-v;Nt(y,Math.abs(t))>0&&(t=t<0?0-y:y)}}}{const h=t<0?s:l,p=n[h];Z(p,`No panel constraints found for index ${h}`);const{collapsedSize:g=0,collapsible:m,minSize:f=0}=p;if(m){const v=e[h];if(Z(v!=null,`Previous layout not found for panel index ${h}`),Te(v,f)){const y=v-g;Nt(y,Math.abs(t))>0&&(t=t<0?0-y:y)}}}}{const h=t<0?1:-1;let p=t<0?l:s,g=0;for(;;){const f=e[p];Z(f!=null,`Previous layout not found for panel index ${p}`);const y=cn({panelConstraints:n,panelIndex:p,size:100})-f;if(g+=y,p+=h,p<0||p>=n.length)break}const m=Math.min(Math.abs(t),Math.abs(g));t=t<0?0-m:m}{let p=t<0?s:l;for(;p>=0&&p<n.length;){const g=Math.abs(t)-Math.abs(u),m=e[p];Z(m!=null,`Previous layout not found for panel index ${p}`);const f=m-g,v=cn({panelConstraints:n,panelIndex:p,size:f});if(!Te(m,v)&&(u+=m-v,a[p]=v,u.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?p--:p++}}if(Tm(i,a))return i;{const h=t<0?l:s,p=e[h];Z(p!=null,`Previous layout not found for panel index ${h}`);const g=p+u,m=cn({panelConstraints:n,panelIndex:h,size:g});if(a[h]=m,!Te(m,g)){let f=g-m,y=t<0?l:s;for(;y>=0&&y<n.length;){const S=a[y];Z(S!=null,`Previous layout not found for panel index ${y}`);const w=S+f,D=cn({panelConstraints:n,panelIndex:y,size:w});if(Te(S,D)||(f-=D-S,a[y]=D),Te(f,0))break;t>0?y--:y++}}}const c=a.reduce((h,p)=>p+h,0);return Te(c,100)?a:i}function Dm({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((h,p)=>{const{constraints:g}=h,{maxSize:m=100,minSize:f=0}=g;p===s?(r=f,i=m):(o+=f,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 Jn(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function md(t,e,n=document){const i=Jn(t,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===e);return i??null}function yd(t,e,n){const r=md(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function bd(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 Si(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function Pm(t,e,n,r=document){var i,o,a,s;const l=Si(e,r),u=Jn(t,r),c=l?u.indexOf(l):-1,h=(i=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,p=(a=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null;return[h,p]}function Om({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:a}){Ce({didWarnAboutMissingResizeHandle:!1}),Pt(()=>{if(!o)return;const s=Jn(n,o);for(let l=0;l<i.length-1;l++){const{valueMax:u,valueMin:c,valueNow:h}=Dm({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),p=s[l];if(p!=null){const g=i[l];Z(g,`No panel data found for index "${l}"`),p.setAttribute("aria-controls",g.id),p.setAttribute("aria-valuemax",""+Math.round(u)),p.setAttribute("aria-valuemin",""+Math.round(c)),p.setAttribute("aria-valuenow",h!=null?""+Math.round(h):"")}}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]),Dt(()=>{if(!o)return;const s=e.current;Z(s,"Eager values not found");const{panelDataArray:l}=s,u=bd(n,o);Z(u!=null,`No group found for id "${n}"`);const c=Jn(n,o);Z(c,`No resize handles found for group id "${n}"`);const h=c.map(p=>{const g=p.getAttribute("data-panel-resize-handle-id");Z(g,"Resize handle element has no handle id attribute");const[m,f]=Pm(n,g,l,o);if(m==null||f==null)return()=>{};const v=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const S=l.findIndex(w=>w.id===m);if(S>=0){const w=l[S];Z(w,`No panel data found for index ${S}`);const D=r[S],{collapsedSize:x=0,collapsible:I,minSize:P=0}=w.constraints;if(D!=null&&I){const b=Fn({delta:Te(D,x)?P-x:x-D,initialLayout:r,panelConstraints:l.map(R=>R.constraints),pivotIndices:yd(n,g,o),prevLayout:r,trigger:"keyboard"});r!==b&&a(b)}}break}}};return p.addEventListener("keydown",v),()=>{p.removeEventListener("keydown",v)}});return()=>{h.forEach(p=>p())}},[o,t,e,n,r,i,a])}function qs(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 Sd(t,e){const n=t==="horizontal",{x:r,y:i}=yi(e);return n?r:i}function Im(t,e,n,r,i){const o=n==="horizontal",a=Si(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=Sd(n,t),c=bd(s,i);Z(c,`No group element found for id "${s}"`);const h=c.getBoundingClientRect(),p=o?h.width:h.height;return(u-l)/p*100}function _m(t,e,n,r,i,o){if(ud(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:Im(t,e,n,r,o)}function km({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 Vt(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,h=n[l];if(h==null||r!==h){n[l]=r;const{onCollapse:p,onExpand:g,onResize:m}=a;m&&m(r,h),c&&(p||g)&&(g&&(h==null||nt(h,u))&&!nt(r,u)&&g(),p&&(h==null||!nt(h,u))&&nt(r,u)&&p())}})}function wr(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 Rm({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 Nm(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function Ys(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 wd(t){return`react-resizable-panels:${t}`}function Ed(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 $d(t,e){try{const n=wd(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Mm(t,e,n){var r,i;const o=(r=$d(t,n))!==null&&r!==void 0?r:{},a=Ed(e);return(i=o[a])!==null&&i!==void 0?i:null}function Am(t,e,n,r,i){var o;const a=wd(t),s=Ed(e),l=(o=$d(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 Xs({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(!Te(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=cn({panelConstraints:e,panelIndex:o,size:a});a!=s&&(i+=a-s,n[o]=s)}if(!Te(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=cn({panelConstraints:e,panelIndex:o,size:s});if(a!==l&&(i-=l-a,n[o]=l,Te(i,0)))break}return n}const Km=100,jn={getItem:t=>(Ys(jn),jn.getItem(t)),setItem:(t,e)=>{Ys(jn),jn.setItem(t,e)}},Js={};function xd({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=jn,style:u,tagName:c="div",...h}){const p=$a(o),g=Ce(null),[m,f]=hn(null),[v,y]=hn([]),S=Cm(),w=Ce({}),D=Ce(new Map),x=Ce(0),I=Ce({autoSaveId:t,direction:r,dragState:m,id:p,keyboardResizeBy:s,onLayout:a,storage:l}),P=Ce({layout:v,panelDataArray:[],panelDataArrayChanged:!1});Ce({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),sd(i,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:_}=P.current;return _},setLayout:_=>{const{onLayout:N}=I.current,{layout:A,panelDataArray:F}=P.current,B=Xs({layout:_,panelConstraints:F.map(L=>L.constraints)});qs(A,B)||(y(B),P.current.layout=B,N&&N(B),Vt(F,B,w.current))}}),[]),Pt(()=>{I.current.autoSaveId=t,I.current.direction=r,I.current.dragState=m,I.current.id=p,I.current.onLayout=a,I.current.storage=l}),Om({committedValuesRef:I,eagerValuesRef:P,groupId:p,layout:v,panelDataArray:P.current.panelDataArray,setLayout:y,panelGroupElement:g.current}),Dt(()=>{const{panelDataArray:_}=P.current;if(t){if(v.length===0||v.length!==_.length)return;let N=Js[t];N==null&&(N=Nm(Am,Km),Js[t]=N);const A=[..._],F=new Map(D.current);N(t,A,F,v,l)}},[t,v,l]),Dt(()=>{});const b=xe(_=>{const{onLayout:N}=I.current,{layout:A,panelDataArray:F}=P.current;if(_.constraints.collapsible){const B=F.map(de=>de.constraints),{collapsedSize:L=0,panelSize:X,pivotIndices:ee}=St(F,_,A);if(Z(X!=null,`Panel size not found for panel "${_.id}"`),!nt(X,L)){D.current.set(_.id,X);const ce=an(F,_)===F.length-1?X-L:L-X,oe=Fn({delta:ce,initialLayout:A,panelConstraints:B,pivotIndices:ee,prevLayout:A,trigger:"imperative-api"});wr(A,oe)||(y(oe),P.current.layout=oe,N&&N(oe),Vt(F,oe,w.current))}}},[]),R=xe((_,N)=>{const{onLayout:A}=I.current,{layout:F,panelDataArray:B}=P.current;if(_.constraints.collapsible){const L=B.map(ge=>ge.constraints),{collapsedSize:X=0,panelSize:ee=0,minSize:de=0,pivotIndices:ce}=St(B,_,F),oe=N??de;if(nt(ee,X)){const ge=D.current.get(_.id),ne=ge!=null&&ge>=oe?ge:oe,st=an(B,_)===B.length-1?ee-ne:ne-ee,ve=Fn({delta:st,initialLayout:F,panelConstraints:L,pivotIndices:ce,prevLayout:F,trigger:"imperative-api"});wr(F,ve)||(y(ve),P.current.layout=ve,A&&A(ve),Vt(B,ve,w.current))}}},[]),W=xe(_=>{const{layout:N,panelDataArray:A}=P.current,{panelSize:F}=St(A,_,N);return Z(F!=null,`Panel size not found for panel "${_.id}"`),F},[]),M=xe((_,N)=>{const{panelDataArray:A}=P.current,F=an(A,_);return Rm({defaultSize:N,dragState:m,layout:v,panelData:A,panelIndex:F})},[m,v]),z=xe(_=>{const{layout:N,panelDataArray:A}=P.current,{collapsedSize:F=0,collapsible:B,panelSize:L}=St(A,_,N);return Z(L!=null,`Panel size not found for panel "${_.id}"`),B===!0&&nt(L,F)},[]),E=xe(_=>{const{layout:N,panelDataArray:A}=P.current,{collapsedSize:F=0,collapsible:B,panelSize:L}=St(A,_,N);return Z(L!=null,`Panel size not found for panel "${_.id}"`),!B||Nt(L,F)>0},[]),k=xe(_=>{const{panelDataArray:N}=P.current;N.push(_),N.sort((A,F)=>{const B=A.order,L=F.order;return B==null&&L==null?0:B==null?-1:L==null?1:B-L}),P.current.panelDataArrayChanged=!0,S()},[S]);Pt(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:_,onLayout:N,storage:A}=I.current,{layout:F,panelDataArray:B}=P.current;let L=null;if(_){const ee=Mm(_,B,A);ee&&(D.current=new Map(Object.entries(ee.expandToSizes)),L=ee.layout)}L==null&&(L=km({panelDataArray:B}));const X=Xs({layout:L,panelConstraints:B.map(ee=>ee.constraints)});qs(F,X)||(y(X),P.current.layout=X,N&&N(X),Vt(B,X,w.current))}}),Pt(()=>{const _=P.current;return()=>{_.layout=[]}},[]);const H=xe(_=>{let N=!1;const A=g.current;return A&&window.getComputedStyle(A,null).getPropertyValue("direction")==="rtl"&&(N=!0),function(B){B.preventDefault();const L=g.current;if(!L)return()=>null;const{direction:X,dragState:ee,id:de,keyboardResizeBy:ce,onLayout:oe}=I.current,{layout:ge,panelDataArray:ne}=P.current,{initialLayout:Ue}=ee??{},st=yd(de,_,L);let ve=_m(B,_,X,ee,ce,L);const Dn=X==="horizontal";Dn&&N&&(ve=-ve);const lr=ne.map(G=>G.constraints),$=Fn({delta:ve,initialLayout:Ue??ge,panelConstraints:lr,pivotIndices:st,prevLayout:ge,trigger:ud(B)?"keyboard":"mouse-or-touch"}),V=!wr(ge,$);(cd(B)||dd(B))&&x.current!=ve&&(x.current=ve,!V&&ve!==0?Dn?Gi(_,ve<0?hd:pd):Gi(_,ve<0?gd:vd):Gi(_,0)),V&&(y($),P.current.layout=$,oe&&oe($),Vt(ne,$,w.current))}},[]),U=xe((_,N)=>{const{onLayout:A}=I.current,{layout:F,panelDataArray:B}=P.current,L=B.map(ge=>ge.constraints),{panelSize:X,pivotIndices:ee}=St(B,_,F);Z(X!=null,`Panel size not found for panel "${_.id}"`);const ce=an(B,_)===B.length-1?X-N:N-X,oe=Fn({delta:ce,initialLayout:F,panelConstraints:L,pivotIndices:ee,prevLayout:F,trigger:"imperative-api"});wr(F,oe)||(y(oe),P.current.layout=oe,A&&A(oe),Vt(B,oe,w.current))},[]),Y=xe((_,N)=>{const{layout:A,panelDataArray:F}=P.current,{collapsedSize:B=0,collapsible:L}=N,{collapsedSize:X=0,collapsible:ee,maxSize:de=100,minSize:ce=0}=_.constraints,{panelSize:oe}=St(F,_,A);oe!=null&&(L&&ee&&nt(oe,B)?nt(B,X)||U(_,X):oe<ce?U(_,ce):oe>de&&U(_,de))},[U]),K=xe((_,N)=>{const{direction:A}=I.current,{layout:F}=P.current;if(!g.current)return;const B=Si(_,g.current);Z(B,`Drag handle element not found for id "${_}"`);const L=Sd(A,N);f({dragHandleId:_,dragHandleRect:B.getBoundingClientRect(),initialCursorPosition:L,initialLayout:F})},[]),q=xe(()=>{f(null)},[]),re=xe(_=>{const{panelDataArray:N}=P.current,A=an(N,_);A>=0&&(N.splice(A,1),delete w.current[_.id],P.current.panelDataArrayChanged=!0,S())},[S]),j=dm(()=>({collapsePanel:b,direction:r,dragState:m,expandPanel:R,getPanelSize:W,getPanelStyle:M,groupId:p,isPanelCollapsed:z,isPanelExpanded:E,reevaluatePanelConstraints:Y,registerPanel:k,registerResizeHandle:H,resizePanel:U,startDragging:K,stopDragging:q,unregisterPanel:re,panelGroupElement:g.current}),[b,m,r,R,W,M,p,z,E,Y,k,H,U,K,q,re]),O={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Sn(mi.Provider,{value:j},Sn(c,{...h,children:e,className:n,id:o,ref:g,style:{...O,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const Cd=od((t,e)=>Sn(xd,{...t,forwardedRef:e}));xd.displayName="PanelGroup";Cd.displayName="forwardRef(PanelGroup)";function an(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function St(t,e,n){const r=an(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:o}}function Lm({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){Dt(()=>{if(t||n==null||r==null)return;const i=Si(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=Jn(s,r),u=md(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 Td({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",...h}){var p,g;const m=Ce(null),f=Ce({onDragging:a});Dt(()=>{f.current.onDragging=a});const v=ad(mi);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:S,registerResizeHandle:w,startDragging:D,stopDragging:x,panelGroupElement:I}=v,P=$a(i),[b,R]=hn("inactive"),[W,M]=hn(!1),[z,E]=hn(null),k=Ce({state:b});Pt(()=>{k.current.state=b}),Dt(()=>{if(n)E(null);else{const K=w(P);E(()=>K)}},[n,P,w]);const H=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,U=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;return Dt(()=>{if(n||z==null)return;const K=m.current;return Z(K,"Element ref not attached"),xm(P,K,y,{coarse:H,fine:U},(re,j,O)=>{if(j)switch(re){case"down":{R("drag"),Z(O,'Expected event to be defined for "down" action'),D(P,O);const{onDragging:_}=f.current;_&&_(!0);break}case"move":{const{state:_}=k.current;_!=="drag"&&R("hover"),Z(O,'Expected event to be defined for "move" action'),z(O);break}case"up":{R("hover"),x();const{onDragging:_}=f.current;_&&_(!1);break}}else R("inactive")})},[H,y,n,U,w,P,z,D,x]),Lm({disabled:n,handleId:P,resizeHandler:z,panelGroupElement:I}),Sn(c,{...h,children:t,className:e,id:i,onBlur:()=>{M(!1),o==null||o()},onFocus:()=>{M(!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":S,"data-resize-handle":"","data-resize-handle-active":b==="drag"?"pointer":W?"keyboard":void 0,"data-resize-handle-state":b,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":P})}Td.displayName="PanelResizeHandle";const Fm=({children:t,isOpen:e})=>{const{isDesktop:n}=ar();return n?T.jsx("div",{className:ot("c__right-panel",{open:e}),children:t}):T.jsx("div",{className:ot("c__right-panel__mobile",{open:e}),children:t})},jm=({icon:t,children:e,leftPanelContent:n,rightPanelContent:r,rightHeaderContent:i,languages:o,enableResize:a=!1,rightPanelIsOpen:s=!1})=>{const[l,u]=d.useState(!1),{isDesktop:c}=ar(),h=d.useRef(null),[p,g]=d.useState(Er(300,c)),[m,f]=d.useState(Er(450,c)),v=()=>{u(!l)};return d.useEffect(()=>{const y=()=>{const S=Math.round(Er(300,c)),w=Math.round(Math.min(Er(450,c),40));g(c?S:0),f(a?w:S)};return y(),window.addEventListener("resize",()=>{y()}),()=>{window.removeEventListener("resize",y)}},[c,a]),T.jsxs("div",{className:"c__main-layout",children:[T.jsx("div",{className:"c__main-layout__header",children:T.jsx(rd,{onTogglePanel:v,isPanelOpen:l,rightIcon:i,leftIcon:t,languages:o})}),T.jsx("div",{className:"c__main-layout__content",children:T.jsxs(Cd,{autoSaveId:"persistance",direction:"horizontal",children:[T.jsx(zo,{ref:h,order:0,defaultSize:p,minSize:p,maxSize:m,children:T.jsx(id,{isOpen:c?!0:l,children:n})}),c&&T.jsx(Td,{className:"bg-greyscale-200",style:{width:"1px"}}),T.jsx(zo,{order:1,children:T.jsxs("div",{className:"c__main-layout__content__center",children:[T.jsx("div",{className:"c__main-layout__content__center__children",children:e}),T.jsx(Fm,{isOpen:s,children:r})]})})]})})]})},Er=(t,e)=>{if(!e)return 0;const n=window.innerWidth;return t/n*100},zm=52,Da=({size:t="sm"})=>T.jsx("div",{className:["c__spinner",t].join(" ")}),Dd=({children:t,text:e,...n})=>T.jsxs("div",{className:"suite__label__container",children:[T.jsx("label",{...n,children:t}),e&&T.jsx("span",{className:"suite__label__container__description",children:e})]}),Hm=({label:t,text:e,labelSide:n="right",children:r})=>T.jsxs("div",{className:ot("c__with-label",{[n]:!0}),children:[T.jsx(Dd,{children:t,text:e}),r]});var Qs=1,Bm=.9,Wm=.8,Um=.17,qi=.1,Yi=.999,Vm=.9999,Gm=.99,qm=/[\\\/_+.#"@\[\(\{&]/,Ym=/[\\\/_+.#"@\[\(\{&]/g,Xm=/[\s-]/,Pd=/[\s-]/g;function Bo(t,e,n,r,i,o,a){if(o===e.length)return i===t.length?Qs:Gm;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,h,p,g,m;u>=0;)h=Bo(t,e,n,r,u+1,o+1,a),h>c&&(u===i?h*=Qs:qm.test(t.charAt(u-1))?(h*=Wm,g=t.slice(i,u-1).match(Ym),g&&i>0&&(h*=Math.pow(Yi,g.length))):Xm.test(t.charAt(u-1))?(h*=Bm,m=t.slice(i,u-1).match(Pd),m&&i>0&&(h*=Math.pow(Yi,m.length))):(h*=Um,i>0&&(h*=Math.pow(Yi,u-i))),t.charAt(u)!==e.charAt(o)&&(h*=Vm)),(h<qi&&n.charAt(u-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(u-1)!==r.charAt(o))&&(p=Bo(t,e,n,r,u+1,o+2,a),p*qi>h&&(h=p*qi)),h>c&&(c=h),u=n.indexOf(l,u+1);return a[s]=c,c}function Zs(t){return t.toLowerCase().replace(Pd," ")}function Jm(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Bo(t,e,Zs(t),Zs(e),0,0,{})}function mt(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 el(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Od(...t){return e=>{let n=!1;const r=t.map(i=>{const o=el(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():el(t[i],null)}}}}function zt(...t){return C.useCallback(Od(...t),t)}function Qm(t,e){const n=C.createContext(e),r=o=>{const{children:a,...s}=o,l=C.useMemo(()=>s,Object.values(s));return T.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(o){const a=C.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 Zm(t,e=[]){let n=[];function r(o,a){const s=C.createContext(a),l=n.length;n=[...n,a];const u=h=>{var y;const{scope:p,children:g,...m}=h,f=((y=p==null?void 0:p[t])==null?void 0:y[l])||s,v=C.useMemo(()=>m,Object.values(m));return T.jsx(f.Provider,{value:v,children:g})};u.displayName=o+"Provider";function c(h,p){var f;const g=((f=p==null?void 0:p[t])==null?void 0:f[l])||s,m=C.useContext(g);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,c]}const i=()=>{const o=n.map(a=>C.createContext(a));return function(s){const l=(s==null?void 0:s[t])||o;return C.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return i.scopeName=t,[r,ey(i,...e)]}function ey(...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 h=l(o)[`__scope${u}`];return{...s,...h}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var ri=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},ty=C.useId||(()=>{}),ny=0;function it(t){const[e,n]=C.useState(ty());return ri(()=>{n(r=>r??String(ny++))},[t]),e?`radix-${e}`:""}function Mt(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function ry({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=iy({defaultProp:e,onChange:n}),o=t!==void 0,a=o?t:r,s=Mt(n),l=C.useCallback(u=>{if(o){const h=typeof u=="function"?u(t):u;h!==t&&s(h)}else i(u)},[o,t,i,s]);return[a,l]}function iy({defaultProp:t,onChange:e}){const n=C.useState(t),[r]=n,i=C.useRef(r),o=Mt(e);return C.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var Pa=C.forwardRef((t,e)=>{const{children:n,...r}=t,i=C.Children.toArray(n),o=i.find(ay);if(o){const a=o.props.children,s=i.map(l=>l===o?C.Children.count(a)>1?C.Children.only(null):C.isValidElement(a)?a.props.children:null:l);return T.jsx(Wo,{...r,ref:e,children:C.isValidElement(a)?C.cloneElement(a,void 0,s):null})}return T.jsx(Wo,{...r,ref:e,children:n})});Pa.displayName="Slot";var Wo=C.forwardRef((t,e)=>{const{children:n,...r}=t;if(C.isValidElement(n)){const i=ly(n),o=sy(r,n.props);return n.type!==C.Fragment&&(o.ref=e?Od(e,i):i),C.cloneElement(n,o)}return C.Children.count(n)>1?C.Children.only(null):null});Wo.displayName="SlotClone";var oy=({children:t})=>T.jsx(T.Fragment,{children:t});function ay(t){return C.isValidElement(t)&&t.type===oy}function sy(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 ly(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 uy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=uy.reduce((t,e)=>{const n=C.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Pa:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),T.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function cy(t,e){t&&ah.flushSync(()=>t.dispatchEvent(e))}function dy(t,e=globalThis==null?void 0:globalThis.document){const n=Mt(t);C.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 fy="DismissableLayer",Uo="dismissableLayer.update",hy="dismissableLayer.pointerDownOutside",py="dismissableLayer.focusOutside",tl,Id=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_d=C.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=t,u=C.useContext(Id),[c,h]=C.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),m=zt(e,P=>h(P)),f=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=f.indexOf(v),S=c?f.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,D=S>=y,x=my(P=>{const b=P.target,R=[...u.branches].some(W=>W.contains(b));!D||R||(i==null||i(P),a==null||a(P),P.defaultPrevented||s==null||s())},p),I=yy(P=>{const b=P.target;[...u.branches].some(W=>W.contains(b))||(o==null||o(P),a==null||a(P),P.defaultPrevented||s==null||s())},p);return dy(P=>{S===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},p),C.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(tl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),nl(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=tl)}},[c,p,n,u]),C.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),nl())},[c,u]),C.useEffect(()=>{const P=()=>g({});return document.addEventListener(Uo,P),()=>document.removeEventListener(Uo,P)},[]),T.jsx(be.div,{...l,ref:m,style:{pointerEvents:w?D?"auto":"none":void 0,...t.style},onFocusCapture:mt(t.onFocusCapture,I.onFocusCapture),onBlurCapture:mt(t.onBlurCapture,I.onBlurCapture),onPointerDownCapture:mt(t.onPointerDownCapture,x.onPointerDownCapture)})});_d.displayName=fy;var gy="DismissableLayerBranch",vy=C.forwardRef((t,e)=>{const n=C.useContext(Id),r=C.useRef(null),i=zt(e,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),T.jsx(be.div,{...t,ref:i})});vy.displayName=gy;function my(t,e=globalThis==null?void 0:globalThis.document){const n=Mt(t),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){kd(hy,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 yy(t,e=globalThis==null?void 0:globalThis.document){const n=Mt(t),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&kd(py,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 nl(){const t=new CustomEvent(Uo);document.dispatchEvent(t)}function kd(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?cy(i,o):i.dispatchEvent(o)}var Xi="focusScope.autoFocusOnMount",Ji="focusScope.autoFocusOnUnmount",rl={bubbles:!1,cancelable:!0},by="FocusScope",Rd=C.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=t,[s,l]=C.useState(null),u=Mt(i),c=Mt(o),h=C.useRef(null),p=zt(e,f=>l(f)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let f=function(w){if(g.paused||!s)return;const D=w.target;s.contains(D)?h.current=D:ct(h.current,{select:!0})},v=function(w){if(g.paused||!s)return;const D=w.relatedTarget;D!==null&&(s.contains(D)||ct(h.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&ct(s)};document.addEventListener("focusin",f),document.addEventListener("focusout",v);const S=new MutationObserver(y);return s&&S.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",v),S.disconnect()}}},[r,s,g.paused]),C.useEffect(()=>{if(s){ol.add(g);const f=document.activeElement;if(!s.contains(f)){const y=new CustomEvent(Xi,rl);s.addEventListener(Xi,u),s.dispatchEvent(y),y.defaultPrevented||(Sy(Cy(Nd(s)),{select:!0}),document.activeElement===f&&ct(s))}return()=>{s.removeEventListener(Xi,u),setTimeout(()=>{const y=new CustomEvent(Ji,rl);s.addEventListener(Ji,c),s.dispatchEvent(y),y.defaultPrevented||ct(f??document.body,{select:!0}),s.removeEventListener(Ji,c),ol.remove(g)},0)}}},[s,u,c,g]);const m=C.useCallback(f=>{if(!n&&!r||g.paused)return;const v=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,y=document.activeElement;if(v&&y){const S=f.currentTarget,[w,D]=wy(S);w&&D?!f.shiftKey&&y===D?(f.preventDefault(),n&&ct(w,{select:!0})):f.shiftKey&&y===w&&(f.preventDefault(),n&&ct(D,{select:!0})):y===S&&f.preventDefault()}},[n,r,g.paused]);return T.jsx(be.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});Rd.displayName=by;function Sy(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ct(r,{select:e}),document.activeElement!==n)return}function wy(t){const e=Nd(t),n=il(e,t),r=il(e.reverse(),t);return[n,r]}function Nd(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 il(t,e){for(const n of t)if(!Ey(n,{upTo:e}))return n}function Ey(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 $y(t){return t instanceof HTMLInputElement&&"select"in t}function ct(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&$y(t)&&e&&t.select()}}var ol=xy();function xy(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=al(t,e),t.unshift(e)},remove(e){var n;t=al(t,e),(n=t[0])==null||n.resume()}}}function al(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Cy(t){return t.filter(e=>e.tagName!=="A")}var Ty="Portal",Md=C.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[i,o]=C.useState(!1);ri(()=>o(!0),[]);const a=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?jt.createPortal(T.jsx(be.div,{...r,ref:e}),a):null});Md.displayName=Ty;function Dy(t,e){return C.useReducer((n,r)=>e[n][r]??n,t)}var wi=t=>{const{present:e,children:n}=t,r=Py(e),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=zt(r.ref,Oy(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};wi.displayName="Presence";function Py(t){const[e,n]=C.useState(),r=C.useRef({}),i=C.useRef(t),o=C.useRef("none"),a=t?"mounted":"unmounted",[s,l]=Dy(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=$r(r.current);o.current=s==="mounted"?u:"none"},[s]),ri(()=>{const u=r.current,c=i.current;if(c!==t){const p=o.current,g=$r(u);t?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),ri(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,h=g=>{const f=$r(r.current).includes(g.animationName);if(g.target===e&&f&&(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)})}},p=g=>{g.target===e&&(o.current=$r(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function $r(t){return(t==null?void 0:t.animationName)||"none"}function Oy(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 Qi=0;function Iy(){C.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sl()),document.body.insertAdjacentElement("beforeend",t[1]??sl()),Qi++,()=>{Qi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Qi--}},[])}function sl(){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 Rr="right-scroll-bar-position",Nr="width-before-scroll-bar",_y="with-scroll-bars-hidden",ky="--removed-body-scroll-bar-size";function Zi(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Ry(t,e){var n=d.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 Ny=typeof window<"u"?C.useLayoutEffect:C.useEffect,ll=new WeakMap;function My(t,e){var n=Ry(null,function(r){return t.forEach(function(i){return Zi(i,r)})});return Ny(function(){var r=ll.get(n);if(r){var i=new Set(r),o=new Set(t),a=n.current;i.forEach(function(s){o.has(s)||Zi(s,null)}),o.forEach(function(s){i.has(s)||Zi(s,a)})}ll.set(n,t)},[t]),n}function Ay(t){return t}function Ky(t,e){e===void 0&&(e=Ay);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 Ly(t){t===void 0&&(t={});var e=Ky(null);return e.options=Ge({async:!0,ssr:!1},t),e}var Ad=function(t){var e=t.sideCar,n=oc(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 C.createElement(r,Ge({},n))};Ad.isSideCarExport=!0;function Fy(t,e){return t.useMedium(e),Ad}var Kd=Ly(),eo=function(){},Ei=C.forwardRef(function(t,e){var n=C.useRef(null),r=C.useState({onScrollCapture:eo,onWheelCapture:eo,onTouchMoveCapture:eo}),i=r[0],o=r[1],a=t.forwardProps,s=t.children,l=t.className,u=t.removeScrollBar,c=t.enabled,h=t.shards,p=t.sideCar,g=t.noIsolation,m=t.inert,f=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,S=t.gapMode,w=oc(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),D=p,x=My([n,e]),I=Ge(Ge({},w),i);return C.createElement(C.Fragment,null,c&&C.createElement(D,{sideCar:Kd,removeScrollBar:u,shards:h,noIsolation:g,inert:m,setCallbacks:o,allowPinchZoom:!!f,lockRef:n,gapMode:S}),a?C.cloneElement(C.Children.only(s),Ge(Ge({},I),{ref:x})):C.createElement(y,Ge({},I,{className:l,ref:x}),s))});Ei.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ei.classNames={fullWidth:Nr,zeroRight:Rr};var jy=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zy(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=jy();return e&&t.setAttribute("nonce",e),t}function Hy(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function By(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Wy=function(){var t=0,e=null;return{add:function(n){t==0&&(e=zy())&&(Hy(e,n),By(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Uy=function(){var t=Wy();return function(e,n){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Ld=function(){var t=Uy(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},Vy={left:0,top:0,right:0,gap:0},to=function(t){return parseInt(t||"",10)||0},Gy=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[to(n),to(r),to(i)]},qy=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Vy;var e=Gy(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])}},Yy=Ld(),gn="data-scroll-locked",Xy=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
|
+
*/var ts;function cp(){return ts||(ts=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 f=m();if(!h){var v=m();o(f,v)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),h=!0)}v=a({inst:{value:f,getSnapshot:m}});var y=v[0].inst,S=v[1];return l(function(){y.value=f,y.getSnapshot=m,n(y)&&S({inst:y})},[g,f,m]),s(function(){return n(y)&&S({inst:y}),g(function(){n(y)&&S({inst:y})})},[g]),u(f),f}function n(g){var m=g.getSnapshot;g=g.value;try{var f=m();return!o(g,f)}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=d,o=typeof Object.is=="function"?Object.is:t,a=i.useState,s=i.useEffect,l=i.useLayoutEffect,u=i.useDebugValue,c=!1,h=!1,p=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?r:e;Ni.useSyncExternalStore=i.useSyncExternalStore!==void 0?i.useSyncExternalStore:p,typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Ni}var ns;function dp(){return ns||(ns=1,process.env.NODE_ENV==="production"?hr.exports=up():hr.exports=cp()),hr.exports}var da=dp();const Ru=d.createContext(!1),Yn=d.createContext(null);function Nu(t){if(d.useContext(Yn))return t.content;let{collection:n,document:r}=gp(t.createCollection);return d.createElement(d.Fragment,null,d.createElement(op,null,d.createElement(Yn.Provider,{value:r},t.content)),d.createElement(fp,{render:t.children,collection:n}))}function fp({collection:t,render:e}){return e(t)}function hp(t,e,n){let r=$n(),i=d.useRef(r);i.current=r;let o=d.useCallback(()=>i.current?n():e(),[e,n]);return da.useSyncExternalStore(t,o)}const pp=typeof d.useSyncExternalStore=="function"?d.useSyncExternalStore:hp;function gp(t){let[e]=d.useState(()=>new rp((t==null?void 0:t())||new ca)),n=d.useCallback(a=>e.subscribe(a),[e]),r=d.useCallback(()=>{let a=e.getCollection();return e.isSSR&&e.resetAfterSSR(),a},[e]),i=d.useCallback(()=>(e.isSSR=!0,e.getCollection()),[e]),o=pp(n,r,i);return lp(()=>(e.isMounted=!0,()=>{e.isMounted=!1}),[e]),{collection:o,document:e}}const Co=d.createContext(null);function vp(t,e,n,r,i,o){let a=d.useCallback(l=>{l==null||l.setProps(e,n,r,o)},[e,n,r,o]),s=d.useContext(Co);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?d.createElement(Co.Provider,{value:l},i):null}return d.createElement(t,{ref:a},i)}function fa(t,e){let n=({node:i})=>e(i.props,i.props.ref,i),r=d.forwardRef((i,o)=>{if(!d.useContext(Ru)){if(e.length>=3)throw new Error(e.name+" cannot be rendered outside a collection.");return e(i,o)}return vp(t,i,o,"children"in i?i.children:null,null,s=>d.createElement(n,{node:s}))});return r.displayName=e.name,r}function mp(t){return ku({...t,addIdAndValue:!0})}const rs=d.createContext(null);function Mu(t){let e=d.useContext(rs),n=((e==null?void 0:e.dependencies)||[]).concat(t.dependencies),r=t.idScope||(e==null?void 0:e.idScope),i=mp({...t,idScope:r,dependencies:n});return d.useContext(Yn)&&(i=d.createElement(yp,null,i)),e=d.useMemo(()=>({dependencies:n,idScope:r}),[r,...n]),d.createElement(rs.Provider,{value:e},i)}function yp({children:t}){let e=d.useContext(Yn),n=d.useMemo(()=>d.createElement(Yn.Provider,{value:null},d.createElement(Ru.Provider,{value:!0},t)),[t]);return $n()?d.createElement(Co.Provider,{value:e},n):jt.createPortal(n,e)}const Pe=typeof document<"u"?d.useLayoutEffect:()=>{};function bp(t){const e=d.useRef(null);return Pe(()=>{e.current=t},[t]),d.useCallback((...n)=>{const r=e.current;return r==null?void 0:r(...n)},[])}const me=t=>{var e;return(e=t==null?void 0:t.ownerDocument)!==null&&e!==void 0?e:document},gt=t=>t&&"window"in t&&t.window===t?t:me(t).defaultView||window;function is(t){if(Sp())t.focus({preventScroll:!0});else{let e=wp(t);t.focus(),Ep(e)}}let pr=null;function Sp(){if(pr==null){pr=!1;try{document.createElement("div").focus({get preventScroll(){return pr=!0,!0}})}catch{}}return pr}function wp(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 Ep(t){for(let{element:e,scrollTop:n,scrollLeft:r}of t)e.scrollTop=n,e.scrollLeft=r}function Au(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 $p(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 ha(t){let e=null;return()=>(e==null&&(e=t()),e)}const xp=ha(function(){return $p(/^Mac/i)}),Cp=ha(function(){return Au(/Chrome/i)}),Ku=ha(function(){return Au(/Android/i)});let on=new Map,To=new Set;function os(){if(typeof window>"u")return;function t(r){return"propertyName"in r}let e=r=>{if(!t(r)||!r.target)return;let i=on.get(r.target);i||(i=new Set,on.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=on.get(r.target);if(i&&(i.delete(r.propertyName),i.size===0&&(r.target.removeEventListener("transitioncancel",n),on.delete(r.target)),on.size===0)){for(let o of To)o();To.clear()}};document.body.addEventListener("transitionrun",e),document.body.addEventListener("transitionend",n)}typeof document<"u"&&(document.readyState!=="loading"?os():document.addEventListener("DOMContentLoaded",os));function Tp(t){requestAnimationFrame(()=>{on.size===0?t():To.add(t)})}function Dp(t){return t.mozInputSource===0&&t.isTrusted?!0:Ku()&&t.pointerType?t.type==="click"&&t.buttons===1:t.detail===0&&!t.pointerType}function Pp(t,e){return e.get?e.get.call(t):e.value}function Lu(t,e,n){if(!e.has(t))throw new TypeError("attempted to "+n+" private field on non-instance");return e.get(t)}function Op(t,e){var n=Lu(t,e,"get");return Pp(t,n)}function Ip(t,e){if(e.has(t))throw new TypeError("Cannot initialize the same private elements twice on an object")}function _p(t,e,n){Ip(t,e),e.set(t,n)}function kp(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 as(t,e,n){var r=Lu(t,e,"set");return kp(t,r,n),n}let Rp=class{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 Fu(t){let e=d.useRef({isFocused:!1,observer:null});Pe(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=bp(r=>{t==null||t(r)});return d.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 Rp("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 Np(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:i}=t;const o=d.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),a=Fu(o),s=d.useCallback(l=>{const u=me(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 Cn=null,Do=new Set,Bn=new Map,kt=!1,Po=!1;const Mp={Tab:!0,Escape:!0};function pa(t,e){for(let n of Do)n(t,e)}function Ap(t){return!(t.metaKey||!xp()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Gr(t){kt=!0,Ap(t)&&(Cn="keyboard",pa("keyboard",t))}function Re(t){Cn="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(kt=!0,pa("pointer",t))}function ju(t){Dp(t)&&(kt=!0,Cn="virtual")}function zu(t){t.target===window||t.target===document||(!kt&&!Po&&(Cn="virtual",pa("virtual",t)),kt=!1,Po=!1)}function Hu(){kt=!1,Po=!0}function Oo(t){if(typeof window>"u"||Bn.get(gt(t)))return;const e=gt(t),n=me(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){kt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Gr,!0),n.addEventListener("keyup",Gr,!0),n.addEventListener("click",ju,!0),e.addEventListener("focus",zu,!0),e.addEventListener("blur",Hu,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Re,!0),n.addEventListener("pointermove",Re,!0),n.addEventListener("pointerup",Re,!0)):(n.addEventListener("mousedown",Re,!0),n.addEventListener("mousemove",Re,!0),n.addEventListener("mouseup",Re,!0)),e.addEventListener("beforeunload",()=>{Bu(t)},{once:!0}),Bn.set(e,{focus:r})}const Bu=(t,e)=>{const n=gt(t),r=me(t);e&&r.removeEventListener("DOMContentLoaded",e),Bn.has(n)&&(n.HTMLElement.prototype.focus=Bn.get(n).focus,r.removeEventListener("keydown",Gr,!0),r.removeEventListener("keyup",Gr,!0),r.removeEventListener("click",ju,!0),n.removeEventListener("focus",zu,!0),n.removeEventListener("blur",Hu,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Re,!0),r.removeEventListener("pointermove",Re,!0),r.removeEventListener("pointerup",Re,!0)):(r.removeEventListener("mousedown",Re,!0),r.removeEventListener("mousemove",Re,!0),r.removeEventListener("mouseup",Re,!0)),Bn.delete(n))};function Kp(t){const e=me(t);let n;return e.readyState!=="loading"?Oo(t):(n=()=>{Oo(t)},e.addEventListener("DOMContentLoaded",n)),()=>Bu(t,n)}typeof document<"u"&&Kp();function Wu(){return Cn!=="pointer"}function Uu(){return Cn}const Lp=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Fp(t,e,n){var r;const i=typeof window<"u"?gt(n==null?void 0:n.target).HTMLInputElement:HTMLInputElement,o=typeof window<"u"?gt(n==null?void 0:n.target).HTMLTextAreaElement:HTMLTextAreaElement,a=typeof window<"u"?gt(n==null?void 0:n.target).HTMLElement:HTMLElement,s=typeof window<"u"?gt(n==null?void 0:n.target).KeyboardEvent:KeyboardEvent;return t=t||(n==null?void 0:n.target)instanceof i&&!Lp.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&&!Mp[n.key])}function jp(t,e,n){Oo(),d.useEffect(()=>{let r=(i,o)=>{Fp(!!(n!=null&&n.isTextInput),i,o)&&t(Wu())};return Do.add(r),()=>{Do.delete(r)}},e)}function zp(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=t,o=d.useRef({isFocusWithin:!1}),a=d.useCallback(u=>{o.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,o]),s=Fu(a),l=d.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}}}function qr(t){const e=me(t);if(Uu()==="virtual"){let n=e.activeElement;Tp(()=>{e.activeElement===n&&t.isConnected&&is(t)})}else is(t)}function Hp(t){const e=gt(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 Bp(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 Vu(t,e){return t.nodeName!=="#comment"&&Hp(t)&&Bp(t,e)&&(!t.parentElement||Vu(t.parentElement,t))}const ss=d.createContext(null),Io="react-aria-focus-scope-restore";let ae=null;function Gu(t){let{children:e,contain:n,restoreFocus:r,autoFocus:i}=t,o=d.useRef(null),a=d.useRef(null),s=d.useRef([]),{parentNode:l}=d.useContext(ss)||{},u=d.useMemo(()=>new ko({scopeRef:s}),[s]);Pe(()=>{let p=l||ue.root;if(ue.getTreeNode(p.scopeRef)&&ae&&!Yr(ae,p.scopeRef)){let g=ue.getTreeNode(ae);g&&(p=g)}p.addChild(u),ue.addNode(u)},[u,l]),Pe(()=>{let p=ue.getTreeNode(s);p&&(p.contain=!!n)},[n]),Pe(()=>{var p;let g=(p=o.current)===null||p===void 0?void 0:p.nextSibling,m=[],f=v=>v.stopPropagation();for(;g&&g!==a.current;)m.push(g),g.addEventListener(Io,f),g=g.nextSibling;return s.current=m,()=>{for(let v of m)v.removeEventListener(Io,f)}},[e]),Xp(s,r,n),Gp(s,n),Jp(s,r,n),Yp(s,i),d.useEffect(()=>{const p=me(s.current?s.current[0]:void 0).activeElement;let g=null;if(Le(p,s.current)){for(let m of ue.traverse())m.scopeRef&&Le(p,m.scopeRef.current)&&(g=m);g===ue.getTreeNode(s)&&(ae=g.scopeRef)}},[s]),Pe(()=>()=>{var p,g,m;let f=(m=(g=ue.getTreeNode(s))===null||g===void 0||(p=g.parent)===null||p===void 0?void 0:p.scopeRef)!==null&&m!==void 0?m:null;(s===ae||Yr(s,ae))&&(!f||ue.getTreeNode(f))&&(ae=f),ue.removeTreeNode(s)},[s]);let c=d.useMemo(()=>Wp(s),[]),h=d.useMemo(()=>({focusManager:c,parentNode:u}),[u,c]);return d.createElement(ss.Provider,{value:h},d.createElement("span",{"data-focus-scope-start":!0,hidden:!0,ref:o}),e,d.createElement("span",{"data-focus-scope-end":!0,hidden:!0,ref:a}))}function Wp(t){return{focusNext(e={}){let n=t.current,{from:r,tabbable:i,wrap:o,accept:a}=e,s=r||me(n[0]).activeElement,l=n[0].previousElementSibling,u=Ct(n),c=qe(u,{tabbable:i,accept:a},n);c.currentNode=Le(s,n)?s:l;let h=c.nextNode();return!h&&o&&(c.currentNode=l,h=c.nextNode()),h&&rt(h,!0),h},focusPrevious(e={}){let n=t.current,{from:r,tabbable:i,wrap:o,accept:a}=e,s=r||me(n[0]).activeElement,l=n[n.length-1].nextElementSibling,u=Ct(n),c=qe(u,{tabbable:i,accept:a},n);c.currentNode=Le(s,n)?s:l;let h=c.previousNode();return!h&&o&&(c.currentNode=l,h=c.previousNode()),h&&rt(h,!0),h},focusFirst(e={}){let n=t.current,{tabbable:r,accept:i}=e,o=Ct(n),a=qe(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=Ct(n),a=qe(o,{tabbable:r,accept:i},n);a.currentNode=n[n.length-1].nextElementSibling;let s=a.previousNode();return s&&rt(s,!0),s}}}const ga=["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"])'],Up=ga.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])";ga.push('[tabindex]:not([tabindex="-1"]):not([disabled])');const Vp=ga.join(':not([hidden]):not([tabindex="-1"]),');function Ct(t){return t[0].parentElement}function Kn(t){let e=ue.getTreeNode(ae);for(;e&&e.scopeRef!==t;){if(e.contain)return!1;e=e.parent}return!0}function Gp(t,e){let n=d.useRef(void 0),r=d.useRef(void 0);Pe(()=>{let i=t.current;if(!e){r.current&&(cancelAnimationFrame(r.current),r.current=void 0);return}const o=me(i?i[0]:void 0);let a=u=>{if(u.key!=="Tab"||u.altKey||u.ctrlKey||u.metaKey||!Kn(t)||u.isComposing)return;let c=o.activeElement,h=t.current;if(!h||!Le(c,h))return;let p=Ct(h),g=qe(p,{tabbable:!0},h);if(!c)return;g.currentNode=c;let m=u.shiftKey?g.previousNode():g.nextNode();m||(g.currentNode=u.shiftKey?h[h.length-1].nextElementSibling:h[0].previousElementSibling,m=u.shiftKey?g.previousNode():g.nextNode()),u.preventDefault(),m&&rt(m,!0)},s=u=>{(!ae||Yr(ae,t))&&Le(u.target,t.current)?(ae=t,n.current=u.target):Kn(t)&&!vt(u.target,t)?n.current?n.current.focus():ae&&ae.current&&_o(ae.current):Kn(t)&&(n.current=u.target)},l=u=>{r.current&&cancelAnimationFrame(r.current),r.current=requestAnimationFrame(()=>{let c=Uu();if(!((c==="virtual"||c===null)&&Ku()&&Cp())&&o.activeElement&&Kn(t)&&!vt(o.activeElement,t))if(ae=t,o.body.contains(u.target)){var p;n.current=u.target,(p=n.current)===null||p===void 0||p.focus()}else ae.current&&_o(ae.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]),Pe(()=>()=>{r.current&&cancelAnimationFrame(r.current)},[r])}function qu(t){return vt(t)}function Le(t,e){return!t||!e?!1:e.some(n=>n.contains(t))}function vt(t,e=null){if(t instanceof Element&&t.closest("[data-react-aria-top-layer]"))return!0;for(let{scopeRef:n}of ue.traverse(ue.getTreeNode(e)))if(n&&Le(t,n.current))return!0;return!1}function qp(t){return vt(t,ae)}function Yr(t,e){var n;let r=(n=ue.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{qr(t)}catch{}else if(t!=null)try{t.focus()}catch{}}function Yu(t,e=!0){let n=t[0].previousElementSibling,r=Ct(t),i=qe(r,{tabbable:e},t);i.currentNode=n;let o=i.nextNode();return e&&!o&&(r=Ct(t),i=qe(r,{tabbable:!1},t),i.currentNode=n,o=i.nextNode()),o}function _o(t,e=!0){rt(Yu(t,e))}function Yp(t,e){const n=d.useRef(e);d.useEffect(()=>{if(n.current){ae=t;const r=me(t.current?t.current[0]:void 0);!Le(r.activeElement,ae.current)&&t.current&&_o(t.current)}n.current=!1},[t])}function Xp(t,e,n){Pe(()=>{if(e||n)return;let r=t.current;const i=me(r?r[0]:void 0);let o=a=>{let s=a.target;Le(s,t.current)?ae=t:qu(s)||(ae=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 ls(t){let e=ue.getTreeNode(ae);for(;e&&e.scopeRef!==t;){if(e.nodeToRestore)return!1;e=e.parent}return(e==null?void 0:e.scopeRef)===t}function Jp(t,e,n){const r=d.useRef(typeof document<"u"?me(t.current?t.current[0]:void 0).activeElement:null);Pe(()=>{let i=t.current;const o=me(i?i[0]:void 0);if(!e||n)return;let a=()=>{(!ae||Yr(ae,t))&&Le(o.activeElement,t.current)&&(ae=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]),Pe(()=>{const i=me(t.current?t.current[0]:void 0);if(!e)return;let o=a=>{if(a.key!=="Tab"||a.altKey||a.ctrlKey||a.metaKey||!Kn(t)||a.isComposing)return;let s=i.activeElement;if(!vt(s,t)||!ls(t))return;let l=ue.getTreeNode(t);if(!l)return;let u=l.nodeToRestore,c=qe(i.body,{tabbable:!0});c.currentNode=s;let h=a.shiftKey?c.previousNode():c.nextNode();if((!u||!i.body.contains(u)||u===i.body)&&(u=void 0,l.nodeToRestore=void 0),(!h||!vt(h,t))&&u){c.currentNode=u;do h=a.shiftKey?c.previousNode():c.nextNode();while(vt(h,t));a.preventDefault(),a.stopPropagation(),h?rt(h,!0):qu(u)?rt(u,!0):s.blur()}};return n||i.addEventListener("keydown",o,!0),()=>{n||i.removeEventListener("keydown",o,!0)}},[t,e,n]),Pe(()=>{const i=me(t.current?t.current[0]:void 0);if(!e)return;let o=ue.getTreeNode(t);if(o){var a;return o.nodeToRestore=(a=r.current)!==null&&a!==void 0?a:void 0,()=>{let s=ue.getTreeNode(t);if(!s)return;let l=s.nodeToRestore;if(e&&l&&(i.activeElement&&vt(i.activeElement,t)||i.activeElement===i.body&&ls(t))){let u=ue.clone();requestAnimationFrame(()=>{if(i.activeElement===i.body){let c=u.getTreeNode(t);for(;c;){if(c.nodeToRestore&&c.nodeToRestore.isConnected){us(c.nodeToRestore);return}c=c.parent}for(c=u.getTreeNode(t);c;){if(c.scopeRef&&c.scopeRef.current&&ue.getTreeNode(c.scopeRef)){let h=Yu(c.scopeRef.current,!0);us(h);return}c=c.parent}}})}}}},[t,e])}function us(t){t.dispatchEvent(new CustomEvent(Io,{bubbles:!0,cancelable:!0}))&&rt(t)}function qe(t,e,n){let r=e!=null&&e.tabbable?Vp:Up,i=me(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)&&Vu(o)&&(!n||Le(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 va{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 ko({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&&Le(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 va;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 ko({scopeRef:null}),this.fastMap.set(null,this.root)}}class ko{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 ue=new va;function hi(t={}){let{autoFocus:e=!1,isTextInput:n,within:r}=t,i=d.useRef({isFocused:!1,isFocusVisible:e||Wu()}),[o,a]=d.useState(!1),[s,l]=d.useState(()=>i.current.isFocused&&i.current.isFocusVisible),u=d.useCallback(()=>l(i.current.isFocused&&i.current.isFocusVisible),[]),c=d.useCallback(g=>{i.current.isFocused=g,a(g),u()},[u]);jp(g=>{i.current.isFocusVisible=g,u()},[],{isTextInput:n});let{focusProps:h}=Np({isDisabled:r,onFocusChange:c}),{focusWithinProps:p}=zp({isDisabled:!r,onFocusWithinChange:c});return{isFocused:o,isFocusVisible:s,focusProps:r?p:h}}function Qp(t,e){let n=e==null?void 0:e.isDisabled,[r,i]=d.useState(!1);return Pe(()=>{if(t!=null&&t.current&&!n){let o=()=>{if(t.current){let s=qe(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}let ln="default",Ro="",kr=new WeakMap;function cs(t){if(di()){if(ln==="default"){const e=Ae(t);Ro=e.documentElement.style.webkitUserSelect,e.documentElement.style.webkitUserSelect="none"}ln="disabled"}else(t instanceof HTMLElement||t instanceof SVGElement)&&(kr.set(t,t.style.userSelect),t.style.userSelect="none")}function gr(t){if(di()){if(ln!=="disabled")return;ln="restoring",setTimeout(()=>{Uh(()=>{if(ln==="restoring"){const e=Ae(t);e.documentElement.style.webkitUserSelect==="none"&&(e.documentElement.style.webkitUserSelect=Ro||""),Ro="",ln="default"}})},300)}else if((t instanceof HTMLElement||t instanceof SVGElement)&&t&&kr.has(t)){let e=kr.get(t);t.style.userSelect==="none"&&(t.style.userSelect=e),t.getAttribute("style")===""&&t.removeAttribute("style"),kr.delete(t)}}const ma=d.createContext({register:()=>{}});ma.displayName="PressResponderContext";function Zp(t){let e=d.useContext(ma);if(e){let{register:n,...r}=e;t=ye(r,t),n()}return Gh(e,t.ref),t}var vr=new WeakMap;class mr{continuePropagation(){as(this,vr,!1)}get shouldStopPropagation(){return Op(this,vr)}constructor(e,n,r,i){_p(this,vr,{writable:!0,value:void 0}),as(this,vr,!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,h=null;r.clientX!=null&&r.clientY!=null&&(c=r.clientX,h=r.clientY),s&&(c!=null&&h!=null?(l=c-s.left,u=h-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 ds=Symbol("linkClicked");function ya(t){let{onPress:e,onPressChange:n,onPressStart:r,onPressEnd:i,onPressUp:o,isDisabled:a,isPressed:s,preventFocusOnPress:l,shouldCancelOnPointerExit:u,allowTextSelectionOnPress:c,ref:h,...p}=Zp(t),[g,m]=d.useState(!1),f=d.useRef({isPressed:!1,ignoreEmulatedMouseEvents:!1,ignoreClickAfterPress:!1,didFirePressStart:!1,isTriggeringEvent:!1,activePointerId:null,target:null,isOverTarget:!1,pointerType:null}),{addGlobalListener:v,removeAllGlobalListeners:y}=Tu(),S=De((b,R)=>{let W=f.current;if(a||W.didFirePressStart)return!1;let M=!0;if(W.isTriggeringEvent=!0,r){let H=new mr("pressstart",R,b);r(H),M=H.shouldStopPropagation}return n&&n(!0),W.isTriggeringEvent=!1,W.didFirePressStart=!0,m(!0),M}),w=De((b,R,W=!0)=>{let M=f.current;if(!M.didFirePressStart)return!1;M.ignoreClickAfterPress=!0,M.didFirePressStart=!1,M.isTriggeringEvent=!0;let H=!0;if(i){let E=new mr("pressend",R,b);i(E),H=E.shouldStopPropagation}if(n&&n(!1),m(!1),e&&W&&!a){let E=new mr("press",R,b);e(E),H&&(H=E.shouldStopPropagation)}return M.isTriggeringEvent=!1,H}),T=De((b,R)=>{let W=f.current;if(a)return!1;if(o){W.isTriggeringEvent=!0;let M=new mr("pressup",R,b);return o(M),W.isTriggeringEvent=!1,M.shouldStopPropagation}return!0}),x=De(b=>{let R=f.current;R.isPressed&&R.target&&(R.isOverTarget&&R.pointerType!=null&&w(Qe(R.target,b),R.pointerType,!1),R.isPressed=!1,R.isOverTarget=!1,R.activePointerId=null,R.pointerType=null,y(),c||gr(R.target))}),I=De(b=>{u&&x(b)}),P=d.useMemo(()=>{let b=f.current,R={onKeyDown(M){if(Mi(M.nativeEvent,M.currentTarget)&&M.currentTarget.contains(M.target)){var H;hs(M.target,M.key)&&M.preventDefault();let E=!0;if(!b.isPressed&&!M.repeat){b.target=M.currentTarget,b.isPressed=!0,E=S(M,"keyboard");let _=M.currentTarget,z=U=>{Mi(U,_)&&!U.repeat&&_.contains(U.target)&&b.target&&T(Qe(b.target,U),"keyboard")};v(Ae(M.currentTarget),"keyup",Vn(z,W),!0)}E&&M.stopPropagation(),M.metaKey&&It()&&((H=b.metaKeyEvents)===null||H===void 0||H.set(M.key,M.nativeEvent))}else M.key==="Meta"&&(b.metaKeyEvents=new Map)},onClick(M){if(!(M&&!M.currentTarget.contains(M.target))&&M&&M.button===0&&!b.isTriggeringEvent&&!_t.isOpening){let H=!0;if(a&&M.preventDefault(),!b.ignoreClickAfterPress&&!b.ignoreEmulatedMouseEvents&&!b.isPressed&&(b.pointerType==="virtual"||$o(M.nativeEvent))){!a&&!l&&xt(M.currentTarget);let E=S(M,"virtual"),_=T(M,"virtual"),z=w(M,"virtual");H=E&&_&&z}b.ignoreEmulatedMouseEvents=!1,b.ignoreClickAfterPress=!1,H&&M.stopPropagation()}}},W=M=>{var H;if(b.isPressed&&b.target&&Mi(M,b.target)){var E;hs(M.target,M.key)&&M.preventDefault();let z=M.target;w(Qe(b.target,M),"keyboard",b.target.contains(z)),y(),M.key!=="Enter"&&ba(b.target)&&b.target.contains(z)&&!M[ds]&&(M[ds]=!0,_t(b.target,M,!1)),b.isPressed=!1,(E=b.metaKeyEvents)===null||E===void 0||E.delete(M.key)}else if(M.key==="Meta"&&(!((H=b.metaKeyEvents)===null||H===void 0)&&H.size)){var _;let z=b.metaKeyEvents;b.metaKeyEvents=void 0;for(let U of z.values())(_=b.target)===null||_===void 0||_.dispatchEvent(new KeyboardEvent("keyup",U))}};if(typeof PointerEvent<"u"){R.onPointerDown=_=>{if(_.button!==0||!_.currentTarget.contains(_.target))return;if(Jh(_.nativeEvent)){b.pointerType="virtual";return}Ki(_.currentTarget)&&_.preventDefault(),b.pointerType=_.pointerType;let z=!0;if(!b.isPressed){b.isPressed=!0,b.isOverTarget=!0,b.activePointerId=_.pointerId,b.target=_.currentTarget,!a&&!l&&xt(_.currentTarget),c||cs(b.target),z=S(_,b.pointerType);let U=_.target;"releasePointerCapture"in U&&U.releasePointerCapture(_.pointerId),v(Ae(_.currentTarget),"pointerup",M,!1),v(Ae(_.currentTarget),"pointercancel",E,!1)}z&&_.stopPropagation()},R.onMouseDown=_=>{_.currentTarget.contains(_.target)&&_.button===0&&(Ki(_.currentTarget)&&_.preventDefault(),_.stopPropagation())},R.onPointerUp=_=>{!_.currentTarget.contains(_.target)||b.pointerType==="virtual"||_.button===0&&T(_,b.pointerType||_.pointerType)},R.onPointerEnter=_=>{_.pointerId===b.activePointerId&&b.target&&!b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!0,S(Qe(b.target,_),b.pointerType))},R.onPointerLeave=_=>{_.pointerId===b.activePointerId&&b.target&&b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!1,w(Qe(b.target,_),b.pointerType,!1),I(_))};let M=_=>{_.pointerId===b.activePointerId&&b.isPressed&&_.button===0&&b.target&&(b.target.contains(_.target)&&b.pointerType!=null?w(Qe(b.target,_),b.pointerType):b.isOverTarget&&b.pointerType!=null&&w(Qe(b.target,_),b.pointerType,!1),b.isPressed=!1,b.isOverTarget=!1,b.activePointerId=null,b.pointerType=null,y(),c||gr(b.target),"ontouchend"in b.target&&_.pointerType!=="mouse"&&v(b.target,"touchend",H,{once:!0}))},H=_=>{Xu(_.currentTarget)&&_.preventDefault()},E=_=>{x(_)};R.onDragStart=_=>{_.currentTarget.contains(_.target)&&x(_)}}else{R.onMouseDown=E=>{if(E.button!==0||!E.currentTarget.contains(E.target))return;if(Ki(E.currentTarget)&&E.preventDefault(),b.ignoreEmulatedMouseEvents){E.stopPropagation();return}b.isPressed=!0,b.isOverTarget=!0,b.target=E.currentTarget,b.pointerType=$o(E.nativeEvent)?"virtual":"mouse",!a&&!l&&xt(E.currentTarget),S(E,b.pointerType)&&E.stopPropagation(),v(Ae(E.currentTarget),"mouseup",M,!1)},R.onMouseEnter=E=>{if(!E.currentTarget.contains(E.target))return;let _=!0;b.isPressed&&!b.ignoreEmulatedMouseEvents&&b.pointerType!=null&&(b.isOverTarget=!0,_=S(E,b.pointerType)),_&&E.stopPropagation()},R.onMouseLeave=E=>{if(!E.currentTarget.contains(E.target))return;let _=!0;b.isPressed&&!b.ignoreEmulatedMouseEvents&&b.pointerType!=null&&(b.isOverTarget=!1,_=w(E,b.pointerType,!1),I(E)),_&&E.stopPropagation()},R.onMouseUp=E=>{E.currentTarget.contains(E.target)&&!b.ignoreEmulatedMouseEvents&&E.button===0&&T(E,b.pointerType||"mouse")};let M=E=>{if(E.button===0){if(b.isPressed=!1,y(),b.ignoreEmulatedMouseEvents){b.ignoreEmulatedMouseEvents=!1;return}b.target&&Ai(E,b.target)&&b.pointerType!=null?w(Qe(b.target,E),b.pointerType):b.target&&b.isOverTarget&&b.pointerType!=null&&w(Qe(b.target,E),b.pointerType,!1),b.isOverTarget=!1}};R.onTouchStart=E=>{if(!E.currentTarget.contains(E.target))return;let _=eg(E.nativeEvent);if(!_)return;b.activePointerId=_.identifier,b.ignoreEmulatedMouseEvents=!0,b.isOverTarget=!0,b.isPressed=!0,b.target=E.currentTarget,b.pointerType="touch",!a&&!l&&xt(E.currentTarget),c||cs(b.target),S(ut(b.target,E),b.pointerType)&&E.stopPropagation(),v(yn(E.currentTarget),"scroll",H,!0)},R.onTouchMove=E=>{if(!E.currentTarget.contains(E.target))return;if(!b.isPressed){E.stopPropagation();return}let _=fs(E.nativeEvent,b.activePointerId),z=!0;_&&Ai(_,E.currentTarget)?!b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!0,z=S(ut(b.target,E),b.pointerType)):b.isOverTarget&&b.pointerType!=null&&(b.isOverTarget=!1,z=w(ut(b.target,E),b.pointerType,!1),I(ut(b.target,E))),z&&E.stopPropagation()},R.onTouchEnd=E=>{if(!E.currentTarget.contains(E.target))return;if(!b.isPressed){E.stopPropagation();return}let _=fs(E.nativeEvent,b.activePointerId),z=!0;_&&Ai(_,E.currentTarget)&&b.pointerType!=null?(T(ut(b.target,E),b.pointerType),z=w(ut(b.target,E),b.pointerType)):b.isOverTarget&&b.pointerType!=null&&(z=w(ut(b.target,E),b.pointerType,!1)),z&&E.stopPropagation(),b.isPressed=!1,b.activePointerId=null,b.isOverTarget=!1,b.ignoreEmulatedMouseEvents=!0,b.target&&!c&&gr(b.target),y()},R.onTouchCancel=E=>{E.currentTarget.contains(E.target)&&(E.stopPropagation(),b.isPressed&&x(ut(b.target,E)))};let H=E=>{b.isPressed&&E.target.contains(b.target)&&x({currentTarget:b.target,shiftKey:!1,ctrlKey:!1,metaKey:!1,altKey:!1})};R.onDragStart=E=>{E.currentTarget.contains(E.target)&&x(E)}}return R},[v,a,l,y,c,x,I,w,S,T]);return d.useEffect(()=>()=>{var b;c||gr((b=f.current.target)!==null&&b!==void 0?b:void 0)},[c]),{isPressed:s||g,pressProps:ye(p,P)}}function ba(t){return t.tagName==="A"&&t.hasAttribute("href")}function Mi(t,e){const{key:n,code:r}=t,i=e,o=i.getAttribute("role");return(n==="Enter"||n===" "||n==="Spacebar"||r==="Space")&&!(i instanceof yn(i).HTMLInputElement&&!Ju(i,n)||i instanceof yn(i).HTMLTextAreaElement||i.isContentEditable)&&!((o==="link"||!o&&ba(i))&&n!=="Enter")}function eg(t){const{targetTouches:e}=t;return e.length>0?e[0]:null}function fs(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 ut(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 tg(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 ng(t,e){return!(t.left>e.right||e.left>t.right||t.top>e.bottom||e.top>t.bottom)}function Ai(t,e){let n=e.getBoundingClientRect(),r=tg(t);return ng(n,r)}function Ki(t){return!(t instanceof HTMLElement)||!t.hasAttribute("draggable")}function Xu(t){return t instanceof HTMLInputElement?!1:t instanceof HTMLButtonElement?t.type!=="submit"&&t.type!=="reset":!ba(t)}function hs(t,e){return t instanceof HTMLInputElement?!Ju(t,e):Xu(t)}const rg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);function Ju(t,e){return t.type==="checkbox"||t.type==="radio"?e===" ":rg.has(t.type)}function ig({children:t}){let e=d.useMemo(()=>({register:()=>{}}),[]);return d.createElement(ma.Provider,{value:e},t)}class og{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 Qu(t){let e=d.useRef({isFocused:!1,observer:null});pe(()=>{const r=e.current;return()=>{r.observer&&(r.observer.disconnect(),r.observer=null)}},[]);let n=De(r=>{t==null||t(r)});return d.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 og("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 ag(t){let{isDisabled:e,onFocus:n,onBlur:r,onFocusChange:i}=t;const o=d.useCallback(l=>{if(l.target===l.currentTarget)return r&&r(l),i&&i(!1),!0},[r,i]),a=Qu(o),s=d.useCallback(l=>{const u=Ae(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 Tn=null,sg=new Set,Wn=new Map,Rt=!1,No=!1;function Sa(t,e){for(let n of sg)n(t,e)}function lg(t){return!(t.metaKey||!It()&&t.altKey||t.ctrlKey||t.key==="Control"||t.key==="Shift"||t.key==="Meta")}function Xr(t){Rt=!0,lg(t)&&(Tn="keyboard",Sa("keyboard",t))}function Ne(t){Tn="pointer",(t.type==="mousedown"||t.type==="pointerdown")&&(Rt=!0,Sa("pointer",t))}function Zu(t){$o(t)&&(Rt=!0,Tn="virtual")}function ec(t){t.target===window||t.target===document||(!Rt&&!No&&(Tn="virtual",Sa("virtual",t)),Rt=!1,No=!1)}function tc(){Rt=!1,No=!0}function ps(t){if(typeof window>"u"||Wn.get(yn(t)))return;const e=yn(t),n=Ae(t);let r=e.HTMLElement.prototype.focus;e.HTMLElement.prototype.focus=function(){Rt=!0,r.apply(this,arguments)},n.addEventListener("keydown",Xr,!0),n.addEventListener("keyup",Xr,!0),n.addEventListener("click",Zu,!0),e.addEventListener("focus",ec,!0),e.addEventListener("blur",tc,!1),typeof PointerEvent<"u"?(n.addEventListener("pointerdown",Ne,!0),n.addEventListener("pointermove",Ne,!0),n.addEventListener("pointerup",Ne,!0)):(n.addEventListener("mousedown",Ne,!0),n.addEventListener("mousemove",Ne,!0),n.addEventListener("mouseup",Ne,!0)),e.addEventListener("beforeunload",()=>{nc(t)},{once:!0}),Wn.set(e,{focus:r})}const nc=(t,e)=>{const n=yn(t),r=Ae(t);e&&r.removeEventListener("DOMContentLoaded",e),Wn.has(n)&&(n.HTMLElement.prototype.focus=Wn.get(n).focus,r.removeEventListener("keydown",Xr,!0),r.removeEventListener("keyup",Xr,!0),r.removeEventListener("click",Zu,!0),n.removeEventListener("focus",ec,!0),n.removeEventListener("blur",tc,!1),typeof PointerEvent<"u"?(r.removeEventListener("pointerdown",Ne,!0),r.removeEventListener("pointermove",Ne,!0),r.removeEventListener("pointerup",Ne,!0)):(r.removeEventListener("mousedown",Ne,!0),r.removeEventListener("mousemove",Ne,!0),r.removeEventListener("mouseup",Ne,!0)),Wn.delete(n))};function ug(t){const e=Ae(t);let n;return e.readyState!=="loading"?ps(t):(n=()=>{ps(t)},e.addEventListener("DOMContentLoaded",n)),()=>nc(t,n)}typeof document<"u"&&ug();function cg(){return Tn!=="pointer"}function gs(){return Tn}function rc(t){let{isDisabled:e,onBlurWithin:n,onFocusWithin:r,onFocusWithinChange:i}=t,o=d.useRef({isFocusWithin:!1}),a=d.useCallback(u=>{o.current.isFocusWithin&&!u.currentTarget.contains(u.relatedTarget)&&(o.current.isFocusWithin=!1,n&&n(u),i&&i(!1))},[n,i,o]),s=Qu(a),l=d.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 Jr=!1,Li=0;function Mo(){Jr=!0,setTimeout(()=>{Jr=!1},50)}function vs(t){t.pointerType==="touch"&&Mo()}function dg(){if(!(typeof document>"u"))return typeof PointerEvent<"u"?document.addEventListener("pointerup",vs):document.addEventListener("touchend",Mo),Li++,()=>{Li--,!(Li>0)&&(typeof PointerEvent<"u"?document.removeEventListener("pointerup",vs):document.removeEventListener("touchend",Mo))}}function wa(t){let{onHoverStart:e,onHoverChange:n,onHoverEnd:r,isDisabled:i}=t,[o,a]=d.useState(!1),s=d.useRef({isHovered:!1,ignoreEmulatedMouseEvents:!1,pointerType:"",target:null}).current;d.useEffect(dg,[]);let{hoverProps:l,triggerHoverEnd:u}=d.useMemo(()=>{let c=(g,m)=>{if(s.pointerType=m,i||m==="touch"||s.isHovered||!g.currentTarget.contains(g.target))return;s.isHovered=!0;let f=g.currentTarget;s.target=f,e&&e({type:"hoverstart",target:f,pointerType:m}),n&&n(!0),a(!0)},h=(g,m)=>{if(s.pointerType="",s.target=null,m==="touch"||!s.isHovered)return;s.isHovered=!1;let f=g.currentTarget;r&&r({type:"hoverend",target:f,pointerType:m}),n&&n(!1),a(!1)},p={};return typeof PointerEvent<"u"?(p.onPointerEnter=g=>{Jr&&g.pointerType==="mouse"||c(g,g.pointerType)},p.onPointerLeave=g=>{!i&&g.currentTarget.contains(g.target)&&h(g,g.pointerType)}):(p.onTouchStart=()=>{s.ignoreEmulatedMouseEvents=!0},p.onMouseEnter=g=>{!s.ignoreEmulatedMouseEvents&&!Jr&&c(g,"mouse"),s.ignoreEmulatedMouseEvents=!1},p.onMouseLeave=g=>{!i&&g.currentTarget.contains(g.target)&&h(g,"mouse")}),{hoverProps:p,triggerHoverEnd:h}},[e,n,r,i,s]);return d.useEffect(()=>{i&&u({currentTarget:s.target},s.pointerType)},[i]),{hoverProps:l,isHovered:o}}function fg(t){let{ref:e,onInteractOutside:n,isDisabled:r,onInteractOutsideStart:i}=t,o=d.useRef({isPointerDown:!1,ignoreEmulatedMouseEvents:!1}),a=De(l=>{n&&yr(l,e)&&(i&&i(l),o.current.isPointerDown=!0)}),s=De(l=>{n&&n(l)});d.useEffect(()=>{let l=o.current;if(r)return;const u=e.current,c=Ae(u);if(typeof PointerEvent<"u"){let h=p=>{l.isPointerDown&&yr(p,e)&&s(p),l.isPointerDown=!1};return c.addEventListener("pointerdown",a,!0),c.addEventListener("pointerup",h,!0),()=>{c.removeEventListener("pointerdown",a,!0),c.removeEventListener("pointerup",h,!0)}}else{let h=g=>{l.ignoreEmulatedMouseEvents?l.ignoreEmulatedMouseEvents=!1:l.isPointerDown&&yr(g,e)&&s(g),l.isPointerDown=!1},p=g=>{l.ignoreEmulatedMouseEvents=!0,l.isPointerDown&&yr(g,e)&&s(g),l.isPointerDown=!1};return c.addEventListener("mousedown",a,!0),c.addEventListener("mouseup",h,!0),c.addEventListener("touchstart",a,!0),c.addEventListener("touchend",p,!0),()=>{c.removeEventListener("mousedown",a,!0),c.removeEventListener("mouseup",h,!0),c.removeEventListener("touchstart",a,!0),c.removeEventListener("touchend",p,!0)}}},[e,r,a,s])}function yr(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 ms(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 hg(t){return{keyboardProps:t.isDisabled?{}:{onKeyDown:ms(t.onKeyDown),onKeyUp:ms(t.onKeyUp)}}}const pg=500;function gg(t){let{isDisabled:e,onLongPressStart:n,onLongPressEnd:r,onLongPress:i,threshold:o=pg,accessibilityDescription:a}=t;const s=d.useRef(void 0);let{addGlobalListener:l,removeGlobalListener:u}=Tu(),{pressProps:c}=ya({isDisabled:e,onPressStart(p){if(p.continuePropagation(),(p.pointerType==="mouse"||p.pointerType==="touch")&&(n&&n({...p,type:"longpressstart"}),s.current=setTimeout(()=>{p.target.dispatchEvent(new PointerEvent("pointercancel",{bubbles:!0})),i&&i({...p,type:"longpress"}),s.current=void 0},o),p.pointerType==="touch")){let g=m=>{m.preventDefault()};l(p.target,"contextmenu",g,{once:!0}),l(window,"pointerup",()=>{setTimeout(()=>{u(p.target,"contextmenu",g)},30)},{once:!0})}},onPressEnd(p){s.current&&clearTimeout(s.current),r&&(p.pointerType==="mouse"||p.pointerType==="touch")&&r({...p,type:"longpressend"})}}),h=Xh(i&&!e?a:void 0);return{longPressProps:ye(c,h)}}const vg=new Set(["Arab","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),mg=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function yg(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 vg.has(n.script)}let e=t.split("-")[0];return mg.has(e)}const bg=Symbol.for("react-aria.i18n.locale");function ic(){let t=typeof window<"u"&&window[bg]||typeof navigator<"u"&&(navigator.language||navigator.userLanguage)||"en-US";try{Intl.DateTimeFormat.supportedLocalesOf([t])}catch{t="en-US"}return{locale:t,direction:yg(t)?"rtl":"ltr"}}let Ao=ic(),Ln=new Set;function ys(){Ao=ic();for(let t of Ln)t(Ao)}function Sg(){let t=$n(),[e,n]=d.useState(Ao);return d.useEffect(()=>(Ln.size===0&&window.addEventListener("languagechange",ys),Ln.add(n),()=>{Ln.delete(n),Ln.size===0&&window.removeEventListener("languagechange",ys)}),[]),t?{locale:"en-US",direction:"ltr"}:e}const wg=d.createContext(null);function or(){let t=Sg();return d.useContext(wg)||t}var Ge=function(){return Ge=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},Ge.apply(this,arguments)};function oc(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 Eg(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 $g=Symbol.for("react-aria.i18n.locale"),xg=Symbol.for("react-aria.i18n.strings");let Wt;class pi{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=Cg(e,this.strings,this.defaultLocale),this.strings[e]=n),n}static getGlobalDictionaryForPackage(e){if(typeof window>"u")return null;let n=window[$g];if(Wt===void 0){let i=window[xg];if(!i)return null;Wt={};for(let o in i)Wt[o]=new pi({[n]:i[o]},n)}let r=Wt==null?void 0:Wt[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 Cg(t,e,n="en-US"){if(e[t])return e[t];let r=Tg(t);if(e[r])return e[r];for(let i in e)if(i.startsWith(r+"-"))return e[i];return e[n]}function Tg(t){return Intl.Locale?new Intl.Locale(t).language:t.split("-")[0]}const bs=new Map,Ss=new Map;class Dg{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=bs.get(o);a||(a=new Intl.PluralRules(this.locale,{type:r}),bs.set(o,a));let s=a.select(e);return i=n[s]||n.other,typeof i=="function"?i():i}number(e){let n=Ss.get(this.locale);return n||(n=new Intl.NumberFormat(this.locale),Ss.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 ws=new WeakMap;function Pg(t){let e=ws.get(t);return e||(e=new pi(t),ws.set(t,e)),e}function Og(t,e){return e&&pi.getGlobalDictionaryForPackage(e)||Pg(t)}function Ig(t,e){let{locale:n}=or(),r=Og(t,e);return d.useMemo(()=>new Dg(n,r),[n,r])}let Fi=new Map;function _g(t){let{locale:e}=or(),n=e+(t?Object.entries(t).sort((i,o)=>i[0]<o[0]?-1:1).join():"");if(Fi.has(n))return Fi.get(n);let r=new Intl.Collator(e,t);return Fi.set(n,r),r}const Es={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 kg(t={}){let{style:e,isFocusable:n}=t,[r,i]=d.useState(!1),{focusWithinProps:o}=rc({isDisabled:!n,onFocusWithinChange:s=>i(s)}),a=d.useMemo(()=>r?e:e?{...Es,...e}:Es,[r]);return{visuallyHiddenProps:{...o,style:a}}}function Rg(t){let{children:e,elementType:n="div",isFocusable:r,style:i,...o}=t,{visuallyHiddenProps:a}=kg(t);return d.createElement(n,ye(o,a),e)}const Ye={top:"top",bottom:"top",left:"left",right:"left"},Qr={top:"bottom",bottom:"top",left:"right",right:"left"},Ng={top:"left",left:"top"},Ko={top:"height",left:"width"},ac={width:"totalWidth",height:"totalHeight"},br={};let fe=typeof document<"u"?window.visualViewport:null;function $s(t){let e=0,n=0,r=0,i=0,o=0,a=0,s={};var l;let u=((l=fe==null?void 0:fe.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=fe==null?void 0:fe.width)!==null&&c!==void 0?c:r;var h;n=(h=fe==null?void 0:fe.height)!==null&&h!==void 0?h:i,s.top=m.scrollTop||t.scrollTop,s.left=m.scrollLeft||t.scrollLeft,fe&&(o=fe.offsetTop,a=fe.offsetLeft)}else({width:e,height:n,top:o,left:a}=fn(t)),s.top=t.scrollTop,s.left=t.scrollLeft,r=e,i=n;if($u()&&(t.tagName==="BODY"||t.tagName==="HTML")&&u){s.top=0,s.left=0;var p;o=(p=fe==null?void 0:fe.pageTop)!==null&&p!==void 0?p:0;var g;a=(g=fe==null?void 0:fe.pageLeft)!==null&&g!==void 0?g:0}return{width:e,height:n,totalWidth:r,totalHeight:i,scroll:s,top:o,left:a}}function Mg(t){return{top:t.scrollTop,left:t.scrollLeft,width:t.scrollWidth,height:t.scrollHeight}}function xs(t,e,n,r,i,o,a){var s;let l=(s=i.scroll[t])!==null&&s!==void 0?s:0,u=r[Ko[t]],c=r.scroll[Ye[t]]+o,h=u+r.scroll[Ye[t]]-o,p=e-l+a[t]-r[Ye[t]],g=e-l+n+a[t]-r[Ye[t]];return p<c?c-p:g>h?Math.max(h-g,c-p):0}function Ag(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 Cs(t){if(br[t])return br[t];let[e,n]=t.split(" "),r=Ye[e]||"right",i=Ng[r];Ye[n]||(n="center");let o=Ko[r],a=Ko[i];return br[t]={placement:e,crossPlacement:n,axis:r,crossAxis:i,size:o,crossSize:a},br[t]}function ji(t,e,n,r,i,o,a,s,l,u){let{placement:c,crossPlacement:h,axis:p,crossAxis:g,size:m,crossSize:f}=r,v={};var y;v[g]=(y=t[g])!==null&&y!==void 0?y:0;var S,w,T,x;h==="center"?v[g]+=(((S=t[f])!==null&&S!==void 0?S:0)-((w=n[f])!==null&&w!==void 0?w:0))/2:h!==g&&(v[g]+=((T=t[f])!==null&&T!==void 0?T:0)-((x=n[f])!==null&&x!==void 0?x:0)),v[g]+=o;const I=t[g]-n[f]+l+u,P=t[g]+t[f]-l-u;if(v[g]=xo(v[g],I,P),c===p){const b=s?a[m]:e[ac[m]];v[Qr[p]]=Math.floor(b-t[p]+i)}else v[p]=Math.floor(t[p]+t[m]+i);return v}function Kg(t,e,n,r,i,o,a,s){const l=r?n.height:e[ac.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 h,p,g,m,f,v;let y=s!=="top"?Math.max(0,e.height+e.top+((h=e.scroll.top)!==null&&h!==void 0?h:0)-c-(((p=i.top)!==null&&p!==void 0?p: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))-(((f=i.top)!==null&&f!==void 0?f:0)+((v=i.bottom)!==null&&v!==void 0?v:0)+o));return Math.min(e.height-o*2,y)}function Ts(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[Qr[s]]-i);var h;return Math.max(0,t[l]+t[s]+t.scroll[s]-e[s]-n[s]-n[l]-((h=r[s])!==null&&h!==void 0?h:0)-r[Qr[s]]-i)}function Lg(t,e,n,r,i,o,a,s,l,u,c,h,p,g,m,f){let v=Cs(t),{size:y,crossAxis:S,crossSize:w,placement:T,crossPlacement:x}=v,I=ji(e,s,n,v,c,h,u,p,m,f),P=c,b=Ts(s,u,e,i,o+c,v);if(a&&r[y]>b){let N=Cs(`${Qr[T]} ${x}`),A=ji(e,s,n,N,c,h,u,p,m,f);Ts(s,u,e,i,o+c,N)>b&&(v=N,I=A,P=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 W=xs(S,I[S],n[w],s,l,o,u);I[S]+=W;let M=Kg(I,s,u,p,i,o,n.height,R);g&&g<M&&(M=g),n.height=Math.min(n.height,M),I=ji(e,s,n,v,P,h,u,p,m,f),W=xs(S,I[S],n[w],s,l,o,u),I[S]+=W;let H={},E=e[S]+.5*e[w]-I[S]-i[Ye[S]];const _=m/2+f;var z,U,Y,K;const q=Ye[S]==="left"?((z=i.left)!==null&&z!==void 0?z:0)+((U=i.right)!==null&&U!==void 0?U:0):((Y=i.top)!==null&&Y!==void 0?Y:0)+((K=i.bottom)!==null&&K!==void 0?K:0),re=n[w]-q-m/2-f,j=e[S]+m/2-(I[S]+i[Ye[S]]),O=e[S]+e[w]-m/2-(I[S]+i[Ye[S]]),k=xo(E,j,O);return H[S]=xo(k,_,re),{position:I,maxHeight:M,arrowOffsetLeft:H.left,arrowOffsetTop:H.top,placement:v.placement}}function Fg(t){let{placement:e,targetNode:n,overlayNode:r,scrollNode:i,padding:o,shouldFlip:a,boundaryElement:s,offset:l,crossOffset:u,maxHeight:c,arrowSize:h=0,arrowBoundaryOffset:p=0}=t,g=r instanceof HTMLElement?jg(r):document.documentElement,m=g===document.documentElement;const f=window.getComputedStyle(g).position;let v=!!f&&f!=="static",y=m?fn(n):Ds(n,g);if(!m){let{marginTop:H,marginLeft:E}=window.getComputedStyle(n);y.top+=parseInt(H,10)||0,y.left+=parseInt(E,10)||0}let S=fn(r),w=Ag(r);var T,x;S.width+=((T=w.left)!==null&&T!==void 0?T:0)+((x=w.right)!==null&&x!==void 0?x:0);var I,P;S.height+=((I=w.top)!==null&&I!==void 0?I:0)+((P=w.bottom)!==null&&P!==void 0?P:0);let b=Mg(i),R=$s(s),W=$s(g),M=s.tagName==="BODY"?fn(g):Ds(g,s);return g.tagName==="HTML"&&s.tagName==="BODY"&&(W.scroll.top=0,W.scroll.left=0),Lg(e,y,S,b,w,o,a,R,W,M,l,u,v,c,h,p)}function fn(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 Ds(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=fn(t);let i=fn(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 jg(t){let e=t.offsetParent;if(e&&e===document.body&&window.getComputedStyle(e).position==="static"&&!Ps(e)&&(e=document.documentElement),e==null)for(e=t.parentElement;e&&!Ps(e);)e=e.parentElement;return e||document.documentElement}function Ps(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 zg=new WeakMap;function Hg(t){let{triggerRef:e,isOpen:n,onClose:r}=t;d.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||zg.get(e.current);s&&s()};return window.addEventListener("scroll",i,!0),()=>{window.removeEventListener("scroll",i,!0)}},[n,r,e])}let le=typeof document<"u"?window.visualViewport:null;function Bg(t){let{direction:e}=or(),{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:h=0,shouldUpdatePosition:p=!0,isOpen:g=!0,onClose:m,maxHeight:f,arrowBoundaryOffset:v=0}=t,[y,S]=d.useState(null),w=[p,a,i.current,r.current,o.current,s,l,u,c,h,g,e,f,v,n],T=d.useRef(le==null?void 0:le.scale);d.useEffect(()=>{g&&(T.current=le==null?void 0:le.scale)},[g]);let x=d.useCallback(()=>{if(p===!1||!g||!i.current||!r.current||!u||(le==null?void 0:le.scale)!==T.current)return;let W=null;if(o.current&&o.current.contains(document.activeElement)){var M;let K=(M=document.activeElement)===null||M===void 0?void 0:M.getBoundingClientRect(),q=o.current.getBoundingClientRect();var H;if(W={type:"top",offset:((H=K==null?void 0:K.top)!==null&&H!==void 0?H:0)-q.top},W.offset>q.height/2){W.type="bottom";var E;W.offset=((E=K==null?void 0:K.bottom)!==null&&E!==void 0?E:0)-q.bottom}}let _=i.current;if(!f&&i.current){var z;_.style.top="0px",_.style.bottom="";var U;_.style.maxHeight=((U=(z=window.visualViewport)===null||z===void 0?void 0:z.height)!==null&&U!==void 0?U:window.innerHeight)+"px"}let Y=Fg({placement:Ug(a,e),overlayNode:i.current,targetNode:r.current,scrollNode:o.current||i.current,padding:s,shouldFlip:l,boundaryElement:u,offset:c,crossOffset:h,maxHeight:f,arrowSize:n,arrowBoundaryOffset:v});if(Y.position){if(_.style.top="",_.style.bottom="",_.style.left="",_.style.right="",Object.keys(Y.position).forEach(K=>_.style[K]=Y.position[K]+"px"),_.style.maxHeight=Y.maxHeight!=null?Y.maxHeight+"px":"",W&&document.activeElement&&o.current){let K=document.activeElement.getBoundingClientRect(),q=o.current.getBoundingClientRect(),re=K[W.type]-q[W.type];o.current.scrollTop+=re-W.offset}S(Y)}},w);pe(x,w),Wg(x),Xa({ref:i,onResize:x}),Xa({ref:r,onResize:x});let I=d.useRef(!1);pe(()=>{let W,M=()=>{I.current=!0,clearTimeout(W),W=setTimeout(()=>{I.current=!1},500),x()},H=()=>{I.current&&M()};return le==null||le.addEventListener("resize",M),le==null||le.addEventListener("scroll",H),()=>{le==null||le.removeEventListener("resize",M),le==null||le.removeEventListener("scroll",H)}},[x]);let P=d.useCallback(()=>{I.current||m==null||m()},[m,I]);Hg({triggerRef:r,isOpen:g,onClose:m&&P});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:x}}function Wg(t){pe(()=>(window.addEventListener("resize",t,!1),()=>{window.removeEventListener("resize",t,!1)}),[t])}function Ug(t,e){return e==="rtl"?t.replace("start","right").replace("end","left"):t.replace("start","left").replace("end","right")}const Ze=[];function Vg(t,e){let{onClose:n,shouldCloseOnBlur:r,isOpen:i,isDismissable:o=!1,isKeyboardDismissDisabled:a=!1,shouldCloseOnInteractOutside:s}=t;d.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())},h=m=>{m.key==="Escape"&&!a&&!m.nativeEvent.isComposing&&(m.stopPropagation(),m.preventDefault(),l())};fg({ref:e,onInteractOutside:o&&i?c:void 0,onInteractOutsideStart:u});let{focusWithinProps:p}=rc({isDisabled:!r,onBlurWithin:m=>{!m.relatedTarget||qp(m.relatedTarget)||(!s||s(m.relatedTarget))&&(n==null||n())}}),g=m=>{m.target===m.currentTarget&&m.preventDefault()};return{overlayProps:{onKeyDown:h,...p},underlayProps:{onPointerDown:g}}}const zi=typeof document<"u"&&window.visualViewport,Gg=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let Sr=0,Hi;function qg(t={}){let{isDisabled:e}=t;pe(()=>{if(!e)return Sr++,Sr===1&&(di()?Hi=Xg():Hi=Yg()),()=>{Sr--,Sr===0&&Hi()}},[e])}function Yg(){return Vn(un(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),un(document.documentElement,"overflow","hidden"))}function Xg(){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=un(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;Jg(c)&&(s(),c.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{c.style.transform="",zi&&(zi.height<window.innerHeight?requestAnimationFrame(()=>{Os(c)}):zi.addEventListener("resize",()=>Os(c),{once:!0}))}))},a=null,s=()=>{if(a)return;let u=()=>{window.scrollTo(0,0)},c=window.pageXOffset,h=window.pageYOffset;a=Vn(_n(window,"scroll",u),un(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`),un(document.documentElement,"overflow","hidden"),un(document.body,"marginTop",`-${h}px`),()=>{window.scrollTo(c,h)}),window.scrollTo(0,0)},l=Vn(_n(document,"touchstart",n,{passive:!1,capture:!0}),_n(document,"touchmove",r,{passive:!1,capture:!0}),_n(document,"touchend",i,{passive:!1,capture:!0}),_n(document,"focus",o,!0));return()=>{e==null||e(),a==null||a(),l()}}function un(t,e,n){let r=t.style[e];return t.style[e]=n,()=>{t.style[e]=r}}function _n(t,e,n,r){return t.addEventListener(e,n,r),()=>{t.removeEventListener(e,n,r)}}function Os(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 Jg(t){return t instanceof HTMLInputElement&&!Gg.has(t.type)||t instanceof HTMLTextAreaElement||t instanceof HTMLElement&&t.isContentEditable}var sc={};sc={dismiss:"تجاهل"};var lc={};lc={dismiss:"Отхвърляне"};var uc={};uc={dismiss:"Odstranit"};var cc={};cc={dismiss:"Luk"};var dc={};dc={dismiss:"Schließen"};var fc={};fc={dismiss:"Απόρριψη"};var hc={};hc={dismiss:"Dismiss"};var pc={};pc={dismiss:"Descartar"};var gc={};gc={dismiss:"Lõpeta"};var vc={};vc={dismiss:"Hylkää"};var mc={};mc={dismiss:"Rejeter"};var yc={};yc={dismiss:"התעלם"};var bc={};bc={dismiss:"Odbaci"};var Sc={};Sc={dismiss:"Elutasítás"};var wc={};wc={dismiss:"Ignora"};var Ec={};Ec={dismiss:"閉じる"};var $c={};$c={dismiss:"무시"};var xc={};xc={dismiss:"Atmesti"};var Cc={};Cc={dismiss:"Nerādīt"};var Tc={};Tc={dismiss:"Lukk"};var Dc={};Dc={dismiss:"Negeren"};var Pc={};Pc={dismiss:"Zignoruj"};var Oc={};Oc={dismiss:"Descartar"};var Ic={};Ic={dismiss:"Dispensar"};var _c={};_c={dismiss:"Revocare"};var kc={};kc={dismiss:"Пропустить"};var Rc={};Rc={dismiss:"Zrušiť"};var Nc={};Nc={dismiss:"Opusti"};var Mc={};Mc={dismiss:"Odbaci"};var Ac={};Ac={dismiss:"Avvisa"};var Kc={};Kc={dismiss:"Kapat"};var Lc={};Lc={dismiss:"Скасувати"};var Fc={};Fc={dismiss:"取消"};var jc={};jc={dismiss:"關閉"};var zc={};zc={"ar-AE":sc,"bg-BG":lc,"cs-CZ":uc,"da-DK":cc,"de-DE":dc,"el-GR":fc,"en-US":hc,"es-ES":pc,"et-EE":gc,"fi-FI":vc,"fr-FR":mc,"he-IL":yc,"hr-HR":bc,"hu-HU":Sc,"it-IT":wc,"ja-JP":Ec,"ko-KR":$c,"lt-LT":xc,"lv-LV":Cc,"nb-NO":Tc,"nl-NL":Dc,"pl-PL":Pc,"pt-BR":Oc,"pt-PT":Ic,"ro-RO":_c,"ru-RU":kc,"sk-SK":Rc,"sl-SI":Nc,"sr-SP":Mc,"sv-SE":Ac,"tr-TR":Kc,"uk-UA":Lc,"zh-CN":Fc,"zh-TW":jc};function Qg(t){return t&&t.__esModule?t.default:t}function Is(t){let{onDismiss:e,...n}=t,r=Ig(Qg(zc),"@react-aria/overlays"),i=sa(n,r.format("dismiss")),o=()=>{e&&e()};return d.createElement(Rg,null,d.createElement("button",{...i,tabIndex:-1,onClick:o,style:{width:1,height:1}}))}let kn=new WeakMap,Ie=[];function Zg(t,e=document.body){let n=new Set(t),r=new Set,i=l=>{for(let p of l.querySelectorAll("[data-live-announcer], [data-react-aria-top-layer]"))n.add(p);let u=p=>{if(n.has(p)||p.parentElement&&r.has(p.parentElement)&&p.parentElement.getAttribute("role")!=="row")return NodeFilter.FILTER_REJECT;for(let g of n)if(p.contains(g))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},c=document.createTreeWalker(l,NodeFilter.SHOW_ELEMENT,{acceptNode:u}),h=u(l);if(h===NodeFilter.FILTER_ACCEPT&&o(l),h!==NodeFilter.FILTER_REJECT){let p=c.nextNode();for(;p!=null;)o(p),p=c.nextNode()}},o=l=>{var u;let c=(u=kn.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),kn.set(l,c+1))};Ie.length&&Ie[Ie.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 Ie.push(s),()=>{a.disconnect();for(let l of r){let u=kn.get(l);u!=null&&(u===1?(l.removeAttribute("aria-hidden"),kn.delete(l)):kn.set(l,u-1))}s===Ie[Ie.length-1]?(Ie.pop(),Ie.length&&Ie[Ie.length-1].observe()):Ie.splice(Ie.indexOf(s),1)}}function ev(t,e){let{triggerRef:n,popoverRef:r,isNonModal:i,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:a,...s}=t,{overlayProps:l,underlayProps:u}=Vg({isOpen:e.isOpen&&!s["data-react-aria-top-layer"],onClose:e.close,shouldCloseOnBlur:!0,isDismissable:!i,isKeyboardDismissDisabled:o,shouldCloseOnInteractOutside:a},r),{overlayProps:c,arrowProps:h,placement:p}=Bg({...s,targetRef:n,overlayRef:r,isOpen:e.isOpen,onClose:i?e.close:null});return qg({isDisabled:i||!e.isOpen}),pe(()=>{if(e.isOpen&&!i&&r.current)return Zg([r.current])},[i,e.isOpen,r]),{popoverProps:ye(l,c),arrowProps:h,underlayProps:u,placement:p}}const tv=d.createContext({});function nv(){var t;return(t=d.useContext(tv))!==null&&t!==void 0?t:{}}const rv=d.createContext(null);function iv(t){let e=$n(),{portalContainer:n=e?null:document.body,isExiting:r}=t,[i,o]=d.useState(!1),a=d.useMemo(()=>({contain:i,setContain:o}),[i,o]),{getContainer:s}=nv();if(!t.portalContainer&&s&&(n=s()),!n)return null;let l=t.children;return t.disableFocusManagement||(l=d.createElement(Gu,{restoreFocus:!0,contain:i&&!r},l)),l=d.createElement(rv.Provider,{value:a},d.createElement(ig,null,l)),jt.createPortal(l,n)}function Lo(t){return Fh()?t.altKey:t.ctrlKey}const ov=1e3;function av(t){let{keyboardDelegate:e,selectionManager:n,onTypeSelect:r}=t,i=d.useRef({search:"",timeout:void 0}).current,o=a=>{let s=sv(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=""},ov)}};return{typeSelectProps:{onKeyDownCapture:e.getKeyForSearch?o:void 0}}}function sv(t){return t.length===1||!/^[A-Z]/i.test(t)?t:""}function Hc(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:h=!1,isVirtualized:p,scrollRef:g=r,linkBehavior:m="action"}=t,{direction:f}=or(),v=fi(),y=E=>{var _;if(E.altKey&&E.key==="Tab"&&E.preventDefault(),!(!((_=r.current)===null||_===void 0)&&_.contains(E.target)))return;const z=(L,X)=>{if(L!=null){if(e.isLink(L)&&m==="selection"&&l&&!Lo(E)){var ee;jt.flushSync(()=>{e.setFocusedKey(L,X)});let de=(ee=g.current)===null||ee===void 0?void 0:ee.querySelector(`[data-key="${CSS.escape(L.toString())}"]`),ce=e.getItemProps(L);de&&v.open(de,E,ce.href,ce.routerOptions);return}if(e.setFocusedKey(L,X),e.isLink(L)&&m==="override")return;E.shiftKey&&e.selectionMode==="multiple"?e.extendSelection(L):l&&!Lo(E)&&e.replaceSelection(L)}};switch(E.key){case"ArrowDown":if(n.getKeyBelow){var U,Y,K;let L=e.focusedKey!=null?(U=n.getKeyBelow)===null||U===void 0?void 0:U.call(n,e.focusedKey):(Y=n.getFirstKey)===null||Y===void 0?void 0:Y.call(n);L==null&&o&&(L=(K=n.getFirstKey)===null||K===void 0?void 0:K.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),z(L))}break;case"ArrowUp":if(n.getKeyAbove){var q,re,j;let L=e.focusedKey!=null?(q=n.getKeyAbove)===null||q===void 0?void 0:q.call(n,e.focusedKey):(re=n.getLastKey)===null||re===void 0?void 0:re.call(n);L==null&&o&&(L=(j=n.getLastKey)===null||j===void 0?void 0:j.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),z(L))}break;case"ArrowLeft":if(n.getKeyLeftOf){var O,k,N;let L=e.focusedKey!=null?(O=n.getKeyLeftOf)===null||O===void 0?void 0:O.call(n,e.focusedKey):null;L==null&&o&&(L=f==="rtl"?(k=n.getFirstKey)===null||k===void 0?void 0:k.call(n,e.focusedKey):(N=n.getLastKey)===null||N===void 0?void 0:N.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),z(L,f==="rtl"?"first":"last"))}break;case"ArrowRight":if(n.getKeyRightOf){var A,F,B;let L=e.focusedKey!=null?(A=n.getKeyRightOf)===null||A===void 0?void 0:A.call(n,e.focusedKey):null;L==null&&o&&(L=f==="rtl"?(F=n.getLastKey)===null||F===void 0?void 0:F.call(n,e.focusedKey):(B=n.getFirstKey)===null||B===void 0?void 0:B.call(n,e.focusedKey)),L!=null&&(E.preventDefault(),z(L,f==="rtl"?"last":"first"))}break;case"Home":if(n.getFirstKey){if(e.focusedKey===null&&E.shiftKey)return;E.preventDefault();let L=n.getFirstKey(e.focusedKey,rn(E));e.setFocusedKey(L),L!=null&&(rn(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,rn(E));e.setFocusedKey(L),L!=null&&(rn(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(),z(L))}break;case"PageUp":if(n.getKeyPageAbove&&e.focusedKey!=null){let L=n.getKeyPageAbove(e.focusedKey);L!=null&&(E.preventDefault(),z(L))}break;case"a":rn(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(!h){if(E.shiftKey)r.current.focus();else{let L=qe(r.current,{tabbable:!0}),X,ee;do ee=L.lastChild(),ee&&(X=ee);while(ee);X&&!X.contains(document.activeElement)&&xt(X)}break}}},S=d.useRef({top:0,left:0});fr(g,"scroll",p?void 0:()=>{var E,_,z,U;S.current={top:(z=(E=g.current)===null||E===void 0?void 0:E.scrollTop)!==null&&z!==void 0?z:0,left:(U=(_=g.current)===null||_===void 0?void 0:_.scrollLeft)!==null&&U!==void 0?U:0}});let w=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 _,z;let K=re=>{re!=null&&(e.setFocusedKey(re),l&&e.replaceSelection(re))},q=E.relatedTarget;var U,Y;q&&E.currentTarget.compareDocumentPosition(q)&Node.DOCUMENT_POSITION_FOLLOWING?K((U=e.lastSelectedKey)!==null&&U!==void 0?U:(_=n.getLastKey)===null||_===void 0?void 0:_.call(n)):K((Y=e.firstSelectedKey)!==null&&Y!==void 0?Y:(z=n.getFirstKey)===null||z===void 0?void 0:z.call(n))}else!p&&g.current&&(g.current.scrollTop=S.current.top,g.current.scrollLeft=S.current.left);if(e.focusedKey!=null&&g.current){let K=g.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);K&&(K.contains(document.activeElement)||xt(K),gs()==="keyboard"&&Qa(K,{containingElement:r.current}))}}},T=E=>{E.currentTarget.contains(E.relatedTarget)||e.setFocused(!1)},x=d.useRef(!1);fr(r,Zh,c?E=>{let{detail:_}=E;E.stopPropagation(),e.setFocused(!0),(_==null?void 0:_.focusStrategy)==="first"&&(x.current=!0)}:void 0);let I=De(()=>{var E,_;let z=(_=(E=n.getFirstKey)===null||E===void 0?void 0:E.call(n))!==null&&_!==void 0?_:null;if(z==null){var U;(U=r.current)===null||U===void 0||U.dispatchEvent(new CustomEvent(Ou,{cancelable:!0,bubbles:!0})),e.collection.size>0&&(x.current=!1)}else e.setFocusedKey(z),x.current=!1});Ya(()=>{x.current&&I()},[e.collection,I]);let P=De(()=>{e.collection.size>0&&(x.current=!1)});Ya(()=>{P()},[e.focusedKey,P]),fr(r,Qh,c?E=>{E.stopPropagation(),e.setFocused(!1),e.setFocusedKey(null)}:void 0);const b=d.useRef(i);d.useEffect(()=>{if(b.current){var E,_;let Y=null;var z;i==="first"&&(Y=(z=(E=n.getFirstKey)===null||E===void 0?void 0:E.call(n))!==null&&z!==void 0?z:null);var U;i==="last"&&(Y=(U=(_=n.getLastKey)===null||_===void 0?void 0:_.call(n))!==null&&U!==void 0?U:null);let K=e.selectedKeys;if(K.size){for(let q of K)if(e.canSelectItem(q)){Y=q;break}}e.setFocused(!0),e.setFocusedKey(Y),Y==null&&!c&&r.current&&qr(r.current)}},[]);let R=d.useRef(e.focusedKey);d.useEffect(()=>{if(e.isFocused&&e.focusedKey!=null&&(e.focusedKey!==R.current||b.current)&&g.current&&r.current){let E=gs(),_=r.current.querySelector(`[data-key="${CSS.escape(e.focusedKey.toString())}"]`);if(!_)return;(E==="keyboard"||b.current)&&(Pu(g.current,_),E!=="virtual"&&Qa(_,{containingElement:r.current}))}!c&&e.isFocused&&e.focusedKey==null&&R.current!=null&&r.current&&qr(r.current),R.current=e.focusedKey,b.current=!1}),fr(r,"react-aria-focus-scope-restore",E=>{E.preventDefault(),e.setFocused(!0)});let W={onKeyDown:y,onFocus:w,onBlur:T,onMouseDown(E){g.current===E.target&&E.preventDefault()}},{typeSelectProps:M}=av({keyboardDelegate:n,selectionManager:e});u||(W=ye(M,W));let H;return c?H=-1:H=e.focusedKey==null?0:-1,{collectionProps:{...W,tabIndex:H}}}function Bc(t){let{id:e,selectionManager:n,key:r,ref:i,shouldSelectOnPressUp:o,shouldUseVirtualFocus:a,focus:s,isDisabled:l,onAction:u,allowsDifferentPressOrigin:c,linkBehavior:h="action"}=t,p=fi();e=tr(e);let g=K=>{if(K.pointerType==="keyboard"&&Lo(K))n.toggleSelection(r);else{if(n.selectionMode==="none")return;if(n.isLink(r)){if(h==="selection"&&i.current){let q=n.getItemProps(r);p.open(i.current,K,q.href,q.routerOptions),n.setSelectedKeys(n.selectedKeys);return}else if(h==="override"||h==="none")return}n.selectionMode==="single"?n.isSelected(r)&&!n.disallowEmptySelection?n.toggleSelection(r):n.replaceSelection(r):K&&K.shiftKey?n.extendSelection(r):n.selectionBehavior==="toggle"||K&&(rn(K)||K.pointerType==="touch"||K.pointerType==="virtual")?n.toggleSelection(r):n.replaceSelection(r)}};d.useEffect(()=>{if(r===n.focusedKey&&n.isFocused)if(!a)s?s():document.activeElement!==i.current&&i.current&&qr(i.current);else{var q;let re=new CustomEvent(Ou,{cancelable:!0,bubbles:!0});(q=i.current)===null||q===void 0||q.dispatchEvent(re)}},[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(K){K.target===i.current&&n.setFocusedKey(r)}}:l&&(m.onMouseDown=K=>{K.preventDefault()});let f=n.isLink(r)&&h==="override",v=n.isLink(r)&&h!=="selection"&&h!=="none",y=!l&&n.canSelectItem(r)&&!f,S=(u||v)&&!l,w=S&&(n.selectionBehavior==="replace"?!y:!y||n.isEmpty),T=S&&y&&n.selectionBehavior==="replace",x=w||T,I=d.useRef(null),P=x&&y,b=d.useRef(!1),R=d.useRef(!1),W=K=>{if(u&&u(),v&&i.current){let q=n.getItemProps(r);p.open(i.current,K,q.href,q.routerOptions)}},M={};o?(M.onPressStart=K=>{I.current=K.pointerType,b.current=P,K.pointerType==="keyboard"&&(!x||ks())&&g(K)},c?(M.onPressUp=w?void 0:K=>{K.pointerType==="mouse"&&y&&g(K)},M.onPress=w?W:K=>{K.pointerType!=="keyboard"&&K.pointerType!=="mouse"&&y&&g(K)}):M.onPress=K=>{if(w||T&&K.pointerType!=="mouse"){if(K.pointerType==="keyboard"&&!_s())return;W(K)}else K.pointerType!=="keyboard"&&y&&g(K)}):(M.onPressStart=K=>{I.current=K.pointerType,b.current=P,R.current=w,y&&(K.pointerType==="mouse"&&!w||K.pointerType==="keyboard"&&(!S||ks()))&&g(K)},M.onPress=K=>{(K.pointerType==="touch"||K.pointerType==="pen"||K.pointerType==="virtual"||K.pointerType==="keyboard"&&x&&_s()||K.pointerType==="mouse"&&R.current)&&(x?W(K):y&&g(K))}),m["data-key"]=r,M.preventFocusOnPress=a;let{pressProps:H,isPressed:E}=ya(M),_=T?K=>{I.current==="mouse"&&(K.stopPropagation(),K.preventDefault(),W(K))}:void 0,{longPressProps:z}=gg({isDisabled:!P,onLongPress(K){K.pointerType==="touch"&&(g(K),n.setSelectionBehavior("toggle"))}}),U=K=>{I.current==="touch"&&b.current&&K.preventDefault()},Y=n.isLink(r)?K=>{_t.isOpening||K.preventDefault()}:void 0;return{itemProps:ye(m,y||w?H:{},P?z:{},{onDoubleClick:_,onDragStartCapture:U,onClick:Y,id:e}),isPressed:E,isSelected:n.isSelected(r),isFocused:n.isFocused&&n.focusedKey===r,isDisabled:l,allowsSelection:y,hasAction:x}}function _s(){let t=window.event;return(t==null?void 0:t.key)==="Enter"}function ks(){let t=window.event;return(t==null?void 0:t.key)===" "||(t==null?void 0:t.code)==="Space"}class Rs{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 lv{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&&!Gn(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&&!Gn(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 Rs(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 Rs(this.ref);this.layout==="stack"&&this.orientation==="vertical"&&(this.getKeyLeftOf=void 0,this.getKeyRightOf=void 0)}}function uv(t){let{selectionManager:e,collection:n,disabledKeys:r,ref:i,keyboardDelegate:o,layoutDelegate:a}=t,s=_g({usage:"search",sensitivity:"base"}),l=e.disabledBehavior,u=d.useMemo(()=>o||new lv({collection:n,disabledKeys:r,disabledBehavior:l,ref:i,collator:s,layoutDelegate:a}),[o,a,n,r,i,s,l]),{collectionProps:c}=Hc({...t,ref:i,selectionManager:e,keyboardDelegate:u});return{listProps:c}}function Wc(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function cv(t){return dv(t)}function dv(t,e){for(let n of t)return n}function Bi(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...Ns(t,e),e],i=[...Ns(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 Ns(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 Ms=new WeakMap;function fv(t){let e=Ms.get(t);if(e!=null)return e;let n=0,r=i=>{for(let o of i)o.type==="section"?r(Wc(o,t)):n++};return r(t),Ms.set(t,n),n}const Uc=new WeakMap;function hv(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=Be(t,{labelable:!0}),{listProps:l}=uv({...a,ref:n,selectionManager:e.selectionManager,collection:e.collection,disabledKeys:e.disabledKeys,shouldFocusWrap:r,linkBehavior:"override"});return Uc.set(e,{onClose:t.onClose,onAction:t.onAction,shouldUseVirtualFocus:t.shouldUseVirtualFocus}),{menuProps:ye(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 pv(t,e,n){let{id:r,key:i,closeOnSelect:o,isVirtualized:a,"aria-haspopup":s,onPressStart:l,onPressUp:u,onPress:c,onPressChange:h,onPressEnd:p,onHoverStart:g,onHoverChange:m,onHoverEnd:f,onKeyDown:v,onKeyUp:y,onFocus:S,onFocusChange:w,onBlur:T,selectionManager:x=e.selectionManager}=t,I=!!s,P=I&&t["aria-expanded"]==="true";var b;let R=(b=t.isDisabled)!==null&&b!==void 0?b:x.isDisabled(i);var W;let M=(W=t.isSelected)!==null&&W!==void 0?W:x.isSelected(i),H=Uc.get(e),E=e.collection.getItem(i),_=t.onClose||H.onClose,z=fi(),U=ne=>{var Ue;if(!I){if(!(E==null||(Ue=E.props)===null||Ue===void 0)&&Ue.onAction?E.props.onAction():t.onAction&&t.onAction(i),H.onAction){let st=H.onAction;st(i)}ne.target instanceof HTMLAnchorElement&&E&&z.open(ne.target,ne,E.props.href,E.props.routerOptions)}},Y="menuitem";I||(x.selectionMode==="single"?Y="menuitemradio":x.selectionMode==="multiple"&&(Y="menuitemcheckbox"));let K=_i(),q=_i(),re=_i(),j={id:r,"aria-disabled":R||void 0,role:Y,"aria-label":t["aria-label"],"aria-labelledby":K,"aria-describedby":[q,re].filter(Boolean).join(" ")||void 0,"aria-controls":t["aria-controls"],"aria-haspopup":s,"aria-expanded":t["aria-expanded"]};x.selectionMode!=="none"&&!I&&(j["aria-checked"]=M),a&&(j["aria-posinset"]=E==null?void 0:E.index,j["aria-setsize"]=fv(e.collection));let O=ne=>{ne.pointerType==="keyboard"&&U(ne),l==null||l(ne)},k=()=>{!I&&_&&(o??(x.selectionMode!=="multiple"||x.isLink(i)))&&_()},N=ne=>{ne.pointerType==="mouse"&&(U(ne),k()),u==null||u(ne)},A=ne=>{ne.pointerType!=="keyboard"&&ne.pointerType!=="mouse"&&(U(ne),k()),c==null||c(ne)},{itemProps:F,isFocused:B}=Bc({id:r,selectionManager:x,key:i,ref:n,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,linkBehavior:"none",shouldUseVirtualFocus:H.shouldUseVirtualFocus}),{pressProps:L,isPressed:X}=ya({onPressStart:O,onPress:A,onPressUp:N,onPressChange:h,onPressEnd:p,isDisabled:R}),{hoverProps:ee}=wa({isDisabled:R,onHoverStart(ne){!cg()&&!(P&&s==="dialog")&&(x.setFocused(!0),x.setFocusedKey(i)),g==null||g(ne)},onHoverChange:m,onHoverEnd:f}),{keyboardProps:de}=hg({onKeyDown:ne=>{if(ne.repeat){ne.continuePropagation();return}switch(ne.key){case" ":!R&&x.selectionMode==="none"&&!I&&o!==!1&&_&&_();break;case"Enter":!R&&o!==!1&&!I&&_&&_();break;default:I||ne.continuePropagation(),v==null||v(ne);break}},onKeyUp:y}),{focusProps:ce}=ag({onBlur:T,onFocus:S,onFocusChange:w}),oe=Be(E==null?void 0:E.props);delete oe.id;let ge=Cu(E==null?void 0:E.props);return{menuItemProps:{...j,...ye(oe,ge,I?{onFocus:F.onFocus,"data-key":F["data-key"]}:F,L,ee,de,ce),tabIndex:F.tabIndex!=null&&P?-1:F.tabIndex},labelProps:{id:K},descriptionProps:{id:q},keyboardShortcutProps:{id:re},isFocused:B,isSelected:M,isPressed:X,isDisabled:R}}function gv(t){let{heading:e,"aria-label":n}=t,r=tr();return{itemProps:{role:"presentation"},headingProps:e?{id:r,role:"presentation"}:{},groupProps:{role:"group","aria-label":n,"aria-labelledby":e?r:void 0}}}function vv(t){let e=Be(t,{labelable:!0}),n;return t.orientation==="vertical"&&(n="vertical"),t.elementType!=="hr"?{separatorProps:{...e,role:"separator","aria-orientation":n}}:{separatorProps:e}}const Vc=new WeakMap;function Zr(t,e,n){return t?(typeof e=="string"&&(e=e.replace(/\s+/g,"")),`${Vc.get(t)}-${n}-${e}`):""}function mv(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:h}=Bc({selectionManager:a,key:r,ref:n,isDisabled:u,shouldSelectOnPressUp:o,linkBehavior:"selection"}),p=Zr(e,r,"tab"),g=Zr(e,r,"tabpanel"),{tabIndex:m}=c,f=e.collection.getItem(r),v=Be(f==null?void 0:f.props,{labelable:!0});delete v.id;let y=Cu(f==null?void 0:f.props);return{tabProps:ye(v,y,c,{id:p,"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:h}}function yv(t,e,n){let r=Qp(n)?void 0:0;var i;const o=Zr(e,(i=t.id)!==null&&i!==void 0?i:e==null?void 0:e.selectedKey,"tabpanel"),a=sa({...t,id:o,"aria-labelledby":Zr(e,e==null?void 0:e.selectedKey,"tab")});return{tabPanelProps:ye(a,{tabIndex:r,role:"tabpanel","aria-describedby":t["aria-describedby"],"aria-details":t["aria-details"]})}}class bv{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 Sv(t,e,n){let{orientation:r="horizontal",keyboardActivation:i="automatic"}=t,{collection:o,selectionManager:a,disabledKeys:s}=e,{direction:l}=or(),u=d.useMemo(()=>new bv(o,l,r,s),[o,s,r,l]),{collectionProps:c}=Hc({ref:n,selectionManager:a,keyboardDelegate:u,selectOnFocus:i==="automatic",disallowEmptySelection:!0,scrollRef:n,linkBehavior:"selection"}),h=tr();Vc.set(e,h);let p=sa({...t,id:h});return{tabListProps:{...ye(c,p),role:"tablist","aria-orientation":r,tabIndex:void 0}}}const wv=d.createContext({});function Ev(t){let[e,n]=nr(t.isOpen,t.defaultOpen||!1,t.onOpenChange);const r=d.useCallback(()=>{n(!0)},[n]),i=d.useCallback(()=>{n(!1)},[n]),o=d.useCallback(()=>{n(!e)},[n,e]);return{isOpen:e,setOpen:n,open:r,close:i,toggle:o}}class $v{build(e,n){return this.context=n,As(()=>this.iterateCollection(e))}*iterateCollection(e){let{children:n,items:r}=e;if(d.isValidElement(n)&&n.type===d.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=[];d.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(d.isValidElement(e.element)&&e.element.type===d.Fragment){let v=[];d.Children.forEach(e.element.props.children,S=>{v.push(S)});var o;let y=(o=e.index)!==null&&o!==void 0?o:0;for(const S of v)yield*this.getFullNode({element:S,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(d.isValidElement(a)){let v=a.type;if(typeof v!="function"&&typeof v.getCollectionNode!="function"){let T=a.type;throw new Error(`Unknown element <${T}> in collection.`)}let y=v.getCollectionNode(a.props,this.context);var s;let S=(s=e.index)!==null&&s!==void 0?s:0,w=y.next();for(;!w.done&&w.value;){let T=w.value;e.index=S;var l;let x=(l=T.key)!==null&&l!==void 0?l:null;x==null&&(x=T.element?null:this.getKey(a,e,n,r));let P=[...this.getFullNode({...T,key:x,index:S,wrapper:xv(e.wrapper,T.wrapper)},this.getChildState(n,T),r?`${r}${a.key}`:a.key,i)];for(let b of P){var u,c;b.value=(c=(u=T.value)!==null&&u!==void 0?u:e.value)!==null&&c!==void 0?c:null,b.value&&this.cache.set(b.value,b);var h;if(e.type&&b.type!==e.type)throw new Error(`Unsupported type <${Wi(b.type)}> in <${Wi((h=i==null?void 0:i.type)!==null&&h!==void 0?h:"unknown parent type")}>. Only <${Wi(e.type)}> is supported.`);S++,yield b}w=y.next(P)}return}if(e.key==null||e.type==null)return;let p=this;var g,m;let f={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:As(function*(){if(!e.hasChildNodes||!e.childNodes)return;let v=0;for(let y of e.childNodes()){y.key!=null&&(y.key=`${f.key}${y.key}`);let S=p.getFullNode({...y,index:v},p.getChildState(n,y),f.key,f);for(let w of S)v++,yield w}})};yield f}constructor(){this.cache=new WeakMap}}function As(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 xv(t,e){if(t&&e)return n=>t(e(n));if(t)return t;if(e)return e}function Wi(t){return t[0].toUpperCase()+t.slice(1)}function Gc(t,e,n){let r=d.useMemo(()=>new $v,[]),{children:i,items:o,collection:a}=t;return d.useMemo(()=>{if(a)return a;let l=r.build({children:i,items:o},n);return e(l)},[r,i,o,a,n,e])}function Cv(t,e){return typeof e.getChildren=="function"?e.getChildren(t.key):t.childNodes}function Tv(t){return Dv(t)}function Dv(t,e){for(let n of t)return n}function Ui(t,e,n){if(e.parentKey===n.parentKey)return e.index-n.index;let r=[...Ks(t,e),e],i=[...Ks(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 Ks(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}function Pv(t){let{initialItems:e=[],initialSelectedKeys:n,getKey:r=f=>{var v;return(v=f.id)!==null&&v!==void 0?v:f.key},getChildren:i=f=>f.children}=t,[o,a]=d.useState(()=>h(e,new Map)),{items:s,nodeMap:l}=o,[u,c]=d.useState(new Set(n||[]));function h(f=[],v,y){return f==null&&(f=[]),{items:f.map(S=>{let w={key:r(S),parentKey:y,value:S,children:null};return w.children=h(i(S),v,w.key).items,v.set(w.key,w),w}),nodeMap:v}}function p(f,v,y,S){let w=S.get(v);if(!w)return{items:f,nodeMap:S};let T=new Map(S),x=y(w);for(x==null?m(w,T):g(x,T);w&&w.parentKey;){let P=T.get(w.parentKey),b={key:P.key,parentKey:P.parentKey,value:P.value,children:null},R=P.children;x==null&&R&&(R=R.filter(W=>W!==w));var I;b.children=(I=R==null?void 0:R.map(W=>W===w?x:W))!==null&&I!==void 0?I:null,T.set(b.key,b),x=b,w=P}return x==null&&(f=f.filter(P=>P!==w)),{items:f.map(P=>P===w?x:P),nodeMap:T}}function g(f,v){if(v.set(f.key,f),f.children)for(let y of f.children)g(y,v)}function m(f,v){if(v.delete(f.key),f.children)for(let y of f.children)m(y,v)}return{items:s,selectedKeys:u,setSelectedKeys:c,getItem(f){return l.get(f)},insert(f,v,...y){a(({items:S,nodeMap:w})=>{let{items:T,nodeMap:x}=h(y,w,f);return f==null?{items:[...S.slice(0,v),...T,...S.slice(v)],nodeMap:x}:p(S,f,I=>({key:I.key,parentKey:I.parentKey,value:I.value,children:[...I.children.slice(0,v),...T,...I.children.slice(v)]}),x)})},insertBefore(f,...v){let y=l.get(f);if(!y)return;let S=l.get(y.parentKey),T=(S?S.children:s).indexOf(y);var x;this.insert((x=S==null?void 0:S.key)!==null&&x!==void 0?x:null,T,...v)},insertAfter(f,...v){let y=l.get(f);if(!y)return;let S=l.get(y.parentKey),T=(S?S.children:s).indexOf(y);var x;this.insert((x=S==null?void 0:S.key)!==null&&x!==void 0?x:null,T+1,...v)},prepend(f,...v){this.insert(f,0,...v)},append(f,...v){if(f==null)this.insert(null,s.length,...v);else{let y=l.get(f);if(!y)return;this.insert(f,y.children.length,...v)}},remove(...f){if(f.length===0)return;let v=s,y=l,S;for(let T of f)S=p(v,T,()=>null,y),y=S.nodeMap,v=S.items;a(S);let w=new Set(u);for(let T of u)S.nodeMap.has(T)||w.delete(T);c(w)},removeSelectedItems(){this.remove(...u)},move(f,v,y){a(({items:S,nodeMap:w})=>{let T=w.get(f);if(!T)return{items:S,nodeMap:w};let{items:x,nodeMap:I}=p(S,f,()=>null,w);const P={...T,parentKey:v};return v==null?(I.set(P.key,P),{items:[...x.slice(0,y),P,...x.slice(y)],nodeMap:I}):p(x,v,b=>({key:b.key,parentKey:b.parentKey,value:b.value,children:[...b.children.slice(0,y),P,...b.children.slice(y)]}),I)})},update(f,v){a(({items:y,nodeMap:S})=>p(y,f,w=>{let T={key:w.key,parentKey:w.parentKey,value:v,children:null},x=h(i(v),S,T.key);return T.children=x.items,T},S))}}}class Ls{*[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}}let tt=class qc extends Set{constructor(e,n,r){super(e),e instanceof qc?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}};function Ov(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Yc(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:o="all"}=t,a=d.useRef(!1),[,s]=d.useState(!1),l=d.useRef(null),u=d.useRef(null),[,c]=d.useState(null),h=d.useMemo(()=>Fs(t.selectedKeys),[t.selectedKeys]),p=d.useMemo(()=>Fs(t.defaultSelectedKeys,new tt),[t.defaultSelectedKeys]),[g,m]=nr(h,p,t.onSelectionChange),f=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,y]=d.useState(i);i==="replace"&&v==="toggle"&&typeof g=="object"&&g.size===0&&y("replace");let S=d.useRef(i);return d.useEffect(()=>{i!==S.current&&(y(i),S.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return a.current},setFocused(w){a.current=w,s(w)},get focusedKey(){return l.current},get childFocusStrategy(){return u.current},setFocusedKey(w,T="first"){l.current=w,u.current=T,c(w)},selectedKeys:g,setSelectedKeys(w){(r||!Ov(w,g))&&m(w)},disabledKeys:f,disabledBehavior:o}}function Fs(t,e){return t?t==="all"?"all":new tt(t):e}let Xc=class{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&&Ui(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&&Ui(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 tt([n],n,n);else{let a=this.state.selectedKeys;var i;let s=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new tt(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?Ui(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 tt(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 tt([n],n,n):new tt;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new tt;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=Tv(Cv(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 tt)}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 Iv(t){let{filter:e,layoutDelegate:n}=t,r=Yc(t),i=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),o=d.useCallback(c=>e?new Ls(e(c)):new Ls(c),[e]),a=d.useMemo(()=>({suppressTextValueWarning:t.suppressTextValueWarning}),[t.suppressTextValueWarning]),s=Gc(t,o,a),l=d.useMemo(()=>new Xc(s,r,{layoutDelegate:n}),[s,r,n]);const u=d.useRef(null);return d.useEffect(()=>{if(r.focusedKey!=null&&!s.getItem(r.focusedKey)&&u.current){const y=u.current.getItem(r.focusedKey),S=[...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),w=[...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,h;const T=((c=S==null?void 0:S.length)!==null&&c!==void 0?c:0)-((h=w==null?void 0:w.length)!==null&&h!==void 0?h:0);var p,g,m;let x=Math.min(T>1?Math.max(((p=y==null?void 0:y.index)!==null&&p!==void 0?p:0)-T+1,0):(g=y==null?void 0:y.index)!==null&&g!==void 0?g:0,((m=w==null?void 0:w.length)!==null&&m!==void 0?m:0)-1),I=null,P=!1;for(;x>=0;){if(!l.isDisabled(w[x].key)){I=w[x];break}if(x<w.length-1&&!P)x++;else{P=!0;var f,v;x>((f=y==null?void 0:y.index)!==null&&f!==void 0?f:0)&&(x=(v=y==null?void 0:y.index)!==null&&v!==void 0?v:0),x--}}r.setFocusedKey(I?I.key:null)}u.current=s},[s,l,r,r.focusedKey]),{collection:s,disabledKeys:i,selectionManager:l}}function _v(t){var e;let[n,r]=nr(t.selectedKey,(e=t.defaultSelectedKey)!==null&&e!==void 0?e:null,t.onSelectionChange),i=d.useMemo(()=>n!=null?[n]:[],[n]),{collection:o,disabledKeys:a,selectionManager:s}=Iv({...t,selectionMode:"single",disallowEmptySelection:!0,allowDuplicateSelectionEvents:!0,selectedKeys:i,onSelectionChange:u=>{if(u==="all")return;var c;let h=(c=u.values().next().value)!==null&&c!==void 0?c:null;h===n&&t.onSelectionChange&&t.onSelectionChange(h),r(h)}}),l=n!=null?o.getItem(n):null;return{collection:o,disabledKeys:a,selectionManager:s,selectedKey:n,setSelectedKey:r,selectedItem:l}}function kv(t){var e,n;let r=_v({...t,suppressTextValueWarning:!0,defaultSelectedKey:(n=(e=t.defaultSelectedKey)!==null&&e!==void 0?e:js(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=d.useRef(a);return d.useEffect(()=>{let l=a;(i.isEmpty||l==null||!o.getItem(l))&&(l=js(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 js(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 Rv{*[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 Nv(t){let{onExpandedChange:e}=t,[n,r]=nr(t.expandedKeys?new Set(t.expandedKeys):void 0,t.defaultExpandedKeys?new Set(t.defaultExpandedKeys):new Set,e),i=Yc(t),o=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),a=Gc(t,d.useCallback(l=>new Rv(l,{expandedKeys:n}),[n]),null);return d.useEffect(()=>{i.focusedKey!=null&&!a.getItem(i.focusedKey)&&i.setFocusedKey(null)},[a,i.focusedKey]),{collection:a,expandedKeys:n,disabledKeys:o,toggleKey:l=>{r(Mv(n,l))},setExpandedKeys:r,selectionManager:new Xc(a,i)}}function Mv(t,e){let n=new Set(t);return n.has(e)?n.delete(e):n.add(e),n}const Av=d.createContext(null),Kv=d.createContext(null),Jc={CollectionRoot({collection:t,renderDropIndicator:e}){return zs(t,null,e)},CollectionBranch({collection:t,parent:e,renderDropIndicator:n}){return zs(t,e,n)}};function zs(t,e,n){return ku({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 d.createElement(d.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 gi=d.createContext(Jc);function Qc(t){return d.useMemo(()=>t!=null?new Set([t]):null,[t])}const Lv=d.createContext({}),Zc=d.createContext({}),Fv=fa("separator",function(e,n){[e,n]=ir(e,n,Zc);let{elementType:r,orientation:i,style:o,className:a}=e,s=r||"hr";s==="hr"&&i==="vertical"&&(s="div");let{separatorProps:l}=vv({elementType:r,orientation:i});return d.createElement(s,{...Be(e),...l,style:o,className:a??"react-aria-Separator",ref:n,slot:e.slot||void 0})}),jv=d.createContext({placement:"bottom"}),zv=d.createContext(null),Hv=d.forwardRef(function(e,n){[e,n]=ir(e,n,zv);let r=d.useContext(nm),i=Ev(e),o=e.isOpen!=null||e.defaultOpen!=null||!r?i:r,a=tp(n,o.isOpen)||e.isExiting||!1;if(sp()){let l=e.children;return typeof l=="function"&&(l=l({trigger:e.trigger||null,placement:"bottom",isEntering:!1,isExiting:!1,defaultChildren:null})),d.createElement(d.Fragment,null,l)}return o&&!o.isOpen&&!a?null:d.createElement(Bv,{...e,triggerRef:e.triggerRef,state:o,popoverRef:n,isExiting:a})});function Bv({state:t,isExiting:e,UNSTABLE_portalContainer:n,...r}){let i=d.useRef(null),[o,a]=d.useState(0);pe(()=>{i.current&&t.isOpen&&a(i.current.getBoundingClientRect().width)},[t.isOpen,i]);var s;let{popoverProps:l,underlayProps:u,arrowProps:c,placement:h}=ev({...r,offset:(s=r.offset)!==null&&s!==void 0?s:8,arrowSize:o},t),p=r.popoverRef,g=ep(p,!!h)||r.isEntering||!1,m=yt({...r,defaultClassName:"react-aria-Popover",values:{trigger:r.trigger||null,placement:h,isEntering:g,isExiting:e}}),f={...l.style,...m.style};return d.createElement(iv,{...r,isExiting:e,portalContainer:n},!r.isNonModal&&t.isOpen&&d.createElement("div",{"data-testid":"underlay",...u,style:{position:"fixed",inset:0}}),d.createElement("div",{...ye(Be(r),l),...m,ref:p,slot:r.slot||void 0,style:f,"data-trigger":r.trigger,"data-placement":h,"data-entering":g||void 0,"data-exiting":e||void 0},!r.isNonModal&&d.createElement(Is,{onDismiss:t.close}),d.createElement(jv.Provider,{value:{...c,placement:h,ref:i}},m.children),d.createElement(Is,{onDismiss:t.close})))}const Wv=d.createContext({});class ze extends Set{constructor(e,n,r){super(e),e instanceof ze?(this.anchorKey=n??e.anchorKey,this.currentKey=r??e.currentKey):(this.anchorKey=n??null,this.currentKey=r??null)}}function Uv(t,e){if(t.size!==e.size)return!1;for(let n of t)if(!e.has(n))return!1;return!0}function Vv(t){let{selectionMode:e="none",disallowEmptySelection:n=!1,allowDuplicateSelectionEvents:r,selectionBehavior:i="toggle",disabledBehavior:o="all"}=t,a=d.useRef(!1),[,s]=d.useState(!1),l=d.useRef(null),u=d.useRef(null),[,c]=d.useState(null),h=d.useMemo(()=>Hs(t.selectedKeys),[t.selectedKeys]),p=d.useMemo(()=>Hs(t.defaultSelectedKeys,new ze),[t.defaultSelectedKeys]),[g,m]=nr(h,p,t.onSelectionChange),f=d.useMemo(()=>t.disabledKeys?new Set(t.disabledKeys):new Set,[t.disabledKeys]),[v,y]=d.useState(i);i==="replace"&&v==="toggle"&&typeof g=="object"&&g.size===0&&y("replace");let S=d.useRef(i);return d.useEffect(()=>{i!==S.current&&(y(i),S.current=i)},[i]),{selectionMode:e,disallowEmptySelection:n,selectionBehavior:v,setSelectionBehavior:y,get isFocused(){return a.current},setFocused(w){a.current=w,s(w)},get focusedKey(){return l.current},get childFocusStrategy(){return u.current},setFocusedKey(w,T="first"){l.current=w,u.current=T,c(w)},selectedKeys:g,setSelectedKeys(w){(r||!Uv(w,g))&&m(w)},disabledKeys:f,disabledBehavior:o}}function Hs(t,e){return t?t==="all"?"all":new ze(t):e}class Gv{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&&Bi(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&&Bi(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 ze([n],n,n);else{let a=this.state.selectedKeys;var i;let s=(i=a.anchorKey)!==null&&i!==void 0?i:n;r=new ze(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?Bi(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 ze(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 ze([n],n,n):new ze;this.state.setSelectedKeys(r)}setSelectedKeys(e){if(this.selectionMode==="none")return;let n=new ze;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=cv(Wc(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 ze)}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}}const qv=d.createContext(null),Ea=d.createContext(null),Yv=d.createContext(null),ei=d.createContext(null),Xv=d.createContext(null),Jv=d.forwardRef(function(e,n){return[e,n]=ir(e,n,qv),d.createElement(Nu,{content:d.createElement(Mu,e)},r=>r.size>0&&d.createElement(Qv,{props:e,collection:r,menuRef:n}))});function Qv({props:t,collection:e,menuRef:n}){let{filterFn:r,collectionProps:i,collectionRef:o}=d.useContext(Av)||{};n=xn(d.useMemo(()=>wu(n,o!==void 0?o:null),[o,n]));let a=d.useMemo(()=>r?e.filter(r):e,[e,r]),s=Nv({...t,collection:a,children:void 0}),l=d.useContext(Yv),{isVirtualized:u,CollectionRoot:c}=d.useContext(gi),{menuProps:h}=hv({...t,...i,isVirtualized:u,onClose:t.onClose||(l==null?void 0:l.close)},s,n),p=yt({defaultClassName:"react-aria-Menu",className:t.className,style:t.style,values:{}});return d.createElement(Gu,null,d.createElement("div",{...Be(t),...h,...p,ref:n,slot:t.slot||void 0,onScroll:t.onScroll},d.createElement(rr,{values:[[Ea,s],[Zc,{elementType:"div"}],[Kv,{name:"MenuSection",render:em}],[Xv,{parentMenuRef:n}],[Fo,null],[ei,s.selectionManager]]},d.createElement(c,{collection:s.collection,persistedKeys:Qc(s.selectionManager.focusedKey),scrollRef:n}))))}class Zv extends Gv{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 em(t,e,n,r="react-aria-MenuSection"){var i,o;let a=d.useContext(Ea),{CollectionBranch:s}=d.useContext(gi),[l,u]=np();var c;let{headingProps:h,groupProps:p}=gv({heading:u,"aria-label":(c=n.props["aria-label"])!==null&&c!==void 0?c:void 0}),g=yt({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=d.useContext(ei),f=Vv(t),v=t.selectionMode!=null?new Zv(m,f):m;return d.createElement("section",{...Be(t),...p,...g,ref:e},d.createElement(rr,{values:[[Lv,{...h,ref:l}],[ei,v]]},d.createElement(s,{collection:a.collection,parent:n})))}const Fo=d.createContext(null),tm=fa("item",function(e,n,r){var i;[e,n]=ir(e,n,Fo);let o=(i=la(Fo))===null||i===void 0?void 0:i.id,a=d.useContext(Ea),s=xn(n),l=d.useContext(ei),{menuItemProps:u,labelProps:c,descriptionProps:h,keyboardShortcutProps:p,...g}=pv({...e,id:o,key:r.key,selectionManager:l},a,s),{isFocusVisible:m,focusProps:f}=hi(),{hoverProps:v,isHovered:y}=wa({isDisabled:g.isDisabled}),S=yt({...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"}}),w=e.href?"a":"div";return d.createElement(w,{...ye(u,f,v),...S,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},d.createElement(rr,{values:[[wv,{slots:{label:c,description:h}}],[Wv,p]]},S.children))}),nm=d.createContext(null),vi=d.createContext(null),bn=d.createContext(null),rm=d.forwardRef(function(e,n){[e,n]=ir(e,n,vi);let{children:r,orientation:i="horizontal"}=e;return r=d.useMemo(()=>typeof r=="function"?r({orientation:i,defaultChildren:null}):r,[r,i]),d.createElement(Nu,{content:r},o=>d.createElement(im,{props:e,collection:o,tabsRef:n}))});function im({props:t,tabsRef:e,collection:n}){let{orientation:r="horizontal"}=t,i=kv({...t,collection:n,children:void 0}),{focusProps:o,isFocused:a,isFocusVisible:s}=hi({within:!0}),l=d.useMemo(()=>({orientation:r,isFocusWithin:a,isFocusVisible:s}),[r,a,s]),u=yt({...t,defaultClassName:"react-aria-Tabs",values:l});return d.createElement("div",{...Be(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},d.createElement(rr,{values:[[vi,t],[bn,i]]},u.children))}const om=d.forwardRef(function(e,n){return d.useContext(bn)?d.createElement(am,{props:e,forwardedRef:n}):d.createElement(Mu,e)});function am({props:t,forwardedRef:e}){let n=d.useContext(bn),{CollectionRoot:r}=d.useContext(gi),{orientation:i="horizontal",keyboardActivation:o="automatic"}=la(vi),a=xn(e),{tabListProps:s}=Sv({...t,orientation:i,keyboardActivation:o},n,a),l=yt({...t,children:null,defaultClassName:"react-aria-TabList",values:{orientation:i,state:n}}),u=Be(t);return delete u.id,d.createElement("div",{...u,...s,ref:a,...l,"data-orientation":i||void 0},d.createElement(r,{collection:n.collection,persistedKeys:Qc(n.selectionManager.focusedKey)}))}const sm=fa("item",(t,e,n)=>{let r=d.useContext(bn),i=xn(e),{tabProps:o,isSelected:a,isDisabled:s,isPressed:l}=mv({key:n.key,...t},r,i),{focusProps:u,isFocused:c,isFocusVisible:h}=hi(),{hoverProps:p,isHovered:g}=wa({isDisabled:s,onHoverStart:t.onHoverStart,onHoverEnd:t.onHoverEnd,onHoverChange:t.onHoverChange}),m=yt({...t,id:void 0,defaultClassName:"react-aria-Tab",values:{isSelected:a,isDisabled:s,isFocused:c,isFocusVisible:h,isPressed:l,isHovered:g}}),f=n.props.href?"a":"div";return d.createElement(f,{...ye(o,u,p,m),ref:i,"data-selected":a||void 0,"data-disabled":s||void 0,"data-focused":c||void 0,"data-focus-visible":h||void 0,"data-pressed":l||void 0,"data-hovered":g||void 0})}),lm=ap(function(e,n){const r=d.useContext(bn);let i=xn(n),{tabPanelProps:o}=yv(e,r,i),{focusProps:a,isFocused:s,isFocusVisible:l}=hi(),u=r.selectedKey===e.id,c=yt({...e,defaultClassName:"react-aria-TabPanel",values:{isFocused:s,isFocusVisible:l,isInert:!u,state:r}});if(!u&&!e.shouldForceMount)return null;let h=Be(e);delete h.id;let p=u?ye(h,o,a,c):c;return d.createElement("div",{...p,ref:i,"data-focused":s||void 0,"data-focus-visible":l||void 0,inert:u?void 0:"true","data-inert":u?void 0:"true"},d.createElement(rr,{values:[[vi,null],[bn,null]]},d.createElement(gi.Provider,{value:Jc},c.children)))}),ed=({options:t,isOpen:e=!1,onOpenChange:n,children:r,selectedValues:i=[],onSelectValue:o})=>{const a=d.useId(),s=u=>{n==null||n(u)},l=d.useRef(null);return D.jsxs(D.Fragment,{children:[D.jsx("div",{className:"c__dropdown-menu-trigger",ref:l,id:a,onClick:u=>{u.stopPropagation(),u.preventDefault()},children:r}),D.jsx(Hv,{triggerRef:l,style:{marginTop:"0px"},isOpen:e,onOpenChange:s,children:D.jsx(Jv,{className:"c__dropdown-menu","aria-labelledby":a,children:t.map(u=>D.jsxs(d.Fragment,{children:[D.jsxs(tm,{className:"c__dropdown-menu-item","aria-label":u.label,onAction:()=>{var c;u.value&&(o==null||o(u.value)),(c=u.callback)==null||c.call(u),s(!1)},isDisabled:u.isDisabled,children:[u.icon,D.jsx("div",{className:"c__dropdown-menu-item__label","aria-label":u.label,children:u.label}),(u.isChecked||u.value&&i.includes(u.value))&&D.jsx("span",{className:"material-icons checked",children:"check"})]},u.label),u.showSeparator&&D.jsx(Fv,{})]},u.label))})})]})},td=()=>{const[t,e]=d.useState(!1);return{isOpen:t,setIsOpen:e}},nd=({languages:t})=>{const{isOpen:e,setIsOpen:n}=td();return D.jsx(ed,{options:t,isOpen:e,onOpenChange:n,children:D.jsxs(mn.Button,{onClick:()=>n(!e),color:"primary-text",className:"c__language-picker",children:[D.jsx("span",{className:"material-icons",children:"translate"}),D.jsx("span",{className:"c__language-picker__label",children:"Français"}),D.jsx("span",{className:"material-icons",children:e?"arrow_drop_up":"arrow_drop_down"})]})})},rd=({leftIcon:t,rightIcon:e,languages:n,onTogglePanel:r,isPanelOpen:i})=>{const{t:o}=mn.useCunningham();return D.jsxs("div",{className:"c__header",children:[D.jsx("div",{className:"c__header__toggle-menu",children:D.jsx(mn.Button,{size:"medium",onClick:r,"aria-label":o(i?"Close the menu":"Open the menu"),color:"tertiary-text",icon:D.jsx("span",{className:"material-icons clr-primary-800",children:i?"close":"menu"})})}),D.jsx("div",{className:"c__header__left",children:t}),D.jsxs("div",{className:"c__header__right",children:[n&&D.jsx("div",{className:"c__header__right__language-picker",children:D.jsx(nd,{languages:n})}),e]})]})},jo={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-050":"#FFF4F4","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"},tooltip:{padding:"4px 8px","background-color":"var(--c--theme--colors--greyscale-1000)"},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"}}}}},ar=()=>{const[t,e]=d.useState(window.innerWidth),n=parseInt(jo.themes.default.theme.breakpoints.mobile.replace("px","")),r=parseInt(jo.themes.default.theme.breakpoints.tablet.replace("px","")),i=()=>{e(window.innerWidth)};d.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}},id=({children:t,isOpen:e=!1})=>{const{isDesktop:n}=ar();return n?D.jsx("div",{className:"c__left-panel",children:t}):D.jsx("div",{className:ot("c__left-panel__mobile",{open:e}),children:t})},{createElement:Sn,createContext:um,createRef:Ox,forwardRef:od,useCallback:xe,useContext:ad,useEffect:Dt,useImperativeHandle:sd,useLayoutEffect:cm,useMemo:dm,useRef:Ce,useState:hn}=C,Bs=C[`useId${Math.random()}`.slice(0,5)],fm=cm,mi=um(null);mi.displayName="PanelGroupContext";const Pt=fm,hm=typeof Bs=="function"?Bs:()=>null;let pm=0;function $a(t=null){const e=hm(),n=Ce(t||e||null);return n.current===null&&(n.current=""+pm++),t??n.current}function ld({children:t,className:e="",collapsedSize:n,collapsible:r,defaultSize:i,forwardedRef:o,id:a,maxSize:s,minSize:l,onCollapse:u,onExpand:c,onResize:h,order:p,style:g,tagName:m="div",...f}){const v=ad(mi);if(v===null)throw Error("Panel components must be rendered within a PanelGroup container");const{collapsePanel:y,expandPanel:S,getPanelSize:w,getPanelStyle:T,groupId:x,isPanelCollapsed:I,reevaluatePanelConstraints:P,registerPanel:b,resizePanel:R,unregisterPanel:W}=v,M=$a(a),H=Ce({callbacks:{onCollapse:u,onExpand:c,onResize:h},constraints:{collapsedSize:n,collapsible:r,defaultSize:i,maxSize:s,minSize:l},id:M,idIsFromProps:a!==void 0,order:p});Ce({didLogMissingDefaultSizeWarning:!1}),Pt(()=>{const{callbacks:_,constraints:z}=H.current,U={...z};H.current.id=M,H.current.idIsFromProps=a!==void 0,H.current.order=p,_.onCollapse=u,_.onExpand=c,_.onResize=h,z.collapsedSize=n,z.collapsible=r,z.defaultSize=i,z.maxSize=s,z.minSize=l,(U.collapsedSize!==z.collapsedSize||U.collapsible!==z.collapsible||U.maxSize!==z.maxSize||U.minSize!==z.minSize)&&P(H.current,U)}),Pt(()=>{const _=H.current;return b(_),()=>{W(_)}},[p,M,b,W]),sd(o,()=>({collapse:()=>{y(H.current)},expand:_=>{S(H.current,_)},getId(){return M},getSize(){return w(H.current)},isCollapsed(){return I(H.current)},isExpanded(){return!I(H.current)},resize:_=>{R(H.current,_)}}),[y,S,w,I,M,R]);const E=T(H.current,i);return Sn(m,{...f,children:t,className:e,id:a,style:{...E,...g},"data-panel":"","data-panel-collapsible":r||void 0,"data-panel-group-id":x,"data-panel-id":M,"data-panel-size":parseFloat(""+E.flexGrow).toFixed(1)})}const zo=od((t,e)=>Sn(ld,{...t,forwardedRef:e}));ld.displayName="Panel";zo.displayName="forwardRef(Panel)";let Ho=null,Tt=null;function gm(t,e){if(e){const n=(e&hd)!==0,r=(e&pd)!==0,i=(e&gd)!==0,o=(e&vd)!==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 vm(){Tt!==null&&(document.head.removeChild(Tt),Ho=null,Tt=null)}function Vi(t,e){const n=gm(t,e);Ho!==n&&(Ho=n,Tt===null&&(Tt=document.createElement("style"),document.head.appendChild(Tt)),Tt.innerHTML=`*{cursor: ${n}!important;}`)}function ud(t){return t.type==="keydown"}function cd(t){return t.type.startsWith("pointer")}function dd(t){return t.type.startsWith("mouse")}function yi(t){if(cd(t)){if(t.isPrimary)return{x:t.clientX,y:t.clientY}}else if(dd(t))return{x:t.clientX,y:t.clientY};return{x:1/0,y:1/0}}function mm(){if(typeof matchMedia=="function")return matchMedia("(pointer:coarse)").matches?"coarse":"fine"}function ym(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 bm(t,e){if(t===e)throw new Error("Cannot compare node with itself");const n={a:Vs(t),b:Vs(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:Us(Ws(n.a)),b:Us(Ws(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 Sm=/\b(?:position|zIndex|opacity|transform|webkitTransform|mixBlendMode|filter|webkitFilter|isolation)\b/;function wm(t){var e;const n=getComputedStyle((e=fd(t))!==null&&e!==void 0?e:t).display;return n==="flex"||n==="inline-flex"}function Em(t){const e=getComputedStyle(t);return!!(e.position==="fixed"||e.zIndex!=="auto"&&(e.position!=="static"||wm(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"||Sm.test(e.willChange)||e.webkitOverflowScrolling==="touch")}function Ws(t){let e=t.length;for(;e--;){const n=t[e];if(Z(n,"Missing node"),Em(n))return n}return null}function Us(t){return t&&Number(getComputedStyle(t).zIndex)||0}function Vs(t){const e=[];for(;t;)e.push(t),t=fd(t);return e}function fd(t){const{parentNode:e}=t;return e&&e instanceof ShadowRoot?e.host:e}const hd=1,pd=2,gd=4,vd=8,$m=mm()==="coarse";let He=[],pn=!1,pt=new Map,bi=new Map;const Xn=new Set;function xm(t,e,n,r,i){var o;const{ownerDocument:a}=e,s={direction:n,element:e,hitAreaMargins:r,setResizeHandlerState:i},l=(o=pt.get(a))!==null&&o!==void 0?o:0;return pt.set(a,l+1),Xn.add(s),ti(),function(){var c;bi.delete(t),Xn.delete(s);const h=(c=pt.get(a))!==null&&c!==void 0?c:1;if(pt.set(a,h-1),ti(),h===1&&pt.delete(a),He.includes(s)){const p=He.indexOf(s);p>=0&&He.splice(p,1),Ca(),i("up",!0,null)}}}function Gs(t){const{target:e}=t,{x:n,y:r}=yi(t);pn=!0,xa({target:e,x:n,y:r}),ti(),He.length>0&&(ni("down",t),t.preventDefault(),t.stopPropagation())}function Rn(t){const{x:e,y:n}=yi(t);if(pn&&t.buttons===0&&(pn=!1,ni("up",t)),!pn){const{target:r}=t;xa({target:r,x:e,y:n})}ni("move",t),Ca(),He.length>0&&t.preventDefault()}function Ut(t){const{target:e}=t,{x:n,y:r}=yi(t);bi.clear(),pn=!1,He.length>0&&t.preventDefault(),ni("up",t),xa({target:e,x:n,y:r}),Ca(),ti()}function xa({target:t,x:e,y:n}){He.splice(0);let r=null;(t instanceof HTMLElement||t instanceof SVGElement)&&(r=t),Xn.forEach(i=>{const{element:o,hitAreaMargins:a}=i,s=o.getBoundingClientRect(),{bottom:l,left:u,right:c,top:h}=s,p=$m?a.coarse:a.fine;if(e>=u-p&&e<=c+p&&n>=h-p&&n<=l+p){if(r!==null&&document.contains(r)&&o!==r&&!o.contains(r)&&!r.contains(o)&&bm(r,o)>0){let m=r,f=!1;for(;m&&!m.contains(o);){if(ym(m.getBoundingClientRect(),s)){f=!0;break}m=m.parentElement}if(f)return}He.push(i)}})}function Gi(t,e){bi.set(t,e)}function Ca(){let t=!1,e=!1;He.forEach(r=>{const{direction:i}=r;i==="horizontal"?t=!0:e=!0});let n=0;bi.forEach(r=>{n|=r}),t&&e?Vi("intersection",n):t?Vi("horizontal",n):e?Vi("vertical",n):vm()}function ti(){pt.forEach((t,e)=>{const{body:n}=e;n.removeEventListener("contextmenu",Ut),n.removeEventListener("pointerdown",Gs),n.removeEventListener("pointerleave",Rn),n.removeEventListener("pointermove",Rn)}),window.removeEventListener("pointerup",Ut),window.removeEventListener("pointercancel",Ut),Xn.size>0&&(pn?(He.length>0&&pt.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("contextmenu",Ut),n.addEventListener("pointerleave",Rn),n.addEventListener("pointermove",Rn))}),window.addEventListener("pointerup",Ut),window.addEventListener("pointercancel",Ut)):pt.forEach((t,e)=>{const{body:n}=e;t>0&&(n.addEventListener("pointerdown",Gs,{capture:!0}),n.addEventListener("pointermove",Rn))}))}function ni(t,e){Xn.forEach(n=>{const{setResizeHandlerState:r}=n,i=He.includes(n);r(t,i,e)})}function Cm(){const[t,e]=hn(0);return xe(()=>e(n=>n+1),[])}function Z(t,e){if(!t)throw console.error(e),Error(e)}const Ta=10;function Nt(t,e,n=Ta){return t.toFixed(n)===e.toFixed(n)?0:t>e?1:-1}function nt(t,e,n=Ta){return Nt(t,e,n)===0}function Te(t,e,n){return Nt(t,e,n)===0}function Tm(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(!Te(i,o,n))return!1}return!0}function cn({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(Nt(n,s)<0)if(o){const l=(i+s)/2;Nt(n,l)<0?n=i:n=s}else n=s;return n=Math.min(a,n),n=parseFloat(n.toFixed(Ta)),n}function Fn({delta:t,initialLayout:e,panelConstraints:n,pivotIndices:r,prevLayout:i,trigger:o}){if(Te(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 h=t<0?l:s,p=n[h];Z(p,`Panel constraints not found for index ${h}`);const{collapsedSize:g=0,collapsible:m,minSize:f=0}=p;if(m){const v=e[h];if(Z(v!=null,`Previous layout not found for panel index ${h}`),Te(v,g)){const y=f-v;Nt(y,Math.abs(t))>0&&(t=t<0?0-y:y)}}}{const h=t<0?s:l,p=n[h];Z(p,`No panel constraints found for index ${h}`);const{collapsedSize:g=0,collapsible:m,minSize:f=0}=p;if(m){const v=e[h];if(Z(v!=null,`Previous layout not found for panel index ${h}`),Te(v,f)){const y=v-g;Nt(y,Math.abs(t))>0&&(t=t<0?0-y:y)}}}}{const h=t<0?1:-1;let p=t<0?l:s,g=0;for(;;){const f=e[p];Z(f!=null,`Previous layout not found for panel index ${p}`);const y=cn({panelConstraints:n,panelIndex:p,size:100})-f;if(g+=y,p+=h,p<0||p>=n.length)break}const m=Math.min(Math.abs(t),Math.abs(g));t=t<0?0-m:m}{let p=t<0?s:l;for(;p>=0&&p<n.length;){const g=Math.abs(t)-Math.abs(u),m=e[p];Z(m!=null,`Previous layout not found for panel index ${p}`);const f=m-g,v=cn({panelConstraints:n,panelIndex:p,size:f});if(!Te(m,v)&&(u+=m-v,a[p]=v,u.toPrecision(3).localeCompare(Math.abs(t).toPrecision(3),void 0,{numeric:!0})>=0))break;t<0?p--:p++}}if(Tm(i,a))return i;{const h=t<0?l:s,p=e[h];Z(p!=null,`Previous layout not found for panel index ${h}`);const g=p+u,m=cn({panelConstraints:n,panelIndex:h,size:g});if(a[h]=m,!Te(m,g)){let f=g-m,y=t<0?l:s;for(;y>=0&&y<n.length;){const S=a[y];Z(S!=null,`Previous layout not found for panel index ${y}`);const w=S+f,T=cn({panelConstraints:n,panelIndex:y,size:w});if(Te(S,T)||(f-=T-S,a[y]=T),Te(f,0))break;t>0?y--:y++}}}const c=a.reduce((h,p)=>p+h,0);return Te(c,100)?a:i}function Dm({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((h,p)=>{const{constraints:g}=h,{maxSize:m=100,minSize:f=0}=g;p===s?(r=f,i=m):(o+=f,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 Jn(t,e=document){return Array.from(e.querySelectorAll(`[data-panel-resize-handle-id][data-panel-group-id="${t}"]`))}function md(t,e,n=document){const i=Jn(t,n).findIndex(o=>o.getAttribute("data-panel-resize-handle-id")===e);return i??null}function yd(t,e,n){const r=md(t,e,n);return r!=null?[r,r+1]:[-1,-1]}function bd(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 Si(t,e=document){const n=e.querySelector(`[data-panel-resize-handle-id="${t}"]`);return n||null}function Pm(t,e,n,r=document){var i,o,a,s;const l=Si(e,r),u=Jn(t,r),c=l?u.indexOf(l):-1,h=(i=(o=n[c])===null||o===void 0?void 0:o.id)!==null&&i!==void 0?i:null,p=(a=(s=n[c+1])===null||s===void 0?void 0:s.id)!==null&&a!==void 0?a:null;return[h,p]}function Om({committedValuesRef:t,eagerValuesRef:e,groupId:n,layout:r,panelDataArray:i,panelGroupElement:o,setLayout:a}){Ce({didWarnAboutMissingResizeHandle:!1}),Pt(()=>{if(!o)return;const s=Jn(n,o);for(let l=0;l<i.length-1;l++){const{valueMax:u,valueMin:c,valueNow:h}=Dm({layout:r,panelsArray:i,pivotIndices:[l,l+1]}),p=s[l];if(p!=null){const g=i[l];Z(g,`No panel data found for index "${l}"`),p.setAttribute("aria-controls",g.id),p.setAttribute("aria-valuemax",""+Math.round(u)),p.setAttribute("aria-valuemin",""+Math.round(c)),p.setAttribute("aria-valuenow",h!=null?""+Math.round(h):"")}}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]),Dt(()=>{if(!o)return;const s=e.current;Z(s,"Eager values not found");const{panelDataArray:l}=s,u=bd(n,o);Z(u!=null,`No group found for id "${n}"`);const c=Jn(n,o);Z(c,`No resize handles found for group id "${n}"`);const h=c.map(p=>{const g=p.getAttribute("data-panel-resize-handle-id");Z(g,"Resize handle element has no handle id attribute");const[m,f]=Pm(n,g,l,o);if(m==null||f==null)return()=>{};const v=y=>{if(!y.defaultPrevented)switch(y.key){case"Enter":{y.preventDefault();const S=l.findIndex(w=>w.id===m);if(S>=0){const w=l[S];Z(w,`No panel data found for index ${S}`);const T=r[S],{collapsedSize:x=0,collapsible:I,minSize:P=0}=w.constraints;if(T!=null&&I){const b=Fn({delta:Te(T,x)?P-x:x-T,initialLayout:r,panelConstraints:l.map(R=>R.constraints),pivotIndices:yd(n,g,o),prevLayout:r,trigger:"keyboard"});r!==b&&a(b)}}break}}};return p.addEventListener("keydown",v),()=>{p.removeEventListener("keydown",v)}});return()=>{h.forEach(p=>p())}},[o,t,e,n,r,i,a])}function qs(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 Sd(t,e){const n=t==="horizontal",{x:r,y:i}=yi(e);return n?r:i}function Im(t,e,n,r,i){const o=n==="horizontal",a=Si(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=Sd(n,t),c=bd(s,i);Z(c,`No group element found for id "${s}"`);const h=c.getBoundingClientRect(),p=o?h.width:h.height;return(u-l)/p*100}function _m(t,e,n,r,i,o){if(ud(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:Im(t,e,n,r,o)}function km({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 Vt(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,h=n[l];if(h==null||r!==h){n[l]=r;const{onCollapse:p,onExpand:g,onResize:m}=a;m&&m(r,h),c&&(p||g)&&(g&&(h==null||nt(h,u))&&!nt(r,u)&&g(),p&&(h==null||!nt(h,u))&&nt(r,u)&&p())}})}function wr(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 Rm({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 Nm(t,e=10){let n=null;return(...i)=>{n!==null&&clearTimeout(n),n=setTimeout(()=>{t(...i)},e)}}function Ys(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 wd(t){return`react-resizable-panels:${t}`}function Ed(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 $d(t,e){try{const n=wd(t),r=e.getItem(n);if(r){const i=JSON.parse(r);if(typeof i=="object"&&i!=null)return i}}catch{}return null}function Mm(t,e,n){var r,i;const o=(r=$d(t,n))!==null&&r!==void 0?r:{},a=Ed(e);return(i=o[a])!==null&&i!==void 0?i:null}function Am(t,e,n,r,i){var o;const a=wd(t),s=Ed(e),l=(o=$d(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 Xs({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(!Te(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=cn({panelConstraints:e,panelIndex:o,size:a});a!=s&&(i+=a-s,n[o]=s)}if(!Te(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=cn({panelConstraints:e,panelIndex:o,size:s});if(a!==l&&(i-=l-a,n[o]=l,Te(i,0)))break}return n}const Km=100,jn={getItem:t=>(Ys(jn),jn.getItem(t)),setItem:(t,e)=>{Ys(jn),jn.setItem(t,e)}},Js={};function xd({autoSaveId:t=null,children:e,className:n="",direction:r,forwardedRef:i,id:o=null,onLayout:a=null,keyboardResizeBy:s=null,storage:l=jn,style:u,tagName:c="div",...h}){const p=$a(o),g=Ce(null),[m,f]=hn(null),[v,y]=hn([]),S=Cm(),w=Ce({}),T=Ce(new Map),x=Ce(0),I=Ce({autoSaveId:t,direction:r,dragState:m,id:p,keyboardResizeBy:s,onLayout:a,storage:l}),P=Ce({layout:v,panelDataArray:[],panelDataArrayChanged:!1});Ce({didLogIdAndOrderWarning:!1,didLogPanelConstraintsWarning:!1,prevPanelIds:[]}),sd(i,()=>({getId:()=>I.current.id,getLayout:()=>{const{layout:k}=P.current;return k},setLayout:k=>{const{onLayout:N}=I.current,{layout:A,panelDataArray:F}=P.current,B=Xs({layout:k,panelConstraints:F.map(L=>L.constraints)});qs(A,B)||(y(B),P.current.layout=B,N&&N(B),Vt(F,B,w.current))}}),[]),Pt(()=>{I.current.autoSaveId=t,I.current.direction=r,I.current.dragState=m,I.current.id=p,I.current.onLayout=a,I.current.storage=l}),Om({committedValuesRef:I,eagerValuesRef:P,groupId:p,layout:v,panelDataArray:P.current.panelDataArray,setLayout:y,panelGroupElement:g.current}),Dt(()=>{const{panelDataArray:k}=P.current;if(t){if(v.length===0||v.length!==k.length)return;let N=Js[t];N==null&&(N=Nm(Am,Km),Js[t]=N);const A=[...k],F=new Map(T.current);N(t,A,F,v,l)}},[t,v,l]),Dt(()=>{});const b=xe(k=>{const{onLayout:N}=I.current,{layout:A,panelDataArray:F}=P.current;if(k.constraints.collapsible){const B=F.map(de=>de.constraints),{collapsedSize:L=0,panelSize:X,pivotIndices:ee}=St(F,k,A);if(Z(X!=null,`Panel size not found for panel "${k.id}"`),!nt(X,L)){T.current.set(k.id,X);const ce=an(F,k)===F.length-1?X-L:L-X,oe=Fn({delta:ce,initialLayout:A,panelConstraints:B,pivotIndices:ee,prevLayout:A,trigger:"imperative-api"});wr(A,oe)||(y(oe),P.current.layout=oe,N&&N(oe),Vt(F,oe,w.current))}}},[]),R=xe((k,N)=>{const{onLayout:A}=I.current,{layout:F,panelDataArray:B}=P.current;if(k.constraints.collapsible){const L=B.map(ge=>ge.constraints),{collapsedSize:X=0,panelSize:ee=0,minSize:de=0,pivotIndices:ce}=St(B,k,F),oe=N??de;if(nt(ee,X)){const ge=T.current.get(k.id),ne=ge!=null&&ge>=oe?ge:oe,st=an(B,k)===B.length-1?ee-ne:ne-ee,ve=Fn({delta:st,initialLayout:F,panelConstraints:L,pivotIndices:ce,prevLayout:F,trigger:"imperative-api"});wr(F,ve)||(y(ve),P.current.layout=ve,A&&A(ve),Vt(B,ve,w.current))}}},[]),W=xe(k=>{const{layout:N,panelDataArray:A}=P.current,{panelSize:F}=St(A,k,N);return Z(F!=null,`Panel size not found for panel "${k.id}"`),F},[]),M=xe((k,N)=>{const{panelDataArray:A}=P.current,F=an(A,k);return Rm({defaultSize:N,dragState:m,layout:v,panelData:A,panelIndex:F})},[m,v]),H=xe(k=>{const{layout:N,panelDataArray:A}=P.current,{collapsedSize:F=0,collapsible:B,panelSize:L}=St(A,k,N);return Z(L!=null,`Panel size not found for panel "${k.id}"`),B===!0&&nt(L,F)},[]),E=xe(k=>{const{layout:N,panelDataArray:A}=P.current,{collapsedSize:F=0,collapsible:B,panelSize:L}=St(A,k,N);return Z(L!=null,`Panel size not found for panel "${k.id}"`),!B||Nt(L,F)>0},[]),_=xe(k=>{const{panelDataArray:N}=P.current;N.push(k),N.sort((A,F)=>{const B=A.order,L=F.order;return B==null&&L==null?0:B==null?-1:L==null?1:B-L}),P.current.panelDataArrayChanged=!0,S()},[S]);Pt(()=>{if(P.current.panelDataArrayChanged){P.current.panelDataArrayChanged=!1;const{autoSaveId:k,onLayout:N,storage:A}=I.current,{layout:F,panelDataArray:B}=P.current;let L=null;if(k){const ee=Mm(k,B,A);ee&&(T.current=new Map(Object.entries(ee.expandToSizes)),L=ee.layout)}L==null&&(L=km({panelDataArray:B}));const X=Xs({layout:L,panelConstraints:B.map(ee=>ee.constraints)});qs(F,X)||(y(X),P.current.layout=X,N&&N(X),Vt(B,X,w.current))}}),Pt(()=>{const k=P.current;return()=>{k.layout=[]}},[]);const z=xe(k=>{let N=!1;const A=g.current;return A&&window.getComputedStyle(A,null).getPropertyValue("direction")==="rtl"&&(N=!0),function(B){B.preventDefault();const L=g.current;if(!L)return()=>null;const{direction:X,dragState:ee,id:de,keyboardResizeBy:ce,onLayout:oe}=I.current,{layout:ge,panelDataArray:ne}=P.current,{initialLayout:Ue}=ee??{},st=yd(de,k,L);let ve=_m(B,k,X,ee,ce,L);const Dn=X==="horizontal";Dn&&N&&(ve=-ve);const lr=ne.map(G=>G.constraints),$=Fn({delta:ve,initialLayout:Ue??ge,panelConstraints:lr,pivotIndices:st,prevLayout:ge,trigger:ud(B)?"keyboard":"mouse-or-touch"}),V=!wr(ge,$);(cd(B)||dd(B))&&x.current!=ve&&(x.current=ve,!V&&ve!==0?Dn?Gi(k,ve<0?hd:pd):Gi(k,ve<0?gd:vd):Gi(k,0)),V&&(y($),P.current.layout=$,oe&&oe($),Vt(ne,$,w.current))}},[]),U=xe((k,N)=>{const{onLayout:A}=I.current,{layout:F,panelDataArray:B}=P.current,L=B.map(ge=>ge.constraints),{panelSize:X,pivotIndices:ee}=St(B,k,F);Z(X!=null,`Panel size not found for panel "${k.id}"`);const ce=an(B,k)===B.length-1?X-N:N-X,oe=Fn({delta:ce,initialLayout:F,panelConstraints:L,pivotIndices:ee,prevLayout:F,trigger:"imperative-api"});wr(F,oe)||(y(oe),P.current.layout=oe,A&&A(oe),Vt(B,oe,w.current))},[]),Y=xe((k,N)=>{const{layout:A,panelDataArray:F}=P.current,{collapsedSize:B=0,collapsible:L}=N,{collapsedSize:X=0,collapsible:ee,maxSize:de=100,minSize:ce=0}=k.constraints,{panelSize:oe}=St(F,k,A);oe!=null&&(L&&ee&&nt(oe,B)?nt(B,X)||U(k,X):oe<ce?U(k,ce):oe>de&&U(k,de))},[U]),K=xe((k,N)=>{const{direction:A}=I.current,{layout:F}=P.current;if(!g.current)return;const B=Si(k,g.current);Z(B,`Drag handle element not found for id "${k}"`);const L=Sd(A,N);f({dragHandleId:k,dragHandleRect:B.getBoundingClientRect(),initialCursorPosition:L,initialLayout:F})},[]),q=xe(()=>{f(null)},[]),re=xe(k=>{const{panelDataArray:N}=P.current,A=an(N,k);A>=0&&(N.splice(A,1),delete w.current[k.id],P.current.panelDataArrayChanged=!0,S())},[S]),j=dm(()=>({collapsePanel:b,direction:r,dragState:m,expandPanel:R,getPanelSize:W,getPanelStyle:M,groupId:p,isPanelCollapsed:H,isPanelExpanded:E,reevaluatePanelConstraints:Y,registerPanel:_,registerResizeHandle:z,resizePanel:U,startDragging:K,stopDragging:q,unregisterPanel:re,panelGroupElement:g.current}),[b,m,r,R,W,M,p,H,E,Y,_,z,U,K,q,re]),O={display:"flex",flexDirection:r==="horizontal"?"row":"column",height:"100%",overflow:"hidden",width:"100%"};return Sn(mi.Provider,{value:j},Sn(c,{...h,children:e,className:n,id:o,ref:g,style:{...O,...u},"data-panel-group":"","data-panel-group-direction":r,"data-panel-group-id":p}))}const Cd=od((t,e)=>Sn(xd,{...t,forwardedRef:e}));xd.displayName="PanelGroup";Cd.displayName="forwardRef(PanelGroup)";function an(t,e){return t.findIndex(n=>n===e||n.id===e.id)}function St(t,e,n){const r=an(t,e),o=r===t.length-1?[r-1,r]:[r,r+1],a=n[r];return{...e.constraints,panelSize:a,pivotIndices:o}}function Lm({disabled:t,handleId:e,resizeHandler:n,panelGroupElement:r}){Dt(()=>{if(t||n==null||r==null)return;const i=Si(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=Jn(s,r),u=md(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 Td({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",...h}){var p,g;const m=Ce(null),f=Ce({onDragging:a});Dt(()=>{f.current.onDragging=a});const v=ad(mi);if(v===null)throw Error("PanelResizeHandle components must be rendered within a PanelGroup container");const{direction:y,groupId:S,registerResizeHandle:w,startDragging:T,stopDragging:x,panelGroupElement:I}=v,P=$a(i),[b,R]=hn("inactive"),[W,M]=hn(!1),[H,E]=hn(null),_=Ce({state:b});Pt(()=>{_.current.state=b}),Dt(()=>{if(n)E(null);else{const K=w(P);E(()=>K)}},[n,P,w]);const z=(p=r==null?void 0:r.coarse)!==null&&p!==void 0?p:15,U=(g=r==null?void 0:r.fine)!==null&&g!==void 0?g:5;return Dt(()=>{if(n||H==null)return;const K=m.current;return Z(K,"Element ref not attached"),xm(P,K,y,{coarse:z,fine:U},(re,j,O)=>{if(j)switch(re){case"down":{R("drag"),Z(O,'Expected event to be defined for "down" action'),T(P,O);const{onDragging:k}=f.current;k&&k(!0);break}case"move":{const{state:k}=_.current;k!=="drag"&&R("hover"),Z(O,'Expected event to be defined for "move" action'),H(O);break}case"up":{R("hover"),x();const{onDragging:k}=f.current;k&&k(!1);break}}else R("inactive")})},[z,y,n,U,w,P,H,T,x]),Lm({disabled:n,handleId:P,resizeHandler:H,panelGroupElement:I}),Sn(c,{...h,children:t,className:e,id:i,onBlur:()=>{M(!1),o==null||o()},onFocus:()=>{M(!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":S,"data-resize-handle":"","data-resize-handle-active":b==="drag"?"pointer":W?"keyboard":void 0,"data-resize-handle-state":b,"data-panel-resize-handle-enabled":!n,"data-panel-resize-handle-id":P})}Td.displayName="PanelResizeHandle";const Fm=({children:t,isOpen:e})=>{const{isDesktop:n}=ar();return n?D.jsx("div",{className:ot("c__right-panel",{open:e}),children:t}):D.jsx("div",{className:ot("c__right-panel__mobile",{open:e}),children:t})},jm=({icon:t,children:e,leftPanelContent:n,rightPanelContent:r,rightHeaderContent:i,languages:o,enableResize:a=!1,rightPanelIsOpen:s=!1})=>{const[l,u]=d.useState(!1),{isDesktop:c}=ar(),h=d.useRef(null),[p,g]=d.useState(Er(300,c)),[m,f]=d.useState(Er(450,c)),v=()=>{u(!l)};return d.useEffect(()=>{const y=()=>{const S=Math.round(Er(300,c)),w=Math.round(Math.min(Er(450,c),40));g(c?S:0),f(a?w:S)};return y(),window.addEventListener("resize",()=>{y()}),()=>{window.removeEventListener("resize",y)}},[c,a]),D.jsxs("div",{className:"c__main-layout",children:[D.jsx("div",{className:"c__main-layout__header",children:D.jsx(rd,{onTogglePanel:v,isPanelOpen:l,rightIcon:i,leftIcon:t,languages:o})}),D.jsx("div",{className:"c__main-layout__content",children:D.jsxs(Cd,{autoSaveId:"persistance",direction:"horizontal",children:[D.jsx(zo,{ref:h,order:0,defaultSize:p,minSize:p,maxSize:m,children:D.jsx(id,{isOpen:c?!0:l,children:n})}),c&&D.jsx(Td,{className:"bg-greyscale-200",style:{width:"1px"}}),D.jsx(zo,{order:1,children:D.jsxs("div",{className:"c__main-layout__content__center",children:[D.jsx("div",{className:"c__main-layout__content__center__children",children:e}),D.jsx(Fm,{isOpen:s,children:r})]})})]})})]})},Er=(t,e)=>{if(!e)return 0;const n=window.innerWidth;return t/n*100},zm=52,Da=({size:t="sm"})=>D.jsx("div",{className:["c__spinner",t].join(" ")}),Dd=({children:t,text:e,...n})=>D.jsxs("div",{className:"suite__label__container",children:[D.jsx("label",{...n,children:t}),e&&D.jsx("span",{className:"suite__label__container__description",children:e})]}),Hm=({label:t,text:e,labelSide:n="right",children:r})=>D.jsxs("div",{className:ot("c__with-label",{[n]:!0}),children:[D.jsx(Dd,{children:t,text:e}),r]});var Qs=1,Bm=.9,Wm=.8,Um=.17,qi=.1,Yi=.999,Vm=.9999,Gm=.99,qm=/[\\\/_+.#"@\[\(\{&]/,Ym=/[\\\/_+.#"@\[\(\{&]/g,Xm=/[\s-]/,Pd=/[\s-]/g;function Bo(t,e,n,r,i,o,a){if(o===e.length)return i===t.length?Qs:Gm;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,h,p,g,m;u>=0;)h=Bo(t,e,n,r,u+1,o+1,a),h>c&&(u===i?h*=Qs:qm.test(t.charAt(u-1))?(h*=Wm,g=t.slice(i,u-1).match(Ym),g&&i>0&&(h*=Math.pow(Yi,g.length))):Xm.test(t.charAt(u-1))?(h*=Bm,m=t.slice(i,u-1).match(Pd),m&&i>0&&(h*=Math.pow(Yi,m.length))):(h*=Um,i>0&&(h*=Math.pow(Yi,u-i))),t.charAt(u)!==e.charAt(o)&&(h*=Vm)),(h<qi&&n.charAt(u-1)===r.charAt(o+1)||r.charAt(o+1)===r.charAt(o)&&n.charAt(u-1)!==r.charAt(o))&&(p=Bo(t,e,n,r,u+1,o+2,a),p*qi>h&&(h=p*qi)),h>c&&(c=h),u=n.indexOf(l,u+1);return a[s]=c,c}function Zs(t){return t.toLowerCase().replace(Pd," ")}function Jm(t,e,n){return t=n&&n.length>0?`${t+" "+n.join(" ")}`:t,Bo(t,e,Zs(t),Zs(e),0,0,{})}function mt(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 el(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function Od(...t){return e=>{let n=!1;const r=t.map(i=>{const o=el(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():el(t[i],null)}}}}function zt(...t){return C.useCallback(Od(...t),t)}function Qm(t,e){const n=C.createContext(e),r=o=>{const{children:a,...s}=o,l=C.useMemo(()=>s,Object.values(s));return D.jsx(n.Provider,{value:l,children:a})};r.displayName=t+"Provider";function i(o){const a=C.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 Zm(t,e=[]){let n=[];function r(o,a){const s=C.createContext(a),l=n.length;n=[...n,a];const u=h=>{var y;const{scope:p,children:g,...m}=h,f=((y=p==null?void 0:p[t])==null?void 0:y[l])||s,v=C.useMemo(()=>m,Object.values(m));return D.jsx(f.Provider,{value:v,children:g})};u.displayName=o+"Provider";function c(h,p){var f;const g=((f=p==null?void 0:p[t])==null?void 0:f[l])||s,m=C.useContext(g);if(m)return m;if(a!==void 0)return a;throw new Error(`\`${h}\` must be used within \`${o}\``)}return[u,c]}const i=()=>{const o=n.map(a=>C.createContext(a));return function(s){const l=(s==null?void 0:s[t])||o;return C.useMemo(()=>({[`__scope${t}`]:{...s,[t]:l}}),[s,l])}};return i.scopeName=t,[r,ey(i,...e)]}function ey(...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 h=l(o)[`__scope${u}`];return{...s,...h}},{});return C.useMemo(()=>({[`__scope${e.scopeName}`]:a}),[a])}};return n.scopeName=e.scopeName,n}var ri=globalThis!=null&&globalThis.document?C.useLayoutEffect:()=>{},ty=C.useId||(()=>{}),ny=0;function it(t){const[e,n]=C.useState(ty());return ri(()=>{n(r=>r??String(ny++))},[t]),e?`radix-${e}`:""}function Mt(t){const e=C.useRef(t);return C.useEffect(()=>{e.current=t}),C.useMemo(()=>(...n)=>{var r;return(r=e.current)==null?void 0:r.call(e,...n)},[])}function ry({prop:t,defaultProp:e,onChange:n=()=>{}}){const[r,i]=iy({defaultProp:e,onChange:n}),o=t!==void 0,a=o?t:r,s=Mt(n),l=C.useCallback(u=>{if(o){const h=typeof u=="function"?u(t):u;h!==t&&s(h)}else i(u)},[o,t,i,s]);return[a,l]}function iy({defaultProp:t,onChange:e}){const n=C.useState(t),[r]=n,i=C.useRef(r),o=Mt(e);return C.useEffect(()=>{i.current!==r&&(o(r),i.current=r)},[r,i,o]),n}var Pa=C.forwardRef((t,e)=>{const{children:n,...r}=t,i=C.Children.toArray(n),o=i.find(ay);if(o){const a=o.props.children,s=i.map(l=>l===o?C.Children.count(a)>1?C.Children.only(null):C.isValidElement(a)?a.props.children:null:l);return D.jsx(Wo,{...r,ref:e,children:C.isValidElement(a)?C.cloneElement(a,void 0,s):null})}return D.jsx(Wo,{...r,ref:e,children:n})});Pa.displayName="Slot";var Wo=C.forwardRef((t,e)=>{const{children:n,...r}=t;if(C.isValidElement(n)){const i=ly(n),o=sy(r,n.props);return n.type!==C.Fragment&&(o.ref=e?Od(e,i):i),C.cloneElement(n,o)}return C.Children.count(n)>1?C.Children.only(null):null});Wo.displayName="SlotClone";var oy=({children:t})=>D.jsx(D.Fragment,{children:t});function ay(t){return C.isValidElement(t)&&t.type===oy}function sy(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 ly(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 uy=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"],be=uy.reduce((t,e)=>{const n=C.forwardRef((r,i)=>{const{asChild:o,...a}=r,s=o?Pa:e;return typeof window<"u"&&(window[Symbol.for("radix-ui")]=!0),D.jsx(s,{...a,ref:i})});return n.displayName=`Primitive.${e}`,{...t,[e]:n}},{});function cy(t,e){t&&ah.flushSync(()=>t.dispatchEvent(e))}function dy(t,e=globalThis==null?void 0:globalThis.document){const n=Mt(t);C.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 fy="DismissableLayer",Uo="dismissableLayer.update",hy="dismissableLayer.pointerDownOutside",py="dismissableLayer.focusOutside",tl,Id=C.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),_d=C.forwardRef((t,e)=>{const{disableOutsidePointerEvents:n=!1,onEscapeKeyDown:r,onPointerDownOutside:i,onFocusOutside:o,onInteractOutside:a,onDismiss:s,...l}=t,u=C.useContext(Id),[c,h]=C.useState(null),p=(c==null?void 0:c.ownerDocument)??(globalThis==null?void 0:globalThis.document),[,g]=C.useState({}),m=zt(e,P=>h(P)),f=Array.from(u.layers),[v]=[...u.layersWithOutsidePointerEventsDisabled].slice(-1),y=f.indexOf(v),S=c?f.indexOf(c):-1,w=u.layersWithOutsidePointerEventsDisabled.size>0,T=S>=y,x=my(P=>{const b=P.target,R=[...u.branches].some(W=>W.contains(b));!T||R||(i==null||i(P),a==null||a(P),P.defaultPrevented||s==null||s())},p),I=yy(P=>{const b=P.target;[...u.branches].some(W=>W.contains(b))||(o==null||o(P),a==null||a(P),P.defaultPrevented||s==null||s())},p);return dy(P=>{S===u.layers.size-1&&(r==null||r(P),!P.defaultPrevented&&s&&(P.preventDefault(),s()))},p),C.useEffect(()=>{if(c)return n&&(u.layersWithOutsidePointerEventsDisabled.size===0&&(tl=p.body.style.pointerEvents,p.body.style.pointerEvents="none"),u.layersWithOutsidePointerEventsDisabled.add(c)),u.layers.add(c),nl(),()=>{n&&u.layersWithOutsidePointerEventsDisabled.size===1&&(p.body.style.pointerEvents=tl)}},[c,p,n,u]),C.useEffect(()=>()=>{c&&(u.layers.delete(c),u.layersWithOutsidePointerEventsDisabled.delete(c),nl())},[c,u]),C.useEffect(()=>{const P=()=>g({});return document.addEventListener(Uo,P),()=>document.removeEventListener(Uo,P)},[]),D.jsx(be.div,{...l,ref:m,style:{pointerEvents:w?T?"auto":"none":void 0,...t.style},onFocusCapture:mt(t.onFocusCapture,I.onFocusCapture),onBlurCapture:mt(t.onBlurCapture,I.onBlurCapture),onPointerDownCapture:mt(t.onPointerDownCapture,x.onPointerDownCapture)})});_d.displayName=fy;var gy="DismissableLayerBranch",vy=C.forwardRef((t,e)=>{const n=C.useContext(Id),r=C.useRef(null),i=zt(e,r);return C.useEffect(()=>{const o=r.current;if(o)return n.branches.add(o),()=>{n.branches.delete(o)}},[n.branches]),D.jsx(be.div,{...t,ref:i})});vy.displayName=gy;function my(t,e=globalThis==null?void 0:globalThis.document){const n=Mt(t),r=C.useRef(!1),i=C.useRef(()=>{});return C.useEffect(()=>{const o=s=>{if(s.target&&!r.current){let l=function(){kd(hy,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 yy(t,e=globalThis==null?void 0:globalThis.document){const n=Mt(t),r=C.useRef(!1);return C.useEffect(()=>{const i=o=>{o.target&&!r.current&&kd(py,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 nl(){const t=new CustomEvent(Uo);document.dispatchEvent(t)}function kd(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?cy(i,o):i.dispatchEvent(o)}var Xi="focusScope.autoFocusOnMount",Ji="focusScope.autoFocusOnUnmount",rl={bubbles:!1,cancelable:!0},by="FocusScope",Rd=C.forwardRef((t,e)=>{const{loop:n=!1,trapped:r=!1,onMountAutoFocus:i,onUnmountAutoFocus:o,...a}=t,[s,l]=C.useState(null),u=Mt(i),c=Mt(o),h=C.useRef(null),p=zt(e,f=>l(f)),g=C.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;C.useEffect(()=>{if(r){let f=function(w){if(g.paused||!s)return;const T=w.target;s.contains(T)?h.current=T:ct(h.current,{select:!0})},v=function(w){if(g.paused||!s)return;const T=w.relatedTarget;T!==null&&(s.contains(T)||ct(h.current,{select:!0}))},y=function(w){if(document.activeElement===document.body)for(const x of w)x.removedNodes.length>0&&ct(s)};document.addEventListener("focusin",f),document.addEventListener("focusout",v);const S=new MutationObserver(y);return s&&S.observe(s,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",f),document.removeEventListener("focusout",v),S.disconnect()}}},[r,s,g.paused]),C.useEffect(()=>{if(s){ol.add(g);const f=document.activeElement;if(!s.contains(f)){const y=new CustomEvent(Xi,rl);s.addEventListener(Xi,u),s.dispatchEvent(y),y.defaultPrevented||(Sy(Cy(Nd(s)),{select:!0}),document.activeElement===f&&ct(s))}return()=>{s.removeEventListener(Xi,u),setTimeout(()=>{const y=new CustomEvent(Ji,rl);s.addEventListener(Ji,c),s.dispatchEvent(y),y.defaultPrevented||ct(f??document.body,{select:!0}),s.removeEventListener(Ji,c),ol.remove(g)},0)}}},[s,u,c,g]);const m=C.useCallback(f=>{if(!n&&!r||g.paused)return;const v=f.key==="Tab"&&!f.altKey&&!f.ctrlKey&&!f.metaKey,y=document.activeElement;if(v&&y){const S=f.currentTarget,[w,T]=wy(S);w&&T?!f.shiftKey&&y===T?(f.preventDefault(),n&&ct(w,{select:!0})):f.shiftKey&&y===w&&(f.preventDefault(),n&&ct(T,{select:!0})):y===S&&f.preventDefault()}},[n,r,g.paused]);return D.jsx(be.div,{tabIndex:-1,...a,ref:p,onKeyDown:m})});Rd.displayName=by;function Sy(t,{select:e=!1}={}){const n=document.activeElement;for(const r of t)if(ct(r,{select:e}),document.activeElement!==n)return}function wy(t){const e=Nd(t),n=il(e,t),r=il(e.reverse(),t);return[n,r]}function Nd(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 il(t,e){for(const n of t)if(!Ey(n,{upTo:e}))return n}function Ey(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 $y(t){return t instanceof HTMLInputElement&&"select"in t}function ct(t,{select:e=!1}={}){if(t&&t.focus){const n=document.activeElement;t.focus({preventScroll:!0}),t!==n&&$y(t)&&e&&t.select()}}var ol=xy();function xy(){let t=[];return{add(e){const n=t[0];e!==n&&(n==null||n.pause()),t=al(t,e),t.unshift(e)},remove(e){var n;t=al(t,e),(n=t[0])==null||n.resume()}}}function al(t,e){const n=[...t],r=n.indexOf(e);return r!==-1&&n.splice(r,1),n}function Cy(t){return t.filter(e=>e.tagName!=="A")}var Ty="Portal",Md=C.forwardRef((t,e)=>{var s;const{container:n,...r}=t,[i,o]=C.useState(!1);ri(()=>o(!0),[]);const a=n||i&&((s=globalThis==null?void 0:globalThis.document)==null?void 0:s.body);return a?jt.createPortal(D.jsx(be.div,{...r,ref:e}),a):null});Md.displayName=Ty;function Dy(t,e){return C.useReducer((n,r)=>e[n][r]??n,t)}var wi=t=>{const{present:e,children:n}=t,r=Py(e),i=typeof n=="function"?n({present:r.isPresent}):C.Children.only(n),o=zt(r.ref,Oy(i));return typeof n=="function"||r.isPresent?C.cloneElement(i,{ref:o}):null};wi.displayName="Presence";function Py(t){const[e,n]=C.useState(),r=C.useRef({}),i=C.useRef(t),o=C.useRef("none"),a=t?"mounted":"unmounted",[s,l]=Dy(a,{mounted:{UNMOUNT:"unmounted",ANIMATION_OUT:"unmountSuspended"},unmountSuspended:{MOUNT:"mounted",ANIMATION_END:"unmounted"},unmounted:{MOUNT:"mounted"}});return C.useEffect(()=>{const u=$r(r.current);o.current=s==="mounted"?u:"none"},[s]),ri(()=>{const u=r.current,c=i.current;if(c!==t){const p=o.current,g=$r(u);t?l("MOUNT"):g==="none"||(u==null?void 0:u.display)==="none"?l("UNMOUNT"):l(c&&p!==g?"ANIMATION_OUT":"UNMOUNT"),i.current=t}},[t,l]),ri(()=>{if(e){let u;const c=e.ownerDocument.defaultView??window,h=g=>{const f=$r(r.current).includes(g.animationName);if(g.target===e&&f&&(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)})}},p=g=>{g.target===e&&(o.current=$r(r.current))};return e.addEventListener("animationstart",p),e.addEventListener("animationcancel",h),e.addEventListener("animationend",h),()=>{c.clearTimeout(u),e.removeEventListener("animationstart",p),e.removeEventListener("animationcancel",h),e.removeEventListener("animationend",h)}}else l("ANIMATION_END")},[e,l]),{isPresent:["mounted","unmountSuspended"].includes(s),ref:C.useCallback(u=>{u&&(r.current=getComputedStyle(u)),n(u)},[])}}function $r(t){return(t==null?void 0:t.animationName)||"none"}function Oy(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 Qi=0;function Iy(){C.useEffect(()=>{const t=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",t[0]??sl()),document.body.insertAdjacentElement("beforeend",t[1]??sl()),Qi++,()=>{Qi===1&&document.querySelectorAll("[data-radix-focus-guard]").forEach(e=>e.remove()),Qi--}},[])}function sl(){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 Rr="right-scroll-bar-position",Nr="width-before-scroll-bar",_y="with-scroll-bars-hidden",ky="--removed-body-scroll-bar-size";function Zi(t,e){return typeof t=="function"?t(e):t&&(t.current=e),t}function Ry(t,e){var n=d.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 Ny=typeof window<"u"?C.useLayoutEffect:C.useEffect,ll=new WeakMap;function My(t,e){var n=Ry(null,function(r){return t.forEach(function(i){return Zi(i,r)})});return Ny(function(){var r=ll.get(n);if(r){var i=new Set(r),o=new Set(t),a=n.current;i.forEach(function(s){o.has(s)||Zi(s,null)}),o.forEach(function(s){i.has(s)||Zi(s,a)})}ll.set(n,t)},[t]),n}function Ay(t){return t}function Ky(t,e){e===void 0&&(e=Ay);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 Ly(t){t===void 0&&(t={});var e=Ky(null);return e.options=Ge({async:!0,ssr:!1},t),e}var Ad=function(t){var e=t.sideCar,n=oc(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 C.createElement(r,Ge({},n))};Ad.isSideCarExport=!0;function Fy(t,e){return t.useMedium(e),Ad}var Kd=Ly(),eo=function(){},Ei=C.forwardRef(function(t,e){var n=C.useRef(null),r=C.useState({onScrollCapture:eo,onWheelCapture:eo,onTouchMoveCapture:eo}),i=r[0],o=r[1],a=t.forwardProps,s=t.children,l=t.className,u=t.removeScrollBar,c=t.enabled,h=t.shards,p=t.sideCar,g=t.noIsolation,m=t.inert,f=t.allowPinchZoom,v=t.as,y=v===void 0?"div":v,S=t.gapMode,w=oc(t,["forwardProps","children","className","removeScrollBar","enabled","shards","sideCar","noIsolation","inert","allowPinchZoom","as","gapMode"]),T=p,x=My([n,e]),I=Ge(Ge({},w),i);return C.createElement(C.Fragment,null,c&&C.createElement(T,{sideCar:Kd,removeScrollBar:u,shards:h,noIsolation:g,inert:m,setCallbacks:o,allowPinchZoom:!!f,lockRef:n,gapMode:S}),a?C.cloneElement(C.Children.only(s),Ge(Ge({},I),{ref:x})):C.createElement(y,Ge({},I,{className:l,ref:x}),s))});Ei.defaultProps={enabled:!0,removeScrollBar:!0,inert:!1};Ei.classNames={fullWidth:Nr,zeroRight:Rr};var jy=function(){if(typeof __webpack_nonce__<"u")return __webpack_nonce__};function zy(){if(!document)return null;var t=document.createElement("style");t.type="text/css";var e=jy();return e&&t.setAttribute("nonce",e),t}function Hy(t,e){t.styleSheet?t.styleSheet.cssText=e:t.appendChild(document.createTextNode(e))}function By(t){var e=document.head||document.getElementsByTagName("head")[0];e.appendChild(t)}var Wy=function(){var t=0,e=null;return{add:function(n){t==0&&(e=zy())&&(Hy(e,n),By(e)),t++},remove:function(){t--,!t&&e&&(e.parentNode&&e.parentNode.removeChild(e),e=null)}}},Uy=function(){var t=Wy();return function(e,n){C.useEffect(function(){return t.add(e),function(){t.remove()}},[e&&n])}},Ld=function(){var t=Uy(),e=function(n){var r=n.styles,i=n.dynamic;return t(r,i),null};return e},Vy={left:0,top:0,right:0,gap:0},to=function(t){return parseInt(t||"",10)||0},Gy=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[to(n),to(r),to(i)]},qy=function(t){if(t===void 0&&(t="margin"),typeof window>"u")return Vy;var e=Gy(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])}},Yy=Ld(),gn="data-scroll-locked",Xy=function(t,e,n,r){var i=t.left,o=t.top,a=t.right,s=t.gap;return n===void 0&&(n="margin"),`
|
|
48
48
|
.`.concat(_y,` {
|
|
49
49
|
overflow: hidden `).concat(r,`;
|
|
50
50
|
padding-right: `).concat(s,"px ").concat(r,`;
|
|
@@ -84,19 +84,19 @@ Check the top-level render call using <`+$+">."),V}var w=d,D=Symbol.for("react.t
|
|
|
84
84
|
`)},ul=function(){var t=parseInt(document.body.getAttribute(gn)||"0",10);return isFinite(t)?t:0},Jy=function(){C.useEffect(function(){return document.body.setAttribute(gn,(ul()+1).toString()),function(){var t=ul()-1;t<=0?document.body.removeAttribute(gn):document.body.setAttribute(gn,t.toString())}},[])},Qy=function(t){var e=t.noRelative,n=t.noImportant,r=t.gapMode,i=r===void 0?"margin":r;Jy();var o=C.useMemo(function(){return qy(i)},[i]);return C.createElement(Yy,{styles:Xy(o,!e,i,n?"":"!important")})},Vo=!1;if(typeof window<"u")try{var xr=Object.defineProperty({},"passive",{get:function(){return Vo=!0,!0}});window.addEventListener("test",xr,xr),window.removeEventListener("test",xr,xr)}catch{Vo=!1}var Gt=Vo?{passive:!1}:!1,Zy=function(t){return t.tagName==="TEXTAREA"},Fd=function(t,e){if(!(t instanceof Element))return!1;var n=window.getComputedStyle(t);return n[e]!=="hidden"&&!(n.overflowY===n.overflowX&&!Zy(t)&&n[e]==="visible")},eb=function(t){return Fd(t,"overflowY")},tb=function(t){return Fd(t,"overflowX")},cl=function(t,e){var n=e.ownerDocument,r=e;do{typeof ShadowRoot<"u"&&r instanceof ShadowRoot&&(r=r.host);var i=jd(t,r);if(i){var o=zd(t,r),a=o[1],s=o[2];if(a>s)return!0}r=r.parentNode}while(r&&r!==n.body);return!1},nb=function(t){var e=t.scrollTop,n=t.scrollHeight,r=t.clientHeight;return[e,n,r]},rb=function(t){var e=t.scrollLeft,n=t.scrollWidth,r=t.clientWidth;return[e,n,r]},jd=function(t,e){return t==="v"?eb(e):tb(e)},zd=function(t,e){return t==="v"?nb(e):rb(e)},ib=function(t,e){return t==="h"&&e==="rtl"?-1:1},ob=function(t,e,n,r,i){var o=ib(t,window.getComputedStyle(e).direction),a=o*r,s=n.target,l=e.contains(s),u=!1,c=a>0,h=0,p=0;do{var g=zd(t,s),m=g[0],f=g[1],v=g[2],y=f-v-o*m;(m||y)&&jd(t,s)&&(h+=y,p+=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(h)<1||!c&&Math.abs(p)<1)&&(u=!0),u},Cr=function(t){return"changedTouches"in t?[t.changedTouches[0].clientX,t.changedTouches[0].clientY]:[0,0]},dl=function(t){return[t.deltaX,t.deltaY]},fl=function(t){return t&&"current"in t?t.current:t},ab=function(t,e){return t[0]===e[0]&&t[1]===e[1]},sb=function(t){return`
|
|
85
85
|
.block-interactivity-`.concat(t,` {pointer-events: none;}
|
|
86
86
|
.allow-interactivity-`).concat(t,` {pointer-events: all;}
|
|
87
|
-
`)},lb=0,qt=[];function ub(t){var e=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(lb++)[0],o=C.useState(Ld)[0],a=C.useRef(t);C.useEffect(function(){a.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var f=Eg([t.lockRef.current],(t.shards||[]).map(fl),!0).filter(Boolean);return f.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),f.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=C.useCallback(function(f,v){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!a.current.allowPinchZoom;var y=Cr(f),S=n.current,w="deltaX"in f?f.deltaX:S[0]-y[0],
|
|
87
|
+
`)},lb=0,qt=[];function ub(t){var e=C.useRef([]),n=C.useRef([0,0]),r=C.useRef(),i=C.useState(lb++)[0],o=C.useState(Ld)[0],a=C.useRef(t);C.useEffect(function(){a.current=t},[t]),C.useEffect(function(){if(t.inert){document.body.classList.add("block-interactivity-".concat(i));var f=Eg([t.lockRef.current],(t.shards||[]).map(fl),!0).filter(Boolean);return f.forEach(function(v){return v.classList.add("allow-interactivity-".concat(i))}),function(){document.body.classList.remove("block-interactivity-".concat(i)),f.forEach(function(v){return v.classList.remove("allow-interactivity-".concat(i))})}}},[t.inert,t.lockRef.current,t.shards]);var s=C.useCallback(function(f,v){if("touches"in f&&f.touches.length===2||f.type==="wheel"&&f.ctrlKey)return!a.current.allowPinchZoom;var y=Cr(f),S=n.current,w="deltaX"in f?f.deltaX:S[0]-y[0],T="deltaY"in f?f.deltaY:S[1]-y[1],x,I=f.target,P=Math.abs(w)>Math.abs(T)?"h":"v";if("touches"in f&&P==="h"&&I.type==="range")return!1;var b=cl(P,I);if(!b)return!0;if(b?x=P:(x=P==="v"?"h":"v",b=cl(P,I)),!b)return!1;if(!r.current&&"changedTouches"in f&&(w||T)&&(r.current=x),!x)return!0;var R=r.current||x;return ob(R,v,f,R==="h"?w:T)},[]),l=C.useCallback(function(f){var v=f;if(!(!qt.length||qt[qt.length-1]!==o)){var y="deltaY"in v?dl(v):Cr(v),S=e.current.filter(function(x){return x.name===v.type&&(x.target===v.target||v.target===x.shadowParent)&&ab(x.delta,y)})[0];if(S&&S.should){v.cancelable&&v.preventDefault();return}if(!S){var w=(a.current.shards||[]).map(fl).filter(Boolean).filter(function(x){return x.contains(v.target)}),T=w.length>0?s(v,w[0]):!a.current.noIsolation;T&&v.cancelable&&v.preventDefault()}}},[]),u=C.useCallback(function(f,v,y,S){var w={name:f,delta:v,target:y,should:S,shadowParent:cb(y)};e.current.push(w),setTimeout(function(){e.current=e.current.filter(function(T){return T!==w})},1)},[]),c=C.useCallback(function(f){n.current=Cr(f),r.current=void 0},[]),h=C.useCallback(function(f){u(f.type,dl(f),f.target,s(f,t.lockRef.current))},[]),p=C.useCallback(function(f){u(f.type,Cr(f),f.target,s(f,t.lockRef.current))},[]);C.useEffect(function(){return qt.push(o),t.setCallbacks({onScrollCapture:h,onWheelCapture:h,onTouchMoveCapture:p}),document.addEventListener("wheel",l,Gt),document.addEventListener("touchmove",l,Gt),document.addEventListener("touchstart",c,Gt),function(){qt=qt.filter(function(f){return f!==o}),document.removeEventListener("wheel",l,Gt),document.removeEventListener("touchmove",l,Gt),document.removeEventListener("touchstart",c,Gt)}},[]);var g=t.removeScrollBar,m=t.inert;return C.createElement(C.Fragment,null,m?C.createElement(o,{styles:sb(i)}):null,g?C.createElement(Qy,{gapMode:t.gapMode}):null)}function cb(t){for(var e=null;t!==null;)t instanceof ShadowRoot&&(e=t.host,t=t.host),t=t.parentNode;return e}const db=Fy(Kd,ub);var Hd=C.forwardRef(function(t,e){return C.createElement(Ei,Ge({},t,{ref:e,sideCar:db}))});Hd.classNames=Ei.classNames;var fb=function(t){if(typeof document>"u")return null;var e=Array.isArray(t)?t[0]:t;return e.ownerDocument.body},Yt=new WeakMap,Tr=new WeakMap,Dr={},no=0,Bd=function(t){return t&&(t.host||Bd(t.parentNode))},hb=function(t,e){return e.map(function(n){if(t.contains(n))return n;var r=Bd(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})},pb=function(t,e,n,r){var i=hb(e,Array.isArray(t)?t:[t]);Dr[n]||(Dr[n]=new WeakMap);var o=Dr[n],a=[],s=new Set,l=new Set(i),u=function(h){!h||s.has(h)||(s.add(h),u(h.parentNode))};i.forEach(u);var c=function(h){!h||l.has(h)||Array.prototype.forEach.call(h.children,function(p){if(s.has(p))c(p);else try{var g=p.getAttribute(r),m=g!==null&&g!=="false",f=(Yt.get(p)||0)+1,v=(o.get(p)||0)+1;Yt.set(p,f),o.set(p,v),a.push(p),f===1&&m&&Tr.set(p,!0),v===1&&p.setAttribute(n,"true"),m||p.setAttribute(r,"true")}catch(y){console.error("aria-hidden: cannot operate on ",p,y)}})};return c(e),s.clear(),no++,function(){a.forEach(function(h){var p=Yt.get(h)-1,g=o.get(h)-1;Yt.set(h,p),o.set(h,g),p||(Tr.has(h)||h.removeAttribute(r),Tr.delete(h)),g||h.removeAttribute(n)}),no--,no||(Yt=new WeakMap,Yt=new WeakMap,Tr=new WeakMap,Dr={})}},gb=function(t,e,n){n===void 0&&(n="data-aria-hidden");var r=Array.from(Array.isArray(t)?t:[t]),i=fb(t);return i?(r.push.apply(r,Array.from(i.querySelectorAll("[aria-live]"))),pb(r,i,n,"aria-hidden")):function(){return null}},Oa="Dialog",[Wd,Ix]=Zm(Oa),[vb,We]=Wd(Oa),Ud=t=>{const{__scopeDialog:e,children:n,open:r,defaultOpen:i,onOpenChange:o,modal:a=!0}=t,s=C.useRef(null),l=C.useRef(null),[u=!1,c]=ry({prop:r,defaultProp:i,onChange:o});return D.jsx(vb,{scope:e,triggerRef:s,contentRef:l,contentId:it(),titleId:it(),descriptionId:it(),open:u,onOpenChange:c,onOpenToggle:C.useCallback(()=>c(h=>!h),[c]),modal:a,children:n})};Ud.displayName=Oa;var Vd="DialogTrigger",mb=C.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=We(Vd,n),o=zt(e,i.triggerRef);return D.jsx(be.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":ka(i.open),...r,ref:o,onClick:mt(t.onClick,i.onOpenToggle)})});mb.displayName=Vd;var Ia="DialogPortal",[yb,Gd]=Wd(Ia,{forceMount:void 0}),qd=t=>{const{__scopeDialog:e,forceMount:n,children:r,container:i}=t,o=We(Ia,e);return D.jsx(yb,{scope:e,forceMount:n,children:C.Children.map(r,a=>D.jsx(wi,{present:n||o.open,children:D.jsx(Md,{asChild:!0,container:i,children:a})}))})};qd.displayName=Ia;var ii="DialogOverlay",Yd=C.forwardRef((t,e)=>{const n=Gd(ii,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=We(ii,t.__scopeDialog);return o.modal?D.jsx(wi,{present:r||o.open,children:D.jsx(bb,{...i,ref:e})}):null});Yd.displayName=ii;var bb=C.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=We(ii,n);return D.jsx(Hd,{as:Pa,allowPinchZoom:!0,shards:[i.contentRef],children:D.jsx(be.div,{"data-state":ka(i.open),...r,ref:e,style:{pointerEvents:"auto",...r.style}})})}),At="DialogContent",Xd=C.forwardRef((t,e)=>{const n=Gd(At,t.__scopeDialog),{forceMount:r=n.forceMount,...i}=t,o=We(At,t.__scopeDialog);return D.jsx(wi,{present:r||o.open,children:o.modal?D.jsx(Sb,{...i,ref:e}):D.jsx(wb,{...i,ref:e})})});Xd.displayName=At;var Sb=C.forwardRef((t,e)=>{const n=We(At,t.__scopeDialog),r=C.useRef(null),i=zt(e,n.contentRef,r);return C.useEffect(()=>{const o=r.current;if(o)return gb(o)},[]),D.jsx(Jd,{...t,ref:i,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:mt(t.onCloseAutoFocus,o=>{var a;o.preventDefault(),(a=n.triggerRef.current)==null||a.focus()}),onPointerDownOutside:mt(t.onPointerDownOutside,o=>{const a=o.detail.originalEvent,s=a.button===0&&a.ctrlKey===!0;(a.button===2||s)&&o.preventDefault()}),onFocusOutside:mt(t.onFocusOutside,o=>o.preventDefault())})}),wb=C.forwardRef((t,e)=>{const n=We(At,t.__scopeDialog),r=C.useRef(!1),i=C.useRef(!1);return D.jsx(Jd,{...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()}})}),Jd=C.forwardRef((t,e)=>{const{__scopeDialog:n,trapFocus:r,onOpenAutoFocus:i,onCloseAutoFocus:o,...a}=t,s=We(At,n),l=C.useRef(null),u=zt(e,l);return Iy(),D.jsxs(D.Fragment,{children:[D.jsx(Rd,{asChild:!0,loop:!0,trapped:r,onMountAutoFocus:i,onUnmountAutoFocus:o,children:D.jsx(_d,{role:"dialog",id:s.contentId,"aria-describedby":s.descriptionId,"aria-labelledby":s.titleId,"data-state":ka(s.open),...a,ref:u,onDismiss:()=>s.onOpenChange(!1)})}),D.jsxs(D.Fragment,{children:[D.jsx(Cb,{titleId:s.titleId}),D.jsx(Db,{contentRef:l,descriptionId:s.descriptionId})]})]})}),_a="DialogTitle",Eb=C.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=We(_a,n);return D.jsx(be.h2,{id:i.titleId,...r,ref:e})});Eb.displayName=_a;var Qd="DialogDescription",$b=C.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=We(Qd,n);return D.jsx(be.p,{id:i.descriptionId,...r,ref:e})});$b.displayName=Qd;var Zd="DialogClose",xb=C.forwardRef((t,e)=>{const{__scopeDialog:n,...r}=t,i=We(Zd,n);return D.jsx(be.button,{type:"button",...r,ref:e,onClick:mt(t.onClick,()=>i.onOpenChange(!1))})});xb.displayName=Zd;function ka(t){return t?"open":"closed"}var ef="DialogTitleWarning",[_x,tf]=Qm(ef,{contentName:At,titleName:_a,docsSlug:"dialog"}),Cb=({titleId:t})=>{const e=tf(ef),n=`\`${e.contentName}\` requires a \`${e.titleName}\` for the component to be accessible for screen reader users.
|
|
88
88
|
|
|
89
89
|
If you want to hide the \`${e.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
90
90
|
|
|
91
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return C.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Tb="DialogDescriptionWarning",Db=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tf(Tb).contentName}}.`;return C.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},Pb=Ud,Ob=qd,Ib=Yd,_b=Xd,Nn='[cmdk-group=""]',ro='[cmdk-group-items=""]',kb='[cmdk-group-heading=""]',Ra='[cmdk-item=""]',hl=`${Ra}:not([aria-disabled="true"])`,Go="cmdk-item-select",wt="data-value",Rb=(t,e,n)=>Jm(t,e,n),nf=C.createContext(void 0),sr=()=>C.useContext(nf),rf=C.createContext(void 0),Na=()=>C.useContext(rf),of=C.createContext(void 0),af=C.forwardRef((t,e)=>{let n=sn(()=>{var O,_;return{search:"",value:(_=(O=t.value)!=null?O:t.defaultValue)!=null?_:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=sn(()=>new Set),i=sn(()=>new Map),o=sn(()=>new Map),a=sn(()=>new Set),s=sf(t),{label:l,children:u,value:c,onValueChange:h,filter:p,shouldFilter:g,loop:m,disablePointerSelection:f=!1,vimBindings:v=!0,...y}=t,S=it(),w=it(),D=it(),x=C.useRef(null),I=Wb();Kt(()=>{if(c!==void 0){let O=c.trim();n.current.value=O,P.emit()}},[c]),Kt(()=>{I(6,E)},[]);let P=C.useMemo(()=>({subscribe:O=>(a.current.add(O),()=>a.current.delete(O)),snapshot:()=>n.current,setState:(O,_,N)=>{var A,F,B;if(!Object.is(n.current[O],_)){if(n.current[O]=_,O==="search")z(),W(),I(1,M);else if(O==="value"&&(N||I(5,E),((A=s.current)==null?void 0:A.value)!==void 0)){let L=_??"";(B=(F=s.current).onValueChange)==null||B.call(F,L);return}P.emit()}},emit:()=>{a.current.forEach(O=>O())}}),[]),b=C.useMemo(()=>({value:(O,_,N)=>{var A;_!==((A=o.current.get(O))==null?void 0:A.value)&&(o.current.set(O,{value:_,keywords:N}),n.current.filtered.items.set(O,R(_,N)),I(2,()=>{W(),P.emit()}))},item:(O,_)=>(r.current.add(O),_&&(i.current.has(_)?i.current.get(_).add(O):i.current.set(_,new Set([O]))),I(3,()=>{z(),W(),n.current.value||M(),P.emit()}),()=>{o.current.delete(O),r.current.delete(O),n.current.filtered.items.delete(O);let N=k();I(4,()=>{z(),(N==null?void 0:N.getAttribute("id"))===O&&M(),P.emit()})}),group:O=>(i.current.has(O)||i.current.set(O,new Set),()=>{o.current.delete(O),i.current.delete(O)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:S,inputId:D,labelId:w,listInnerRef:x}),[]);function R(O,_){var N,A;let F=(A=(N=s.current)==null?void 0:N.filter)!=null?A:Rb;return O?F(O,n.current.search,_):0}function W(){if(!n.current.search||s.current.shouldFilter===!1)return;let O=n.current.filtered.items,_=[];n.current.filtered.groups.forEach(A=>{let F=i.current.get(A),B=0;F.forEach(L=>{let X=O.get(L);B=Math.max(X,B)}),_.push([A,B])});let N=x.current;H().sort((A,F)=>{var B,L;let X=A.getAttribute("id"),ee=F.getAttribute("id");return((B=O.get(ee))!=null?B:0)-((L=O.get(X))!=null?L:0)}).forEach(A=>{let F=A.closest(ro);F?F.appendChild(A.parentElement===F?A:A.closest(`${ro} > *`)):N.appendChild(A.parentElement===N?A:A.closest(`${ro} > *`))}),_.sort((A,F)=>F[1]-A[1]).forEach(A=>{var F;let B=(F=x.current)==null?void 0:F.querySelector(`${Nn}[${wt}="${encodeURIComponent(A[0])}"]`);B==null||B.parentElement.appendChild(B)})}function M(){let O=H().find(N=>N.getAttribute("aria-disabled")!=="true"),_=O==null?void 0:O.getAttribute(wt);P.setState("value",_||void 0)}function z(){var O,_,N,A;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let F=0;for(let B of r.current){let L=(_=(O=o.current.get(B))==null?void 0:O.value)!=null?_:"",X=(A=(N=o.current.get(B))==null?void 0:N.keywords)!=null?A:[],ee=R(L,X);n.current.filtered.items.set(B,ee),ee>0&&F++}for(let[B,L]of i.current)for(let X of L)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(B);break}n.current.filtered.count=F}function E(){var O,_,N;let A=k();A&&(((O=A.parentElement)==null?void 0:O.firstChild)===A&&((N=(_=A.closest(Nn))==null?void 0:_.querySelector(kb))==null||N.scrollIntoView({block:"nearest"})),A.scrollIntoView({block:"nearest"}))}function k(){var O;return(O=x.current)==null?void 0:O.querySelector(`${Ra}[aria-selected="true"]`)}function H(){var O;return Array.from(((O=x.current)==null?void 0:O.querySelectorAll(hl))||[])}function U(O){let _=H()[O];_&&P.setState("value",_.getAttribute(wt))}function Y(O){var _;let N=k(),A=H(),F=A.findIndex(L=>L===N),B=A[F+O];(_=s.current)!=null&&_.loop&&(B=F+O<0?A[A.length-1]:F+O===A.length?A[0]:A[F+O]),B&&P.setState("value",B.getAttribute(wt))}function K(O){let _=k(),N=_==null?void 0:_.closest(Nn),A;for(;N&&!A;)N=O>0?Hb(N,Nn):Bb(N,Nn),A=N==null?void 0:N.querySelector(hl);A?P.setState("value",A.getAttribute(wt)):Y(O)}let q=()=>U(H().length-1),re=O=>{O.preventDefault(),O.metaKey?q():O.altKey?K(1):Y(1)},j=O=>{O.preventDefault(),O.metaKey?U(0):O.altKey?K(-1):Y(-1)};return C.createElement(be.div,{ref:e,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:O=>{var _;if((_=y.onKeyDown)==null||_.call(y,O),!O.defaultPrevented)switch(O.key){case"n":case"j":{v&&O.ctrlKey&&re(O);break}case"ArrowDown":{re(O);break}case"p":case"k":{v&&O.ctrlKey&&j(O);break}case"ArrowUp":{j(O);break}case"Home":{O.preventDefault(),U(0);break}case"End":{O.preventDefault(),q();break}case"Enter":if(!O.nativeEvent.isComposing&&O.keyCode!==229){O.preventDefault();let N=k();if(N){let A=new Event(Go);N.dispatchEvent(A)}}}}},C.createElement("label",{"cmdk-label":"",htmlFor:b.inputId,id:b.labelId,style:Vb},l),$i(t,O=>C.createElement(rf.Provider,{value:P},C.createElement(nf.Provider,{value:b},O))))}),Nb=C.forwardRef((t,e)=>{var n,r;let i=it(),o=C.useRef(null),a=C.useContext(of),s=sr(),l=sf(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=lf(i,o,[t.value,t.children,o],t.keywords),h=Na(),p=Lt(I=>I.value&&I.value===c.current),g=Lt(I=>u||s.filter()===!1?!0:I.search?I.filtered.items.get(i)>0:!0);C.useEffect(()=>{let I=o.current;if(!(!I||t.disabled))return I.addEventListener(Go,m),()=>I.removeEventListener(Go,m)},[g,t.onSelect,t.disabled]);function m(){var I,P;f(),(P=(I=l.current).onSelect)==null||P.call(I,c.current)}function f(){h.setState("value",c.current,!0)}if(!g)return null;let{disabled:v,value:y,onSelect:S,forceMount:w,keywords:D,...x}=t;return C.createElement(be.div,{ref:Zn([o,e]),...x,id:i,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||s.getDisablePointerSelection()?void 0:f,onClick:v?void 0:m},t.children)}),Mb=C.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...o}=t,a=it(),s=C.useRef(null),l=C.useRef(null),u=it(),c=sr(),h=Lt(g=>i||c.filter()===!1?!0:g.search?g.filtered.groups.has(a):!0);Kt(()=>c.group(a),[]),lf(a,s,[t.value,t.heading,l]);let p=C.useMemo(()=>({id:a,forceMount:i}),[i]);return C.createElement(be.div,{ref:Zn([s,e]),...o,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&C.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),$i(t,g=>C.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},C.createElement(of.Provider,{value:p},g))))}),Ab=C.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=C.useRef(null),o=Lt(a=>!a.search);return!n&&!o?null:C.createElement(be.div,{ref:Zn([i,e]),...r,"cmdk-separator":"",role:"separator"})}),Kb=C.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=Na(),a=Lt(c=>c.search),s=Lt(c=>c.value),l=sr(),u=C.useMemo(()=>{var c;let h=(c=l.listInnerRef.current)==null?void 0:c.querySelector(`${Ra}[${wt}="${encodeURIComponent(s)}"]`);return h==null?void 0:h.getAttribute("id")},[]);return C.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),C.createElement(be.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)}})}),Lb=C.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,o=C.useRef(null),a=C.useRef(null),s=sr();return C.useEffect(()=>{if(a.current&&o.current){let l=a.current,u=o.current,c,h=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let p=l.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return h.observe(l),()=>{cancelAnimationFrame(c),h.unobserve(l)}}},[]),C.createElement(be.div,{ref:Zn([o,e]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:s.listId},$i(t,l=>C.createElement("div",{ref:Zn([a,s.listInnerRef]),"cmdk-list-sizer":""},l)))}),Fb=C.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=t;return C.createElement(Pb,{open:n,onOpenChange:r},C.createElement(Ob,{container:a},C.createElement(Ib,{"cmdk-overlay":"",className:i}),C.createElement(_b,{"aria-label":t.label,"cmdk-dialog":"",className:o},C.createElement(af,{ref:e,...s}))))}),jb=C.forwardRef((t,e)=>Lt(n=>n.filtered.count===0)?C.createElement(be.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),zb=C.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...o}=t;return C.createElement(be.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$i(t,a=>C.createElement("div",{"aria-hidden":!0},a)))}),Qn=Object.assign(af,{List:Lb,Item:Nb,Input:Kb,Group:Mb,Separator:Ab,Dialog:Fb,Empty:jb,Loading:zb});function Hb(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function Bb(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function sf(t){let e=C.useRef(t);return Kt(()=>{e.current=t}),e}var Kt=typeof window>"u"?C.useEffect:C.useLayoutEffect;function sn(t){let e=C.useRef();return e.current===void 0&&(e.current=t()),e}function Zn(t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function Lt(t){let e=Na(),n=()=>t(e.snapshot());return da.useSyncExternalStore(e.subscribe,n,n)}function lf(t,e,n,r=[]){let i=C.useRef(),o=sr();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(wt,s),i.current=s}),i}var Wb=()=>{let[t,e]=C.useState(),n=sn(()=>new Map);return Kt(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function Ub(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function $i({asChild:t,children:e},n){return t&&C.isValidElement(e)?C.cloneElement(Ub(e),{ref:e.ref},n(e.props.children)):n(e)}var Vb={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const qo=({withPadding:t=!0})=>T.jsx("div",{className:ot("c__horizontal-separator",{"with-padding":t})}),uf=({loading:t,inputValue:e,onFilter:n,placeholder:r,children:i,withSeparator:o=!0})=>{const{t:a}=mn.useCunningham();return i?T.jsxs(T.Fragment,{children:[i,o&&T.jsx(qo,{})]}):T.jsxs(T.Fragment,{children:[T.jsxs("div",{className:"quick-search-input-container",children:[!t&&T.jsx("span",{className:"material-icons",children:"search"}),t&&T.jsx("div",{children:T.jsx(Da,{size:"sm"})}),T.jsx(Qn.Input,{autoFocus:!0,"aria-label":a("Quick search input"),onClick:s=>{s.stopPropagation()},role:"combobox",value:e,placeholder:r,onValueChange:n})]}),o&&T.jsx(qo,{withPadding:!1})]})},Gb=t=>{let e=!1;return d.Children.forEach(t,n=>{e=e||!!n}),e},qb=({onFilter:t,inputContent:e,inputValue:n,loading:r,showInput:i=!0,label:o,placeholder:a,children:s})=>{const l=d.useRef(null);return T.jsx(T.Fragment,{children:T.jsx("div",{className:"quick-search-container",children:T.jsxs(Qn,{label:o,shouldFilter:!1,ref:l,children:[i&&T.jsx(uf,{loading:r,withSeparator:Gb(s),inputValue:n,onFilter:t,placeholder:a,children:e}),T.jsx(Qn.List,{children:T.jsx("div",{children:s})})]})})})},Mr=({children:t,onSelect:e,id:n})=>T.jsx(Qn.Item,{value:n,onSelect:e,children:t}),Yb=({group:t,onSelect:e,renderElement:n})=>{var r,i;return!t.showWhenEmpty&&t.elements.length===0?null:T.jsx("div",{className:"pt-base",children:T.jsxs(Qn.Group,{heading:t.groupName,forceMount:!1,children:[(r=t.startActions)==null?void 0:r.map((o,a)=>T.jsx(Mr,{onSelect:o.onSelect,children:o.content},`${t.groupName}-action-${a}`)),t.elements.map((o,a)=>T.jsx(Mr,{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)=>T.jsx(Mr,{onSelect:o.onSelect,children:o.content},`${t.groupName}-action-${a}`)),t.emptyString&&t.elements.length===0&&T.jsx("span",{className:"ml-b clr-greyscale-500",children:t.emptyString})]},t.groupName)})},Xb=({alwaysShowRight:t,left:e,right:n})=>{const{isDesktop:r}=ar();return T.jsxs("div",{className:"c__quick-search-item-template",children:[T.jsx("div",{className:"c__quick-search-item-template__left",children:e}),r&&n&&T.jsx("div",{className:ot("c__quick-search-item-template__right",{"show-right-on-focus":t}),children:n})]})},Jb=({tabs:t,defaultSelectedTab:e,fullWidth:n=!1})=>t.length===0?null:T.jsx("div",{className:ot("c__tabs",{"c__tabs__full-width":n}),children:T.jsxs(rm,{defaultSelectedKey:e,children:[T.jsx(om,{"aria-label":"History of Ancient Rome",children:t.map(r=>T.jsxs(sm,{id:r.id,children:[r.icon&&T.jsx("span",{className:"material-icons",children:r.icon}),r.label]},r.id))}),t.map(r=>T.jsx(lm,{id:r.id,children:r.content},r.id))]})}),cf=d.createContext(null);function Oe(){const t=d.useContext(cf);if(t===null)throw new Error("No Tree Api Provided");return t}const df=d.createContext(null);function Qb(){const t=d.useContext(df);if(t===null)throw new Error("Provide a NodesContext");return t}const ff=d.createContext(null);function Zb(){const t=d.useContext(ff);if(t===null)throw new Error("Provide a DnDContext");return t}const hf=d.createContext(0);function pf(){d.useContext(hf)}function Ar(t,e,n){return Math.max(Math.min(t,n),e)}function gf(t){return t&&t.isLeaf}function vf(t){return t&&t.isInternal&&!t.isOpen}function mf(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const yf=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},bf=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function eS(){}function Ma(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=Ma(n,e);if(r)return r}return null}function oi(t,e){if(e(t),t.children)for(let n of t.children)oi(n,e)}function Sf(t){const e=Ef(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=tS(e,r);break}n==null||n.focus()}function wf(t){const e=Ef(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=nS(e,r);break}n==null||n.focus()}function tS(t,e){return e+1<t.length?t[e+1]:t[0]}function nS(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function Ef(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 zn(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function $f(t){return t===null?null:Et(t)}function Et(t){return typeof t=="string"?t:t.id}function rS(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function xf(t,...e){if(t)return t(...e)}function Cf(t){return new Promise((e,n)=>{let r=0;function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)}i()})}function Tf(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 Df(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const iS=Object.freeze(Object.defineProperty({__proto__:null,access:zn,bound:Ar,dfs:Ma,focusNextElement:Sf,focusPrevElement:wf,getInsertIndex:Tf,getInsertParentId:Df,identify:Et,identifyNull:$f,indexOf:bf,isClosed:vf,isDescendant:yf,isItem:gf,isOpenWithEmptyChildren:mf,mergeRefs:rS,noop:eS,safeRun:xf,waitFor:Cf,walk:oi},Symbol.toStringTag,{value:"Module"})),oS={display:"flex",alignItems:"center",zIndex:1},aS={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},sS={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},lS=d.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 T.jsxs("div",{style:Object.assign(Object.assign({},oS),i),children:[T.jsx("div",{style:Object.assign({},sS)}),T.jsx("div",{style:Object.assign({},aS)})]})});function uS({node:t,attrs:e,innerRef:n,children:r}){return T.jsx("div",Object.assign({},e,{ref:n,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:r}))}function cS(t){return T.jsxs("div",{ref:t.dragHandle,style:t.style,children:[T.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"🌳":t.node.isOpen?"🗁":"🗀"})," ",t.node.isEditing?T.jsx(fS,Object.assign({},t)):T.jsx(dS,Object.assign({},t))]})}function dS(t){return T.jsx(T.Fragment,{children:T.jsx("span",{children:t.node.data.name})})}function fS({node:t}){const e=d.useRef();return d.useEffect(()=>{var n,r;(n=e.current)===null||n===void 0||n.focus(),(r=e.current)===null||r===void 0||r.select()},[]),T.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 io(t){return{type:"EDIT",id:t}}function hS(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t}function Xt(t){return{type:"FOCUS",id:t}}function pS(){return{type:"TREE_BLUR"}}function gS(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 ai{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===er}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 ai(Object.assign({},this))}edit(){return this.tree.edit(this)}}const er="__REACT_ARBORIST_INTERNAL_ROOT__";function pl(t){var e;function n(o,a,s){const l=t.accessId(o),u=new ai({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(h=>n(h,a+1,u))),u}const r=new ai({tree:t,id:er,data:{id:er},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 Yo={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 gl(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 vS(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:gl(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:gl(t.unfiltered,e)}):t}const wn=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}}},Fe={clear:()=>({type:"SELECTION_CLEAR"}),only:t=>({type:"SELECTION_ONLY",id:Et(t)}),add:t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(Et)}),remove:t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(Et)}),set:t=>Object.assign({type:"SELECTION_SET"},t),mostRecent:t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:Et(t)}),anchor:t=>({type:"SELECTION_ANCHOR",id:t===null?null:Et(t)})};function mS(t=wn().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 En={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 yS(t=wn().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 wn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}const bS={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},SS=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},wS=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function Pf({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return T.jsxs(ES,{isDragging:i,children:[T.jsx($S,{offset:t,children:T.jsx(CS,{id:n,dragIds:r})}),T.jsx(xS,{mouse:e,count:r.length})]})}const ES=d.memo(function(e){return e.isDragging?T.jsx("div",{style:bS,children:e.children}):null});function $S(t){return T.jsx("div",{className:"row preview",style:SS(t.offset),children:t.children})}function xS(t){const{count:e,mouse:n}=t;return e>1?T.jsx("div",{className:"selected-count",style:wS(n),children:e}):null}const CS=d.memo(function(e){const n=Oe(),r=n.get(e.id);return r?T.jsx(n.renderNode,{preview:!0,node:r,style:{paddingLeft:r.level*n.indent,opacity:.2,background:"transparent"},tree:n}):null});function Xo(){return Xo=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},Xo.apply(null,arguments)}function vl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Jo(t,e){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Jo(t,e)}function TS(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Jo(t,e)}var ml=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function DS(t,e){return!!(t===e||ml(t)&&ml(e))}function PS(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!DS(t[n],e[n]))return!1;return!0}function oo(t,e){e===void 0&&(e=PS);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 OS=typeof performance=="object"&&typeof performance.now=="function",yl=OS?function(){return performance.now()}:function(){return Date.now()};function bl(t){cancelAnimationFrame(t.id)}function IS(t,e){var n=yl();function r(){yl()-n>=e?t.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var ao=-1;function Sl(t){if(t===void 0&&(t=!1),ao===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),ao=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return ao}var Jt=null;function wl(t){if(t===void 0&&(t=!1),Jt===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?Jt="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?Jt="negative":Jt="positive-ascending"),document.body.removeChild(e),Jt}return Jt}process.env.NODE_ENV;var _S=150,kS=function(e,n){return e},Kr=null,Lr=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Kr=new WeakSet,Lr=new WeakSet);function RS(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(h){TS(p,h);function p(m){var f;return f=h.call(this,m)||this,f._instanceProps=l(f.props,vl(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:vl(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=oo(function(v,y,S,w){return f.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:S,visibleStopIndex:w})}),f._callOnScroll=void 0,f._callOnScroll=oo(function(v,y,S){return f.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:S})}),f._getItemStyle=void 0,f._getItemStyle=function(v){var y=f.props,S=y.direction,w=y.itemSize,D=y.layout,x=f._getItemStyleCache(u&&w,u&&D,u&&S),I;if(x.hasOwnProperty(v))I=x[v];else{var P=n(f.props,v,f._instanceProps),b=i(f.props,v,f._instanceProps),R=S==="horizontal"||D==="horizontal",W=S==="rtl",M=R?P:0;x[v]=I={position:"absolute",left:W?void 0:M,right:W?M:void 0,top:R?0:P,height:R?"100%":b,width:R?b:"100%"}}return I},f._getItemStyleCache=void 0,f._getItemStyleCache=oo(function(v,y,S){return{}}),f._onScrollHorizontal=function(v){var y=v.currentTarget,S=y.clientWidth,w=y.scrollLeft,D=y.scrollWidth;f.setState(function(x){if(x.scrollOffset===w)return null;var I=f.props.direction,P=w;if(I==="rtl")switch(wl()){case"negative":P=-w;break;case"positive-descending":P=D-S-w;break}return P=Math.max(0,Math.min(P,D-S)),{isScrolling:!0,scrollDirection:x.scrollOffset<P?"forward":"backward",scrollOffset:P,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(v){var y=v.currentTarget,S=y.clientHeight,w=y.scrollHeight,D=y.scrollTop;f.setState(function(x){if(x.scrollOffset===D)return null;var I=Math.max(0,Math.min(D,w-S));return{isScrolling:!0,scrollDirection:x.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._outerRefSetter=function(v){var y=f.props.outerRef;f._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},f._resetIsScrollingDebounced=function(){f._resetIsScrollingTimeoutId!==null&&bl(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=IS(f._resetIsScrolling,_S)},f._resetIsScrolling=function(){f._resetIsScrollingTimeoutId=null,f.setState({isScrolling:!1},function(){f._getItemStyleCache(-1,null)})},f}p.getDerivedStateFromProps=function(f,v){return NS(f,v),c(f),null};var g=p.prototype;return g.scrollTo=function(f){f=Math.max(0,f),this.setState(function(v){return v.scrollOffset===f?null:{scrollDirection:v.scrollOffset<f?"forward":"backward",scrollOffset:f,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(f,v){v===void 0&&(v="auto");var y=this.props,S=y.itemCount,w=y.layout,D=this.state.scrollOffset;f=Math.max(0,Math.min(f,S-1));var x=0;if(this._outerRef){var I=this._outerRef;w==="vertical"?x=I.scrollWidth>I.clientWidth?Sl():0:x=I.scrollHeight>I.clientHeight?Sl():0}this.scrollTo(o(this.props,f,v,D,this._instanceProps,x))},g.componentDidMount=function(){var f=this.props,v=f.direction,y=f.initialScrollOffset,S=f.layout;if(typeof y=="number"&&this._outerRef!=null){var w=this._outerRef;v==="horizontal"||S==="horizontal"?w.scrollLeft=y:w.scrollTop=y}this._callPropsCallbacks()},g.componentDidUpdate=function(){var f=this.props,v=f.direction,y=f.layout,S=this.state,w=S.scrollOffset,D=S.scrollUpdateWasRequested;if(D&&this._outerRef!=null){var x=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(wl()){case"negative":x.scrollLeft=-w;break;case"positive-ascending":x.scrollLeft=w;break;default:var I=x.clientWidth,P=x.scrollWidth;x.scrollLeft=P-I-w;break}else x.scrollLeft=w;else x.scrollTop=w}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&bl(this._resetIsScrollingTimeoutId)},g.render=function(){var f=this.props,v=f.children,y=f.className,S=f.direction,w=f.height,D=f.innerRef,x=f.innerElementType,I=f.innerTagName,P=f.itemCount,b=f.itemData,R=f.itemKey,W=R===void 0?kS:R,M=f.layout,z=f.outerElementType,E=f.outerTagName,k=f.style,H=f.useIsScrolling,U=f.width,Y=this.state.isScrolling,K=S==="horizontal"||M==="horizontal",q=K?this._onScrollHorizontal:this._onScrollVertical,re=this._getRangeToRender(),j=re[0],O=re[1],_=[];if(P>0)for(var N=j;N<=O;N++)_.push(d.createElement(v,{data:b,key:W(N,b),index:N,isScrolling:H?Y:void 0,style:this._getItemStyle(N)}));var A=r(this.props,this._instanceProps);return d.createElement(z||E||"div",{className:y,onScroll:q,ref:this._outerRefSetter,style:Xo({position:"relative",height:w,width:U,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:S},k)},d.createElement(x||I||"div",{children:_,ref:D,style:{height:K?"100%":A,pointerEvents:Y?"none":void 0,width:K?A:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var f=this.props.itemCount;if(f>0){var v=this._getRangeToRender(),y=v[0],S=v[1],w=v[2],D=v[3];this._callOnItemsRendered(y,S,w,D)}}if(typeof this.props.onScroll=="function"){var x=this.state,I=x.scrollDirection,P=x.scrollOffset,b=x.scrollUpdateWasRequested;this._callOnScroll(I,P,b)}},g._getRangeToRender=function(){var f=this.props,v=f.itemCount,y=f.overscanCount,S=this.state,w=S.isScrolling,D=S.scrollDirection,x=S.scrollOffset;if(v===0)return[0,0,0,0];var I=a(this.props,x,this._instanceProps),P=s(this.props,I,x,this._instanceProps),b=!w||D==="backward"?Math.max(1,y):1,R=!w||D==="forward"?Math.max(1,y):1;return[Math.max(0,I-b),Math.max(0,Math.min(v-1,P+R)),I,P]},p}(d.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var NS=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)&&Lr&&!Lr.has(c)&&(Lr.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var h=i==="horizontal"||a==="horizontal";switch(i){case"horizontal":case"vertical":Kr&&!Kr.has(c)&&(Kr.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(h&&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(!h&&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.'))}},MS=RS({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,h=e.layout,p=e.width,g=s==="horizontal"||h==="horizontal",m=g?p:l,f=Math.max(0,u*c-m),v=Math.min(f,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 S=Math.round(y+(v-y)/2);return S<Math.ceil(m/2)?0:S>f+Math.floor(m/2)?f:S}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",h=n*s,p=c?u:o,g=Math.ceil((p+r-h)/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 AS(){var t,e;const n=Oe(),i=Zb().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 T.jsx(l,{top:a,left:s,indent:o})}var KS=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 LS=d.forwardRef(function(e,n){const{children:r}=e,i=KS(e,["children"]),o=Oe();return T.jsxs("div",Object.assign({ref:n},i,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[T.jsx(FS,{}),r]}))}),FS=()=>{const t=Oe();return T.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:T.jsx(AS,{})})};var jS=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 zS=d.forwardRef(function(e,n){var r,i,o,a,{style:s}=e,l=jS(e,["style"]);const u=Oe(),c=(i=(r=u.props.padding)!==null&&r!==void 0?r:u.props.paddingTop)!==null&&i!==void 0?i:0,h=(a=(o=u.props.padding)!==null&&o!==void 0?o:u.props.paddingBottom)!==null&&a!==void 0?a:0;return T.jsx("div",Object.assign({ref:n,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+c+h}px`})},l))});var Of=d.createContext({dragDropManager:void 0}),Me;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Me||(Me={}));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 Aa="dnd-core/INIT_COORDS",xi="dnd-core/BEGIN_DRAG",Ka="dnd-core/PUBLISH_DRAG_SOURCE",Ci="dnd-core/HOVER",Ti="dnd-core/DROP",Di="dnd-core/END_DRAG";function El(t,e){return{type:Aa,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function Fr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fr=function(n){return typeof n}:Fr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Fr(t)}function HS(t,e,n){return e.split(".").reduce(function(r,i){return r&&r[i]?r[i]:n},t)}function BS(t,e){return t.filter(function(n){return n!==e})}function If(t){return Fr(t)==="object"}function WS(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 US(t,e){return t.filter(function(n){return e.indexOf(n)>-1})}var VS={type:Aa,payload:{clientOffset:null,sourceClientOffset:null}};function GS(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(El(a)),qS(n,l,u);var c=JS(n,l);if(c===null){t.dispatch(VS);return}var h=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");YS(s),h=s(c)}t.dispatch(El(a,h));var p=u.getSource(c),g=p.beginDrag(l,c);if(g!=null){XS(g),u.pinSource(c);var m=u.getSourceType(c);return{type:xi,payload:{itemType:m,item:g,sourceId:c,clientOffset:a||null,sourceClientOffset:h||null,isSourcePublic:!!o}}}}}function qS(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 YS(t){J(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function XS(t){J(If(t),"Item must be an object.")}function JS(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 QS(t){return function(){var n=t.getMonitor();if(n.isDragging())return{type:Ka}}}function Qo(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function ZS(t){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.clientOffset;ew(n);var o=n.slice(0),a=t.getMonitor(),s=t.getRegistry();tw(o,a,s);var l=a.getItemType();return nw(o,s,l),rw(o,a,s),{type:Ci,payload:{targetIds:o,clientOffset:i||null}}}}function ew(t){J(Array.isArray(t),"Expected targetIds to be an array.")}function tw(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 nw(t,e,n){for(var r=t.length-1;r>=0;r--){var i=t[r],o=e.getTargetType(i);Qo(o,n)||t.splice(r,1)}}function rw(t,e,n){t.forEach(function(r){var i=n.getTarget(r);i.hover(e,r)})}function $l(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 xl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$l(Object(n),!0).forEach(function(r){iw(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ow(t){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.getMonitor(),i=t.getRegistry();aw(r);var o=uw(r);o.forEach(function(a,s){var l=sw(a,s,i,r),u={type:Ti,payload:{dropResult:xl(xl({},n),l)}};t.dispatch(u)})}}function aw(t){J(t.isDragging(),"Cannot call drop while not dragging."),J(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function sw(t,e,n,r){var i=n.getTarget(t),o=i?i.drop(r,t):void 0;return lw(o),typeof o>"u"&&(o=e===0?{}:r.getDropResult()),o}function lw(t){J(typeof t>"u"||If(t),"Drop result must either be an object or undefined.")}function uw(t){var e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function cw(t){return function(){var n=t.getMonitor(),r=t.getRegistry();dw(n);var i=n.getSourceId();if(i!=null){var o=r.getSource(i,!0);o.endDrag(n,i),r.unpinSource()}return{type:Di}}}function dw(t){J(t.isDragging(),"Cannot call endDrag while not dragging.")}function fw(t){return{beginDrag:GS(t),publishDragSource:QS(t),hover:ZS(t),drop:ow(t),endDrag:cw(t)}}function hw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pw(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 gw(t,e,n){return pw(t.prototype,e),t}function Mn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vw=function(){function t(e,n){var r=this;hw(this,t),Mn(this,"store",void 0),Mn(this,"monitor",void 0),Mn(this,"backend",void 0),Mn(this,"isSetUp",!1),Mn(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 gw(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=fw(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 _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 Cl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),so=function(){return Math.random().toString(36).substring(7).split("").join(".")},Tl={INIT:"@@redux/INIT"+so(),REPLACE:"@@redux/REPLACE"+so(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+so()}};function mw(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 yw(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(ww(t))return"date";if(Sw(t))return"error";var n=bw(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 bw(t){return typeof t.constructor=="function"?t.constructor.name:null}function Sw(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function ww(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Qt(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=yw(t)),e}function _f(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"?_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: '"+Qt(n)+"'");return n(_f)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?_e(2):"Expected the root reducer to be a function. Instead, received: '"+Qt(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"?_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 o}function h(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?_e(4):"Expected the listener to be a function. Instead, received: '"+Qt(f)+"'");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.");var v=!0;return u(),s.push(f),function(){if(v){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.");v=!1,u();var S=s.indexOf(f);s.splice(S,1),a=null}}}function p(f){if(!mw(f))throw new Error(process.env.NODE_ENV==="production"?_e(7):"Actions must be plain objects. Instead, the actual type was: '"+Qt(f)+"'. 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 f.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(l)throw new Error(process.env.NODE_ENV==="production"?_e(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,f)}finally{l=!1}for(var v=a=s,y=0;y<v.length;y++){var S=v[y];S()}return f}function g(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?_e(10):"Expected the nextReducer to be a function. Instead, received: '"+Qt(f));i=f,p({type:Tl.REPLACE})}function m(){var f,v=h;return f={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(process.env.NODE_ENV==="production"?_e(11):"Expected the observer to be an object. Instead, received: '"+Qt(S)+"'");function w(){S.next&&S.next(c())}w();var D=v(w);return{unsubscribe:D}}},f[Cl]=function(){return this},f}return p({type:Tl.INIT}),r={dispatch:p,subscribe:h,getState:c,replaceReducer:g},r[Cl]=m,r}var Ew=function(e,n){return e===n};function $w(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function xw(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ew;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 Dl(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 Pl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Dl(Object(n),!0).forEach(function(r){Cw(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Cw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ol={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Tw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ol,e=arguments.length>1?arguments[1]:void 0,n=e.payload;switch(e.type){case Aa:case xi:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Ci:return $w(t.clientOffset,n.clientOffset)?t:Pl(Pl({},t),{},{clientOffset:n.clientOffset});case Di:case Ti:return Ol;default:return t}}var La="dnd-core/ADD_SOURCE",Fa="dnd-core/ADD_TARGET",ja="dnd-core/REMOVE_SOURCE",Pi="dnd-core/REMOVE_TARGET";function Dw(t){return{type:La,payload:{sourceId:t}}}function Pw(t){return{type:Fa,payload:{targetId:t}}}function Ow(t){return{type:ja,payload:{sourceId:t}}}function Iw(t){return{type:Pi,payload:{targetId:t}}}function Il(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 ke(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Il(Object(n),!0).forEach(function(r){_w(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Il(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var kw={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Rw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kw,e=arguments.length>1?arguments[1]:void 0,n=e.payload;switch(e.type){case xi:return ke(ke({},t),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Ka:return ke(ke({},t),{},{isSourcePublic:!0});case Ci:return ke(ke({},t),{},{targetIds:n.targetIds});case Pi:return t.targetIds.indexOf(n.targetId)===-1?t:ke(ke({},t),{},{targetIds:BS(t.targetIds,n.targetId)});case Ti:return ke(ke({},t),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Di:return ke(ke({},t),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Nw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case La:case Fa:return t+1;case ja:case Pi:return t-1;default:return t}}var si=[],za=[];si.__IS_NONE__=!0;za.__IS_ALL__=!0;function Mw(t,e){if(t===si)return!1;if(t===za||typeof e>"u")return!0;var n=US(e,t);return n.length>0}function Aw(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ci:break;case La:case Fa:case Pi:case ja:return si;case xi:case Ka:case Di:case Ti:default:return za}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,o=i===void 0?[]:i,a=WS(r,o),s=a.length>0||!xw(r,o);if(!s)return si;var l=o[o.length-1],u=r[r.length-1];return l!==u&&(l&&a.push(l),u&&a.push(u)),a}function Kw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t+1}function _l(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 kl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_l(Object(n),!0).forEach(function(r){Lw(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_l(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Lw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Aw(t.dirtyHandlerIds,{type:e.type,payload:kl(kl({},e.payload),{},{prevTargetIds:HS(t,"dragOperation.targetIds",[])})}),dragOffset:Tw(t.dragOffset,e),refCount:Nw(t.refCount,e),dragOperation:Rw(t.dragOperation,e),stateId:Kw(t.stateId)}}function jw(t,e){return{x:t.x+e.x,y:t.y+e.y}}function kf(t,e){return{x:t.x-e.x,y:t.y-e.y}}function zw(t){var e=t.clientOffset,n=t.initialClientOffset,r=t.initialSourceClientOffset;return!e||!n||!r?null:kf(jw(e,r),n)}function Hw(t){var e=t.clientOffset,n=t.initialClientOffset;return!e||!n?null:kf(e,n)}function Bw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ww(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 Ww(t.prototype,e),t}function Rl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Vw=function(){function t(e,n){Bw(this,t),Rl(this,"store",void 0),Rl(this,"registry",void 0),this.store=e,this.registry=n}return Uw(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 h=c===a||c===a+1&&!Mw(u.dirtyHandlerIds,o);h||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 Qo(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&&!Qo(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 zw(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return Hw(this.store.getState().dragOffset)}}]),t}(),Gw=0;function qw(){return Gw++}function jr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jr=function(n){return typeof n}:jr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},jr(t)}function Yw(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 Xw(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 Zo(t,e){if(e&&Array.isArray(t)){t.forEach(function(n){return Zo(n,!1)});return}J(typeof t=="string"||jr(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 Nl=typeof global<"u"?global:self,Rf=Nl.MutationObserver||Nl.WebKitMutationObserver;function Nf(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function Jw(t){let e=1;const n=new Rf(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Qw=typeof Rf=="function"?Jw:Nf;class Zw{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=Qw(this.flush),this.requestErrorThrow=Nf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class e0{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 t0{create(e){const n=this.freeTasks,r=n.length?n.pop():new e0(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Mf=new Zw,n0=new t0(Mf.registerPendingError);function r0(t){Mf.enqueueTask(n0.create(t))}function i0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o0(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 a0(t,e,n){return o0(t.prototype,e),t}function Zt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s0(t,e){return d0(t)||c0(t,e)||u0(t,e)||l0()}function l0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
91
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${e.docsSlug}`;return C.useEffect(()=>{t&&(document.getElementById(t)||console.error(n))},[n,t]),null},Tb="DialogDescriptionWarning",Db=({contentRef:t,descriptionId:e})=>{const r=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${tf(Tb).contentName}}.`;return C.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},Pb=Ud,Ob=qd,Ib=Yd,_b=Xd,Nn='[cmdk-group=""]',ro='[cmdk-group-items=""]',kb='[cmdk-group-heading=""]',Ra='[cmdk-item=""]',hl=`${Ra}:not([aria-disabled="true"])`,Go="cmdk-item-select",wt="data-value",Rb=(t,e,n)=>Jm(t,e,n),nf=C.createContext(void 0),sr=()=>C.useContext(nf),rf=C.createContext(void 0),Na=()=>C.useContext(rf),of=C.createContext(void 0),af=C.forwardRef((t,e)=>{let n=sn(()=>{var O,k;return{search:"",value:(k=(O=t.value)!=null?O:t.defaultValue)!=null?k:"",filtered:{count:0,items:new Map,groups:new Set}}}),r=sn(()=>new Set),i=sn(()=>new Map),o=sn(()=>new Map),a=sn(()=>new Set),s=sf(t),{label:l,children:u,value:c,onValueChange:h,filter:p,shouldFilter:g,loop:m,disablePointerSelection:f=!1,vimBindings:v=!0,...y}=t,S=it(),w=it(),T=it(),x=C.useRef(null),I=Wb();Kt(()=>{if(c!==void 0){let O=c.trim();n.current.value=O,P.emit()}},[c]),Kt(()=>{I(6,E)},[]);let P=C.useMemo(()=>({subscribe:O=>(a.current.add(O),()=>a.current.delete(O)),snapshot:()=>n.current,setState:(O,k,N)=>{var A,F,B;if(!Object.is(n.current[O],k)){if(n.current[O]=k,O==="search")H(),W(),I(1,M);else if(O==="value"&&(N||I(5,E),((A=s.current)==null?void 0:A.value)!==void 0)){let L=k??"";(B=(F=s.current).onValueChange)==null||B.call(F,L);return}P.emit()}},emit:()=>{a.current.forEach(O=>O())}}),[]),b=C.useMemo(()=>({value:(O,k,N)=>{var A;k!==((A=o.current.get(O))==null?void 0:A.value)&&(o.current.set(O,{value:k,keywords:N}),n.current.filtered.items.set(O,R(k,N)),I(2,()=>{W(),P.emit()}))},item:(O,k)=>(r.current.add(O),k&&(i.current.has(k)?i.current.get(k).add(O):i.current.set(k,new Set([O]))),I(3,()=>{H(),W(),n.current.value||M(),P.emit()}),()=>{o.current.delete(O),r.current.delete(O),n.current.filtered.items.delete(O);let N=_();I(4,()=>{H(),(N==null?void 0:N.getAttribute("id"))===O&&M(),P.emit()})}),group:O=>(i.current.has(O)||i.current.set(O,new Set),()=>{o.current.delete(O),i.current.delete(O)}),filter:()=>s.current.shouldFilter,label:l||t["aria-label"],getDisablePointerSelection:()=>s.current.disablePointerSelection,listId:S,inputId:T,labelId:w,listInnerRef:x}),[]);function R(O,k){var N,A;let F=(A=(N=s.current)==null?void 0:N.filter)!=null?A:Rb;return O?F(O,n.current.search,k):0}function W(){if(!n.current.search||s.current.shouldFilter===!1)return;let O=n.current.filtered.items,k=[];n.current.filtered.groups.forEach(A=>{let F=i.current.get(A),B=0;F.forEach(L=>{let X=O.get(L);B=Math.max(X,B)}),k.push([A,B])});let N=x.current;z().sort((A,F)=>{var B,L;let X=A.getAttribute("id"),ee=F.getAttribute("id");return((B=O.get(ee))!=null?B:0)-((L=O.get(X))!=null?L:0)}).forEach(A=>{let F=A.closest(ro);F?F.appendChild(A.parentElement===F?A:A.closest(`${ro} > *`)):N.appendChild(A.parentElement===N?A:A.closest(`${ro} > *`))}),k.sort((A,F)=>F[1]-A[1]).forEach(A=>{var F;let B=(F=x.current)==null?void 0:F.querySelector(`${Nn}[${wt}="${encodeURIComponent(A[0])}"]`);B==null||B.parentElement.appendChild(B)})}function M(){let O=z().find(N=>N.getAttribute("aria-disabled")!=="true"),k=O==null?void 0:O.getAttribute(wt);P.setState("value",k||void 0)}function H(){var O,k,N,A;if(!n.current.search||s.current.shouldFilter===!1){n.current.filtered.count=r.current.size;return}n.current.filtered.groups=new Set;let F=0;for(let B of r.current){let L=(k=(O=o.current.get(B))==null?void 0:O.value)!=null?k:"",X=(A=(N=o.current.get(B))==null?void 0:N.keywords)!=null?A:[],ee=R(L,X);n.current.filtered.items.set(B,ee),ee>0&&F++}for(let[B,L]of i.current)for(let X of L)if(n.current.filtered.items.get(X)>0){n.current.filtered.groups.add(B);break}n.current.filtered.count=F}function E(){var O,k,N;let A=_();A&&(((O=A.parentElement)==null?void 0:O.firstChild)===A&&((N=(k=A.closest(Nn))==null?void 0:k.querySelector(kb))==null||N.scrollIntoView({block:"nearest"})),A.scrollIntoView({block:"nearest"}))}function _(){var O;return(O=x.current)==null?void 0:O.querySelector(`${Ra}[aria-selected="true"]`)}function z(){var O;return Array.from(((O=x.current)==null?void 0:O.querySelectorAll(hl))||[])}function U(O){let k=z()[O];k&&P.setState("value",k.getAttribute(wt))}function Y(O){var k;let N=_(),A=z(),F=A.findIndex(L=>L===N),B=A[F+O];(k=s.current)!=null&&k.loop&&(B=F+O<0?A[A.length-1]:F+O===A.length?A[0]:A[F+O]),B&&P.setState("value",B.getAttribute(wt))}function K(O){let k=_(),N=k==null?void 0:k.closest(Nn),A;for(;N&&!A;)N=O>0?Hb(N,Nn):Bb(N,Nn),A=N==null?void 0:N.querySelector(hl);A?P.setState("value",A.getAttribute(wt)):Y(O)}let q=()=>U(z().length-1),re=O=>{O.preventDefault(),O.metaKey?q():O.altKey?K(1):Y(1)},j=O=>{O.preventDefault(),O.metaKey?U(0):O.altKey?K(-1):Y(-1)};return C.createElement(be.div,{ref:e,tabIndex:-1,...y,"cmdk-root":"",onKeyDown:O=>{var k;if((k=y.onKeyDown)==null||k.call(y,O),!O.defaultPrevented)switch(O.key){case"n":case"j":{v&&O.ctrlKey&&re(O);break}case"ArrowDown":{re(O);break}case"p":case"k":{v&&O.ctrlKey&&j(O);break}case"ArrowUp":{j(O);break}case"Home":{O.preventDefault(),U(0);break}case"End":{O.preventDefault(),q();break}case"Enter":if(!O.nativeEvent.isComposing&&O.keyCode!==229){O.preventDefault();let N=_();if(N){let A=new Event(Go);N.dispatchEvent(A)}}}}},C.createElement("label",{"cmdk-label":"",htmlFor:b.inputId,id:b.labelId,style:Vb},l),$i(t,O=>C.createElement(rf.Provider,{value:P},C.createElement(nf.Provider,{value:b},O))))}),Nb=C.forwardRef((t,e)=>{var n,r;let i=it(),o=C.useRef(null),a=C.useContext(of),s=sr(),l=sf(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=lf(i,o,[t.value,t.children,o],t.keywords),h=Na(),p=Lt(I=>I.value&&I.value===c.current),g=Lt(I=>u||s.filter()===!1?!0:I.search?I.filtered.items.get(i)>0:!0);C.useEffect(()=>{let I=o.current;if(!(!I||t.disabled))return I.addEventListener(Go,m),()=>I.removeEventListener(Go,m)},[g,t.onSelect,t.disabled]);function m(){var I,P;f(),(P=(I=l.current).onSelect)==null||P.call(I,c.current)}function f(){h.setState("value",c.current,!0)}if(!g)return null;let{disabled:v,value:y,onSelect:S,forceMount:w,keywords:T,...x}=t;return C.createElement(be.div,{ref:Zn([o,e]),...x,id:i,"cmdk-item":"",role:"option","aria-disabled":!!v,"aria-selected":!!p,"data-disabled":!!v,"data-selected":!!p,onPointerMove:v||s.getDisablePointerSelection()?void 0:f,onClick:v?void 0:m},t.children)}),Mb=C.forwardRef((t,e)=>{let{heading:n,children:r,forceMount:i,...o}=t,a=it(),s=C.useRef(null),l=C.useRef(null),u=it(),c=sr(),h=Lt(g=>i||c.filter()===!1?!0:g.search?g.filtered.groups.has(a):!0);Kt(()=>c.group(a),[]),lf(a,s,[t.value,t.heading,l]);let p=C.useMemo(()=>({id:a,forceMount:i}),[i]);return C.createElement(be.div,{ref:Zn([s,e]),...o,"cmdk-group":"",role:"presentation",hidden:h?void 0:!0},n&&C.createElement("div",{ref:l,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),$i(t,g=>C.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},C.createElement(of.Provider,{value:p},g))))}),Ab=C.forwardRef((t,e)=>{let{alwaysRender:n,...r}=t,i=C.useRef(null),o=Lt(a=>!a.search);return!n&&!o?null:C.createElement(be.div,{ref:Zn([i,e]),...r,"cmdk-separator":"",role:"separator"})}),Kb=C.forwardRef((t,e)=>{let{onValueChange:n,...r}=t,i=t.value!=null,o=Na(),a=Lt(c=>c.search),s=Lt(c=>c.value),l=sr(),u=C.useMemo(()=>{var c;let h=(c=l.listInnerRef.current)==null?void 0:c.querySelector(`${Ra}[${wt}="${encodeURIComponent(s)}"]`);return h==null?void 0:h.getAttribute("id")},[]);return C.useEffect(()=>{t.value!=null&&o.setState("search",t.value)},[t.value]),C.createElement(be.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)}})}),Lb=C.forwardRef((t,e)=>{let{children:n,label:r="Suggestions",...i}=t,o=C.useRef(null),a=C.useRef(null),s=sr();return C.useEffect(()=>{if(a.current&&o.current){let l=a.current,u=o.current,c,h=new ResizeObserver(()=>{c=requestAnimationFrame(()=>{let p=l.offsetHeight;u.style.setProperty("--cmdk-list-height",p.toFixed(1)+"px")})});return h.observe(l),()=>{cancelAnimationFrame(c),h.unobserve(l)}}},[]),C.createElement(be.div,{ref:Zn([o,e]),...i,"cmdk-list":"",role:"listbox","aria-label":r,id:s.listId},$i(t,l=>C.createElement("div",{ref:Zn([a,s.listInnerRef]),"cmdk-list-sizer":""},l)))}),Fb=C.forwardRef((t,e)=>{let{open:n,onOpenChange:r,overlayClassName:i,contentClassName:o,container:a,...s}=t;return C.createElement(Pb,{open:n,onOpenChange:r},C.createElement(Ob,{container:a},C.createElement(Ib,{"cmdk-overlay":"",className:i}),C.createElement(_b,{"aria-label":t.label,"cmdk-dialog":"",className:o},C.createElement(af,{ref:e,...s}))))}),jb=C.forwardRef((t,e)=>Lt(n=>n.filtered.count===0)?C.createElement(be.div,{ref:e,...t,"cmdk-empty":"",role:"presentation"}):null),zb=C.forwardRef((t,e)=>{let{progress:n,children:r,label:i="Loading...",...o}=t;return C.createElement(be.div,{ref:e,...o,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":i},$i(t,a=>C.createElement("div",{"aria-hidden":!0},a)))}),Qn=Object.assign(af,{List:Lb,Item:Nb,Input:Kb,Group:Mb,Separator:Ab,Dialog:Fb,Empty:jb,Loading:zb});function Hb(t,e){let n=t.nextElementSibling;for(;n;){if(n.matches(e))return n;n=n.nextElementSibling}}function Bb(t,e){let n=t.previousElementSibling;for(;n;){if(n.matches(e))return n;n=n.previousElementSibling}}function sf(t){let e=C.useRef(t);return Kt(()=>{e.current=t}),e}var Kt=typeof window>"u"?C.useEffect:C.useLayoutEffect;function sn(t){let e=C.useRef();return e.current===void 0&&(e.current=t()),e}function Zn(t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function Lt(t){let e=Na(),n=()=>t(e.snapshot());return da.useSyncExternalStore(e.subscribe,n,n)}function lf(t,e,n,r=[]){let i=C.useRef(),o=sr();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(wt,s),i.current=s}),i}var Wb=()=>{let[t,e]=C.useState(),n=sn(()=>new Map);return Kt(()=>{n.current.forEach(r=>r()),n.current=new Map},[t]),(r,i)=>{n.current.set(r,i),e({})}};function Ub(t){let e=t.type;return typeof e=="function"?e(t.props):"render"in e?e.render(t.props):t}function $i({asChild:t,children:e},n){return t&&C.isValidElement(e)?C.cloneElement(Ub(e),{ref:e.ref},n(e.props.children)):n(e)}var Vb={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const qo=({withPadding:t=!0})=>D.jsx("div",{className:ot("c__horizontal-separator",{"with-padding":t})}),uf=({loading:t,inputValue:e,onFilter:n,placeholder:r,children:i,withSeparator:o=!0})=>{const{t:a}=mn.useCunningham();return i?D.jsxs(D.Fragment,{children:[i,o&&D.jsx(qo,{})]}):D.jsxs(D.Fragment,{children:[D.jsxs("div",{className:"quick-search-input-container",children:[!t&&D.jsx("span",{className:"material-icons",children:"search"}),t&&D.jsx("div",{children:D.jsx(Da,{size:"sm"})}),D.jsx(Qn.Input,{autoFocus:!0,"aria-label":a("Quick search input"),onClick:s=>{s.stopPropagation()},role:"combobox",value:e,placeholder:r,onValueChange:n})]}),o&&D.jsx(qo,{withPadding:!1})]})},Gb=t=>{let e=!1;return d.Children.forEach(t,n=>{e=e||!!n}),e},qb=({onFilter:t,inputContent:e,inputValue:n,loading:r,showInput:i=!0,label:o,placeholder:a,children:s})=>{const l=d.useRef(null);return D.jsx(D.Fragment,{children:D.jsx("div",{className:"quick-search-container",children:D.jsxs(Qn,{label:o,shouldFilter:!1,ref:l,children:[i&&D.jsx(uf,{loading:r,withSeparator:Gb(s),inputValue:n,onFilter:t,placeholder:a,children:e}),D.jsx(Qn.List,{children:D.jsx("div",{children:s})})]})})})},Mr=({children:t,onSelect:e,id:n})=>D.jsx(Qn.Item,{value:n,onSelect:e,children:t}),Yb=({group:t,onSelect:e,renderElement:n})=>{var r,i;return!t.showWhenEmpty&&t.elements.length===0?null:D.jsx("div",{className:"pt-base",children:D.jsxs(Qn.Group,{heading:t.groupName,forceMount:!1,children:[(r=t.startActions)==null?void 0:r.map((o,a)=>D.jsx(Mr,{onSelect:o.onSelect,children:o.content},`${t.groupName}-action-${a}`)),t.elements.map((o,a)=>D.jsx(Mr,{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)=>D.jsx(Mr,{onSelect:o.onSelect,children:o.content},`${t.groupName}-action-${a}`)),t.emptyString&&t.elements.length===0&&D.jsx("span",{className:"ml-b clr-greyscale-500",children:t.emptyString})]},t.groupName)})},Xb=({alwaysShowRight:t,left:e,right:n})=>{const{isDesktop:r}=ar();return D.jsxs("div",{className:"c__quick-search-item-template",children:[D.jsx("div",{className:"c__quick-search-item-template__left",children:e}),r&&n&&D.jsx("div",{className:ot("c__quick-search-item-template__right",{"show-right-on-focus":t}),children:n})]})},Jb=({tabs:t,defaultSelectedTab:e,fullWidth:n=!1})=>t.length===0?null:D.jsx("div",{className:ot("c__tabs",{"c__tabs__full-width":n}),children:D.jsxs(rm,{defaultSelectedKey:e,children:[D.jsx(om,{"aria-label":"History of Ancient Rome",children:t.map(r=>D.jsxs(sm,{id:r.id,children:[r.icon&&D.jsx("span",{className:"material-icons",children:r.icon}),r.label]},r.id))}),t.map(r=>D.jsx(lm,{id:r.id,children:r.content},r.id))]})}),cf=d.createContext(null);function Oe(){const t=d.useContext(cf);if(t===null)throw new Error("No Tree Api Provided");return t}const df=d.createContext(null);function Qb(){const t=d.useContext(df);if(t===null)throw new Error("Provide a NodesContext");return t}const ff=d.createContext(null);function Zb(){const t=d.useContext(ff);if(t===null)throw new Error("Provide a DnDContext");return t}const hf=d.createContext(0);function pf(){d.useContext(hf)}function Ar(t,e,n){return Math.max(Math.min(t,n),e)}function gf(t){return t&&t.isLeaf}function vf(t){return t&&t.isInternal&&!t.isOpen}function mf(t){var e;return t&&t.isOpen&&!(!((e=t.children)===null||e===void 0)&&e.length)}const yf=(t,e)=>{let n=t;for(;n;){if(n.id===e.id)return!0;n=n.parent}return!1},bf=t=>{if(!t.parent)throw Error("Node does not have a parent");return t.parent.children.findIndex(e=>e.id===t.id)};function eS(){}function Ma(t,e){if(!t)return null;if(t.id===e)return t;if(t.children)for(let n of t.children){const r=Ma(n,e);if(r)return r}return null}function oi(t,e){if(e(t),t.children)for(let n of t.children)oi(n,e)}function Sf(t){const e=Ef(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=tS(e,r);break}n==null||n.focus()}function wf(t){const e=Ef(t);let n;for(let r=0;r<e.length;++r)if(e[r]===t){n=nS(e,r);break}n==null||n.focus()}function tS(t,e){return e+1<t.length?t[e+1]:t[0]}function nS(t,e){return e-1>=0?t[e-1]:t[t.length-1]}function Ef(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 zn(t,e){return typeof e=="boolean"?e:typeof e=="string"?t[e]:e(t)}function $f(t){return t===null?null:Et(t)}function Et(t){return typeof t=="string"?t:t.id}function rS(...t){return e=>{t.forEach(n=>{typeof n=="function"?n(e):n!=null&&(n.current=e)})}}function xf(t,...e){if(t)return t(...e)}function Cf(t){return new Promise((e,n)=>{let r=0;function i(){r+=1,r===100&&n(),t()?e():setTimeout(i,10)}i()})}function Tf(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 Df(t){const e=t.focusedNode;return e?e.isOpen?e.id:e.parent&&!e.parent.isRoot?e.parent.id:null:null}const iS=Object.freeze(Object.defineProperty({__proto__:null,access:zn,bound:Ar,dfs:Ma,focusNextElement:Sf,focusPrevElement:wf,getInsertIndex:Tf,getInsertParentId:Df,identify:Et,identifyNull:$f,indexOf:bf,isClosed:vf,isDescendant:yf,isItem:gf,isOpenWithEmptyChildren:mf,mergeRefs:rS,noop:eS,safeRun:xf,waitFor:Cf,walk:oi},Symbol.toStringTag,{value:"Module"})),oS={display:"flex",alignItems:"center",zIndex:1},aS={flex:1,height:"2px",background:"#4B91E2",borderRadius:"1px"},sS={width:"4px",height:"4px",boxShadow:"0 0 0 3px #4B91E2",borderRadius:"50%"},lS=d.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 D.jsxs("div",{style:Object.assign(Object.assign({},oS),i),children:[D.jsx("div",{style:Object.assign({},sS)}),D.jsx("div",{style:Object.assign({},aS)})]})});function uS({node:t,attrs:e,innerRef:n,children:r}){return D.jsx("div",Object.assign({},e,{ref:n,onFocus:i=>i.stopPropagation(),onClick:t.handleClick,children:r}))}function cS(t){return D.jsxs("div",{ref:t.dragHandle,style:t.style,children:[D.jsx("span",{onClick:e=>{e.stopPropagation(),t.node.toggle()},children:t.node.isLeaf?"🌳":t.node.isOpen?"🗁":"🗀"})," ",t.node.isEditing?D.jsx(fS,Object.assign({},t)):D.jsx(dS,Object.assign({},t))]})}function dS(t){return D.jsx(D.Fragment,{children:D.jsx("span",{children:t.node.data.name})})}function fS({node:t}){const e=d.useRef();return d.useEffect(()=>{var n,r;(n=e.current)===null||n===void 0||n.focus(),(r=e.current)===null||r===void 0||r.select()},[]),D.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 io(t){return{type:"EDIT",id:t}}function hS(t={id:null},e){return e.type==="EDIT"?Object.assign(Object.assign({},t),{id:e.id}):t}function Xt(t){return{type:"FOCUS",id:t}}function pS(){return{type:"TREE_BLUR"}}function gS(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 ai{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===er}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 ai(Object.assign({},this))}edit(){return this.tree.edit(this)}}const er="__REACT_ARBORIST_INTERNAL_ROOT__";function pl(t){var e;function n(o,a,s){const l=t.accessId(o),u=new ai({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(h=>n(h,a+1,u))),u}const r=new ai({tree:t,id:er,data:{id:er},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 Yo={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 gl(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 vS(t={filtered:{},unfiltered:{}},e){return e.type.startsWith("VISIBILITY")?e.filtered?Object.assign(Object.assign({},t),{filtered:gl(t.filtered,e)}):Object.assign(Object.assign({},t),{unfiltered:gl(t.unfiltered,e)}):t}const wn=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}}},Fe={clear:()=>({type:"SELECTION_CLEAR"}),only:t=>({type:"SELECTION_ONLY",id:Et(t)}),add:t=>({type:"SELECTION_ADD",ids:(Array.isArray(t)?t:[t]).map(Et)}),remove:t=>({type:"SELECTION_REMOVE",ids:(Array.isArray(t)?t:[t]).map(Et)}),set:t=>Object.assign({type:"SELECTION_SET"},t),mostRecent:t=>({type:"SELECTION_MOST_RECENT",id:t===null?null:Et(t)}),anchor:t=>({type:"SELECTION_ANCHOR",id:t===null?null:Et(t)})};function mS(t=wn().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 En={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 yS(t=wn().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 wn().dnd;case"DND_HOVERING":return Object.assign(Object.assign({},t),{parentId:e.parentId,index:e.index});default:return t}}const bS={position:"fixed",pointerEvents:"none",zIndex:100,left:0,top:0,width:"100%",height:"100%"},SS=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e}px, ${n}px)`}},wS=t=>{if(!t)return{display:"none"};const{x:e,y:n}=t;return{transform:`translate(${e+10}px, ${n+10}px)`}};function Pf({offset:t,mouse:e,id:n,dragIds:r,isDragging:i}){return D.jsxs(ES,{isDragging:i,children:[D.jsx($S,{offset:t,children:D.jsx(CS,{id:n,dragIds:r})}),D.jsx(xS,{mouse:e,count:r.length})]})}const ES=d.memo(function(e){return e.isDragging?D.jsx("div",{style:bS,children:e.children}):null});function $S(t){return D.jsx("div",{className:"row preview",style:SS(t.offset),children:t.children})}function xS(t){const{count:e,mouse:n}=t;return e>1?D.jsx("div",{className:"selected-count",style:wS(n),children:e}):null}const CS=d.memo(function(e){const n=Oe(),r=n.get(e.id);return r?D.jsx(n.renderNode,{preview:!0,node:r,style:{paddingLeft:r.level*n.indent,opacity:.2,background:"transparent"},tree:n}):null});function Xo(){return Xo=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},Xo.apply(null,arguments)}function vl(t){if(t===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function Jo(t,e){return Jo=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(n,r){return n.__proto__=r,n},Jo(t,e)}function TS(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,Jo(t,e)}var ml=Number.isNaN||function(e){return typeof e=="number"&&e!==e};function DS(t,e){return!!(t===e||ml(t)&&ml(e))}function PS(t,e){if(t.length!==e.length)return!1;for(var n=0;n<t.length;n++)if(!DS(t[n],e[n]))return!1;return!0}function oo(t,e){e===void 0&&(e=PS);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 OS=typeof performance=="object"&&typeof performance.now=="function",yl=OS?function(){return performance.now()}:function(){return Date.now()};function bl(t){cancelAnimationFrame(t.id)}function IS(t,e){var n=yl();function r(){yl()-n>=e?t.call(null):i.id=requestAnimationFrame(r)}var i={id:requestAnimationFrame(r)};return i}var ao=-1;function Sl(t){if(t===void 0&&(t=!1),ao===-1||t){var e=document.createElement("div"),n=e.style;n.width="50px",n.height="50px",n.overflow="scroll",document.body.appendChild(e),ao=e.offsetWidth-e.clientWidth,document.body.removeChild(e)}return ao}var Jt=null;function wl(t){if(t===void 0&&(t=!1),Jt===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?Jt="positive-descending":(e.scrollLeft=1,e.scrollLeft===0?Jt="negative":Jt="positive-ascending"),document.body.removeChild(e),Jt}return Jt}process.env.NODE_ENV;var _S=150,kS=function(e,n){return e},Kr=null,Lr=null;process.env.NODE_ENV!=="production"&&typeof window<"u"&&typeof window.WeakSet<"u"&&(Kr=new WeakSet,Lr=new WeakSet);function RS(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(h){TS(p,h);function p(m){var f;return f=h.call(this,m)||this,f._instanceProps=l(f.props,vl(f)),f._outerRef=void 0,f._resetIsScrollingTimeoutId=null,f.state={instance:vl(f),isScrolling:!1,scrollDirection:"forward",scrollOffset:typeof f.props.initialScrollOffset=="number"?f.props.initialScrollOffset:0,scrollUpdateWasRequested:!1},f._callOnItemsRendered=void 0,f._callOnItemsRendered=oo(function(v,y,S,w){return f.props.onItemsRendered({overscanStartIndex:v,overscanStopIndex:y,visibleStartIndex:S,visibleStopIndex:w})}),f._callOnScroll=void 0,f._callOnScroll=oo(function(v,y,S){return f.props.onScroll({scrollDirection:v,scrollOffset:y,scrollUpdateWasRequested:S})}),f._getItemStyle=void 0,f._getItemStyle=function(v){var y=f.props,S=y.direction,w=y.itemSize,T=y.layout,x=f._getItemStyleCache(u&&w,u&&T,u&&S),I;if(x.hasOwnProperty(v))I=x[v];else{var P=n(f.props,v,f._instanceProps),b=i(f.props,v,f._instanceProps),R=S==="horizontal"||T==="horizontal",W=S==="rtl",M=R?P:0;x[v]=I={position:"absolute",left:W?void 0:M,right:W?M:void 0,top:R?0:P,height:R?"100%":b,width:R?b:"100%"}}return I},f._getItemStyleCache=void 0,f._getItemStyleCache=oo(function(v,y,S){return{}}),f._onScrollHorizontal=function(v){var y=v.currentTarget,S=y.clientWidth,w=y.scrollLeft,T=y.scrollWidth;f.setState(function(x){if(x.scrollOffset===w)return null;var I=f.props.direction,P=w;if(I==="rtl")switch(wl()){case"negative":P=-w;break;case"positive-descending":P=T-S-w;break}return P=Math.max(0,Math.min(P,T-S)),{isScrolling:!0,scrollDirection:x.scrollOffset<P?"forward":"backward",scrollOffset:P,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._onScrollVertical=function(v){var y=v.currentTarget,S=y.clientHeight,w=y.scrollHeight,T=y.scrollTop;f.setState(function(x){if(x.scrollOffset===T)return null;var I=Math.max(0,Math.min(T,w-S));return{isScrolling:!0,scrollDirection:x.scrollOffset<I?"forward":"backward",scrollOffset:I,scrollUpdateWasRequested:!1}},f._resetIsScrollingDebounced)},f._outerRefSetter=function(v){var y=f.props.outerRef;f._outerRef=v,typeof y=="function"?y(v):y!=null&&typeof y=="object"&&y.hasOwnProperty("current")&&(y.current=v)},f._resetIsScrollingDebounced=function(){f._resetIsScrollingTimeoutId!==null&&bl(f._resetIsScrollingTimeoutId),f._resetIsScrollingTimeoutId=IS(f._resetIsScrolling,_S)},f._resetIsScrolling=function(){f._resetIsScrollingTimeoutId=null,f.setState({isScrolling:!1},function(){f._getItemStyleCache(-1,null)})},f}p.getDerivedStateFromProps=function(f,v){return NS(f,v),c(f),null};var g=p.prototype;return g.scrollTo=function(f){f=Math.max(0,f),this.setState(function(v){return v.scrollOffset===f?null:{scrollDirection:v.scrollOffset<f?"forward":"backward",scrollOffset:f,scrollUpdateWasRequested:!0}},this._resetIsScrollingDebounced)},g.scrollToItem=function(f,v){v===void 0&&(v="auto");var y=this.props,S=y.itemCount,w=y.layout,T=this.state.scrollOffset;f=Math.max(0,Math.min(f,S-1));var x=0;if(this._outerRef){var I=this._outerRef;w==="vertical"?x=I.scrollWidth>I.clientWidth?Sl():0:x=I.scrollHeight>I.clientHeight?Sl():0}this.scrollTo(o(this.props,f,v,T,this._instanceProps,x))},g.componentDidMount=function(){var f=this.props,v=f.direction,y=f.initialScrollOffset,S=f.layout;if(typeof y=="number"&&this._outerRef!=null){var w=this._outerRef;v==="horizontal"||S==="horizontal"?w.scrollLeft=y:w.scrollTop=y}this._callPropsCallbacks()},g.componentDidUpdate=function(){var f=this.props,v=f.direction,y=f.layout,S=this.state,w=S.scrollOffset,T=S.scrollUpdateWasRequested;if(T&&this._outerRef!=null){var x=this._outerRef;if(v==="horizontal"||y==="horizontal")if(v==="rtl")switch(wl()){case"negative":x.scrollLeft=-w;break;case"positive-ascending":x.scrollLeft=w;break;default:var I=x.clientWidth,P=x.scrollWidth;x.scrollLeft=P-I-w;break}else x.scrollLeft=w;else x.scrollTop=w}this._callPropsCallbacks()},g.componentWillUnmount=function(){this._resetIsScrollingTimeoutId!==null&&bl(this._resetIsScrollingTimeoutId)},g.render=function(){var f=this.props,v=f.children,y=f.className,S=f.direction,w=f.height,T=f.innerRef,x=f.innerElementType,I=f.innerTagName,P=f.itemCount,b=f.itemData,R=f.itemKey,W=R===void 0?kS:R,M=f.layout,H=f.outerElementType,E=f.outerTagName,_=f.style,z=f.useIsScrolling,U=f.width,Y=this.state.isScrolling,K=S==="horizontal"||M==="horizontal",q=K?this._onScrollHorizontal:this._onScrollVertical,re=this._getRangeToRender(),j=re[0],O=re[1],k=[];if(P>0)for(var N=j;N<=O;N++)k.push(d.createElement(v,{data:b,key:W(N,b),index:N,isScrolling:z?Y:void 0,style:this._getItemStyle(N)}));var A=r(this.props,this._instanceProps);return d.createElement(H||E||"div",{className:y,onScroll:q,ref:this._outerRefSetter,style:Xo({position:"relative",height:w,width:U,overflow:"auto",WebkitOverflowScrolling:"touch",willChange:"transform",direction:S},_)},d.createElement(x||I||"div",{children:k,ref:T,style:{height:K?"100%":A,pointerEvents:Y?"none":void 0,width:K?A:"100%"}}))},g._callPropsCallbacks=function(){if(typeof this.props.onItemsRendered=="function"){var f=this.props.itemCount;if(f>0){var v=this._getRangeToRender(),y=v[0],S=v[1],w=v[2],T=v[3];this._callOnItemsRendered(y,S,w,T)}}if(typeof this.props.onScroll=="function"){var x=this.state,I=x.scrollDirection,P=x.scrollOffset,b=x.scrollUpdateWasRequested;this._callOnScroll(I,P,b)}},g._getRangeToRender=function(){var f=this.props,v=f.itemCount,y=f.overscanCount,S=this.state,w=S.isScrolling,T=S.scrollDirection,x=S.scrollOffset;if(v===0)return[0,0,0,0];var I=a(this.props,x,this._instanceProps),P=s(this.props,I,x,this._instanceProps),b=!w||T==="backward"?Math.max(1,y):1,R=!w||T==="forward"?Math.max(1,y):1;return[Math.max(0,I-b),Math.max(0,Math.min(v-1,P+R)),I,P]},p}(d.PureComponent),e.defaultProps={direction:"ltr",itemData:void 0,layout:"vertical",overscanCount:2,useIsScrolling:!1},e}var NS=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)&&Lr&&!Lr.has(c)&&(Lr.add(c),console.warn("The innerTagName and outerTagName props have been deprecated. Please use the innerElementType and outerElementType props instead."));var h=i==="horizontal"||a==="horizontal";switch(i){case"horizontal":case"vertical":Kr&&!Kr.has(c)&&(Kr.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(h&&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(!h&&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.'))}},MS=RS({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,h=e.layout,p=e.width,g=s==="horizontal"||h==="horizontal",m=g?p:l,f=Math.max(0,u*c-m),v=Math.min(f,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 S=Math.round(y+(v-y)/2);return S<Math.ceil(m/2)?0:S>f+Math.floor(m/2)?f:S}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",h=n*s,p=c?u:o,g=Math.ceil((p+r-h)/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 AS(){var t,e;const n=Oe(),i=Zb().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 D.jsx(l,{top:a,left:s,indent:o})}var KS=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 LS=d.forwardRef(function(e,n){const{children:r}=e,i=KS(e,["children"]),o=Oe();return D.jsxs("div",Object.assign({ref:n},i,{onClick:a=>{a.currentTarget===a.target&&o.deselectAll()},children:[D.jsx(FS,{}),r]}))}),FS=()=>{const t=Oe();return D.jsx("div",{style:{height:t.visibleNodes.length*t.rowHeight,width:"100%",position:"absolute",left:"0",right:"0"},children:D.jsx(AS,{})})};var jS=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 zS=d.forwardRef(function(e,n){var r,i,o,a,{style:s}=e,l=jS(e,["style"]);const u=Oe(),c=(i=(r=u.props.padding)!==null&&r!==void 0?r:u.props.paddingTop)!==null&&i!==void 0?i:0,h=(a=(o=u.props.padding)!==null&&o!==void 0?o:u.props.paddingBottom)!==null&&a!==void 0?a:0;return D.jsx("div",Object.assign({ref:n,style:Object.assign(Object.assign({},s),{height:`${parseFloat(s.height)+c+h}px`})},l))});var Of=d.createContext({dragDropManager:void 0}),Me;(function(t){t.SOURCE="SOURCE",t.TARGET="TARGET"})(Me||(Me={}));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 Aa="dnd-core/INIT_COORDS",xi="dnd-core/BEGIN_DRAG",Ka="dnd-core/PUBLISH_DRAG_SOURCE",Ci="dnd-core/HOVER",Ti="dnd-core/DROP",Di="dnd-core/END_DRAG";function El(t,e){return{type:Aa,payload:{sourceClientOffset:e||null,clientOffset:t||null}}}function Fr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Fr=function(n){return typeof n}:Fr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Fr(t)}function HS(t,e,n){return e.split(".").reduce(function(r,i){return r&&r[i]?r[i]:n},t)}function BS(t,e){return t.filter(function(n){return n!==e})}function If(t){return Fr(t)==="object"}function WS(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 US(t,e){return t.filter(function(n){return e.indexOf(n)>-1})}var VS={type:Aa,payload:{clientOffset:null,sourceClientOffset:null}};function GS(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(El(a)),qS(n,l,u);var c=JS(n,l);if(c===null){t.dispatch(VS);return}var h=null;if(a){if(!s)throw new Error("getSourceClientOffset must be defined");YS(s),h=s(c)}t.dispatch(El(a,h));var p=u.getSource(c),g=p.beginDrag(l,c);if(g!=null){XS(g),u.pinSource(c);var m=u.getSourceType(c);return{type:xi,payload:{itemType:m,item:g,sourceId:c,clientOffset:a||null,sourceClientOffset:h||null,isSourcePublic:!!o}}}}}function qS(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 YS(t){J(typeof t=="function","When clientOffset is provided, getSourceClientOffset must be a function.")}function XS(t){J(If(t),"Item must be an object.")}function JS(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 QS(t){return function(){var n=t.getMonitor();if(n.isDragging())return{type:Ka}}}function Qo(t,e){return e===null?t===null:Array.isArray(t)?t.some(function(n){return n===e}):t===e}function ZS(t){return function(n){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},i=r.clientOffset;ew(n);var o=n.slice(0),a=t.getMonitor(),s=t.getRegistry();tw(o,a,s);var l=a.getItemType();return nw(o,s,l),rw(o,a,s),{type:Ci,payload:{targetIds:o,clientOffset:i||null}}}}function ew(t){J(Array.isArray(t),"Expected targetIds to be an array.")}function tw(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 nw(t,e,n){for(var r=t.length-1;r>=0;r--){var i=t[r],o=e.getTargetType(i);Qo(o,n)||t.splice(r,1)}}function rw(t,e,n){t.forEach(function(r){var i=n.getTarget(r);i.hover(e,r)})}function $l(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 xl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?$l(Object(n),!0).forEach(function(r){iw(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):$l(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function iw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function ow(t){return function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},r=t.getMonitor(),i=t.getRegistry();aw(r);var o=uw(r);o.forEach(function(a,s){var l=sw(a,s,i,r),u={type:Ti,payload:{dropResult:xl(xl({},n),l)}};t.dispatch(u)})}}function aw(t){J(t.isDragging(),"Cannot call drop while not dragging."),J(!t.didDrop(),"Cannot call drop twice during one drag operation.")}function sw(t,e,n,r){var i=n.getTarget(t),o=i?i.drop(r,t):void 0;return lw(o),typeof o>"u"&&(o=e===0?{}:r.getDropResult()),o}function lw(t){J(typeof t>"u"||If(t),"Drop result must either be an object or undefined.")}function uw(t){var e=t.getTargetIds().filter(t.canDropOnTarget,t);return e.reverse(),e}function cw(t){return function(){var n=t.getMonitor(),r=t.getRegistry();dw(n);var i=n.getSourceId();if(i!=null){var o=r.getSource(i,!0);o.endDrag(n,i),r.unpinSource()}return{type:Di}}}function dw(t){J(t.isDragging(),"Cannot call endDrag while not dragging.")}function fw(t){return{beginDrag:GS(t),publishDragSource:QS(t),hover:ZS(t),drop:ow(t),endDrag:cw(t)}}function hw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function pw(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 gw(t,e,n){return pw(t.prototype,e),t}function Mn(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var vw=function(){function t(e,n){var r=this;hw(this,t),Mn(this,"store",void 0),Mn(this,"monitor",void 0),Mn(this,"backend",void 0),Mn(this,"isSetUp",!1),Mn(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 gw(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=fw(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 _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 Cl=function(){return typeof Symbol=="function"&&Symbol.observable||"@@observable"}(),so=function(){return Math.random().toString(36).substring(7).split("").join(".")},Tl={INIT:"@@redux/INIT"+so(),REPLACE:"@@redux/REPLACE"+so(),PROBE_UNKNOWN_ACTION:function(){return"@@redux/PROBE_UNKNOWN_ACTION"+so()}};function mw(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 yw(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(ww(t))return"date";if(Sw(t))return"error";var n=bw(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 bw(t){return typeof t.constructor=="function"?t.constructor.name:null}function Sw(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function ww(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function Qt(t){var e=typeof t;return process.env.NODE_ENV!=="production"&&(e=yw(t)),e}function _f(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"?_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: '"+Qt(n)+"'");return n(_f)(t,e)}if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?_e(2):"Expected the root reducer to be a function. Instead, received: '"+Qt(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"?_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 o}function h(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?_e(4):"Expected the listener to be a function. Instead, received: '"+Qt(f)+"'");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.");var v=!0;return u(),s.push(f),function(){if(v){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.");v=!1,u();var S=s.indexOf(f);s.splice(S,1),a=null}}}function p(f){if(!mw(f))throw new Error(process.env.NODE_ENV==="production"?_e(7):"Actions must be plain objects. Instead, the actual type was: '"+Qt(f)+"'. 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 f.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(l)throw new Error(process.env.NODE_ENV==="production"?_e(9):"Reducers may not dispatch actions.");try{l=!0,o=i(o,f)}finally{l=!1}for(var v=a=s,y=0;y<v.length;y++){var S=v[y];S()}return f}function g(f){if(typeof f!="function")throw new Error(process.env.NODE_ENV==="production"?_e(10):"Expected the nextReducer to be a function. Instead, received: '"+Qt(f));i=f,p({type:Tl.REPLACE})}function m(){var f,v=h;return f={subscribe:function(S){if(typeof S!="object"||S===null)throw new Error(process.env.NODE_ENV==="production"?_e(11):"Expected the observer to be an object. Instead, received: '"+Qt(S)+"'");function w(){S.next&&S.next(c())}w();var T=v(w);return{unsubscribe:T}}},f[Cl]=function(){return this},f}return p({type:Tl.INIT}),r={dispatch:p,subscribe:h,getState:c,replaceReducer:g},r[Cl]=m,r}var Ew=function(e,n){return e===n};function $w(t,e){return!t&&!e?!0:!t||!e?!1:t.x===e.x&&t.y===e.y}function xw(t,e){var n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Ew;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 Dl(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 Pl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Dl(Object(n),!0).forEach(function(r){Cw(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Dl(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Cw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Ol={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function Tw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Ol,e=arguments.length>1?arguments[1]:void 0,n=e.payload;switch(e.type){case Aa:case xi:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case Ci:return $w(t.clientOffset,n.clientOffset)?t:Pl(Pl({},t),{},{clientOffset:n.clientOffset});case Di:case Ti:return Ol;default:return t}}var La="dnd-core/ADD_SOURCE",Fa="dnd-core/ADD_TARGET",ja="dnd-core/REMOVE_SOURCE",Pi="dnd-core/REMOVE_TARGET";function Dw(t){return{type:La,payload:{sourceId:t}}}function Pw(t){return{type:Fa,payload:{targetId:t}}}function Ow(t){return{type:ja,payload:{sourceId:t}}}function Iw(t){return{type:Pi,payload:{targetId:t}}}function Il(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 ke(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?Il(Object(n),!0).forEach(function(r){_w(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):Il(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function _w(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var kw={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function Rw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:kw,e=arguments.length>1?arguments[1]:void 0,n=e.payload;switch(e.type){case xi:return ke(ke({},t),{},{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case Ka:return ke(ke({},t),{},{isSourcePublic:!0});case Ci:return ke(ke({},t),{},{targetIds:n.targetIds});case Pi:return t.targetIds.indexOf(n.targetId)===-1?t:ke(ke({},t),{},{targetIds:BS(t.targetIds,n.targetId)});case Ti:return ke(ke({},t),{},{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case Di:return ke(ke({},t),{},{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return t}}function Nw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0,e=arguments.length>1?arguments[1]:void 0;switch(e.type){case La:case Fa:return t+1;case ja:case Pi:return t-1;default:return t}}var si=[],za=[];si.__IS_NONE__=!0;za.__IS_ALL__=!0;function Mw(t,e){if(t===si)return!1;if(t===za||typeof e>"u")return!0;var n=US(e,t);return n.length>0}function Aw(){var t=arguments.length>1?arguments[1]:void 0;switch(t.type){case Ci:break;case La:case Fa:case Pi:case ja:return si;case xi:case Ka:case Di:case Ti:default:return za}var e=t.payload,n=e.targetIds,r=n===void 0?[]:n,i=e.prevTargetIds,o=i===void 0?[]:i,a=WS(r,o),s=a.length>0||!xw(r,o);if(!s)return si;var l=o[o.length-1],u=r[r.length-1];return l!==u&&(l&&a.push(l),u&&a.push(u)),a}function Kw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:0;return t+1}function _l(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 kl(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?_l(Object(n),!0).forEach(function(r){Lw(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):_l(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function Lw(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function Fw(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},e=arguments.length>1?arguments[1]:void 0;return{dirtyHandlerIds:Aw(t.dirtyHandlerIds,{type:e.type,payload:kl(kl({},e.payload),{},{prevTargetIds:HS(t,"dragOperation.targetIds",[])})}),dragOffset:Tw(t.dragOffset,e),refCount:Nw(t.refCount,e),dragOperation:Rw(t.dragOperation,e),stateId:Kw(t.stateId)}}function jw(t,e){return{x:t.x+e.x,y:t.y+e.y}}function kf(t,e){return{x:t.x-e.x,y:t.y-e.y}}function zw(t){var e=t.clientOffset,n=t.initialClientOffset,r=t.initialSourceClientOffset;return!e||!n||!r?null:kf(jw(e,r),n)}function Hw(t){var e=t.clientOffset,n=t.initialClientOffset;return!e||!n?null:kf(e,n)}function Bw(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function Ww(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 Ww(t.prototype,e),t}function Rl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Vw=function(){function t(e,n){Bw(this,t),Rl(this,"store",void 0),Rl(this,"registry",void 0),this.store=e,this.registry=n}return Uw(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 h=c===a||c===a+1&&!Mw(u.dirtyHandlerIds,o);h||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 Qo(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&&!Qo(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 zw(this.store.getState().dragOffset)}},{key:"getDifferenceFromInitialOffset",value:function(){return Hw(this.store.getState().dragOffset)}}]),t}(),Gw=0;function qw(){return Gw++}function jr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?jr=function(n){return typeof n}:jr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},jr(t)}function Yw(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 Xw(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 Zo(t,e){if(e&&Array.isArray(t)){t.forEach(function(n){return Zo(n,!1)});return}J(typeof t=="string"||jr(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 Nl=typeof global<"u"?global:self,Rf=Nl.MutationObserver||Nl.WebKitMutationObserver;function Nf(t){return function(){const n=setTimeout(i,0),r=setInterval(i,50);function i(){clearTimeout(n),clearInterval(r),t()}}}function Jw(t){let e=1;const n=new Rf(t),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){e=-e,r.data=e}}const Qw=typeof Rf=="function"?Jw:Nf;class Zw{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=Qw(this.flush),this.requestErrorThrow=Nf(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}}class e0{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 t0{create(e){const n=this.freeTasks,r=n.length?n.pop():new e0(this.onError,i=>n[n.length]=i);return r.task=e,r}constructor(e){this.onError=e,this.freeTasks=[]}}const Mf=new Zw,n0=new t0(Mf.registerPendingError);function r0(t){Mf.enqueueTask(n0.create(t))}function i0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o0(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 a0(t,e,n){return o0(t.prototype,e),t}function Zt(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function s0(t,e){return d0(t)||c0(t,e)||u0(t,e)||l0()}function l0(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
92
92
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function u0(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 c0(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 d0(t){if(Array.isArray(t))return t}function f0(t){var e=qw().toString();switch(t){case Me.SOURCE:return"S".concat(e);case Me.TARGET:return"T".concat(e);default:throw new Error("Unknown Handler Role: ".concat(t))}}function Al(t){switch(t[0]){case"S":return Me.SOURCE;case"T":return Me.TARGET;default:J(!1,"Cannot parse handler ID: ".concat(t))}}function Kl(t,e){var n=t.entries(),r=!1;do{var i=n.next(),o=i.done,a=s0(i.value,2),s=a[1];if(s===e)return!0;r=!!o}while(!r);return!1}var h0=function(){function t(e){i0(this,t),Zt(this,"types",new Map),Zt(this,"dragSources",new Map),Zt(this,"dropTargets",new Map),Zt(this,"pinnedSourceId",null),Zt(this,"pinnedSource",null),Zt(this,"store",void 0),this.store=e}return a0(t,[{key:"addSource",value:function(n,r){Zo(n),Yw(r);var i=this.addHandler(Me.SOURCE,n,r);return this.store.dispatch(Dw(i)),i}},{key:"addTarget",value:function(n,r){Zo(n,!0),Xw(r);var i=this.addHandler(Me.TARGET,n,r);return this.store.dispatch(Pw(i)),i}},{key:"containsHandler",value:function(n){return Kl(this.dragSources,n)||Kl(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=Al(n);return r===Me.SOURCE}},{key:"isTargetId",value:function(n){var r=Al(n);return r===Me.TARGET}},{key:"removeSource",value:function(n){var r=this;J(this.getSource(n),"Expected an existing source."),this.store.dispatch(Ow(n)),r0(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(Iw(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=f0(n);return this.types.set(o,r),n===Me.SOURCE?this.dragSources.set(o,i):n===Me.TARGET&&this.dropTargets.set(o,i),o}}]),t}();function p0(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=g0(r),o=new Vw(i,new h0(i)),a=new vw(i,o),s=t(a,e,n);return a.receiveBackend(s),a}function g0(t){var e=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION__;return _f(Fw,t&&e&&e({name:"dnd-core",instanceId:"dnd-core"}))}var v0=["children"];function m0(t,e){return w0(t)||S0(t,e)||b0(t,e)||y0()}function y0(){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 b0(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 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 w0(t){if(Array.isArray(t))return t}function E0(t,e){if(t==null)return{};var n=$0(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 $0(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 Fl=0,zr=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),x0=d.memo(function(e){var n=e.children,r=E0(e,v0),i=C0(r),o=m0(i,2),a=o[0],s=o[1];return d.useEffect(function(){if(s){var l=Af();return++Fl,function(){--Fl===0&&(l[zr]=null)}}},[]),T.jsx(Of.Provider,Object.assign({value:a},{children:n}),void 0)});function C0(t){if("manager"in t){var e={dragDropManager:t.manager};return[e,!1]}var n=T0(t.backend,t.context,t.options,t.debugMode),r=!t.context;return[n,r]}function T0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Af(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=e;return i[zr]||(i[zr]={dragDropManager:p0(t,e,n,r)}),i[zr]}function Af(){return typeof global<"u"?global:window}function D0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P0(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 O0(t,e,n){return P0(t.prototype,e),t}function jl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var lo=!1,uo=!1,I0=function(){function t(e){D0(this,t),jl(this,"internalMonitor",void 0),jl(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return O0(t,[{key:"receiveHandlerId",value:function(n){this.sourceId=n}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){J(!lo,"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 lo=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{lo=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;J(!uo,"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 uo=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{uo=!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 _0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k0(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 R0(t,e,n){return k0(t.prototype,e),t}function zl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var co=!1,N0=function(){function t(e){_0(this,t),zl(this,"internalMonitor",void 0),zl(this,"targetId",null),this.internalMonitor=e.getMonitor()}return R0(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(!co,"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 co=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{co=!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 M0(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 A0(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(!d.isValidElement(e)){var r=e;return t(r,n),r}var i=e;M0(i);var o=n?function(a){return t(a,n)}:t;return K0(i,o)}}function Kf(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=A0(r);e[n]=function(){return i}}}),e}function Hl(t,e){typeof t=="function"?t(e):t.current=e}function K0(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?d.cloneElement(t,{ref:function(i){Hl(n,i),Hl(e,i)}}):d.cloneElement(t,{ref:e})}function Hr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hr=function(n){return typeof n}:Hr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Hr(t)}function ea(t){return t!==null&&Hr(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ta(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],h=e[u];if(i=void 0,i===!1||i===void 0&&c!==h)return!1}return!0}function L0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F0(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 j0(t,e,n){return F0(t.prototype,e),t}function we(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var z0=function(){function t(e){var n=this;L0(this,t),we(this,"hooks",Kf({dragSource:function(i,o){n.clearDragSource(),n.dragSourceOptions=o||null,ea(i)?n.dragSourceRef=i:n.dragSourceNode=i,n.reconnectDragSource()},dragPreview:function(i,o){n.clearDragPreview(),n.dragPreviewOptions=o||null,ea(i)?n.dragPreviewRef=i:n.dragPreviewNode=i,n.reconnectDragPreview()}})),we(this,"handlerId",null),we(this,"dragSourceRef",null),we(this,"dragSourceNode",void 0),we(this,"dragSourceOptionsInternal",null),we(this,"dragSourceUnsubscribe",void 0),we(this,"dragPreviewRef",null),we(this,"dragPreviewNode",void 0),we(this,"dragPreviewOptionsInternal",null),we(this,"dragPreviewUnsubscribe",void 0),we(this,"lastConnectedHandlerId",null),we(this,"lastConnectedDragSource",null),we(this,"lastConnectedDragSourceOptions",null),we(this,"lastConnectedDragPreview",null),we(this,"lastConnectedDragPreviewOptions",null),we(this,"backend",void 0),this.backend=e}return j0(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!ta(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!ta(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 H0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B0(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 W0(t,e,n){return B0(t.prototype,e),t}function Ve(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var U0=function(){function t(e){var n=this;H0(this,t),Ve(this,"hooks",Kf({dropTarget:function(i,o){n.clearDropTarget(),n.dropTargetOptions=o,ea(i)?n.dropTargetRef=i:n.dropTargetNode=i,n.reconnect()}})),Ve(this,"handlerId",null),Ve(this,"dropTargetRef",null),Ve(this,"dropTargetNode",void 0),Ve(this,"dropTargetOptionsInternal",null),Ve(this,"unsubscribeDropTarget",void 0),Ve(this,"lastConnectedHandlerId",null),Ve(this,"lastConnectedDropTarget",null),Ve(this,"lastConnectedDropTargetOptions",null),Ve(this,"backend",void 0),this.backend=e}return W0(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!ta(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 V0(t,e,n){var r=n.getRegistry(),i=r.addTarget(t,e);return[i,function(){return r.removeTarget(i)}]}function G0(t,e,n){var r=n.getRegistry(),i=r.addSource(t,e);return[i,function(){return r.removeSource(i)}]}var Ft=typeof window<"u"?d.useLayoutEffect:d.useEffect;function Br(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Br=function(n){return typeof n}:Br=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Br(t)}function q0(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 X0(t,e,n){return Y0(t.prototype,e),t}function fo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var J0=function(){function t(e,n,r){q0(this,t),fo(this,"spec",void 0),fo(this,"monitor",void 0),fo(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return X0(t,[{key:"beginDrag",value:function(){var n,r=this.spec,i=this.monitor,o=null;return Br(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 Q0(t,e,n){var r=d.useMemo(function(){return new J0(t,e,n)},[e,n]);return d.useEffect(function(){r.spec=t},[t]),r}function Ht(){var t=d.useContext(Of),e=t.dragDropManager;return J(e!=null,"Expected drag drop context"),e}function Z0(t){return d.useMemo(function(){var e=t.type;return J(e!=null,"spec.type must be defined"),e},[t])}function eE(t,e){return iE(t)||rE(t,e)||nE(t,e)||tE()}function tE(){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 b0(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 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 w0(t){if(Array.isArray(t))return t}function E0(t,e){if(t==null)return{};var n=$0(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 $0(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 Fl=0,zr=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__"),x0=d.memo(function(e){var n=e.children,r=E0(e,v0),i=C0(r),o=m0(i,2),a=o[0],s=o[1];return d.useEffect(function(){if(s){var l=Af();return++Fl,function(){--Fl===0&&(l[zr]=null)}}},[]),D.jsx(Of.Provider,Object.assign({value:a},{children:n}),void 0)});function C0(t){if("manager"in t){var e={dragDropManager:t.manager};return[e,!1]}var n=T0(t.backend,t.context,t.options,t.debugMode),r=!t.context;return[n,r]}function T0(t){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:Af(),n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=e;return i[zr]||(i[zr]={dragDropManager:p0(t,e,n,r)}),i[zr]}function Af(){return typeof global<"u"?global:window}function D0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function P0(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 O0(t,e,n){return P0(t.prototype,e),t}function jl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var lo=!1,uo=!1,I0=function(){function t(e){D0(this,t),jl(this,"internalMonitor",void 0),jl(this,"sourceId",null),this.internalMonitor=e.getMonitor()}return O0(t,[{key:"receiveHandlerId",value:function(n){this.sourceId=n}},{key:"getHandlerId",value:function(){return this.sourceId}},{key:"canDrag",value:function(){J(!lo,"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 lo=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{lo=!1}}},{key:"isDragging",value:function(){if(!this.sourceId)return!1;J(!uo,"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 uo=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{uo=!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 _0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function k0(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 R0(t,e,n){return k0(t.prototype,e),t}function zl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var co=!1,N0=function(){function t(e){_0(this,t),zl(this,"internalMonitor",void 0),zl(this,"targetId",null),this.internalMonitor=e.getMonitor()}return R0(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(!co,"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 co=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{co=!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 M0(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 A0(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(!d.isValidElement(e)){var r=e;return t(r,n),r}var i=e;M0(i);var o=n?function(a){return t(a,n)}:t;return K0(i,o)}}function Kf(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=A0(r);e[n]=function(){return i}}}),e}function Hl(t,e){typeof t=="function"?t(e):t.current=e}function K0(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?d.cloneElement(t,{ref:function(i){Hl(n,i),Hl(e,i)}}):d.cloneElement(t,{ref:e})}function Hr(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Hr=function(n){return typeof n}:Hr=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Hr(t)}function ea(t){return t!==null&&Hr(t)==="object"&&Object.prototype.hasOwnProperty.call(t,"current")}function ta(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],h=e[u];if(i=void 0,i===!1||i===void 0&&c!==h)return!1}return!0}function L0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function F0(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 j0(t,e,n){return F0(t.prototype,e),t}function we(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var z0=function(){function t(e){var n=this;L0(this,t),we(this,"hooks",Kf({dragSource:function(i,o){n.clearDragSource(),n.dragSourceOptions=o||null,ea(i)?n.dragSourceRef=i:n.dragSourceNode=i,n.reconnectDragSource()},dragPreview:function(i,o){n.clearDragPreview(),n.dragPreviewOptions=o||null,ea(i)?n.dragPreviewRef=i:n.dragPreviewNode=i,n.reconnectDragPreview()}})),we(this,"handlerId",null),we(this,"dragSourceRef",null),we(this,"dragSourceNode",void 0),we(this,"dragSourceOptionsInternal",null),we(this,"dragSourceUnsubscribe",void 0),we(this,"dragPreviewRef",null),we(this,"dragPreviewNode",void 0),we(this,"dragPreviewOptionsInternal",null),we(this,"dragPreviewUnsubscribe",void 0),we(this,"lastConnectedHandlerId",null),we(this,"lastConnectedDragSource",null),we(this,"lastConnectedDragSourceOptions",null),we(this,"lastConnectedDragPreview",null),we(this,"lastConnectedDragPreviewOptions",null),we(this,"backend",void 0),this.backend=e}return j0(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!ta(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}},{key:"didDragPreviewOptionsChange",value:function(){return!ta(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 H0(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function B0(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 W0(t,e,n){return B0(t.prototype,e),t}function Ve(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var U0=function(){function t(e){var n=this;H0(this,t),Ve(this,"hooks",Kf({dropTarget:function(i,o){n.clearDropTarget(),n.dropTargetOptions=o,ea(i)?n.dropTargetRef=i:n.dropTargetNode=i,n.reconnect()}})),Ve(this,"handlerId",null),Ve(this,"dropTargetRef",null),Ve(this,"dropTargetNode",void 0),Ve(this,"dropTargetOptionsInternal",null),Ve(this,"unsubscribeDropTarget",void 0),Ve(this,"lastConnectedHandlerId",null),Ve(this,"lastConnectedDropTarget",null),Ve(this,"lastConnectedDropTargetOptions",null),Ve(this,"backend",void 0),this.backend=e}return W0(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!ta(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 V0(t,e,n){var r=n.getRegistry(),i=r.addTarget(t,e);return[i,function(){return r.removeTarget(i)}]}function G0(t,e,n){var r=n.getRegistry(),i=r.addSource(t,e);return[i,function(){return r.removeSource(i)}]}var Ft=typeof window<"u"?d.useLayoutEffect:d.useEffect;function Br(t){"@babel/helpers - typeof";return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Br=function(n){return typeof n}:Br=function(n){return n&&typeof Symbol=="function"&&n.constructor===Symbol&&n!==Symbol.prototype?"symbol":typeof n},Br(t)}function q0(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 X0(t,e,n){return Y0(t.prototype,e),t}function fo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var J0=function(){function t(e,n,r){q0(this,t),fo(this,"spec",void 0),fo(this,"monitor",void 0),fo(this,"connector",void 0),this.spec=e,this.monitor=n,this.connector=r}return X0(t,[{key:"beginDrag",value:function(){var n,r=this.spec,i=this.monitor,o=null;return Br(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 Q0(t,e,n){var r=d.useMemo(function(){return new J0(t,e,n)},[e,n]);return d.useEffect(function(){r.spec=t},[t]),r}function Ht(){var t=d.useContext(Of),e=t.dragDropManager;return J(e!=null,"Expected drag drop context"),e}function Z0(t){return d.useMemo(function(){var e=t.type;return J(e!=null,"spec.type must be defined"),e},[t])}function eE(t,e){return iE(t)||rE(t,e)||nE(t,e)||tE()}function tE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
94
94
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nE(t,e){if(t){if(typeof t=="string")return Bl(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 Bl(t,e)}}function Bl(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 rE(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 iE(t){if(Array.isArray(t))return t}function oE(t,e,n){var r=Ht(),i=Q0(t,e,n),o=Z0(t);Ft(function(){if(o!=null){var s=G0(o,i,r),l=eE(s,2),u=l[0],c=l[1];return e.receiveHandlerId(u),n.receiveHandlerId(u),c}},[r,e,n,i,o])}function aE(t){return cE(t)||uE(t)||lE(t)||sE()}function sE(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
95
95
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function lE(t,e){if(t){if(typeof t=="string")return na(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 na(t,e)}}function uE(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)}function cE(t){if(Array.isArray(t))return na(t)}function na(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 Lf(t,e){var n=aE(e||[]);return e==null&&typeof t!="function"&&n.push(t),d.useMemo(function(){return typeof t=="function"?t():t},n)}function dE(){var t=Ht();return d.useMemo(function(){return new I0(t)},[t])}function fE(t,e){var n=Ht(),r=d.useMemo(function(){return new z0(n.getBackend())},[n]);return Ft(function(){return r.dragSourceOptions=t||null,r.reconnect(),function(){return r.disconnectDragSource()}},[r,t]),Ft(function(){return r.dragPreviewOptions=e||null,r.reconnect(),function(){return r.disconnectDragPreview()}},[r,e]),r}var ho,Wl;function hE(){return Wl||(Wl=1,ho=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}),ho}var pE=hE();const gE=sh(pE);function vE(t,e){return SE(t)||bE(t,e)||yE(t,e)||mE()}function mE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
96
96
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function yE(t,e){if(t){if(typeof t=="string")return Ul(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 Ul(t,e)}}function Ul(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 bE(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 SE(t){if(Array.isArray(t))return t}function Ff(t,e,n){var r=d.useState(function(){return e(t)}),i=vE(r,2),o=i[0],a=i[1],s=d.useCallback(function(){var l=e(t);gE(o,l)||(a(l),n&&n())},[o,t,n]);return Ft(s),[o,s]}function wE(t,e){return CE(t)||xE(t,e)||$E(t,e)||EE()}function EE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
97
97
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function $E(t,e){if(t){if(typeof t=="string")return Vl(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 Vl(t,e)}}function Vl(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 CE(t){if(Array.isArray(t))return t}function TE(t,e,n){var r=Ff(t,e,n),i=wE(r,2),o=i[0],a=i[1];return Ft(function(){var l=t.getHandlerId();if(l!=null)return t.subscribeToStateChange(a,{handlerIds:[l]})},[t,a]),o}function jf(t,e,n){return TE(e,t||function(){return{}},function(){return n.reconnect()})}function DE(t){return d.useMemo(function(){return t.hooks.dragSource()},[t])}function PE(t){return d.useMemo(function(){return t.hooks.dragPreview()},[t])}function OE(t,e){var n=Lf(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=dE(),i=fE(n.options,n.previewOptions);return oE(n,r,i),[jf(n.collect,r,i),DE(i),PE(i)]}function IE(t){var e=t.accept;return d.useMemo(function(){return J(t.accept!=null,"accept must be defined"),Array.isArray(e)?e:[e]},[e])}function _E(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function kE(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 RE(t,e,n){return kE(t.prototype,e),t}function Gl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var NE=function(){function t(e,n){_E(this,t),Gl(this,"spec",void 0),Gl(this,"monitor",void 0),this.spec=e,this.monitor=n}return RE(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 ME(t,e){var n=d.useMemo(function(){return new NE(t,e)},[e]);return d.useEffect(function(){n.spec=t},[t]),n}function AE(t,e){return jE(t)||FE(t,e)||LE(t,e)||KE()}function KE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
98
98
|
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function LE(t,e){if(t){if(typeof t=="string")return ql(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 ql(t,e)}}function ql(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 FE(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 jE(t){if(Array.isArray(t))return t}function zE(t,e,n){var r=Ht(),i=ME(t,e),o=IE(t);Ft(function(){var s=V0(o,i,r),l=AE(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 HE(){var t=Ht();return d.useMemo(function(){return new N0(t)},[t])}function BE(t){var e=Ht(),n=d.useMemo(function(){return new U0(e.getBackend())},[e]);return Ft(function(){return n.dropTargetOptions=t||null,n.reconnect(),function(){return n.disconnectDropTarget()}},[t]),n}function WE(t){return d.useMemo(function(){return t.hooks.dropTarget()},[t])}function zf(t,e){var n=Lf(t,e),r=HE(),i=BE(n.options);return zE(n,r,i),[jf(n.collect,r,i),WE(i)]}function UE(t,e){return YE(t)||qE(t,e)||GE(t,e)||VE()}function VE(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
99
|
-
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GE(t,e){if(t){if(typeof t=="string")return Yl(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 Yl(t,e)}}function Yl(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 qE(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 YE(t){if(Array.isArray(t))return t}function XE(t){var e=Ht(),n=e.getMonitor(),r=Ff(n,t),i=UE(r,2),o=i[0],a=i[1];return d.useEffect(function(){return n.subscribeToOffsetChange(a)}),d.useEffect(function(){return n.subscribeToStateChange(a)}),o}function Hf(t){var e=null,n=function(){return e==null&&(e=t()),e};return n}function JE(t,e){return t.filter(function(n){return n!==e})}function QE(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 ZE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e$(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 t$(t,e,n){return e$(t.prototype,e),t}function Xl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var n$=function(){function t(e){ZE(this,t),Xl(this,"entered",[]),Xl(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return t$(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=QE(this.entered.filter(o),[n]),i===0&&this.entered.length>0}},{key:"leave",value:function(n){var r=this.entered.length;return this.entered=JE(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),r$=Hf(function(){return/firefox/i.test(navigator.userAgent)}),Bf=Hf(function(){return!!window.safari});function i$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o$(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 a$(t,e,n){return o$(t.prototype,e),t}function An(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Jl=function(){function t(e,n){i$(this,t),An(this,"xs",void 0),An(this,"ys",void 0),An(this,"c1s",void 0),An(this,"c2s",void 0),An(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 h=[s[0]],p=0;p<a.length-1;p++){var g=s[p],m=s[p+1];if(g*m<=0)h.push(0);else{l=a[p];var f=a[p+1],v=l+f;h.push(3*v/((v+f)/g+(v+l)/m))}}h.push(s[s.length-1]);for(var y=[],S=[],w,
|
|
100
|
-
`)},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),Or(en,Gf,{exposeProperties:{text:function(e,n){return po(e,n,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),en);function d$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f$(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 h$(t,e,n){return f$(t.prototype,e),t}function Zl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p$=function(){function t(e){d$(this,t),Zl(this,"item",void 0),Zl(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return h$(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 g$(t,e){var n=new p$(ra[t]);return n.loadDataTransfer(e),n}function go(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(ra).filter(function(n){var r=ra[n].matchesTypes;return r.some(function(i){return e.indexOf(i)>-1})})[0]||null}function v$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m$(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 y$(t,e,n){return m$(t.prototype,e),t}function vo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b$=function(){function t(e,n){v$(this,t),vo(this,"ownerDocument",null),vo(this,"globalContext",void 0),vo(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return y$(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 eu(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 tu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?eu(Object(n),!0).forEach(function(r){te(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function S$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w$(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 E$(t,e,n){return w$(t.prototype,e),t}function te(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $$=function(){function t(e,n,r){var i=this;S$(this,t),te(this,"options",void 0),te(this,"actions",void 0),te(this,"monitor",void 0),te(this,"registry",void 0),te(this,"enterLeaveCounter",void 0),te(this,"sourcePreviewNodes",new Map),te(this,"sourcePreviewNodeOptions",new Map),te(this,"sourceNodes",new Map),te(this,"sourceNodeOptions",new Map),te(this,"dragStartSourceIds",null),te(this,"dropTargetIds",[]),te(this,"dragEnterTargetIds",[]),te(this,"currentNativeSource",null),te(this,"currentNativeHandle",null),te(this,"currentDragSourceNode",null),te(this,"altKeyPressed",!1),te(this,"mouseMoveTimeoutTimer",null),te(this,"asyncEndDragFrameId",null),te(this,"dragOverTargetIds",null),te(this,"lastClientOffset",null),te(this,"hoverRafId",null),te(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&Wf(a)||null}),te(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),te(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),te(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),te(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),te(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var s=Pr(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:s});var l=o.dataTransfer,u=go(l);if(i.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){var c=i.monitor.getSourceId(),h=i.sourceNodes.get(c),p=i.sourcePreviewNodes.get(c)||h;if(p){var g=i.getCurrentSourcePreviewNodeOptions(),m=g.anchorX,f=g.anchorY,v=g.offsetX,y=g.offsetY,S={anchorX:m,anchorY:f},w={offsetX:v,offsetY:y},D=c$(h,p,s,S,w);l.setDragImage(p,D.x,D.y)}}try{l==null||l.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target);var x=i.getCurrentSourcePreviewNodeOptions(),I=x.captureDraggingState;I?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()}}}),te(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),te(this,"handleTopDragEnterCapture",function(o){i.dragEnterTargetIds=[];var a=i.enterLeaveCounter.enter(o.target);if(!(!a||i.monitor.isDragging())){var s=o.dataTransfer,l=go(s);l&&i.beginDragNativeItem(l,s)}}),te(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:Pr(o)});var s=a.some(function(l){return i.monitor.canDropOnTarget(l)});s&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect()))}}),te(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),te(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=Pr(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"))}),te(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault();var a=i.enterLeaveCounter.leave(o.target);a&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),te(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 go(o.dataTransfer)&&o.preventDefault();i.enterLeaveCounter.reset()}),te(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:Pr(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),te(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 b$(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new n$(this.isNodeInDocument)}return E$(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 tu({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 tu({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(Ql).some(function(r){return Ql[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=g$(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}(),Ir;function x$(){return Ir||(Ir=new Image,Ir.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Ir}var C$=function(e,n,r){return new $$(e,n,r)};function T$(t){const e=Oe(),n=e.selectedIds,[r,i,o]=OE(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(En.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(En.dragEnd())}}),[n,t]);return d.useEffect(()=>{o(x$())},[o]),i}function D$(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 P$(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 _r(t,e){return{parentId:t||null,index:e}}function tn(t,e){return{type:"line",index:t,level:e}}function O$(t){return{type:"highlight",id:t}}function mo(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=bf(r)+1;return{parentId:i,index:o}}function Yf(t){var e;const n=D$(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]=P$(o,s,a,n);if(o&&o.isInternal&&n.inMiddle)return{drop:_r(o.id,null),cursor:O$(o.id)};if(!l)return{drop:_r((e=u==null?void 0:u.parent)===null||e===void 0?void 0:e.id,0),cursor:tn(0,0)};if(gf(l)){const c=Ar(i,(u==null?void 0:u.level)||0,l.level);return{drop:mo(l,c),cursor:tn(l.rowIndex+1,c)}}if(vf(l)){const c=Ar(i,(u==null?void 0:u.level)||0,l.level);return{drop:mo(l,c),cursor:tn(l.rowIndex+1,c)}}if(mf(l)){const c=Ar(i,0,l.level+1);return c>l.level?{drop:_r(l.id,0),cursor:tn(l.rowIndex+1,c)}:{drop:mo(l,c),cursor:tn(l.rowIndex+1,c)}}return{drop:_r(l==null?void 0:l.id,0),cursor:tn(l.rowIndex+1,l.level+1)}}function I$(t,e){const n=Oe(),[r,i]=zf(()=>({accept:"NODE",canDrop:()=>n.canDrop(),hover:(o,a)=>{const s=a.getClientOffset();if(!t.current||!s)return;const{cursor:l,drop:u}=Yf({element:t.current,offset:s,indent:n.indent,node:e,prevNode:e.prev,nextNode:e.next});u&&n.dispatch(En.hovering(u.parentId,u.index)),a.canDrop()?l&&n.showCursor(l):n.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;let{parentId:s,index:l,dragIds:u}=n.state.dnd;xf(n.props.onMove,{dragIds:u,parentId:s===er?null:s,index:l===null?0:l,dragNodes:n.dragNodes,parentNode:n.get(s)}),n.open(s)}}),[e,t.current,n.props]);return i}function _$(t){const e=Oe(),n=e.at(t);if(!n)throw new Error(`Could not find node for index: ${t}`);return d.useMemo(()=>{const r=n.clone();return e.visibleNodes[t]=r,r},[...Object.values(n.state),n])}const k$=d.memo(function({index:e,style:n}){pf(),Qb();const r=Oe(),i=_$(e),o=d.useRef(null),a=T$(i),s=I$(o,i),l=d.useCallback(f=>{o.current=f,s(f)},[s]),u=r.indent*i.level,c=d.useMemo(()=>({paddingLeft:u}),[u]),h=d.useMemo(()=>{var f,v;return Object.assign(Object.assign({},n),{top:parseFloat(n.top)+((v=(f=r.props.padding)!==null&&f!==void 0?f:r.props.paddingTop)!==null&&v!==void 0?v:0)})},[n,r.props.padding,r.props.paddingTop]),p={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,"aria-expanded":i.isOpen,style:h,tabIndex:-1,className:r.props.rowClassName};d.useEffect(()=>{var f;!i.isEditing&&i.isFocused&&((f=o.current)===null||f===void 0||f.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,o.current]);const g=r.renderNode,m=r.renderRow;return T.jsx(m,{node:i,innerRef:l,attrs:p,children:T.jsx(g,{node:i,tree:r,style:c,dragHandle:a})})});let yo="",nu=null;function Xf(){pf();const t=Oe();return T.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(),Sf(e.currentTarget);return}if(e.key==="Tab"&&e.shiftKey){e.preventDefault(),wf(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(nu),yo+=e.key,nu=setTimeout(()=>{yo=""},600);const r=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"?o.toLowerCase().startsWith(yo):!1});r&&t.focus(r.id)},children:T.jsx(MS,{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:LS,innerElementType:zS,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:k$})})}function ru(t){return t.isFiltered?N$(t.root,t.isMatch.bind(t)):R$(t.root)}function R$(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(Jf),e}function N$(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(Jf),r}function Jf(t,e){t.rowIndex=e}const iu=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var bo=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(h){a(h)}}function l(c){try{u(r.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(t,e||[])).next())})};const{safeRun:he,identify:et,identifyNull:je}=iS;class vn{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=pl(this),this.visibleNodes=ru(this),this.idToIndex=iu(this.visibleNodes)}update(e){this.props=e,this.root=pl(this),this.visibleNodes=ru(this),this.idToIndex=iu(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=zn(e,r))!==null&&n!==void 0?n:null}accessId(e){const n=this.props.idAccessor||"id",r=zn(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=$f(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(){return bo(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?Df(this):e.parentId,o=(n=e.index)!==null&&n!==void 0?n:Tf(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",s=yield he(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 bo(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 he(this.props.onDelete,{nodes:i,ids:r})})}edit(e){const n=et(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(io(n)),new Promise(r=>{vn.editPromise=r})}submit(e,n){return bo(this,void 0,void 0,function*(){if(!e)return;const r=et(e);yield he(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(io(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(io(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(je(e));n&&he(this.props.onActivate,n)}resolveEdit(e){const n=vn.editPromise;n&&n(e),vn.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(Xt(et(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&he(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(Xt(i)),this.dispatch(Fe.only(i)),this.dispatch(Fe.anchor(i)),this.dispatch(Fe.mostRecent(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&he(this.props.onFocus,this.focusedNode),he(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=et(e);this.dispatch(Fe.remove(n)),he(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(je(e));n&&(this.dispatch(Xt(n.id)),this.dispatch(Fe.add(n.id)),this.dispatch(Fe.anchor(n.id)),this.dispatch(Fe.mostRecent(n.id)),this.scrollTo(n),this.focusedNode&&he(this.props.onFocus,this.focusedNode),he(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=et(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Xt(n)),this.dispatch(Fe.remove(this.nodesBetween(r,i))),this.dispatch(Fe.add(this.nodesBetween(r,je(n)))),this.dispatch(Fe.mostRecent(n)),this.scrollTo(n),this.focusedNode&&he(this.props.onFocus,this.focusedNode),he(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),he(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Xt((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&he(this.props.onFocus,this.focusedNode),he(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=je(e.anchor),o=je(e.mostRecent);this.dispatch(Fe.set({ids:r,anchor:i,mostRecent:o})),he(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&&yf(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(En.cursor({type:"none"}))}showCursor(e){this.dispatch(En.cursor(e))}open(e){const n=je(e);n&&(this.isOpen(n)||(this.dispatch(Yo.open(n,this.isFiltered)),he(this.props.onToggle,n)))}close(e){const n=je(e);n&&this.isOpen(n)&&(this.dispatch(Yo.close(n,this.isFiltered)),he(this.props.onToggle,n))}toggle(e){const n=je(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=je(e);if(!n)return;const r=Ma(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(){oi(this.root,e=>{e.isInternal&&e.open()})}closeAll(){oi(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=et(e);return this.openParents(r),Cf(()=>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===er)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){const n=this.props.disableEdit||(()=>!1);return!zn(e,n)}isDraggable(e){const n=this.props.disableDrag||(()=>!1);return!zn(e,n)}isDragging(e){const n=je(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=je(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(Xt(e.id))}onBlur(){this.dispatch(pS())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Xf}get renderRow(){return this.props.renderRow||uS}get renderNode(){return this.props.children||cS}get renderDragPreview(){return this.props.renderDragPreview||Pf}get renderCursor(){return this.props.renderCursor||lS}}function Ee(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 M$=typeof Symbol=="function"&&Symbol.observable||"@@observable",ou=M$,So=()=>Math.random().toString(36).substring(7).split("").join("."),A$={INIT:`@@redux/INIT${So()}`,REPLACE:`@@redux/REPLACE${So()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${So()}`},Ot=A$;function Qf(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 K$(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(j$(t))return"date";if(F$(t))return"error";const n=L$(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 L$(t){return typeof t.constructor=="function"?t.constructor.name:null}function F$(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function j$(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function dt(t){let e=typeof t;return process.env.NODE_ENV!=="production"&&(e=K$(t)),e}function Zf(t,e,n){if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?Ee(2):`Expected the root reducer to be a function. Instead, received: '${dt(t)}'`);if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ee(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"?Ee(1):`Expected the enhancer to be a function. Instead, received: '${dt(n)}'`);return n(Zf)(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"?Ee(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 h(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ee(4):`Expected the listener to be a function. Instead, received: '${dt(v)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?Ee(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 S=s++;return a.set(S,v),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?Ee(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(S),o=null}}}function p(v){if(!Qf(v))throw new Error(process.env.NODE_ENV==="production"?Ee(7):`Actions must be plain objects. Instead, the actual type was: '${dt(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"?Ee(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"?Ee(17):`Action "type" property must be a string. Instead, the actual type was: '${dt(v.type)}'. Value was: '${v.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?Ee(9):"Reducers may not dispatch actions.");try{l=!0,i=r(i,v)}finally{l=!1}return(o=a).forEach(S=>{S()}),v}function g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ee(10):`Expected the nextReducer to be a function. Instead, received: '${dt(v)}`);r=v,p({type:Ot.REPLACE})}function m(){const v=h;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?Ee(11):`Expected the observer to be an object. Instead, received: '${dt(y)}'`);function S(){const D=y;D.next&&D.next(c())}return S(),{unsubscribe:v(S)}},[ou](){return this}}}return p({type:Ot.INIT}),{dispatch:p,subscribe:h,getState:c,replaceReducer:g,[ou]:m}}function au(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function z$(t,e,n,r){const i=Object.keys(e),o=n&&n.type===Ot.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(!Qf(t))return`The ${o} has unexpected type of "${dt(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===Ot.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 H$(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:Ot.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Ee(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:Ot.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Ee(13):`The slice reducer for key "${e}" returned undefined when probed with a random type. Don't try to handle '${Ot.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 su(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"&&au(`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{H$(n)}catch(a){o=a}return function(s={},l){if(o)throw o;if(process.env.NODE_ENV!=="production"){const h=z$(s,n,l,i);h&&au(h)}let u=!1;const c={};for(let h=0;h<r.length;h++){const p=r[h],g=n[p],m=s[p],f=g(m,l);if(typeof f>"u"){const v=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?Ee(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${p}" 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[p]=f,u=u||f!==m}return u=u||r.length!==Object.keys(s).length,u?c:s}}function B$(t=wn().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 W$=su({nodes:su({focus:gS,edit:hS,open:vS,selection:mS,drag:B$}),dnd:yS}),U$=wn();function V$({treeProps:t,imperativeHandle:e,children:n}){const r=d.useRef(null),i=d.useRef(null),o=d.useRef(Zf(W$,wn(t))),a=da.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>U$),s=d.useMemo(()=>new vn(o.current,t,r,i),[]),l=d.useRef(0);return d.useMemo(()=>{l.current+=1,s.update(t)},[...Object.values(t),a.nodes.open]),d.useImperativeHandle(e,()=>s),d.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),d.useEffect(()=>{s.props.searchTerm||o.current.dispatch(Yo.clear(!0))},[s.props.searchTerm]),T.jsx(cf.Provider,{value:s,children:T.jsx(hf.Provider,{value:l.current,children:T.jsx(df.Provider,{value:a.nodes,children:T.jsx(ff.Provider,{value:a.dnd,children:T.jsx(x0,Object.assign({backend:C$,options:{rootElement:s.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function G$(){const t=Oe(),[,e]=zf(()=>({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}=Yf({element:t.listEl.current,offset:i,indent:t.indent,node:null,prevNode:t.visibleNodes[t.visibleNodes.length-1],nextNode:null});a&&t.dispatch(En.hovering(a.parentId,a.index)),r.canDrop()?o&&t.showCursor(o):t.hideCursor()}}),[t]);e(t.listEl)}function q$(t){return G$(),t.children}function Y$(){const e=Oe().props.renderContainer||Xf;return T.jsx(T.Fragment,{children:T.jsx(e,{})})}function X$(){const t=Oe(),{offset:e,mouse:n,item:r,isDragging:i}=XE(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=t.props.renderDragPreview||Pf;return T.jsx(o,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class J${constructor(e){this.root=Q$(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 Q$(t){const e=new eh({id:"ROOT"},null);return e.children=t.map(n=>Ha(n,e)),e}function Ha(t,e){const n=new eh(t,e);return t.children&&(n.children=t.children.map(r=>Ha(r,n))),n}class eh{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=Ha(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 Z$=0;function ex(t){const[e,n]=d.useState(t),r=d.useMemo(()=>new J$(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:h})=>{const p={id:`simple-tree-id-${Z$++}`,name:""};return h==="internal"&&(p.children=[]),r.create({parentId:u,index:c,data:p}),n(r.data),p},onDelete:u=>{u.ids.forEach(c=>r.drop({id:c})),n(r.data)}}]}function tx(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.
|
|
101
|
-
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=ex(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}else return t}function nx(t,e){const n=tx(t);return T.jsxs(V$,{treeProps:n,imperativeHandle:e,children:[T.jsx(q$,{children:T.jsx(Y$,{})}),T.jsx(X$,{})]})}const rx=d.forwardRef(nx),th=({top:t,left:e})=>T.jsx("div",{className:"c__tree-view__cursor",style:{top:t-2,left:e+10}});function ix(t,e){var n=d.useRef(null),r=d.useRef(null);r.current=e;var i=d.useRef(null);d.useEffect(function(){o()});var o=d.useCallback(function(){var a=i.current,s=r.current,l=a||(s?s instanceof Element?s:s.current:null);n.current&&n.current.element===l&&n.current.subscriber===t||(n.current&&n.current.cleanup&&n.current.cleanup(),n.current={element:l,subscriber:t,cleanup:l?t(l):void 0})},[t]);return d.useEffect(function(){return function(){n.current&&n.current.cleanup&&(n.current.cleanup(),n.current=null)}},[]),d.useCallback(function(a){i.current=a,o()},[o])}function lu(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}function ox(t){t===void 0&&(t={});var e=t.onResize,n=d.useRef(void 0);n.current=e;var r=t.round||Math.round,i=d.useRef(),o=d.useState({width:void 0,height:void 0}),a=o[0],s=o[1],l=d.useRef(!1);d.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var u=d.useRef({width:void 0,height:void 0}),c=ix(d.useCallback(function(h){return(!i.current||i.current.box!==t.box||i.current.round!==r)&&(i.current={box:t.box,round:r,instance:new ResizeObserver(function(p){var g=p[0],m=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",f=lu(g,m,"inlineSize"),v=lu(g,m,"blockSize"),y=f?r(f):void 0,S=v?r(v):void 0;if(u.current.width!==y||u.current.height!==S){var w={width:y,height:S};u.current.width=y,u.current.height=S,n.current?n.current(w):l.current||s(w)}})}),i.current.instance.observe(h,{box:t.box}),function(){i.current&&i.current.instance.unobserve(h)}},[t.box,r]),t.ref);return d.useMemo(function(){return{ref:c,width:a.width,height:a.height}},[c,a.width,a.height])}var Ae=(t=>(t.NODE="node",t.SEPARATOR="separator",t.TITLE="title",t))(Ae||{}),$t=(t=>(t.FIRST_CHILD="first-child",t.LAST_CHILD="last-child",t.LEFT="left",t.RIGHT="right",t))($t||{});const li=t=>t?t.nodeType===Ae.SEPARATOR:!1,ui=t=>t?t.nodeType===Ae.TITLE:!1,Hn=t=>!li(t)&&!ui(t),nh=(t,e,n)=>{const{remove:r,update:i,insert:o,insertBefore:a,insertAfter:s,append:l,prepend:u,getItem:c,move:h,items:p}=Pv({initialItems:JSON.parse(JSON.stringify(t)),getKey:j=>j.id,getChildren:j=>j.children||[]}),[g,m]=d.useState(),f=(j=[])=>{const O=p.map(N=>N.key);r(...O);const _=JSON.parse(JSON.stringify(j));_.length>0&&o(null,0,..._),m(void 0)},v=(j,O,_)=>{const N=c(j);if(!N)return;const F=[...N.value.children??[]];_?F.splice(_,0,O):F.push(O),N.value.children=F,N.value.childrenCount=F.length},y=j=>{const O=c(j);O&&m(O.value)},S=(j,O,_)=>{var N;if(j){const A=c(j);A&&(o(j,_??((N=A.children)==null?void 0:N.length)??0,O),v(j,O,_))}else o(null,_??p.length,O)},w=j=>{var O;return(O=c(j))==null?void 0:O.value},D=(j,O)=>{const _=c(j);if(!_){console.error("No item found");return}let N=_.value.children??null;const A=O.childrenCount??_.value.childrenCount??0;(N==null?void 0:N.length)===0&&A>0&&(N=null),O.children&&(N=[...N??[],...O.children]);const F={..._.value,...O,children:N,childrenCount:(N==null?void 0:N.length)??A};i(j,F),_.parentKey&&I(_.parentKey,j,O)},x=j=>{const O=c(j),_=O==null?void 0:O.parentKey;_&&O&&Y(_,O.value.id),r(j)},I=(j,O,_)=>{const N=c(j);if(!N)return;const A=N.value.children??[],F=A.findIndex(L=>L.id===O);if(F===-1)return;const B={...A[F],..._};A[F]=B},P=async j=>{if(!e){console.error("No refresh callback provided");return}try{const O=await e(j);D(j,O)}catch(O){console.error("error while refreshing node:",O)}},b=(j,O)=>{o(null,O??p.length,j)},R=(j,O)=>{const _=c(j);if(!_){console.error("No item found");return}const N={..._.value,children:O,childrenCount:O.length,hasLoadedChildren:O.length>0};i(j,N),_.parentKey&&I(_.parentKey,j,N)},W=j=>{const O=[],_=c(j);if(!_)return[];O.push(_.value);const N=A=>{const F=M(A);if(!F)return;const B=c(F);B&&(O.push(B.value),N(F))};return N(j),O.reverse()},M=j=>{var O;return((O=c(j))==null?void 0:O.parentKey)??null},z=j=>{const O=M(j);if(!O)return null;const _=c(O);return _?_.value:null},E=(j,O)=>{a(j,O)},k=(j,O)=>{s(j,O)},H=(j,O)=>{l(j,O)},U=(j,O)=>{u(j,O)},Y=(j,O)=>{const _=c(j);if(!_)return;const A=(_.value.children??[]).filter(F=>F.id!==O);_.value.children=A,_.value.childrenCount=A.length},K=(j,O,_,N)=>{var F;const A=(F=c(j))==null?void 0:F.value;h(j,O,_),O&&A&&v(O,A),N&&Y(N,j)};return{nodes:p,addChild:S,updateNode:D,deleteNode:x,addRootNode:b,selectedNode:g,setSelectedNode:m,refreshNode:P,setChildren:R,insertBeforeNode:E,insertAfterNode:k,handleMove:j=>{K(j.sourceId,j.newParentId,j.index,j.oldParentId)},prependToNode:U,moveNode:K,appendToNode:H,move:h,resetTree:f,handleLoadChildren:async j=>{if(!n)return[];const O=await n(j);return D(j,{children:O,hasLoadedChildren:!0,childrenCount:O.length}),O},selectNodeById:y,getParent:z,getNode:w,getParentId:M,getAncestors:W}},Ba=d.createContext(null),ax=({children:t,onRefresh:e,initialNodeId:n,onLoadChildren:r,initialTreeData:i})=>{const o=d.useRef(null),[a,s]=d.useState(null),[l,u]=d.useState(n??null),c=nh(i??[],e,r);return T.jsx(Ba.Provider,{value:{treeApiRef:o,treeData:c,root:a,initialTargetId:l,setInitialTargetId:u,setRoot:s},children:t})},Wa=()=>{const t=d.useContext(Ba);if(!t)throw new Error("TreeContext not found");return t},sx=({initialOpenState:t,selectedNodeId:e,rootNodeId:n,renderNode:r,canDrop:i,canDrag:o,afterMove:a})=>{const{ref:s,width:l,height:u}=ox(),c=Wa(),h=(c==null?void 0:c.treeData.nodes)??[],p=m=>{var H,U,Y,K;const f=JSON.parse(JSON.stringify(h)),v=m.dragNodes[0],y=m.parentId?((H=m.parentNode)==null?void 0:H.data.children)??[]:f,S=m.dragNodes[0].data.value.id,w=m.dragNodes[0].data,D=(U=m.parentNode)==null?void 0:U.data;if((D==null?void 0:D.value.nodeType)===Ae.TITLE||(D==null?void 0:D.value.nodeType)===Ae.SEPARATOR)return null;const x=w.parentKey??n,I=m.parentId??n;let P=m.index+0,b=null,R=I;const W=((K=(Y=v.parent)==null?void 0:Y.children)==null?void 0:K.findIndex(q=>q.data.value.id===S))??0;if(x===I){if(W===P)return null;P=P<W?P:P-1}const M=m.index-1,z=y[M],E=m.index,k=y[E];return m.index===0?(R=m.parentId??n,b=$t.FIRST_CHILD):!D&&m.index===1&&!Hn(z.value)?(R=n,P=1,b=$t.FIRST_CHILD):m.index===y.length?(R=R??n,b=$t.LAST_CHILD):z&&Hn(z.value)?(R=z.value.id,b=$t.RIGHT):k&&Hn(k.value)&&(b=$t.LEFT,R=k.value.id),b&&R?{targetModeId:R,mode:b,oldParentId:x,index:P,newParentId:m.parentId,sourceId:S}:null},g=m=>{const f=p(m);f&&(c==null||c.treeData.handleMove(f),a==null||a(f))};if(c)return T.jsx("div",{ref:s,className:"c__tree-view--container",children:T.jsx(rx,{data:h,ref:c.treeApiRef,openByDefault:!1,disableEdit:!0,className:"c__tree-view",idAccessor:"key",onMove:g,rowHeight:35,disableDrag:m=>o?!o(m):!1,disableDrop:({parentNode:m,dragNodes:f,index:v})=>{var D,x;if(i&&!i({parentNode:m,dragNodes:f,index:v}))return m.id!=="__REACT_ARBORIST_INTERNAL_ROOT__"&&(m.data.value.canDrop=!1),!0;if(((D=m.data.value)==null?void 0:D.nodeType)===Ae.TITLE||((x=m.data.value)==null?void 0:x.nodeType)===Ae.SEPARATOR)return!0;if(m.id==="__REACT_ARBORIST_INTERNAL_ROOT__"){const I=h[v-1],P=h[v],b=h[v+1],R=li(I==null?void 0:I.value),W=li(P==null?void 0:P.value),M=ui(I==null?void 0:I.value),z=ui(P==null?void 0:P.value),E=Hn(b==null?void 0:b.value);return!!(v===0&&(W||z)||R&&z&&E||M&&W&&E)}const y=m==null?void 0:m.isOpen,S=(m==null?void 0:m.data.value.childrenCount)&&m.data.value.childrenCount>0||(m==null?void 0:m.data.children)&&m.data.children.length>0;if(!S)return m.data.value.canDrop=!0,!1;let w=m.data.value.childrenCount&&m.data.value.childrenCount>0&&(m==null?void 0:m.data.children)&&m.data.children.length>0;return w=w??!0,!y&&!w&&S?(m.data.value.canDrop=!0,!0):(m.data.value.canDrop=!0,!1)},paddingBottom:30,paddingTop:2,width:l,initialOpenState:t,height:u,overscanCount:20,selection:e,renderCursor:th,renderRow:m=>{const f=m.node.data.value.nodeType===Ae.TITLE,v=m.node.data.value.nodeType===Ae.SEPARATOR,{style:y}=m.attrs,S={...y};return f||v?T.jsx("div",{...m.attrs,style:S,ref:m.innerRef,onFocus:w=>w.stopPropagation(),onClick:m.node.handleClick,children:m.children}):T.jsx("div",{...m.attrs,style:S,ref:m.innerRef,onFocus:w=>w.stopPropagation(),onClick:m.node.handleClick,children:T.jsx("div",{style:{padding:"0 12px"},children:m.children})})},rowClassName:"c__tree-view--row",children:m=>r(m)})})},lx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ux(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function cx(t){return"nodeType"in t}function dx(t){var e,n;return t?ux(t)?t:cx(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}const rh=lx?d.useLayoutEffect:d.useEffect;function ih(t){const e=d.useRef(t);return rh(()=>{e.current=t}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function uu(t,e){e===void 0&&(e=[t]);const n=d.useRef(t);return rh(()=>{n.current!==t&&(n.current=t)},e),n}function fx(t){const e=ih(t),n=d.useRef(null),r=d.useCallback(i=>{i!==n.current&&(e==null||e(i,n.current)),n.current=i},[]);return[n,r]}let wo={};function hx(t,e){return d.useMemo(()=>{const n=wo[t]==null?0:wo[t]+1;return wo[t]=n,t+"-"+n},[t,e])}var Un;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Un||(Un={}));function cu(){}const px=Object.freeze({x:0,y:0});function gx(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function vx(t,e,n){const r=gx(e);if(!r)return t;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=t.left-a-(1-i)*parseFloat(n),u=t.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?t.width/i:t.width,h=o?t.height/o:t.height;return{width:c,height:h,top:u,right:l+c,bottom:u+h,left:l}}const mx={ignoreTransform:!1};function oh(t,e){e===void 0&&(e=mx);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:c}=dx(t).getComputedStyle(t);u&&(n=vx(n,u,c))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function du(t){return oh(t,{ignoreTransform:!0})}var dn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(dn||(dn={}));var fu;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(fu||(fu={}));var ht;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(ht||(ht={}));ht.Space,ht.Enter,ht.Esc,ht.Space,ht.Enter,ht.Tab;var hu;(function(t){t[t.RightClick=2]="RightClick"})(hu||(hu={}));var pu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(pu||(pu={}));var gu;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(gu||(gu={}));dn.Backward+"",dn.Forward+"",dn.Backward+"",dn.Forward+"";var ia;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ia||(ia={}));var oa;(function(t){t.Optimized="optimized"})(oa||(oa={}));function yx(t){let{callback:e,disabled:n}=t;const r=ih(e),i=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return d.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}ia.WhileDragging,oa.Optimized;const bx={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:cu,draggableNodes:new Map,over:null,measureDroppableContainers:cu},Sx=d.createContext(bx);({...px});var vu;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(vu||(vu={}));const wx="Droppable",Ex={timeout:25};function $x(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:i}=t;const o=hx(wx),{active:a,dispatch:s,over:l,measureDroppableContainers:u}=d.useContext(Sx),c=d.useRef({disabled:n}),h=d.useRef(!1),p=d.useRef(null),g=d.useRef(null),{disabled:m,updateMeasurementsFor:f,timeout:v}={...Ex,...i},y=uu(f??r),S=d.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),g.current=null},v)},[v]),w=yx({callback:S,disabled:m||!a}),D=d.useCallback((b,R)=>{w&&(R&&(w.unobserve(R),h.current=!1),b&&w.observe(b))},[w]),[x,I]=fx(D),P=uu(e);return d.useEffect(()=>{!w||!x.current||(w.disconnect(),h.current=!1,w.observe(x.current))},[x,w]),d.useEffect(()=>(s({type:Un.RegisterDroppable,element:{id:r,key:o,disabled:n,node:x,rect:p,data:P}}),()=>s({type:Un.UnregisterDroppable,key:o,id:r})),[r]),d.useEffect(()=>{n!==c.current.disabled&&(s({type:Un.SetDroppableDisabled,id:r,key:o,disabled:n}),c.current.disabled=n)},[r,o,n,s]),{active:a,rect:p,isOver:(l==null?void 0:l.id)===r,node:x,over:l,setNodeRef:I}}const xx=t=>{const{isOver:e,setNodeRef:n}=$x({id:t.id,data:t.data});return d.useEffect(()=>{var r;(r=t.onOver)==null||r.call(t,e,t.data)},[e,t.data,t.onOver]),T.jsx("div",{className:"c__dnd--droppable",ref:n,children:t.children})},Cx=({children:t,onClick:e,node:n,dragHandle:r,style:i,forceLoading:o})=>{var w,D;const a=Wa(),s=d.useRef(null),[l,u]=d.useState(!1),[c,h]=d.useState(!1),p=o??l,g=n.willReceiveDrop||c,m=n.data.value.childrenCount!==void 0&&n.data.value.childrenCount>0||(((w=n.data.children)==null?void 0:w.length)??0)>0,f=((D=n.children)==null?void 0:D.length)??!1,v=n.isLeaf||!m,y=d.useCallback(async()=>{if(!v){if(f||n.data.value.hasLoadedChildren){n.toggle();return}u(!0),await(a==null?void 0:a.treeData.handleLoadChildren(n.data.value.id)),u(!1),n.open()}},[v,f,n,a==null?void 0:a.treeData]),S=d.useCallback(x=>{x&&!n.isOpen&&!n.isDragging&&(s.current=setTimeout(()=>{y()},500)),s.current&&!x&&clearTimeout(s.current)},[y,n.isOpen,n.isDragging]);return d.useEffect(()=>{S(g)},[g,S]),n.data.value.nodeType===Ae.SEPARATOR?T.jsx("div",{className:"c__tree-view--node__separator"}):n.data.value.nodeType===Ae.TITLE?T.jsx("div",{className:"c__tree-view--node__title",children:n.data.value.headerTitle}):T.jsx(xx,{id:n.id,data:{data:n.data,nodeApi:n},onOver:h,children:T.jsxs("div",{onClick:e,ref:r,style:i,className:ot("c__tree-view--node",{...n.state,canDrop:n.data.value.canDrop??!0,externalDrop:c}),children:[v&&T.jsx("div",{className:"c__tree-view--node__leaf"}),!v&&T.jsxs(T.Fragment,{children:[p&&T.jsx("div",{className:"c__tree-view--node__loading",children:T.jsx(Da,{})}),!p&&T.jsx("span",{onClick:x=>{x.stopPropagation(),y()},className:"c__tree-view--node__arrow material-icons",children:n.isOpen?"keyboard_arrow_down":"keyboard_arrow_right"})]}),t]})})};exports.CunninghamProvider=mh;exports.CustomTabs=Jb;exports.DropdownMenu=ed;exports.Header=rd;exports.HorizontalSeparator=qo;exports.Label=Dd;exports.LanguagePicker=nd;exports.LeftPanel=id;exports.MainLayout=jm;exports.ProConnectButton=yh;exports.QuickSearch=qb;exports.QuickSearchGroup=Yb;exports.QuickSearchInput=uf;exports.QuickSearchItem=Mr;exports.QuickSearchItemTemplate=Xb;exports.Spinner=Da;exports.TreeApi=vn;exports.TreeContext=Ba;exports.TreeProvider=ax;exports.TreeView=sx;exports.TreeViewItem=Cx;exports.TreeViewMoveModeEnum=$t;exports.TreeViewNodeTypeEnum=Ae;exports.TreeViewSeparator=th;exports.WithLabel=Hm;exports.cunninghamConfig=jo;exports.getLocales=yu;exports.headerHeight=zm;exports.isNode=Hn;exports.isSeparator=li;exports.isTitle=ui;exports.useDropdownMenu=td;exports.useResponsive=ar;exports.useTree=nh;exports.useTreeContext=Wa;
|
|
99
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function GE(t,e){if(t){if(typeof t=="string")return Yl(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 Yl(t,e)}}function Yl(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 qE(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 YE(t){if(Array.isArray(t))return t}function XE(t){var e=Ht(),n=e.getMonitor(),r=Ff(n,t),i=UE(r,2),o=i[0],a=i[1];return d.useEffect(function(){return n.subscribeToOffsetChange(a)}),d.useEffect(function(){return n.subscribeToStateChange(a)}),o}function Hf(t){var e=null,n=function(){return e==null&&(e=t()),e};return n}function JE(t,e){return t.filter(function(n){return n!==e})}function QE(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 ZE(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function e$(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 t$(t,e,n){return e$(t.prototype,e),t}function Xl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var n$=function(){function t(e){ZE(this,t),Xl(this,"entered",[]),Xl(this,"isNodeInDocument",void 0),this.isNodeInDocument=e}return t$(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=QE(this.entered.filter(o),[n]),i===0&&this.entered.length>0}},{key:"leave",value:function(n){var r=this.entered.length;return this.entered=JE(this.entered.filter(this.isNodeInDocument),n),r>0&&this.entered.length===0}},{key:"reset",value:function(){this.entered=[]}}]),t}(),r$=Hf(function(){return/firefox/i.test(navigator.userAgent)}),Bf=Hf(function(){return!!window.safari});function i$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o$(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 a$(t,e,n){return o$(t.prototype,e),t}function An(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var Jl=function(){function t(e,n){i$(this,t),An(this,"xs",void 0),An(this,"ys",void 0),An(this,"c1s",void 0),An(this,"c2s",void 0),An(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 h=[s[0]],p=0;p<a.length-1;p++){var g=s[p],m=s[p+1];if(g*m<=0)h.push(0);else{l=a[p];var f=a[p+1],v=l+f;h.push(3*v/((v+f)/g+(v+l)/m))}}h.push(s[s.length-1]);for(var y=[],S=[],w,T=0;T<h.length-1;T++){w=s[T];var x=h[T],I=1/a[T],P=x+h[T+1]-w-w;y.push((w-x-P)*I),S.push(P*I*I)}this.xs=e,this.ys=n,this.c1s=h,this.c2s=y,this.c3s=S}return a$(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,h;u<=c;){h=Math.floor(.5*(u+c));var p=r[h];if(p<n)u=h+1;else if(p>n)c=h-1;else return i[h]}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}(),s$=1;function Wf(t){var e=t.nodeType===s$?t:t.parentElement;if(!e)return null;var n=e.getBoundingClientRect(),r=n.top,i=n.left;return{x:i,y:r}}function Pr(t){return{x:t.clientX,y:t.clientY}}function l$(t){var e;return t.nodeName==="IMG"&&(r$()||!((e=document.documentElement)!==null&&e!==void 0&&e.contains(t)))}function u$(t,e,n,r){var i=t?e.width:n,o=t?e.height:r;return Bf()&&t&&(o/=window.devicePixelRatio,i/=window.devicePixelRatio),{dragPreviewWidth:i,dragPreviewHeight:o}}function c$(t,e,n,r,i){var o=l$(e),a=o?t:e,s=Wf(a),l={x:n.x-s.x,y:n.y-s.y},u=t.offsetWidth,c=t.offsetHeight,h=r.anchorX,p=r.anchorY,g=u$(o,e,u,c),m=g.dragPreviewWidth,f=g.dragPreviewHeight,v=function(){var P=new Jl([0,.5,1],[l.y,l.y/c*f,l.y+f-c]),b=P.interpolate(p);return Bf()&&o&&(b+=(window.devicePixelRatio-1)*f),b},y=function(){var P=new Jl([0,.5,1],[l.x,l.x/u*m,l.x+m-u]);return P.interpolate(h)},S=i.offsetX,w=i.offsetY,T=S===0||S,x=w===0||w;return{x:T?S:y(),y:x?w:v()}}var Uf="__NATIVE_FILE__",Vf="__NATIVE_URL__",Gf="__NATIVE_TEXT__",qf="__NATIVE_HTML__";const Ql=Object.freeze(Object.defineProperty({__proto__:null,FILE:Uf,HTML:qf,TEXT:Gf,URL:Vf},Symbol.toStringTag,{value:"Module"}));function po(t,e,n){var r=e.reduce(function(i,o){return i||t.getData(o)},"");return r??n}var en;function Or(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var ra=(en={},Or(en,Uf,{exposeProperties:{files:function(e){return Array.prototype.slice.call(e.files)},items:function(e){return e.items},dataTransfer:function(e){return e}},matchesTypes:["Files"]}),Or(en,qf,{exposeProperties:{html:function(e,n){return po(e,n,"")},dataTransfer:function(e){return e}},matchesTypes:["Html","text/html"]}),Or(en,Vf,{exposeProperties:{urls:function(e,n){return po(e,n,"").split(`
|
|
100
|
+
`)},dataTransfer:function(e){return e}},matchesTypes:["Url","text/uri-list"]}),Or(en,Gf,{exposeProperties:{text:function(e,n){return po(e,n,"")},dataTransfer:function(e){return e}},matchesTypes:["Text","text/plain"]}),en);function d$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function f$(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 h$(t,e,n){return f$(t.prototype,e),t}function Zl(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var p$=function(){function t(e){d$(this,t),Zl(this,"item",void 0),Zl(this,"config",void 0),this.config=e,this.item={},this.initializeExposedProperties()}return h$(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 g$(t,e){var n=new p$(ra[t]);return n.loadDataTransfer(e),n}function go(t){if(!t)return null;var e=Array.prototype.slice.call(t.types||[]);return Object.keys(ra).filter(function(n){var r=ra[n].matchesTypes;return r.some(function(i){return e.indexOf(i)>-1})})[0]||null}function v$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function m$(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 y$(t,e,n){return m$(t.prototype,e),t}function vo(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var b$=function(){function t(e,n){v$(this,t),vo(this,"ownerDocument",null),vo(this,"globalContext",void 0),vo(this,"optionsArgs",void 0),this.globalContext=e,this.optionsArgs=n}return y$(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 eu(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 tu(t){for(var e=1;e<arguments.length;e++){var n=arguments[e]!=null?arguments[e]:{};e%2?eu(Object(n),!0).forEach(function(r){te(t,r,n[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):eu(Object(n)).forEach(function(r){Object.defineProperty(t,r,Object.getOwnPropertyDescriptor(n,r))})}return t}function S$(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function w$(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 E$(t,e,n){return w$(t.prototype,e),t}function te(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var $$=function(){function t(e,n,r){var i=this;S$(this,t),te(this,"options",void 0),te(this,"actions",void 0),te(this,"monitor",void 0),te(this,"registry",void 0),te(this,"enterLeaveCounter",void 0),te(this,"sourcePreviewNodes",new Map),te(this,"sourcePreviewNodeOptions",new Map),te(this,"sourceNodes",new Map),te(this,"sourceNodeOptions",new Map),te(this,"dragStartSourceIds",null),te(this,"dropTargetIds",[]),te(this,"dragEnterTargetIds",[]),te(this,"currentNativeSource",null),te(this,"currentNativeHandle",null),te(this,"currentDragSourceNode",null),te(this,"altKeyPressed",!1),te(this,"mouseMoveTimeoutTimer",null),te(this,"asyncEndDragFrameId",null),te(this,"dragOverTargetIds",null),te(this,"lastClientOffset",null),te(this,"hoverRafId",null),te(this,"getSourceClientOffset",function(o){var a=i.sourceNodes.get(o);return a&&Wf(a)||null}),te(this,"endDragNativeItem",function(){i.isDraggingNativeItem()&&(i.actions.endDrag(),i.currentNativeHandle&&i.registry.removeSource(i.currentNativeHandle),i.currentNativeHandle=null,i.currentNativeSource=null)}),te(this,"isNodeInDocument",function(o){return!!(o&&i.document&&i.document.body&&i.document.body.contains(o))}),te(this,"endDragIfSourceWasRemovedFromDOM",function(){var o=i.currentDragSourceNode;o==null||i.isNodeInDocument(o)||i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),te(this,"handleTopDragStartCapture",function(){i.clearCurrentDragSourceNode(),i.dragStartSourceIds=[]}),te(this,"handleTopDragStart",function(o){if(!o.defaultPrevented){var a=i.dragStartSourceIds;i.dragStartSourceIds=null;var s=Pr(o);i.monitor.isDragging()&&i.actions.endDrag(),i.actions.beginDrag(a||[],{publishSource:!1,getSourceClientOffset:i.getSourceClientOffset,clientOffset:s});var l=o.dataTransfer,u=go(l);if(i.monitor.isDragging()){if(l&&typeof l.setDragImage=="function"){var c=i.monitor.getSourceId(),h=i.sourceNodes.get(c),p=i.sourcePreviewNodes.get(c)||h;if(p){var g=i.getCurrentSourcePreviewNodeOptions(),m=g.anchorX,f=g.anchorY,v=g.offsetX,y=g.offsetY,S={anchorX:m,anchorY:f},w={offsetX:v,offsetY:y},T=c$(h,p,s,S,w);l.setDragImage(p,T.x,T.y)}}try{l==null||l.setData("application/json",{})}catch{}i.setCurrentDragSourceNode(o.target);var x=i.getCurrentSourcePreviewNodeOptions(),I=x.captureDraggingState;I?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()}}}),te(this,"handleTopDragEndCapture",function(){i.clearCurrentDragSourceNode()&&i.monitor.isDragging()&&i.actions.endDrag()}),te(this,"handleTopDragEnterCapture",function(o){i.dragEnterTargetIds=[];var a=i.enterLeaveCounter.enter(o.target);if(!(!a||i.monitor.isDragging())){var s=o.dataTransfer,l=go(s);l&&i.beginDragNativeItem(l,s)}}),te(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:Pr(o)});var s=a.some(function(l){return i.monitor.canDropOnTarget(l)});s&&(o.preventDefault(),o.dataTransfer&&(o.dataTransfer.dropEffect=i.getCurrentDropEffect()))}}),te(this,"handleTopDragOverCapture",function(){i.dragOverTargetIds=[]}),te(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=Pr(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"))}),te(this,"handleTopDragLeaveCapture",function(o){i.isDraggingNativeItem()&&o.preventDefault();var a=i.enterLeaveCounter.leave(o.target);a&&i.isDraggingNativeItem()&&setTimeout(function(){return i.endDragNativeItem()},0)}),te(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 go(o.dataTransfer)&&o.preventDefault();i.enterLeaveCounter.reset()}),te(this,"handleTopDrop",function(o){var a=i.dropTargetIds;i.dropTargetIds=[],i.actions.hover(a,{clientOffset:Pr(o)}),i.actions.drop({dropEffect:i.getCurrentDropEffect()}),i.isDraggingNativeItem()?i.endDragNativeItem():i.monitor.isDragging()&&i.actions.endDrag()}),te(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 b$(n,r),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new n$(this.isNodeInDocument)}return E$(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 tu({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 tu({anchorX:.5,anchorY:.5,captureDraggingState:!1},r||{})}},{key:"isDraggingNativeItem",value:function(){var n=this.monitor.getItemType();return Object.keys(Ql).some(function(r){return Ql[r]===n})}},{key:"beginDragNativeItem",value:function(n,r){this.clearCurrentDragSourceNode(),this.currentNativeSource=g$(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}(),Ir;function x$(){return Ir||(Ir=new Image,Ir.src="data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw=="),Ir}var C$=function(e,n,r){return new $$(e,n,r)};function T$(t){const e=Oe(),n=e.selectedIds,[r,i,o]=OE(()=>({canDrag:()=>t.isDraggable,type:"NODE",item:()=>{const a=e.isSelected(t.id)?Array.from(n):[t.id];return e.dispatch(En.dragStart(t.id,a)),{id:t.id,dragIds:a}},end:()=>{e.hideCursor(),e.dispatch(En.dragEnd())}}),[n,t]);return d.useEffect(()=>{o(x$())},[o]),i}function D$(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 P$(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 _r(t,e){return{parentId:t||null,index:e}}function tn(t,e){return{type:"line",index:t,level:e}}function O$(t){return{type:"highlight",id:t}}function mo(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=bf(r)+1;return{parentId:i,index:o}}function Yf(t){var e;const n=D$(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]=P$(o,s,a,n);if(o&&o.isInternal&&n.inMiddle)return{drop:_r(o.id,null),cursor:O$(o.id)};if(!l)return{drop:_r((e=u==null?void 0:u.parent)===null||e===void 0?void 0:e.id,0),cursor:tn(0,0)};if(gf(l)){const c=Ar(i,(u==null?void 0:u.level)||0,l.level);return{drop:mo(l,c),cursor:tn(l.rowIndex+1,c)}}if(vf(l)){const c=Ar(i,(u==null?void 0:u.level)||0,l.level);return{drop:mo(l,c),cursor:tn(l.rowIndex+1,c)}}if(mf(l)){const c=Ar(i,0,l.level+1);return c>l.level?{drop:_r(l.id,0),cursor:tn(l.rowIndex+1,c)}:{drop:mo(l,c),cursor:tn(l.rowIndex+1,c)}}return{drop:_r(l==null?void 0:l.id,0),cursor:tn(l.rowIndex+1,l.level+1)}}function I$(t,e){const n=Oe(),[r,i]=zf(()=>({accept:"NODE",canDrop:()=>n.canDrop(),hover:(o,a)=>{const s=a.getClientOffset();if(!t.current||!s)return;const{cursor:l,drop:u}=Yf({element:t.current,offset:s,indent:n.indent,node:e,prevNode:e.prev,nextNode:e.next});u&&n.dispatch(En.hovering(u.parentId,u.index)),a.canDrop()?l&&n.showCursor(l):n.hideCursor()},drop:(o,a)=>{if(!a.canDrop())return null;let{parentId:s,index:l,dragIds:u}=n.state.dnd;xf(n.props.onMove,{dragIds:u,parentId:s===er?null:s,index:l===null?0:l,dragNodes:n.dragNodes,parentNode:n.get(s)}),n.open(s)}}),[e,t.current,n.props]);return i}function _$(t){const e=Oe(),n=e.at(t);if(!n)throw new Error(`Could not find node for index: ${t}`);return d.useMemo(()=>{const r=n.clone();return e.visibleNodes[t]=r,r},[...Object.values(n.state),n])}const k$=d.memo(function({index:e,style:n}){pf(),Qb();const r=Oe(),i=_$(e),o=d.useRef(null),a=T$(i),s=I$(o,i),l=d.useCallback(f=>{o.current=f,s(f)},[s]),u=r.indent*i.level,c=d.useMemo(()=>({paddingLeft:u}),[u]),h=d.useMemo(()=>{var f,v;return Object.assign(Object.assign({},n),{top:parseFloat(n.top)+((v=(f=r.props.padding)!==null&&f!==void 0?f:r.props.paddingTop)!==null&&v!==void 0?v:0)})},[n,r.props.padding,r.props.paddingTop]),p={role:"treeitem","aria-level":i.level+1,"aria-selected":i.isSelected,"aria-expanded":i.isOpen,style:h,tabIndex:-1,className:r.props.rowClassName};d.useEffect(()=>{var f;!i.isEditing&&i.isFocused&&((f=o.current)===null||f===void 0||f.focus({preventScroll:!0}))},[i.isEditing,i.isFocused,o.current]);const g=r.renderNode,m=r.renderRow;return D.jsx(m,{node:i,innerRef:l,attrs:p,children:D.jsx(g,{node:i,tree:r,style:c,dragHandle:a})})});let yo="",nu=null;function Xf(){pf();const t=Oe();return D.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(),Sf(e.currentTarget);return}if(e.key==="Tab"&&e.shiftKey){e.preventDefault(),wf(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(nu),yo+=e.key,nu=setTimeout(()=>{yo=""},600);const r=t.visibleNodes.find(i=>{const o=i.data.name;return typeof o=="string"?o.toLowerCase().startsWith(yo):!1});r&&t.focus(r.id)},children:D.jsx(MS,{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:LS,innerElementType:zS,onScroll:t.props.onScroll,onItemsRendered:t.onItemsRendered.bind(t),ref:t.list,children:k$})})}function ru(t){return t.isFiltered?N$(t.root,t.isMatch.bind(t)):R$(t.root)}function R$(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(Jf),e}function N$(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(Jf),r}function Jf(t,e){t.rowIndex=e}const iu=t=>t.reduce((e,n,r)=>(e[n.id]=r,e),{});var bo=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(h){a(h)}}function l(c){try{u(r.throw(c))}catch(h){a(h)}}function u(c){c.done?o(c.value):i(c.value).then(s,l)}u((r=r.apply(t,e||[])).next())})};const{safeRun:he,identify:et,identifyNull:je}=iS;class vn{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=pl(this),this.visibleNodes=ru(this),this.idToIndex=iu(this.visibleNodes)}update(e){this.props=e,this.root=pl(this),this.visibleNodes=ru(this),this.idToIndex=iu(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=zn(e,r))!==null&&n!==void 0?n:null}accessId(e){const n=this.props.idAccessor||"id",r=zn(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=$f(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(){return bo(this,arguments,void 0,function*(e={}){var n,r;const i=e.parentId===void 0?Df(this):e.parentId,o=(n=e.index)!==null&&n!==void 0?n:Tf(this),a=(r=e.type)!==null&&r!==void 0?r:"leaf",s=yield he(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 bo(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 he(this.props.onDelete,{nodes:i,ids:r})})}edit(e){const n=et(e);return this.resolveEdit({cancelled:!0}),this.scrollTo(n),this.dispatch(io(n)),new Promise(r=>{vn.editPromise=r})}submit(e,n){return bo(this,void 0,void 0,function*(){if(!e)return;const r=et(e);yield he(this.props.onRename,{id:r,name:n,node:this.get(r)}),this.dispatch(io(null)),this.resolveEdit({cancelled:!1,value:n}),setTimeout(()=>this.onFocus())})}reset(){this.dispatch(io(null)),this.resolveEdit({cancelled:!0}),setTimeout(()=>this.onFocus())}activate(e){const n=this.get(je(e));n&&he(this.props.onActivate,n)}resolveEdit(e){const n=vn.editPromise;n&&n(e),vn.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(Xt(et(e))),n.scroll!==!1&&this.scrollTo(e),this.focusedNode&&he(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(Xt(i)),this.dispatch(Fe.only(i)),this.dispatch(Fe.anchor(i)),this.dispatch(Fe.mostRecent(i)),this.scrollTo(i,n.align),this.focusedNode&&r&&he(this.props.onFocus,this.focusedNode),he(this.props.onSelect,this.selectedNodes)}deselect(e){if(!e)return;const n=et(e);this.dispatch(Fe.remove(n)),he(this.props.onSelect,this.selectedNodes)}selectMulti(e){const n=this.get(je(e));n&&(this.dispatch(Xt(n.id)),this.dispatch(Fe.add(n.id)),this.dispatch(Fe.anchor(n.id)),this.dispatch(Fe.mostRecent(n.id)),this.scrollTo(n),this.focusedNode&&he(this.props.onFocus,this.focusedNode),he(this.props.onSelect,this.selectedNodes))}selectContiguous(e){if(!e)return;const n=et(e),{anchor:r,mostRecent:i}=this.state.nodes.selection;this.dispatch(Xt(n)),this.dispatch(Fe.remove(this.nodesBetween(r,i))),this.dispatch(Fe.add(this.nodesBetween(r,je(n)))),this.dispatch(Fe.mostRecent(n)),this.scrollTo(n),this.focusedNode&&he(this.props.onFocus,this.focusedNode),he(this.props.onSelect,this.selectedNodes)}deselectAll(){this.setSelection({ids:[],anchor:null,mostRecent:null}),he(this.props.onSelect,this.selectedNodes)}selectAll(){var e;this.setSelection({ids:Object.keys(this.idToIndex),anchor:this.firstNode,mostRecent:this.lastNode}),this.dispatch(Xt((e=this.lastNode)===null||e===void 0?void 0:e.id)),this.focusedNode&&he(this.props.onFocus,this.focusedNode),he(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=je(e.anchor),o=je(e.mostRecent);this.dispatch(Fe.set({ids:r,anchor:i,mostRecent:o})),he(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&&yf(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(En.cursor({type:"none"}))}showCursor(e){this.dispatch(En.cursor(e))}open(e){const n=je(e);n&&(this.isOpen(n)||(this.dispatch(Yo.open(n,this.isFiltered)),he(this.props.onToggle,n)))}close(e){const n=je(e);n&&this.isOpen(n)&&(this.dispatch(Yo.close(n,this.isFiltered)),he(this.props.onToggle,n))}toggle(e){const n=je(e);if(n)return this.isOpen(n)?this.close(n):this.open(n)}openParents(e){const n=je(e);if(!n)return;const r=Ma(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(){oi(this.root,e=>{e.isInternal&&e.open()})}closeAll(){oi(this.root,e=>{e.isInternal&&e.close()})}scrollTo(e,n="smart"){if(!e)return;const r=et(e);return this.openParents(r),Cf(()=>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===er)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){const n=this.props.disableEdit||(()=>!1);return!zn(e,n)}isDraggable(e){const n=this.props.disableDrag||(()=>!1);return!zn(e,n)}isDragging(e){const n=je(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=je(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(Xt(e.id))}onBlur(){this.dispatch(pS())}onItemsRendered(e){this.visibleStartIndex=e.visibleStartIndex,this.visibleStopIndex=e.visibleStopIndex}get renderContainer(){return this.props.renderContainer||Xf}get renderRow(){return this.props.renderRow||uS}get renderNode(){return this.props.children||cS}get renderDragPreview(){return this.props.renderDragPreview||Pf}get renderCursor(){return this.props.renderCursor||lS}}function Ee(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 M$=typeof Symbol=="function"&&Symbol.observable||"@@observable",ou=M$,So=()=>Math.random().toString(36).substring(7).split("").join("."),A$={INIT:`@@redux/INIT${So()}`,REPLACE:`@@redux/REPLACE${So()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${So()}`},Ot=A$;function Qf(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 K$(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(j$(t))return"date";if(F$(t))return"error";const n=L$(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 L$(t){return typeof t.constructor=="function"?t.constructor.name:null}function F$(t){return t instanceof Error||typeof t.message=="string"&&t.constructor&&typeof t.constructor.stackTraceLimit=="number"}function j$(t){return t instanceof Date?!0:typeof t.toDateString=="function"&&typeof t.getDate=="function"&&typeof t.setDate=="function"}function dt(t){let e=typeof t;return process.env.NODE_ENV!=="production"&&(e=K$(t)),e}function Zf(t,e,n){if(typeof t!="function")throw new Error(process.env.NODE_ENV==="production"?Ee(2):`Expected the root reducer to be a function. Instead, received: '${dt(t)}'`);if(typeof e=="function"&&typeof n=="function"||typeof n=="function"&&typeof arguments[3]=="function")throw new Error(process.env.NODE_ENV==="production"?Ee(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"?Ee(1):`Expected the enhancer to be a function. Instead, received: '${dt(n)}'`);return n(Zf)(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"?Ee(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 h(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ee(4):`Expected the listener to be a function. Instead, received: '${dt(v)}'`);if(l)throw new Error(process.env.NODE_ENV==="production"?Ee(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 S=s++;return a.set(S,v),function(){if(y){if(l)throw new Error(process.env.NODE_ENV==="production"?Ee(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(S),o=null}}}function p(v){if(!Qf(v))throw new Error(process.env.NODE_ENV==="production"?Ee(7):`Actions must be plain objects. Instead, the actual type was: '${dt(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"?Ee(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"?Ee(17):`Action "type" property must be a string. Instead, the actual type was: '${dt(v.type)}'. Value was: '${v.type}' (stringified)`);if(l)throw new Error(process.env.NODE_ENV==="production"?Ee(9):"Reducers may not dispatch actions.");try{l=!0,i=r(i,v)}finally{l=!1}return(o=a).forEach(S=>{S()}),v}function g(v){if(typeof v!="function")throw new Error(process.env.NODE_ENV==="production"?Ee(10):`Expected the nextReducer to be a function. Instead, received: '${dt(v)}`);r=v,p({type:Ot.REPLACE})}function m(){const v=h;return{subscribe(y){if(typeof y!="object"||y===null)throw new Error(process.env.NODE_ENV==="production"?Ee(11):`Expected the observer to be an object. Instead, received: '${dt(y)}'`);function S(){const T=y;T.next&&T.next(c())}return S(),{unsubscribe:v(S)}},[ou](){return this}}}return p({type:Ot.INIT}),{dispatch:p,subscribe:h,getState:c,replaceReducer:g,[ou]:m}}function au(t){typeof console<"u"&&typeof console.error=="function"&&console.error(t);try{throw new Error(t)}catch{}}function z$(t,e,n,r){const i=Object.keys(e),o=n&&n.type===Ot.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(!Qf(t))return`The ${o} has unexpected type of "${dt(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===Ot.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 H$(t){Object.keys(t).forEach(e=>{const n=t[e];if(typeof n(void 0,{type:Ot.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?Ee(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:Ot.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?Ee(13):`The slice reducer for key "${e}" returned undefined when probed with a random type. Don't try to handle '${Ot.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 su(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"&&au(`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{H$(n)}catch(a){o=a}return function(s={},l){if(o)throw o;if(process.env.NODE_ENV!=="production"){const h=z$(s,n,l,i);h&&au(h)}let u=!1;const c={};for(let h=0;h<r.length;h++){const p=r[h],g=n[p],m=s[p],f=g(m,l);if(typeof f>"u"){const v=l&&l.type;throw new Error(process.env.NODE_ENV==="production"?Ee(14):`When called with an action of type ${v?`"${String(v)}"`:"(unknown type)"}, the slice reducer for key "${p}" 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[p]=f,u=u||f!==m}return u=u||r.length!==Object.keys(s).length,u?c:s}}function B$(t=wn().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 W$=su({nodes:su({focus:gS,edit:hS,open:vS,selection:mS,drag:B$}),dnd:yS}),U$=wn();function V$({treeProps:t,imperativeHandle:e,children:n}){const r=d.useRef(null),i=d.useRef(null),o=d.useRef(Zf(W$,wn(t))),a=da.useSyncExternalStore(o.current.subscribe,o.current.getState,()=>U$),s=d.useMemo(()=>new vn(o.current,t,r,i),[]),l=d.useRef(0);return d.useMemo(()=>{l.current+=1,s.update(t)},[...Object.values(t),a.nodes.open]),d.useImperativeHandle(e,()=>s),d.useEffect(()=>{s.props.selection?s.select(s.props.selection,{focus:!1}):s.deselectAll()},[s.props.selection]),d.useEffect(()=>{s.props.searchTerm||o.current.dispatch(Yo.clear(!0))},[s.props.searchTerm]),D.jsx(cf.Provider,{value:s,children:D.jsx(hf.Provider,{value:l.current,children:D.jsx(df.Provider,{value:a.nodes,children:D.jsx(ff.Provider,{value:a.dnd,children:D.jsx(x0,Object.assign({backend:C$,options:{rootElement:s.props.dndRootElement||void 0}},t.dndManager&&{manager:t.dndManager},{children:n}))})})})})}function G$(){const t=Oe(),[,e]=zf(()=>({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}=Yf({element:t.listEl.current,offset:i,indent:t.indent,node:null,prevNode:t.visibleNodes[t.visibleNodes.length-1],nextNode:null});a&&t.dispatch(En.hovering(a.parentId,a.index)),r.canDrop()?o&&t.showCursor(o):t.hideCursor()}}),[t]);e(t.listEl)}function q$(t){return G$(),t.children}function Y$(){const e=Oe().props.renderContainer||Xf;return D.jsx(D.Fragment,{children:D.jsx(e,{})})}function X$(){const t=Oe(),{offset:e,mouse:n,item:r,isDragging:i}=XE(a=>({offset:a.getSourceClientOffset(),mouse:a.getClientOffset(),item:a.getItem(),isDragging:a.isDragging()})),o=t.props.renderDragPreview||Pf;return D.jsx(o,{offset:e,mouse:n,id:(r==null?void 0:r.id)||null,dragIds:(r==null?void 0:r.dragIds)||[],isDragging:i})}class J${constructor(e){this.root=Q$(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 Q$(t){const e=new eh({id:"ROOT"},null);return e.children=t.map(n=>Ha(n,e)),e}function Ha(t,e){const n=new eh(t,e);return t.children&&(n.children=t.children.map(r=>Ha(r,n))),n}class eh{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=Ha(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 Z$=0;function ex(t){const[e,n]=d.useState(t),r=d.useMemo(()=>new J$(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:h})=>{const p={id:`simple-tree-id-${Z$++}`,name:""};return h==="internal"&&(p.children=[]),r.create({parentId:u,index:c,data:p}),n(r.data),p},onDelete:u=>{u.ids.forEach(c=>r.drop({id:c})),n(r.data)}}]}function tx(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.
|
|
101
|
+
Use the data prop if you want to provide your own handlers.`);if(t.initialData){const[e,n]=ex(t.initialData);return Object.assign(Object.assign(Object.assign({},t),n),{data:e})}else return t}function nx(t,e){const n=tx(t);return D.jsxs(V$,{treeProps:n,imperativeHandle:e,children:[D.jsx(q$,{children:D.jsx(Y$,{})}),D.jsx(X$,{})]})}const rx=d.forwardRef(nx),th=({top:t,left:e})=>D.jsx("div",{className:"c__tree-view__cursor",style:{top:t-2,left:e+10,width:`calc(100% - ${24+e}px)`}});function ix(t,e){var n=d.useRef(null),r=d.useRef(null);r.current=e;var i=d.useRef(null);d.useEffect(function(){o()});var o=d.useCallback(function(){var a=i.current,s=r.current,l=a||(s?s instanceof Element?s:s.current:null);n.current&&n.current.element===l&&n.current.subscriber===t||(n.current&&n.current.cleanup&&n.current.cleanup(),n.current={element:l,subscriber:t,cleanup:l?t(l):void 0})},[t]);return d.useEffect(function(){return function(){n.current&&n.current.cleanup&&(n.current.cleanup(),n.current=null)}},[]),d.useCallback(function(a){i.current=a,o()},[o])}function lu(t,e,n){return t[e]?t[e][0]?t[e][0][n]:t[e][n]:e==="contentBoxSize"?t.contentRect[n==="inlineSize"?"width":"height"]:void 0}function ox(t){t===void 0&&(t={});var e=t.onResize,n=d.useRef(void 0);n.current=e;var r=t.round||Math.round,i=d.useRef(),o=d.useState({width:void 0,height:void 0}),a=o[0],s=o[1],l=d.useRef(!1);d.useEffect(function(){return l.current=!1,function(){l.current=!0}},[]);var u=d.useRef({width:void 0,height:void 0}),c=ix(d.useCallback(function(h){return(!i.current||i.current.box!==t.box||i.current.round!==r)&&(i.current={box:t.box,round:r,instance:new ResizeObserver(function(p){var g=p[0],m=t.box==="border-box"?"borderBoxSize":t.box==="device-pixel-content-box"?"devicePixelContentBoxSize":"contentBoxSize",f=lu(g,m,"inlineSize"),v=lu(g,m,"blockSize"),y=f?r(f):void 0,S=v?r(v):void 0;if(u.current.width!==y||u.current.height!==S){var w={width:y,height:S};u.current.width=y,u.current.height=S,n.current?n.current(w):l.current||s(w)}})}),i.current.instance.observe(h,{box:t.box}),function(){i.current&&i.current.instance.unobserve(h)}},[t.box,r]),t.ref);return d.useMemo(function(){return{ref:c,width:a.width,height:a.height}},[c,a.width,a.height])}var Ke=(t=>(t.NODE="node",t.SEPARATOR="separator",t.TITLE="title",t))(Ke||{}),$t=(t=>(t.FIRST_CHILD="first-child",t.LAST_CHILD="last-child",t.LEFT="left",t.RIGHT="right",t))($t||{});const li=t=>t?t.nodeType===Ke.SEPARATOR:!1,ui=t=>t?t.nodeType===Ke.TITLE:!1,Hn=t=>!li(t)&&!ui(t),nh=(t,e,n)=>{const{remove:r,update:i,insert:o,insertBefore:a,insertAfter:s,append:l,prepend:u,getItem:c,move:h,items:p}=Pv({initialItems:JSON.parse(JSON.stringify(t)),getKey:j=>j.id,getChildren:j=>j.children||[]}),[g,m]=d.useState(),f=(j=[])=>{const O=p.map(N=>N.key);r(...O);const k=JSON.parse(JSON.stringify(j));k.length>0&&o(null,0,...k),m(void 0)},v=(j,O,k)=>{const N=c(j);if(!N)return;const F=[...N.value.children??[]];k?F.splice(k,0,O):F.push(O),N.value.children=F,N.value.childrenCount=F.length},y=j=>{const O=c(j);O&&m(O.value)},S=(j,O,k)=>{var N;if(j){const A=c(j);A&&(o(j,k??((N=A.children)==null?void 0:N.length)??0,O),v(j,O,k))}else o(null,k??p.length,O)},w=j=>{var O;return(O=c(j))==null?void 0:O.value},T=(j,O)=>{const k=c(j);if(!k){console.error("No item found");return}let N=k.value.children??null;const A=O.childrenCount??k.value.childrenCount??0;(N==null?void 0:N.length)===0&&A>0&&(N=null),O.children&&(N=[...N??[],...O.children]);const F={...k.value,...O,children:N,childrenCount:(N==null?void 0:N.length)??A};i(j,F),k.parentKey&&I(k.parentKey,j,O)},x=j=>{const O=c(j),k=O==null?void 0:O.parentKey;k&&O&&Y(k,O.value.id),r(j)},I=(j,O,k)=>{const N=c(j);if(!N)return;const A=N.value.children??[],F=A.findIndex(L=>L.id===O);if(F===-1)return;const B={...A[F],...k};A[F]=B},P=async j=>{if(!e){console.error("No refresh callback provided");return}try{const O=await e(j);T(j,O)}catch(O){console.error("error while refreshing node:",O)}},b=(j,O)=>{o(null,O??p.length,j)},R=(j,O)=>{const k=c(j);if(!k){console.error("No item found");return}const N={...k.value,children:O,childrenCount:O.length,hasLoadedChildren:O.length>0};i(j,N),k.parentKey&&I(k.parentKey,j,N)},W=j=>{const O=[],k=c(j);if(!k)return[];O.push(k.value);const N=A=>{const F=M(A);if(!F)return;const B=c(F);B&&(O.push(B.value),N(F))};return N(j),O.reverse()},M=j=>{var O;return((O=c(j))==null?void 0:O.parentKey)??null},H=j=>{const O=M(j);if(!O)return null;const k=c(O);return k?k.value:null},E=(j,O)=>{a(j,O)},_=(j,O)=>{s(j,O)},z=(j,O)=>{l(j,O)},U=(j,O)=>{u(j,O)},Y=(j,O)=>{const k=c(j);if(!k)return;const A=(k.value.children??[]).filter(F=>F.id!==O);k.value.children=A,k.value.childrenCount=A.length},K=(j,O,k,N)=>{var F;const A=(F=c(j))==null?void 0:F.value;h(j,O,k),O&&A&&v(O,A),N&&Y(N,j)};return{nodes:p,addChild:S,updateNode:T,deleteNode:x,addRootNode:b,selectedNode:g,setSelectedNode:m,refreshNode:P,setChildren:R,insertBeforeNode:E,insertAfterNode:_,handleMove:j=>{K(j.sourceId,j.newParentId,j.index,j.oldParentId)},prependToNode:U,moveNode:K,appendToNode:z,move:h,resetTree:f,handleLoadChildren:async j=>{if(!n)return[];const O=await n(j);return T(j,{children:O,hasLoadedChildren:!0,childrenCount:O.length}),O},selectNodeById:y,getParent:H,getNode:w,getParentId:M,getAncestors:W}},Ba=d.createContext(null),ax=({children:t,onRefresh:e,initialNodeId:n,onLoadChildren:r,initialTreeData:i})=>{const o=d.useRef(null),[a,s]=d.useState(null),[l,u]=d.useState(n??null),c=nh(i??[],e,r);return D.jsx(Ba.Provider,{value:{treeApiRef:o,treeData:c,root:a,initialTargetId:l,setInitialTargetId:u,setRoot:s},children:t})},Wa=()=>{const t=d.useContext(Ba);if(!t)throw new Error("TreeContext not found");return t},sx=({initialOpenState:t,selectedNodeId:e,rootNodeId:n,renderNode:r,canDrop:i,canDrag:o,afterMove:a})=>{const{ref:s,width:l,height:u}=ox(),c=Wa(),h=(c==null?void 0:c.treeData.nodes)??[],p=m=>{var z,U,Y,K;const f=JSON.parse(JSON.stringify(h)),v=m.dragNodes[0],y=m.parentId?((z=m.parentNode)==null?void 0:z.data.children)??[]:f,S=m.dragNodes[0].data.value.id,w=m.dragNodes[0].data,T=(U=m.parentNode)==null?void 0:U.data;if((T==null?void 0:T.value.nodeType)===Ke.TITLE||(T==null?void 0:T.value.nodeType)===Ke.SEPARATOR)return null;const x=w.parentKey??n,I=m.parentId??n;let P=m.index+0,b=null,R=I;const W=((K=(Y=v.parent)==null?void 0:Y.children)==null?void 0:K.findIndex(q=>q.data.value.id===S))??0;if(x===I){if(W===P)return null;P=P<W?P:P-1}const M=m.index-1,H=y[M],E=m.index,_=y[E];return m.index===0?(R=m.parentId??n,b=$t.FIRST_CHILD):!T&&m.index===1&&!Hn(H.value)?(R=n,P=1,b=$t.FIRST_CHILD):m.index===y.length?(R=R??n,b=$t.LAST_CHILD):H&&Hn(H.value)?(R=H.value.id,b=$t.RIGHT):_&&Hn(_.value)&&(b=$t.LEFT,R=_.value.id),b&&R?{targetModeId:R,mode:b,oldParentId:x,index:P,newParentId:m.parentId,sourceId:S}:null},g=m=>{const f=p(m);f&&(c==null||c.treeData.handleMove(f),a==null||a(f))};if(c)return D.jsx("div",{ref:s,className:"c__tree-view--container",children:D.jsx(rx,{data:h,ref:c.treeApiRef,openByDefault:!1,disableEdit:!0,className:"c__tree-view",idAccessor:"key",onMove:g,rowHeight:35,disableDrag:m=>o?!o(m):!1,disableDrop:({parentNode:m,dragNodes:f,index:v})=>{var x,I;if(i&&!i({parentNode:m,dragNodes:f,index:v}))return m.id!=="__REACT_ARBORIST_INTERNAL_ROOT__"&&(m.data.value.canDrop=!1),!0;const y=f[0];if(y&&y.isDragging&&y.willReceiveDrop||((x=m.data.value)==null?void 0:x.nodeType)===Ke.TITLE||((I=m.data.value)==null?void 0:I.nodeType)===Ke.SEPARATOR)return!0;if(m.id==="__REACT_ARBORIST_INTERNAL_ROOT__"){const P=h[v-1],b=h[v],R=h[v+1],W=li(P==null?void 0:P.value),M=li(b==null?void 0:b.value),H=ui(P==null?void 0:P.value),E=ui(b==null?void 0:b.value),_=Hn(R==null?void 0:R.value);return!!(v===0&&(M||E)||W&&E&&_||H&&M&&_)}const S=m==null?void 0:m.isOpen,w=(m==null?void 0:m.data.value.childrenCount)&&m.data.value.childrenCount>0||(m==null?void 0:m.data.children)&&m.data.children.length>0;if(!w)return m.data.value.canDrop=!0,!1;let T=m.data.value.childrenCount&&m.data.value.childrenCount>0&&(m==null?void 0:m.data.children)&&m.data.children.length>0;return T=T??!0,!S&&!T&&w?(m.data.value.canDrop=!0,!0):(m.data.value.canDrop=!0,!1)},paddingBottom:30,paddingTop:2,width:l,initialOpenState:t,height:u,overscanCount:20,selection:e,renderCursor:th,renderRow:lx,rowClassName:"c__tree-view--row",children:r})})},lx=({children:t,...e})=>{const n=e.node.data.value.nodeType===Ke.TITLE,r=e.node.data.value.nodeType===Ke.SEPARATOR,{style:i}=e.attrs,o={...i};return n||r?d.createElement("div",{...e.attrs,key:e.node.id,style:o,ref:e.innerRef,onFocus:a=>a.stopPropagation(),onClick:e.node.handleClick},t):d.createElement("div",{...e.attrs,style:o,key:e.node.id,ref:e.innerRef,onFocus:a=>a.stopPropagation(),onClick:e.node.handleClick},D.jsx("div",{style:{padding:"0 12px"},children:t}))},ux=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function cx(t){const e=Object.prototype.toString.call(t);return e==="[object Window]"||e==="[object global]"}function dx(t){return"nodeType"in t}function fx(t){var e,n;return t?cx(t)?t:dx(t)&&(e=(n=t.ownerDocument)==null?void 0:n.defaultView)!=null?e:window:window}const rh=ux?d.useLayoutEffect:d.useEffect;function ih(t){const e=d.useRef(t);return rh(()=>{e.current=t}),d.useCallback(function(){for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];return e.current==null?void 0:e.current(...r)},[])}function uu(t,e){e===void 0&&(e=[t]);const n=d.useRef(t);return rh(()=>{n.current!==t&&(n.current=t)},e),n}function hx(t){const e=ih(t),n=d.useRef(null),r=d.useCallback(i=>{i!==n.current&&(e==null||e(i,n.current)),n.current=i},[]);return[n,r]}let wo={};function px(t,e){return d.useMemo(()=>{const n=wo[t]==null?0:wo[t]+1;return wo[t]=n,t+"-"+n},[t,e])}var Un;(function(t){t.DragStart="dragStart",t.DragMove="dragMove",t.DragEnd="dragEnd",t.DragCancel="dragCancel",t.DragOver="dragOver",t.RegisterDroppable="registerDroppable",t.SetDroppableDisabled="setDroppableDisabled",t.UnregisterDroppable="unregisterDroppable"})(Un||(Un={}));function cu(){}const gx=Object.freeze({x:0,y:0});function vx(t){if(t.startsWith("matrix3d(")){const e=t.slice(9,-1).split(/, /);return{x:+e[12],y:+e[13],scaleX:+e[0],scaleY:+e[5]}}else if(t.startsWith("matrix(")){const e=t.slice(7,-1).split(/, /);return{x:+e[4],y:+e[5],scaleX:+e[0],scaleY:+e[3]}}return null}function mx(t,e,n){const r=vx(e);if(!r)return t;const{scaleX:i,scaleY:o,x:a,y:s}=r,l=t.left-a-(1-i)*parseFloat(n),u=t.top-s-(1-o)*parseFloat(n.slice(n.indexOf(" ")+1)),c=i?t.width/i:t.width,h=o?t.height/o:t.height;return{width:c,height:h,top:u,right:l+c,bottom:u+h,left:l}}const yx={ignoreTransform:!1};function oh(t,e){e===void 0&&(e=yx);let n=t.getBoundingClientRect();if(e.ignoreTransform){const{transform:u,transformOrigin:c}=fx(t).getComputedStyle(t);u&&(n=mx(n,u,c))}const{top:r,left:i,width:o,height:a,bottom:s,right:l}=n;return{top:r,left:i,width:o,height:a,bottom:s,right:l}}function du(t){return oh(t,{ignoreTransform:!0})}var dn;(function(t){t[t.Forward=1]="Forward",t[t.Backward=-1]="Backward"})(dn||(dn={}));var fu;(function(t){t.Click="click",t.DragStart="dragstart",t.Keydown="keydown",t.ContextMenu="contextmenu",t.Resize="resize",t.SelectionChange="selectionchange",t.VisibilityChange="visibilitychange"})(fu||(fu={}));var ht;(function(t){t.Space="Space",t.Down="ArrowDown",t.Right="ArrowRight",t.Left="ArrowLeft",t.Up="ArrowUp",t.Esc="Escape",t.Enter="Enter",t.Tab="Tab"})(ht||(ht={}));ht.Space,ht.Enter,ht.Esc,ht.Space,ht.Enter,ht.Tab;var hu;(function(t){t[t.RightClick=2]="RightClick"})(hu||(hu={}));var pu;(function(t){t[t.Pointer=0]="Pointer",t[t.DraggableRect=1]="DraggableRect"})(pu||(pu={}));var gu;(function(t){t[t.TreeOrder=0]="TreeOrder",t[t.ReversedTreeOrder=1]="ReversedTreeOrder"})(gu||(gu={}));dn.Backward+"",dn.Forward+"",dn.Backward+"",dn.Forward+"";var ia;(function(t){t[t.Always=0]="Always",t[t.BeforeDragging=1]="BeforeDragging",t[t.WhileDragging=2]="WhileDragging"})(ia||(ia={}));var oa;(function(t){t.Optimized="optimized"})(oa||(oa={}));function bx(t){let{callback:e,disabled:n}=t;const r=ih(e),i=d.useMemo(()=>{if(n||typeof window>"u"||typeof window.ResizeObserver>"u")return;const{ResizeObserver:o}=window;return new o(r)},[n]);return d.useEffect(()=>()=>i==null?void 0:i.disconnect(),[i]),i}ia.WhileDragging,oa.Optimized;const Sx={activatorEvent:null,activators:[],active:null,activeNodeRect:null,ariaDescribedById:{draggable:""},dispatch:cu,draggableNodes:new Map,over:null,measureDroppableContainers:cu},wx=d.createContext(Sx);({...gx});var vu;(function(t){t[t.Uninitialized=0]="Uninitialized",t[t.Initializing=1]="Initializing",t[t.Initialized=2]="Initialized"})(vu||(vu={}));const Ex="Droppable",$x={timeout:25};function xx(t){let{data:e,disabled:n=!1,id:r,resizeObserverConfig:i}=t;const o=px(Ex),{active:a,dispatch:s,over:l,measureDroppableContainers:u}=d.useContext(wx),c=d.useRef({disabled:n}),h=d.useRef(!1),p=d.useRef(null),g=d.useRef(null),{disabled:m,updateMeasurementsFor:f,timeout:v}={...$x,...i},y=uu(f??r),S=d.useCallback(()=>{if(!h.current){h.current=!0;return}g.current!=null&&clearTimeout(g.current),g.current=setTimeout(()=>{u(Array.isArray(y.current)?y.current:[y.current]),g.current=null},v)},[v]),w=bx({callback:S,disabled:m||!a}),T=d.useCallback((b,R)=>{w&&(R&&(w.unobserve(R),h.current=!1),b&&w.observe(b))},[w]),[x,I]=hx(T),P=uu(e);return d.useEffect(()=>{!w||!x.current||(w.disconnect(),h.current=!1,w.observe(x.current))},[x,w]),d.useEffect(()=>(s({type:Un.RegisterDroppable,element:{id:r,key:o,disabled:n,node:x,rect:p,data:P}}),()=>s({type:Un.UnregisterDroppable,key:o,id:r})),[r]),d.useEffect(()=>{n!==c.current.disabled&&(s({type:Un.SetDroppableDisabled,id:r,key:o,disabled:n}),c.current.disabled=n)},[r,o,n,s]),{active:a,rect:p,isOver:(l==null?void 0:l.id)===r,node:x,over:l,setNodeRef:I}}const Cx=t=>{const{isOver:e,setNodeRef:n}=xx({id:t.id,data:t.data});return d.useEffect(()=>{var r;(r=t.onOver)==null||r.call(t,e,t.data)},[e,t.data,t.onOver]),D.jsx("div",{className:"c__dnd--droppable",ref:n,children:t.children})},Tx=({children:t,onClick:e,node:n,dragHandle:r,style:i,forceLoading:o})=>{var w,T;const a=Wa(),s=d.useRef(null),[l,u]=d.useState(!1),[c,h]=d.useState(!1),p=o??l,g=n.willReceiveDrop||c,m=n.data.value.childrenCount!==void 0&&n.data.value.childrenCount>0||(((w=n.data.children)==null?void 0:w.length)??0)>0,f=((T=n.children)==null?void 0:T.length)??!1,v=n.isLeaf||!m,y=d.useCallback(async()=>{if(!v){if(f||n.data.value.hasLoadedChildren){n.toggle();return}u(!0),await(a==null?void 0:a.treeData.handleLoadChildren(n.data.value.id)),u(!1),n.open()}},[v,f,n,a==null?void 0:a.treeData]),S=d.useCallback(x=>{x&&!n.isOpen&&!n.isDragging&&(s.current=setTimeout(()=>{y()},500)),s.current&&!x&&clearTimeout(s.current)},[y,n.isOpen,n.isDragging]);return d.useEffect(()=>{S(g)},[g,S]),n.data.value.nodeType===Ke.SEPARATOR?D.jsx("div",{className:"c__tree-view--node__separator"}):n.data.value.nodeType===Ke.TITLE?D.jsx("div",{className:"c__tree-view--node__title",children:n.data.value.headerTitle}):D.jsx(Cx,{id:n.id,data:{data:n.data,nodeApi:n},onOver:h,children:D.jsxs("div",{onClick:e,ref:r,style:i,className:ot("c__tree-view--node",{...n.state,canDrop:n.data.value.canDrop??!0,externalDrop:c}),children:[v&&D.jsx("div",{className:"c__tree-view--node__leaf"}),!v&&D.jsxs(D.Fragment,{children:[p&&D.jsx("div",{className:"c__tree-view--node__loading",children:D.jsx(Da,{})}),!p&&D.jsx("span",{onClick:x=>{x.stopPropagation(),y()},className:"c__tree-view--node__arrow material-icons",children:n.isOpen?"keyboard_arrow_down":"keyboard_arrow_right"})]}),t]})})};exports.CunninghamProvider=mh;exports.CustomTabs=Jb;exports.DropdownMenu=ed;exports.Header=rd;exports.HorizontalSeparator=qo;exports.Label=Dd;exports.LanguagePicker=nd;exports.LeftPanel=id;exports.MainLayout=jm;exports.ProConnectButton=yh;exports.QuickSearch=qb;exports.QuickSearchGroup=Yb;exports.QuickSearchInput=uf;exports.QuickSearchItem=Mr;exports.QuickSearchItemTemplate=Xb;exports.Spinner=Da;exports.TreeApi=vn;exports.TreeContext=Ba;exports.TreeProvider=ax;exports.TreeView=sx;exports.TreeViewItem=Tx;exports.TreeViewMoveModeEnum=$t;exports.TreeViewNodeTypeEnum=Ke;exports.TreeViewSeparator=th;exports.WithLabel=Hm;exports.cunninghamConfig=jo;exports.getLocales=yu;exports.headerHeight=zm;exports.isNode=Hn;exports.isSeparator=li;exports.isTitle=ui;exports.useDropdownMenu=td;exports.useResponsive=ar;exports.useTree=nh;exports.useTreeContext=Wa;
|
|
102
102
|
//# sourceMappingURL=index.cjs.map
|