cemtrik-dependencies 1.0.227 → 1.0.228
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/package.json +1 -1
- package/dist/index.js +0 -72
package/package.json
CHANGED
package/dist/index.js
DELETED
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
(function(z,u){typeof exports=="object"&&typeof module<"u"?u(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],u):(z=typeof globalThis<"u"?globalThis:z||self,u(z["cemtrik-dependencies"]={},z.React,z.ReactDOM))})(this,function(z,u,jt){"use strict";function kr(e){const n=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const r=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(n,t,r.get?r:{enumerable:!0,get:()=>e[t]})}}return n.default=e,Object.freeze(n)}const S=kr(u),Ot=(e,n=!1)=>{function t(o){if(typeof o!="object"||o===null)return o;const i=Array.isArray(o)?[]:{};for(const l in o)o.hasOwnProperty(l)&&!n&&(i[l]=t(o[l]));return i}return e.map(o=>t(o))},pn=e=>/^(?:[^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*|"[^\n"]+")@(?:[^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,63}$/i.test(e);function $(...e){return e.filter(Boolean).join(" ")}const Ir=e=>{const n=e.split(" ");let t=e.slice(0,2);return n.length>1&&(t=`${e.at(0)}${n[n.length-1].slice(0,1)}`),t};function $r({items:e,key:n}){const t=e.reduce((r,o)=>(r[o[n]]||(r[o[n]]=[]),r[o[n]].push(o),r),{});return Object.values(t).sort((r,o)=>{const i=r[0][n],l=o[0][n];return i===""&&l!==""?1:l===""&&i!==""?-1:String(i).localeCompare(String(l))})}const Fr=e=>typeof e!="string"&&Promise.resolve(e)instanceof Promise,Mr="The user aborted a request.",Pr="signal is aborted without reason",hn=({id:e,close:n})=>{u.useEffect(()=>{const t=r=>{const o=document.getElementById(e);o&&(o.contains(r.target)||n())};return document.addEventListener("click",t,!0),()=>{document.removeEventListener("click",t,!0)}},[e,n])},Lr=()=>{const e=u.useRef({}),[n,t]=u.useState({}),[r,o]=u.useState({}),[i,l]=u.useState([]);u.useEffect(()=>{e.current={}},[]);const s=x=>m=>{m.preventDefault(),m.stopPropagation(),x(n)},a=(x,m,v)=>{const{checked:g,value:b,name:E,type:w,id:y}=x.target,N={radio:y,checkbox:g};e.current={...v,...e.current,[E]:N[w]??b},t({...e.current,[E]:N[w]??b}),m({...e.current,[E]:N[w]??b})},f=u.useCallback((x,m)=>{e.current={...e.current,[x]:m},t(v=>({...v,[x]:m}))},[]),d=u.useCallback((x,m)=>{const v=m.filter(g=>x[g]===""||x[g]===void 0);return v.forEach(g=>o(b=>({...b,[g]:"Este campo es requerido"}))),l(v),v.length>0},[]);return{handleSubmit:s,handleChange:a,setValuesDefault:f,validateFields:d,errors:i,model:n,handleError:(x,m)=>{m.forEach(v=>o(g=>({...g,[v]:x}))),l(m)},messageError:r,setModel:t}},Ar=e=>{const[n,t]=u.useState(!0),[r,o]=u.useState(!1),i=u.useCallback((l,s)=>{const a=e.match(/[0-9]+/g);if(a===null)return;const[f]=a;s=Math.min(window.innerWidth,window.outerWidth);const d=l?s>=Number(f):s<=Number(f);o(d)},[e]);return u.useEffect(()=>{const l=/\(min-width:\s?[0-9]+px\)/gi.test(e),s=/\(max-width:\s?[0-9]+px\)/gi.test(e);if(!l&&!s&&t(!1),!l&&!s)return;const a=Math.min(window.innerWidth,window.outerWidth);i(l,a)},[e,i]),u.useEffect(()=>{if(!n)return;const l=Math.min(window.innerWidth,window.outerWidth);function s(){const a=/min-width/gi.test(e);i(a,l)}return window.addEventListener("resize",s),()=>window.removeEventListener("resize",s)},[n,e,i]),r},vn=()=>{const[e,n]=u.useState({width:0,height:0});return u.useEffect(()=>{const t=()=>{const r=Math.min(window.innerWidth,window.outerWidth),o=Math.min(window.innerHeight,window.outerHeight);n({width:r,height:o})};return requestAnimationFrame(()=>t()),window.addEventListener("resize",t),()=>window.removeEventListener("resize",t)},[]),e};function Dr(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Nt={exports:{}},qe={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react-jsx-runtime.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
6
|
-
*
|
|
7
|
-
* This source code is licensed under the MIT license found in the
|
|
8
|
-
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var gn;function _r(){if(gn)return qe;gn=1;var e=u,n=Symbol.for("react.element"),t=Symbol.for("react.fragment"),r=Object.prototype.hasOwnProperty,o=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,i={key:!0,ref:!0,__self:!0,__source:!0};function l(s,a,f){var d,h={},x=null,m=null;f!==void 0&&(x=""+f),a.key!==void 0&&(x=""+a.key),a.ref!==void 0&&(m=a.ref);for(d in a)r.call(a,d)&&!i.hasOwnProperty(d)&&(h[d]=a[d]);if(s&&s.defaultProps)for(d in a=s.defaultProps,a)h[d]===void 0&&(h[d]=a[d]);return{$$typeof:n,type:s,key:x,ref:m,props:h,_owner:o.current}}return qe.Fragment=t,qe.jsx=l,qe.jsxs=l,qe}var Ge={};/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.development.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var xn;function Rr(){return xn||(xn=1,process.env.NODE_ENV!=="production"&&function(){var e=u,n=Symbol.for("react.element"),t=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),l=Symbol.for("react.provider"),s=Symbol.for("react.context"),a=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),d=Symbol.for("react.suspense_list"),h=Symbol.for("react.memo"),x=Symbol.for("react.lazy"),m=Symbol.for("react.offscreen"),v=Symbol.iterator,g="@@iterator";function b(p){if(p===null||typeof p!="object")return null;var T=v&&p[v]||p[g];return typeof T=="function"?T:null}var E=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;function w(p){{for(var T=arguments.length,F=new Array(T>1?T-1:0),H=1;H<T;H++)F[H-1]=arguments[H];y("error",p,F)}}function y(p,T,F){{var H=E.ReactDebugCurrentFrame,oe=H.getStackAddendum();oe!==""&&(T+="%s",F=F.concat([oe]));var ce=F.map(function(te){return String(te)});ce.unshift("Warning: "+T),Function.prototype.apply.call(console[p],console,ce)}}var N=!1,k=!1,L=!1,B=!1,Y=!1,D;D=Symbol.for("react.module.reference");function A(p){return!!(typeof p=="string"||typeof p=="function"||p===r||p===i||Y||p===o||p===f||p===d||B||p===m||N||k||L||typeof p=="object"&&p!==null&&(p.$$typeof===x||p.$$typeof===h||p.$$typeof===l||p.$$typeof===s||p.$$typeof===a||p.$$typeof===D||p.getModuleId!==void 0))}function W(p,T,F){var H=p.displayName;if(H)return H;var oe=T.displayName||T.name||"";return oe!==""?F+"("+oe+")":F}function q(p){return p.displayName||"Context"}function G(p){if(p==null)return null;if(typeof p.tag=="number"&&w("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),typeof p=="function")return p.displayName||p.name||null;if(typeof p=="string")return p;switch(p){case r:return"Fragment";case t:return"Portal";case i:return"Profiler";case o:return"StrictMode";case f:return"Suspense";case d:return"SuspenseList"}if(typeof p=="object")switch(p.$$typeof){case s:var T=p;return q(T)+".Consumer";case l:var F=p;return q(F._context)+".Provider";case a:return W(p,p.render,"ForwardRef");case h:var H=p.displayName||null;return H!==null?H:G(p.type)||"Memo";case x:{var oe=p,ce=oe._payload,te=oe._init;try{return G(te(ce))}catch{return null}}}return null}var Q=Object.assign,C=0,re,K,j,I,_,Z,ee;function se(){}se.__reactDisabledLog=!0;function ae(){{if(C===0){re=console.log,K=console.info,j=console.warn,I=console.error,_=console.group,Z=console.groupCollapsed,ee=console.groupEnd;var p={configurable:!0,enumerable:!0,value:se,writable:!0};Object.defineProperties(console,{info:p,log:p,warn:p,error:p,group:p,groupCollapsed:p,groupEnd:p})}C++}}function ge(){{if(C--,C===0){var p={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:Q({},p,{value:re}),info:Q({},p,{value:K}),warn:Q({},p,{value:j}),error:Q({},p,{value:I}),group:Q({},p,{value:_}),groupCollapsed:Q({},p,{value:Z}),groupEnd:Q({},p,{value:ee})})}C<0&&w("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}}var we=E.ReactCurrentDispatcher,R;function ue(p,T,F){{if(R===void 0)try{throw Error()}catch(oe){var H=oe.stack.trim().match(/\n( *(at )?)/);R=H&&H[1]||""}return`
|
|
18
|
-
`+R+p}}var P=!1,V;{var O=typeof WeakMap=="function"?WeakMap:Map;V=new O}function U(p,T){if(!p||P)return"";{var F=V.get(p);if(F!==void 0)return F}var H;P=!0;var oe=Error.prepareStackTrace;Error.prepareStackTrace=void 0;var ce;ce=we.current,we.current=null,ae();try{if(T){var te=function(){throw Error()};if(Object.defineProperty(te.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(te,[])}catch(Fe){H=Fe}Reflect.construct(p,[],te)}else{try{te.call()}catch(Fe){H=Fe}p.call(te.prototype)}}else{try{throw Error()}catch(Fe){H=Fe}p()}}catch(Fe){if(Fe&&H&&typeof Fe.stack=="string"){for(var J=Fe.stack.split(`
|
|
19
|
-
`),ye=H.stack.split(`
|
|
20
|
-
`),ve=J.length-1,xe=ye.length-1;ve>=1&&xe>=0&&J[ve]!==ye[xe];)xe--;for(;ve>=1&&xe>=0;ve--,xe--)if(J[ve]!==ye[xe]){if(ve!==1||xe!==1)do if(ve--,xe--,xe<0||J[ve]!==ye[xe]){var Ce=`
|
|
21
|
-
`+J[ve].replace(" at new "," at ");return p.displayName&&Ce.includes("<anonymous>")&&(Ce=Ce.replace("<anonymous>",p.displayName)),typeof p=="function"&&V.set(p,Ce),Ce}while(ve>=1&&xe>=0);break}}}finally{P=!1,we.current=ce,ge(),Error.prepareStackTrace=oe}var Ye=p?p.displayName||p.name:"",Nr=Ye?ue(Ye):"";return typeof p=="function"&&V.set(p,Nr),Nr}function X(p,T,F){return U(p,!1)}function Se(p){var T=p.prototype;return!!(T&&T.isReactComponent)}function ze(p,T,F){if(p==null)return"";if(typeof p=="function")return U(p,Se(p));if(typeof p=="string")return ue(p);switch(p){case f:return ue("Suspense");case d:return ue("SuspenseList")}if(typeof p=="object")switch(p.$$typeof){case a:return X(p.render);case h:return ze(p.type,T,F);case x:{var H=p,oe=H._payload,ce=H._init;try{return ze(ce(oe),T,F)}catch{}}}return""}var We=Object.prototype.hasOwnProperty,vr={},gr=E.ReactDebugCurrentFrame;function Tt(p){if(p){var T=p._owner,F=ze(p.type,p._source,T?T.type:null);gr.setExtraStackFrame(F)}else gr.setExtraStackFrame(null)}function ea(p,T,F,H,oe){{var ce=Function.call.bind(We);for(var te in p)if(ce(p,te)){var J=void 0;try{if(typeof p[te]!="function"){var ye=Error((H||"React class")+": "+F+" type `"+te+"` is invalid; it must be a function, usually from the `prop-types` package, but received `"+typeof p[te]+"`.This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.");throw ye.name="Invariant Violation",ye}J=p[te](T,te,H,F,null,"SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED")}catch(ve){J=ve}J&&!(J instanceof Error)&&(Tt(oe),w("%s: type specification of %s `%s` is invalid; the type checker function must return `null` or an `Error` but returned a %s. You may have forgotten to pass an argument to the type checker creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and shape all require an argument).",H||"React class",F,te,typeof J),Tt(null)),J instanceof Error&&!(J.message in vr)&&(vr[J.message]=!0,Tt(oe),w("Failed %s type: %s",F,J.message),Tt(null))}}}var ta=Array.isArray;function un(p){return ta(p)}function na(p){{var T=typeof Symbol=="function"&&Symbol.toStringTag,F=T&&p[Symbol.toStringTag]||p.constructor.name||"Object";return F}}function ra(p){try{return xr(p),!1}catch{return!0}}function xr(p){return""+p}function br(p){if(ra(p))return w("The provided key is an unsupported type %s. This value must be coerced to a string before before using it here.",na(p)),xr(p)}var ct=E.ReactCurrentOwner,oa={key:!0,ref:!0,__self:!0,__source:!0},wr,yr,cn;cn={};function la(p){if(We.call(p,"ref")){var T=Object.getOwnPropertyDescriptor(p,"ref").get;if(T&&T.isReactWarning)return!1}return p.ref!==void 0}function ia(p){if(We.call(p,"key")){var T=Object.getOwnPropertyDescriptor(p,"key").get;if(T&&T.isReactWarning)return!1}return p.key!==void 0}function sa(p,T){if(typeof p.ref=="string"&&ct.current&&T&&ct.current.stateNode!==T){var F=G(ct.current.type);cn[F]||(w('Component "%s" contains the string ref "%s". Support for string refs will be removed in a future major release. This case cannot be automatically converted to an arrow function. We ask you to manually fix this case by using useRef() or createRef() instead. Learn more about using refs safely here: https://reactjs.org/link/strict-mode-string-ref',G(ct.current.type),p.ref),cn[F]=!0)}}function aa(p,T){{var F=function(){wr||(wr=!0,w("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};F.isReactWarning=!0,Object.defineProperty(p,"key",{get:F,configurable:!0})}}function ua(p,T){{var F=function(){yr||(yr=!0,w("%s: `ref` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://reactjs.org/link/special-props)",T))};F.isReactWarning=!0,Object.defineProperty(p,"ref",{get:F,configurable:!0})}}var ca=function(p,T,F,H,oe,ce,te){var J={$$typeof:n,type:p,key:T,ref:F,props:te,_owner:ce};return J._store={},Object.defineProperty(J._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:!1}),Object.defineProperty(J,"_self",{configurable:!1,enumerable:!1,writable:!1,value:H}),Object.defineProperty(J,"_source",{configurable:!1,enumerable:!1,writable:!1,value:oe}),Object.freeze&&(Object.freeze(J.props),Object.freeze(J)),J};function da(p,T,F,H,oe){{var ce,te={},J=null,ye=null;F!==void 0&&(br(F),J=""+F),ia(T)&&(br(T.key),J=""+T.key),la(T)&&(ye=T.ref,sa(T,oe));for(ce in T)We.call(T,ce)&&!oa.hasOwnProperty(ce)&&(te[ce]=T[ce]);if(p&&p.defaultProps){var ve=p.defaultProps;for(ce in ve)te[ce]===void 0&&(te[ce]=ve[ce])}if(J||ye){var xe=typeof p=="function"?p.displayName||p.name||"Unknown":p;J&&aa(te,xe),ye&&ua(te,xe)}return ca(p,J,ye,oe,H,ct.current,te)}}var dn=E.ReactCurrentOwner,Er=E.ReactDebugCurrentFrame;function Ve(p){if(p){var T=p._owner,F=ze(p.type,p._source,T?T.type:null);Er.setExtraStackFrame(F)}else Er.setExtraStackFrame(null)}var fn;fn=!1;function mn(p){return typeof p=="object"&&p!==null&&p.$$typeof===n}function Sr(){{if(dn.current){var p=G(dn.current.type);if(p)return`
|
|
22
|
-
|
|
23
|
-
Check the render method of \``+p+"`."}return""}}function fa(p){return""}var Cr={};function ma(p){{var T=Sr();if(!T){var F=typeof p=="string"?p:p.displayName||p.name;F&&(T=`
|
|
24
|
-
|
|
25
|
-
Check the top-level render call using <`+F+">.")}return T}}function Tr(p,T){{if(!p._store||p._store.validated||p.key!=null)return;p._store.validated=!0;var F=ma(T);if(Cr[F])return;Cr[F]=!0;var H="";p&&p._owner&&p._owner!==dn.current&&(H=" It was passed a child from "+G(p._owner.type)+"."),Ve(p),w('Each child in a list should have a unique "key" prop.%s%s See https://reactjs.org/link/warning-keys for more information.',F,H),Ve(null)}}function jr(p,T){{if(typeof p!="object")return;if(un(p))for(var F=0;F<p.length;F++){var H=p[F];mn(H)&&Tr(H,T)}else if(mn(p))p._store&&(p._store.validated=!0);else if(p){var oe=b(p);if(typeof oe=="function"&&oe!==p.entries)for(var ce=oe.call(p),te;!(te=ce.next()).done;)mn(te.value)&&Tr(te.value,T)}}}function pa(p){{var T=p.type;if(T==null||typeof T=="string")return;var F;if(typeof T=="function")F=T.propTypes;else if(typeof T=="object"&&(T.$$typeof===a||T.$$typeof===h))F=T.propTypes;else return;if(F){var H=G(T);ea(F,p.props,"prop",H,p)}else if(T.PropTypes!==void 0&&!fn){fn=!0;var oe=G(T);w("Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?",oe||"Unknown")}typeof T.getDefaultProps=="function"&&!T.getDefaultProps.isReactClassApproved&&w("getDefaultProps is only used on classic React.createClass definitions. Use a static property named `defaultProps` instead.")}}function ha(p){{for(var T=Object.keys(p.props),F=0;F<T.length;F++){var H=T[F];if(H!=="children"&&H!=="key"){Ve(p),w("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",H),Ve(null);break}}p.ref!==null&&(Ve(p),w("Invalid attribute `ref` supplied to `React.Fragment`."),Ve(null))}}function Or(p,T,F,H,oe,ce){{var te=A(p);if(!te){var J="";(p===void 0||typeof p=="object"&&p!==null&&Object.keys(p).length===0)&&(J+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports.");var ye=fa();ye?J+=ye:J+=Sr();var ve;p===null?ve="null":un(p)?ve="array":p!==void 0&&p.$$typeof===n?(ve="<"+(G(p.type)||"Unknown")+" />",J=" Did you accidentally export a JSX literal instead of a component?"):ve=typeof p,w("React.jsx: type is invalid -- expected a string (for built-in components) or a class/function (for composite components) but got: %s.%s",ve,J)}var xe=da(p,T,F,oe,ce);if(xe==null)return xe;if(te){var Ce=T.children;if(Ce!==void 0)if(H)if(un(Ce)){for(var Ye=0;Ye<Ce.length;Ye++)jr(Ce[Ye],p);Object.freeze&&Object.freeze(Ce)}else w("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else jr(Ce,p)}return p===r?ha(xe):pa(xe),xe}}function va(p,T,F){return Or(p,T,F,!0)}function ga(p,T,F){return Or(p,T,F,!1)}var xa=ga,ba=va;Ge.Fragment=r,Ge.jsx=xa,Ge.jsxs=ba}()),Ge}process.env.NODE_ENV==="production"?Nt.exports=_r():Nt.exports=Rr();var c=Nt.exports;function Ke(e,n,t){let r=t.initialDeps??[],o;return()=>{var i,l,s,a;let f;t.key&&((i=t.debug)!=null&&i.call(t))&&(f=Date.now());const d=e();if(!(d.length!==r.length||d.some((m,v)=>r[v]!==m)))return o;r=d;let x;if(t.key&&((l=t.debug)!=null&&l.call(t))&&(x=Date.now()),o=n(...d),t.key&&((s=t.debug)!=null&&s.call(t))){const m=Math.round((Date.now()-f)*100)/100,v=Math.round((Date.now()-x)*100)/100,g=v/16,b=(E,w)=>{for(E=String(E);E.length<w;)E=" "+E;return E};console.info(`%c⏱ ${b(v,5)} /${b(m,5)} ms`,`
|
|
26
|
-
font-size: .6rem;
|
|
27
|
-
font-weight: bold;
|
|
28
|
-
color: hsl(${Math.max(0,Math.min(120-120*g,120))}deg 100% 31%);`,t==null?void 0:t.key)}return(a=t==null?void 0:t.onChange)==null||a.call(t,o),o}}function kt(e,n){if(e===void 0)throw new Error("Unexpected undefined");return e}const Br=(e,n)=>Math.abs(e-n)<1,zr=(e,n,t)=>{let r;return function(...o){e.clearTimeout(r),r=e.setTimeout(()=>n.apply(this,o),t)}},Wr=e=>e,Ur=e=>{const n=Math.max(e.startIndex-e.overscan,0),t=Math.min(e.endIndex+e.overscan,e.count-1),r=[];for(let o=n;o<=t;o++)r.push(o);return r},Hr=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;const o=l=>{const{width:s,height:a}=l;n({width:Math.round(s),height:Math.round(a)})};if(o(t.getBoundingClientRect()),!r.ResizeObserver)return()=>{};const i=new r.ResizeObserver(l=>{const s=l[0];if(s!=null&&s.borderBoxSize){const a=s.borderBoxSize[0];if(a){o({width:a.inlineSize,height:a.blockSize});return}}o(t.getBoundingClientRect())});return i.observe(t,{box:"border-box"}),()=>{i.unobserve(t)}},bn={passive:!0},Vr=typeof window>"u"?!0:"onscrollend"in window,Yr=(e,n)=>{const t=e.scrollElement;if(!t)return;const r=e.targetWindow;if(!r)return;let o=0;const i=Vr?()=>{}:zr(r,()=>{n(o,!1)},e.options.isScrollingResetDelay),l=f=>()=>{o=t[e.options.horizontal?"scrollLeft":"scrollTop"],i(),n(o,f)},s=l(!0),a=l(!1);return a(),t.addEventListener("scroll",s,bn),t.addEventListener("scrollend",a,bn),()=>{t.removeEventListener("scroll",s),t.removeEventListener("scrollend",a)}},qr=(e,n,t)=>{if(n!=null&&n.borderBoxSize){const r=n.borderBoxSize[0];if(r)return Math.round(r[t.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[t.options.horizontal?"width":"height"])},Gr=(e,{adjustments:n=0,behavior:t},r)=>{var o,i;const l=e+n;(i=(o=r.scrollElement)==null?void 0:o.scrollTo)==null||i.call(o,{[r.options.horizontal?"left":"top"]:l,behavior:t})};class Kr{constructor(n){this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.isScrolling=!1,this.scrollToIndexTimeoutId=null,this.measurementsCache=[],this.itemSizeCache=new Map,this.pendingMeasuredCacheIndexes=[],this.scrollRect=null,this.scrollOffset=null,this.scrollDirection=null,this.scrollAdjustments=0,this.elementsCache=new Map,this.observer=(()=>{let t=null;const r=()=>t||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:t=new this.targetWindow.ResizeObserver(o=>{o.forEach(i=>{this._measureElement(i.target,i)})}));return{disconnect:()=>{var o;return(o=r())==null?void 0:o.disconnect()},observe:o=>{var i;return(i=r())==null?void 0:i.observe(o,{box:"border-box"})},unobserve:o=>{var i;return(i=r())==null?void 0:i.unobserve(o)}}})(),this.range=null,this.setOptions=t=>{Object.entries(t).forEach(([r,o])=>{typeof o>"u"&&delete t[r]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:Wr,rangeExtractor:Ur,onChange:()=>{},measureElement:qr,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...t}},this.notify=(t,r)=>{var o,i;const{startIndex:l,endIndex:s}=this.range??{startIndex:void 0,endIndex:void 0},a=this.calculateRange();(t||l!==(a==null?void 0:a.startIndex)||s!==(a==null?void 0:a.endIndex))&&((i=(o=this.options).onChange)==null||i.call(o,this,r))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(t=>t()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var t;const r=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==r){if(this.cleanup(),!r){this.notify(!1,!1);return}this.scrollElement=r,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((t=this.scrollElement)==null?void 0:t.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,o=>{this.scrollRect=o,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(o,i)=>{this.scrollAdjustments=0,this.scrollDirection=i?this.getScrollOffset()<o?"forward":"backward":null,this.scrollOffset=o;const l=this.isScrolling;this.isScrolling=i,this.notify(l!==i,i)}))}},this.getSize=()=>this.options.enabled?(this.scrollRect=this.scrollRect??this.options.initialRect,this.scrollRect[this.options.horizontal?"width":"height"]):(this.scrollRect=null,0),this.getScrollOffset=()=>this.options.enabled?(this.scrollOffset=this.scrollOffset??(typeof this.options.initialOffset=="function"?this.options.initialOffset():this.options.initialOffset),this.scrollOffset):(this.scrollOffset=null,0),this.getFurthestMeasurement=(t,r)=>{const o=new Map,i=new Map;for(let l=r-1;l>=0;l--){const s=t[l];if(o.has(s.lane))continue;const a=i.get(s.lane);if(a==null||s.end>a.end?i.set(s.lane,s):s.end<a.end&&o.set(s.lane,!0),o.size===this.options.lanes)break}return i.size===this.options.lanes?Array.from(i.values()).sort((l,s)=>l.end===s.end?l.index-s.index:l.end-s.end)[0]:void 0},this.getMeasurementOptions=Ke(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(t,r,o,i,l)=>(this.pendingMeasuredCacheIndexes=[],{count:t,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:l}),{key:!1}),this.getMeasurements=Ke(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:t,paddingStart:r,scrollMargin:o,getItemKey:i,enabled:l},s)=>{var a;if(!l)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(h=>{this.itemSizeCache.set(h.key,h.size)}));const f=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const d=this.measurementsCache.slice(0,f);for(let h=f;h<t;h++){let x=(a=this.measurementsCache[h])==null?void 0:a.measureElement;x||(x=N=>{const k=i(h),L=this.elementsCache.get(k);if(!N){L&&(this.observer.unobserve(L),this.elementsCache.delete(k));return}L!==N&&(L&&this.observer.unobserve(L),this.observer.observe(N),this.elementsCache.set(k,N)),N.isConnected&&this.resizeItem(h,this.options.measureElement(N,void 0,this))});const m=i(h),v=this.options.lanes===1?d[h-1]:this.getFurthestMeasurement(d,h),g=v?v.end+this.options.gap:r+o,b=s.get(m),E=typeof b=="number"?b:this.options.estimateSize(h),w=g+E,y=v?v.lane:h%this.options.lanes;d[h]={index:h,start:g,size:E,end:w,key:m,lane:y,measureElement:x}}return this.measurementsCache=d,d},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=Ke(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(t,r,o)=>this.range=t.length>0&&r>0?Zr({measurements:t,outerSize:r,scrollOffset:o}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=Ke(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(t,r,o,i)=>r===null?[]:t({startIndex:r.startIndex,endIndex:r.endIndex,overscan:o,count:i}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=t=>{const r=this.options.indexAttribute,o=t.getAttribute(r);return o?parseInt(o,10):(console.warn(`Missing attribute name '${r}={index}' on measured element.`),-1)},this._measureElement=(t,r)=>{const o=this.indexFromElement(t),i=this.getMeasurements()[o];if(!i||!t.isConnected){this.elementsCache.forEach((s,a)=>{s===t&&(this.observer.unobserve(t),this.elementsCache.delete(a))});return}const l=this.elementsCache.get(i.key);l!==t&&(l&&this.observer.unobserve(l),this.observer.observe(t),this.elementsCache.set(i.key,t)),this.resizeItem(o,this.options.measureElement(t,r,this))},this.resizeItem=(t,r)=>{const o=this.getMeasurements()[t];if(!o)return;const i=this.itemSizeCache.get(o.key)??o.size,l=r-i;l!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(o,l,this):o.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",l),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=l,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(o.index),this.itemSizeCache=new Map(this.itemSizeCache.set(o.key,r)),this.notify(!0,!1))},this.measureElement=t=>{t&&this._measureElement(t,void 0)},this.getVirtualItems=Ke(()=>[this.getIndexes(),this.getMeasurements()],(t,r)=>{const o=[];for(let i=0,l=t.length;i<l;i++){const s=t[i],a=r[s];o.push(a)}return o},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=t=>{const r=this.getMeasurements();if(r.length!==0)return kt(r[wn(0,r.length-1,o=>kt(r[o]).start,t)])},this.getOffsetForAlignment=(t,r)=>{const o=this.getSize(),i=this.getScrollOffset();r==="auto"&&(t<=i?r="start":t>=i+o?r="end":r="start"),r==="start"?t=t:r==="end"?t=t-o:r==="center"&&(t=t-o/2);const l=this.options.horizontal?"scrollWidth":"scrollHeight",a=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[l]:this.scrollElement[l]:0)-o;return Math.max(Math.min(a,t),0)},this.getOffsetForIndex=(t,r="auto")=>{t=Math.max(0,Math.min(t,this.options.count-1));const o=this.getMeasurements()[t];if(!o)return;const i=this.getSize(),l=this.getScrollOffset();if(r==="auto")if(o.end>=l+i-this.options.scrollPaddingEnd)r="end";else if(o.start<=l+this.options.scrollPaddingStart)r="start";else return[l,r];const s=r==="end"?o.end+this.options.scrollPaddingEnd:o.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(s,r),r]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(t,{align:r="start",behavior:o}={})=>{this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(t,r),{adjustments:void 0,behavior:o})},this.scrollToIndex=(t,{align:r="auto",behavior:o}={})=>{t=Math.max(0,Math.min(t,this.options.count-1)),this.cancelScrollToIndex(),o==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const i=this.getOffsetForIndex(t,r);if(!i)return;const[l,s]=i;this._scrollToOffset(l,{adjustments:void 0,behavior:o}),o!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(t))){const[f]=kt(this.getOffsetForIndex(t,s));Br(f,this.getScrollOffset())||this.scrollToIndex(t,{align:s,behavior:o})}else this.scrollToIndex(t,{align:s,behavior:o})}))},this.scrollBy=(t,{behavior:r}={})=>{this.cancelScrollToIndex(),r==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+t,{adjustments:void 0,behavior:r})},this.getTotalSize=()=>{var t;const r=this.getMeasurements();let o;return r.length===0?o=this.options.paddingStart:o=this.options.lanes===1?((t=r[r.length-1])==null?void 0:t.end)??0:Math.max(...r.slice(-this.options.lanes).map(i=>i.end)),o-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(t,{adjustments:r,behavior:o})=>{this.options.scrollToFn(t,{behavior:o,adjustments:r},this)},this.measure=()=>{var t,r;this.itemSizeCache=new Map,(r=(t=this.options).onChange)==null||r.call(t,this,!1)},this.setOptions(n)}}const wn=(e,n,t,r)=>{for(;e<=n;){const o=(e+n)/2|0,i=t(o);if(i<r)e=o+1;else if(i>r)n=o-1;else return o}return e>0?e-1:0};function Zr({measurements:e,outerSize:n,scrollOffset:t}){const r=e.length-1,i=wn(0,r,s=>e[s].start,t);let l=i;for(;l<r&&e[l].end<t+n;)l++;return{startIndex:i,endIndex:l}}const Xr=typeof document<"u"?S.useLayoutEffect:S.useEffect;function Jr(e){const n=S.useReducer(()=>({}),{})[1],t={...e,onChange:(o,i)=>{var l;i?jt.flushSync(n):n(),(l=e.onChange)==null||l.call(e,o,i)}},[r]=S.useState(()=>new Kr(t));return r.setOptions(t),S.useEffect(()=>r._didMount(),[]),Xr(()=>r._willUpdate()),r}function Qr(e){return Jr({observeElementRect:Hr,observeElementOffset:Yr,scrollToFn:Gr,...e})}var eo=Object.defineProperty,to=(e,n,t)=>n in e?eo(e,n,{enumerable:!0,configurable:!0,writable:!0,value:t}):e[n]=t,It=(e,n,t)=>(to(e,typeof n!="symbol"?n+"":n,t),t);let no=class{constructor(){It(this,"current",this.detect()),It(this,"handoffState","pending"),It(this,"currentId",0)}set(n){this.current!==n&&(this.handoffState="pending",this.currentId=0,this.current=n)}reset(){this.set(this.detect())}nextId(){return++this.currentId}get isServer(){return this.current==="server"}get isClient(){return this.current==="client"}detect(){return typeof window>"u"||typeof document>"u"?"server":"client"}handoff(){this.handoffState==="pending"&&(this.handoffState="complete")}get isHandoffComplete(){return this.handoffState==="complete"}},Ne=new no,le=(e,n)=>{Ne.isServer?u.useEffect(e,n):u.useLayoutEffect(e,n)};function Te(e){let n=u.useRef(e);return le(()=>{n.current=e},[e]),n}function $t(e,n){let[t,r]=u.useState(e),o=Te(e);return le(()=>r(o.current),[o,r,...n]),t}let M=function(e){let n=Te(e);return u.useCallback((...t)=>n.current(...t),[n])};function yn(e,n,t){let[r,o]=u.useState(t),i=e!==void 0,l=u.useRef(i),s=u.useRef(!1),a=u.useRef(!1);return i&&!l.current&&!s.current?(s.current=!0,l.current=i,console.error("A component is changing from uncontrolled to controlled. This may be caused by the value changing from undefined to a defined value, which should not happen.")):!i&&l.current&&!a.current&&(a.current=!0,l.current=i,console.error("A component is changing from controlled to uncontrolled. This may be caused by the value changing from a defined value to undefined, which should not happen.")),[i?e:r,M(f=>(i||o(f),n==null?void 0:n(f)))]}function dt(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(n=>setTimeout(()=>{throw n}))}function Ee(){let e=[],n={addEventListener(t,r,o,i){return t.addEventListener(r,o,i),n.add(()=>t.removeEventListener(r,o,i))},requestAnimationFrame(...t){let r=requestAnimationFrame(...t);return n.add(()=>cancelAnimationFrame(r))},nextFrame(...t){return n.requestAnimationFrame(()=>n.requestAnimationFrame(...t))},setTimeout(...t){let r=setTimeout(...t);return n.add(()=>clearTimeout(r))},microTask(...t){let r={current:!0};return dt(()=>{r.current&&t[0]()}),n.add(()=>{r.current=!1})},style(t,r,o){let i=t.style.getPropertyValue(r);return Object.assign(t.style,{[r]:o}),this.add(()=>{Object.assign(t.style,{[r]:i})})},group(t){let r=Ee();return t(r),this.add(()=>r.dispose())},add(t){return e.push(t),()=>{let r=e.indexOf(t);if(r>=0)for(let o of e.splice(r,1))o()}},dispose(){for(let t of e.splice(0))t()}};return n}function ke(){let[e]=u.useState(Ee);return u.useEffect(()=>()=>e.dispose(),[e]),e}function ro(){let e=typeof document>"u";return"useSyncExternalStore"in S?(n=>n.useSyncExternalStore)(S)(()=>()=>{},()=>!1,()=>!e):!1}function Ue(){let e=ro(),[n,t]=S.useState(Ne.isHandoffComplete);return n&&Ne.isHandoffComplete===!1&&t(!1),S.useEffect(()=>{n!==!0&&t(!0)},[n]),S.useEffect(()=>Ne.handoff(),[]),e?!1:n}var En;let be=(En=u.useId)!=null?En:function(){let e=Ue(),[n,t]=u.useState(e?()=>Ne.nextId():null);return le(()=>{n===null&&t(Ne.nextId())},[n]),n!=null?""+n:void 0};function me(e,n,...t){if(e in n){let o=n[e];return typeof o=="function"?o(...t):o}let r=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(n).map(o=>`"${o}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,me),r}function ft(e){return Ne.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let Ft=["[contentEditable=true]","[tabindex]","a[href]","area[href]","button:not([disabled])","iframe","input:not([disabled])","select:not([disabled])","textarea:not([disabled])"].map(e=>`${e}:not([tabindex='-1'])`).join(",");var Ie=(e=>(e[e.First=1]="First",e[e.Previous=2]="Previous",e[e.Next=4]="Next",e[e.Last=8]="Last",e[e.WrapAround=16]="WrapAround",e[e.NoScroll=32]="NoScroll",e))(Ie||{}),Sn=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Sn||{}),oo=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(oo||{});function Cn(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(Ft)).sort((n,t)=>Math.sign((n.tabIndex||Number.MAX_SAFE_INTEGER)-(t.tabIndex||Number.MAX_SAFE_INTEGER)))}var Mt=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(Mt||{});function Pt(e,n=0){var t;return e===((t=ft(e))==null?void 0:t.body)?!1:me(n,{0(){return e.matches(Ft)},1(){let r=e;for(;r!==null;){if(r.matches(Ft))return!0;r=r.parentElement}return!1}})}function Tn(e){let n=ft(e);Ee().nextFrame(()=>{n&&!Pt(n.activeElement,0)&&Me(e)})}var lo=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(lo||{});typeof window<"u"&&typeof document<"u"&&(document.addEventListener("keydown",e=>{e.metaKey||e.altKey||e.ctrlKey||(document.documentElement.dataset.headlessuiFocusVisible="")},!0),document.addEventListener("click",e=>{e.detail===1?delete document.documentElement.dataset.headlessuiFocusVisible:e.detail===0&&(document.documentElement.dataset.headlessuiFocusVisible="")},!0));function Me(e){e==null||e.focus({preventScroll:!0})}let io=["textarea","input"].join(",");function so(e){var n,t;return(t=(n=e==null?void 0:e.matches)==null?void 0:n.call(e,io))!=null?t:!1}function Lt(e,n=t=>t){return e.slice().sort((t,r)=>{let o=n(t),i=n(r);if(o===null||i===null)return 0;let l=o.compareDocumentPosition(i);return l&Node.DOCUMENT_POSITION_FOLLOWING?-1:l&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function ao(e,n){return Ze(Cn(),n,{relativeTo:e})}function Ze(e,n,{sorted:t=!0,relativeTo:r=null,skipElements:o=[]}={}){let i=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,l=Array.isArray(e)?t?Lt(e):e:Cn(e);o.length>0&&l.length>1&&(l=l.filter(m=>!o.includes(m))),r=r??i.activeElement;let s=(()=>{if(n&5)return 1;if(n&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),a=(()=>{if(n&1)return 0;if(n&2)return Math.max(0,l.indexOf(r))-1;if(n&4)return Math.max(0,l.indexOf(r))+1;if(n&8)return l.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),f=n&32?{preventScroll:!0}:{},d=0,h=l.length,x;do{if(d>=h||d+h<=0)return 0;let m=a+d;if(n&16)m=(m+h)%h;else{if(m<0)return 3;if(m>=h)return 1}x=l[m],x==null||x.focus(f),d+=s}while(x!==i.activeElement);return n&6&&so(x)&&x.select(),2}function jn(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function uo(){return/Android/gi.test(window.navigator.userAgent)}function On(){return jn()||uo()}function mt(e,n,t){let r=Te(n);u.useEffect(()=>{function o(i){r.current(i)}return document.addEventListener(e,o,t),()=>document.removeEventListener(e,o,t)},[e,t])}function Nn(e,n,t){let r=Te(n);u.useEffect(()=>{function o(i){r.current(i)}return window.addEventListener(e,o,t),()=>window.removeEventListener(e,o,t)},[e,t])}function At(e,n,t=!0){let r=u.useRef(!1);u.useEffect(()=>{requestAnimationFrame(()=>{r.current=t})},[t]);function o(l,s){if(!r.current||l.defaultPrevented)return;let a=s(l);if(a===null||!a.getRootNode().contains(a)||!a.isConnected)return;let f=function d(h){return typeof h=="function"?d(h()):Array.isArray(h)||h instanceof Set?h:[h]}(e);for(let d of f){if(d===null)continue;let h=d instanceof HTMLElement?d:d.current;if(h!=null&&h.contains(a)||l.composed&&l.composedPath().includes(h))return}return!Pt(a,Mt.Loose)&&a.tabIndex!==-1&&l.preventDefault(),n(l,a)}let i=u.useRef(null);mt("pointerdown",l=>{var s,a;r.current&&(i.current=((a=(s=l.composedPath)==null?void 0:s.call(l))==null?void 0:a[0])||l.target)},!0),mt("mousedown",l=>{var s,a;r.current&&(i.current=((a=(s=l.composedPath)==null?void 0:s.call(l))==null?void 0:a[0])||l.target)},!0),mt("click",l=>{On()||i.current&&(o(l,()=>i.current),i.current=null)},!0),mt("touchend",l=>o(l,()=>l.target instanceof HTMLElement?l.target:null),!0),Nn("blur",l=>o(l,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function _e(...e){return u.useMemo(()=>ft(...e),[...e])}function kn(e){var n;if(e.type)return e.type;let t=(n=e.as)!=null?n:"button";if(typeof t=="string"&&t.toLowerCase()==="button")return"button"}function Dt(e,n){let[t,r]=u.useState(()=>kn(e));return le(()=>{r(kn(e))},[e.type,e.as]),le(()=>{t||n.current&&n.current instanceof HTMLButtonElement&&!n.current.hasAttribute("type")&&r("button")},[t,n]),t}let In=Symbol();function co(e,n=!0){return Object.assign(e,{[In]:n})}function pe(...e){let n=u.useRef(e);u.useEffect(()=>{n.current=e},[e]);let t=M(r=>{for(let o of n.current)o!=null&&(typeof o=="function"?o(r):o.current=r)});return e.every(r=>r==null||(r==null?void 0:r[In]))?void 0:t}function $n(e){return[e.screenX,e.screenY]}function Fn(){let e=u.useRef([-1,-1]);return{wasMoved(n){let t=$n(n);return e.current[0]===t[0]&&e.current[1]===t[1]?!1:(e.current=t,!0)},update(n){e.current=$n(n)}}}function Mn({container:e,accept:n,walk:t,enabled:r=!0}){let o=u.useRef(n),i=u.useRef(t);u.useEffect(()=>{o.current=n,i.current=t},[n,t]),le(()=>{if(!e||!r)return;let l=ft(e);if(!l)return;let s=o.current,a=i.current,f=Object.assign(h=>s(h),{acceptNode:s}),d=l.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,f,!1);for(;d.nextNode();)a(d.currentNode)},[e,r,o,i])}function Xe(e,n){let t=u.useRef([]),r=M(e);u.useEffect(()=>{let o=[...t.current];for(let[i,l]of n.entries())if(t.current[i]!==l){let s=r(n,o);return t.current=n,s}},[r,...n])}function pt(...e){return Array.from(new Set(e.flatMap(n=>typeof n=="string"?n.split(" "):[]))).filter(Boolean).join(" ")}var Pe=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(Pe||{}),Le=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(Le||{});function de({ourProps:e,theirProps:n,slot:t,defaultTag:r,features:o,visible:i=!0,name:l,mergeRefs:s}){s=s??fo;let a=Pn(n,e);if(i)return ht(a,t,r,l,s);let f=o??0;if(f&2){let{static:d=!1,...h}=a;if(d)return ht(h,t,r,l,s)}if(f&1){let{unmount:d=!0,...h}=a;return me(d?0:1,{0(){return null},1(){return ht({...h,hidden:!0,style:{display:"none"}},t,r,l,s)}})}return ht(a,t,r,l,s)}function ht(e,n={},t,r,o){let{as:i=t,children:l,refName:s="ref",...a}=_t(e,["unmount","static"]),f=e.ref!==void 0?{[s]:e.ref}:{},d=typeof l=="function"?l(n):l;"className"in a&&a.className&&typeof a.className=="function"&&(a.className=a.className(n));let h={};if(n){let x=!1,m=[];for(let[v,g]of Object.entries(n))typeof g=="boolean"&&(x=!0),g===!0&&m.push(v);x&&(h["data-headlessui-state"]=m.join(" "))}if(i===u.Fragment&&Object.keys(vt(a)).length>0){if(!u.isValidElement(d)||Array.isArray(d)&&d.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${r} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(a).map(g=>` - ${g}`).join(`
|
|
29
|
-
`),"","You can apply a few solutions:",['Add an `as="..."` prop, to ensure that we render an actual element instead of a "Fragment".',"Render a single element as the child so that we can forward the props onto that element."].map(g=>` - ${g}`).join(`
|
|
30
|
-
`)].join(`
|
|
31
|
-
`));let x=d.props,m=typeof(x==null?void 0:x.className)=="function"?(...g)=>pt(x==null?void 0:x.className(...g),a.className):pt(x==null?void 0:x.className,a.className),v=m?{className:m}:{};return u.cloneElement(d,Object.assign({},Pn(d.props,vt(_t(a,["ref"]))),h,f,{ref:o(d.ref,f.ref)},v))}return u.createElement(i,Object.assign({},_t(a,["ref"]),i!==u.Fragment&&f,i!==u.Fragment&&h),d)}function fo(...e){return e.every(n=>n==null)?void 0:n=>{for(let t of e)t!=null&&(typeof t=="function"?t(n):t.current=n)}}function Pn(...e){if(e.length===0)return{};if(e.length===1)return e[0];let n={},t={};for(let r of e)for(let o in r)o.startsWith("on")&&typeof r[o]=="function"?(t[o]!=null||(t[o]=[]),t[o].push(r[o])):n[o]=r[o];if(n.disabled||n["aria-disabled"])return Object.assign(n,Object.fromEntries(Object.keys(t).map(r=>[r,void 0])));for(let r in t)Object.assign(n,{[r](o,...i){let l=t[r];for(let s of l){if((o instanceof Event||(o==null?void 0:o.nativeEvent)instanceof Event)&&o.defaultPrevented)return;s(o,...i)}}});return n}function fe(e){var n;return Object.assign(u.forwardRef(e),{displayName:(n=e.displayName)!=null?n:e.name})}function vt(e){let n=Object.assign({},e);for(let t in n)n[t]===void 0&&delete n[t];return n}function _t(e,n=[]){let t=Object.assign({},e);for(let r of n)r in t&&delete t[r];return t}let mo="div";var He=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(He||{});function po(e,n){var t;let{features:r=1,...o}=e,i={ref:n,"aria-hidden":(r&2)===2?!0:(t=o["aria-hidden"])!=null?t:void 0,hidden:(r&4)===4?!0:void 0,style:{position:"fixed",top:1,left:1,width:1,height:0,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0",...(r&4)===4&&(r&2)!==2&&{display:"none"}}};return de({ourProps:i,theirProps:o,slot:{},defaultTag:mo,name:"Hidden"})}let Je=fe(po),Rt=u.createContext(null);Rt.displayName="OpenClosedContext";var he=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(he||{});function Qe(){return u.useContext(Rt)}function Bt({value:e,children:n}){return u.createElement(Rt.Provider,{value:e},n)}function ho(e){function n(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",n))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",n),n())}let Oe=[];ho(()=>{function e(n){n.target instanceof HTMLElement&&n.target!==document.body&&Oe[0]!==n.target&&(Oe.unshift(n.target),Oe=Oe.filter(t=>t!=null&&t.isConnected),Oe.splice(10))}window.addEventListener("click",e,{capture:!0}),window.addEventListener("mousedown",e,{capture:!0}),window.addEventListener("focus",e,{capture:!0}),document.body.addEventListener("click",e,{capture:!0}),document.body.addEventListener("mousedown",e,{capture:!0}),document.body.addEventListener("focus",e,{capture:!0})});function gt(e){let n=e.parentElement,t=null;for(;n&&!(n instanceof HTMLFieldSetElement);)n instanceof HTMLLegendElement&&(t=n),n=n.parentElement;let r=(n==null?void 0:n.getAttribute("disabled"))==="";return r&&vo(t)?!1:r}function vo(e){if(!e)return!1;let n=e.previousElementSibling;for(;n!==null;){if(n instanceof HTMLLegendElement)return!1;n=n.previousElementSibling}return!0}function go(e){throw new Error("Unexpected object: "+e)}var ie=(e=>(e[e.First=0]="First",e[e.Previous=1]="Previous",e[e.Next=2]="Next",e[e.Last=3]="Last",e[e.Specific=4]="Specific",e[e.Nothing=5]="Nothing",e))(ie||{});function zt(e,n){let t=n.resolveItems();if(t.length<=0)return null;let r=n.resolveActiveIndex(),o=r??-1;switch(e.focus){case 0:{for(let i=0;i<t.length;++i)if(!n.resolveDisabled(t[i],i,t))return i;return r}case 1:{for(let i=o-1;i>=0;--i)if(!n.resolveDisabled(t[i],i,t))return i;return r}case 2:{for(let i=o+1;i<t.length;++i)if(!n.resolveDisabled(t[i],i,t))return i;return r}case 3:{for(let i=t.length-1;i>=0;--i)if(!n.resolveDisabled(t[i],i,t))return i;return r}case 4:{for(let i=0;i<t.length;++i)if(n.resolveId(t[i],i,t)===e.id)return i;return r}case 5:return null;default:go(e)}}function Ln(e={},n=null,t=[]){for(let[r,o]of Object.entries(e))Dn(t,An(n,r),o);return t}function An(e,n){return e?e+"["+n+"]":n}function Dn(e,n,t){if(Array.isArray(t))for(let[r,o]of t.entries())Dn(e,An(n,r.toString()),o);else t instanceof Date?e.push([n,t.toISOString()]):typeof t=="boolean"?e.push([n,t?"1":"0"]):typeof t=="string"?e.push([n,t]):typeof t=="number"?e.push([n,`${t}`]):t==null?e.push([n,""]):Ln(t,n,e)}function xo(e){var n,t;let r=(n=e==null?void 0:e.form)!=null?n:e.closest("form");if(r){for(let o of r.elements)if(o!==e&&(o.tagName==="INPUT"&&o.type==="submit"||o.tagName==="BUTTON"&&o.type==="submit"||o.nodeName==="INPUT"&&o.type==="image")){o.click();return}(t=r.requestSubmit)==null||t.call(r)}}var ne=(e=>(e.Space=" ",e.Enter="Enter",e.Escape="Escape",e.Backspace="Backspace",e.Delete="Delete",e.ArrowLeft="ArrowLeft",e.ArrowUp="ArrowUp",e.ArrowRight="ArrowRight",e.ArrowDown="ArrowDown",e.Home="Home",e.End="End",e.PageUp="PageUp",e.PageDown="PageDown",e.Tab="Tab",e))(ne||{}),bo=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(bo||{}),wo=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(wo||{}),yo=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(yo||{}),Eo=(e=>(e[e.OpenCombobox=0]="OpenCombobox",e[e.CloseCombobox=1]="CloseCombobox",e[e.GoToOption=2]="GoToOption",e[e.RegisterOption=3]="RegisterOption",e[e.UnregisterOption=4]="UnregisterOption",e[e.RegisterLabel=5]="RegisterLabel",e[e.SetActivationTrigger=6]="SetActivationTrigger",e[e.UpdateVirtualOptions=7]="UpdateVirtualOptions",e))(Eo||{});function Wt(e,n=t=>t){let t=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,r=n(e.options.slice()),o=r.length>0&&r[0].dataRef.current.order!==null?r.sort((l,s)=>l.dataRef.current.order-s.dataRef.current.order):Lt(r,l=>l.dataRef.current.domRef.current),i=t?o.indexOf(t):null;return i===-1&&(i=null),{options:o,activeOptionIndex:i}}let So={1(e){var n;return(n=e.dataRef.current)!=null&&n.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var n,t;if((n=e.dataRef.current)!=null&&n.disabled||e.comboboxState===0)return e;if((t=e.dataRef.current)!=null&&t.value){let r=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(r!==-1)return{...e,activeOptionIndex:r,comboboxState:0}}return{...e,comboboxState:0}},2(e,n){var t,r,o,i,l;if((t=e.dataRef.current)!=null&&t.disabled||(r=e.dataRef.current)!=null&&r.optionsRef.current&&!((o=e.dataRef.current)!=null&&o.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let d=n.focus===ie.Specific?n.idx:zt(n,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var x,m;return(m=(x=e.activeOptionIndex)!=null?x:e.virtual.options.findIndex(v=>!e.virtual.disabled(v)))!=null?m:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),h=(i=n.trigger)!=null?i:2;return e.activeOptionIndex===d&&e.activationTrigger===h?e:{...e,activeOptionIndex:d,activationTrigger:h}}let s=Wt(e);if(s.activeOptionIndex===null){let d=s.options.findIndex(h=>!h.dataRef.current.disabled);d!==-1&&(s.activeOptionIndex=d)}let a=n.focus===ie.Specific?n.idx:zt(n,{resolveItems:()=>s.options,resolveActiveIndex:()=>s.activeOptionIndex,resolveId:d=>d.id,resolveDisabled:d=>d.dataRef.current.disabled}),f=(l=n.trigger)!=null?l:2;return e.activeOptionIndex===a&&e.activationTrigger===f?e:{...e,...s,activeOptionIndex:a,activationTrigger:f}},3:(e,n)=>{var t,r,o;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:[...e.options,n.payload]};let i=n.payload,l=Wt(e,a=>(a.push(i),a));e.activeOptionIndex===null&&(r=e.dataRef.current)!=null&&r.isSelected(n.payload.dataRef.current.value)&&(l.activeOptionIndex=l.options.indexOf(i));let s={...e,...l,activationTrigger:2};return(o=e.dataRef.current)!=null&&o.__demoMode&&e.dataRef.current.value===void 0&&(s.activeOptionIndex=0),s},4:(e,n)=>{var t;if((t=e.dataRef.current)!=null&&t.virtual)return{...e,options:e.options.filter(o=>o.id!==n.id)};let r=Wt(e,o=>{let i=o.findIndex(l=>l.id===n.id);return i!==-1&&o.splice(i,1),o});return{...e,...r,activationTrigger:2}},5:(e,n)=>e.labelId===n.id?e:{...e,labelId:n.id},6:(e,n)=>e.activationTrigger===n.trigger?e:{...e,activationTrigger:n.trigger},7:(e,n)=>{var t;if(((t=e.virtual)==null?void 0:t.options)===n.options)return e;let r=e.activeOptionIndex;if(e.activeOptionIndex!==null){let o=n.options.indexOf(e.virtual.options[e.activeOptionIndex]);o!==-1?r=o:r=null}return{...e,activeOptionIndex:r,virtual:Object.assign({},e.virtual,{options:n.options})}}},Ut=u.createContext(null);Ut.displayName="ComboboxActionsContext";function et(e){let n=u.useContext(Ut);if(n===null){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,et),t}return n}let _n=u.createContext(null);function Co(e){var n;let t=Re("VirtualProvider"),[r,o]=u.useMemo(()=>{let a=t.optionsRef.current;if(!a)return[0,0];let f=window.getComputedStyle(a);return[parseFloat(f.paddingBlockStart||f.paddingTop),parseFloat(f.paddingBlockEnd||f.paddingBottom)]},[t.optionsRef.current]),i=Qr({scrollPaddingStart:r,scrollPaddingEnd:o,count:t.virtual.options.length,estimateSize(){return 40},getScrollElement(){var a;return(a=t.optionsRef.current)!=null?a:null},overscan:12}),[l,s]=u.useState(0);return le(()=>{s(a=>a+1)},[(n=t.virtual)==null?void 0:n.options]),u.createElement(_n.Provider,{value:i},u.createElement("div",{style:{position:"relative",width:"100%",height:`${i.getTotalSize()}px`},ref:a=>{if(a){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||t.activationTrigger===0)return;t.activeOptionIndex!==null&&t.virtual.options.length>t.activeOptionIndex&&i.scrollToIndex(t.activeOptionIndex)}}},i.getVirtualItems().map(a=>{var f;return u.createElement(u.Fragment,{key:a.key},u.cloneElement((f=e.children)==null?void 0:f.call(e,{option:t.virtual.options[a.index],open:t.comboboxState===0}),{key:`${l}-${a.key}`,"data-index":a.index,"aria-setsize":t.virtual.options.length,"aria-posinset":a.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${a.start}px)`,overflowAnchor:"none"}}))})))}let Ht=u.createContext(null);Ht.displayName="ComboboxDataContext";function Re(e){let n=u.useContext(Ht);if(n===null){let t=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,Re),t}return n}function To(e,n){return me(n.type,So,e,n)}let jo=u.Fragment;function Oo(e,n){let{value:t,defaultValue:r,onChange:o,form:i,name:l,by:s=null,disabled:a=!1,__demoMode:f=!1,nullable:d=!1,multiple:h=!1,immediate:x=!1,virtual:m=null,...v}=e,g=!1,b=null,[E=h?[]:void 0,w]=yn(t,o,r),[y,N]=u.useReducer(To,{dataRef:u.createRef(),comboboxState:f?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),k=u.useRef(!1),L=u.useRef({static:!1,hold:!1}),B=u.useRef(null),Y=u.useRef(null),D=u.useRef(null),A=u.useRef(null),W=M(typeof s=="string"?(P,V)=>{let O=s;return(P==null?void 0:P[O])===(V==null?void 0:V[O])}:s??((P,V)=>P===V)),q=M(P=>y.options.findIndex(V=>W(V.dataRef.current.value,P))),G=u.useCallback(P=>me(C.mode,{1:()=>E.some(V=>W(V,P)),0:()=>W(E,P)}),[E]),Q=M(P=>y.activeOptionIndex===q(P)),C=u.useMemo(()=>({...y,immediate:g,optionsPropsRef:L,labelRef:B,inputRef:Y,buttonRef:D,optionsRef:A,value:E,defaultValue:r,disabled:a,mode:h?1:0,virtual:y.virtual,get activeOptionIndex(){if(k.current&&y.activeOptionIndex===null&&y.options.length>0){let P=y.options.findIndex(V=>!V.dataRef.current.disabled);if(P!==-1)return P}return y.activeOptionIndex},calculateIndex:q,compare:W,isSelected:G,isActive:Q,nullable:d,__demoMode:f}),[E,r,a,h,d,f,y,b]);le(()=>{},[b,void 0]),le(()=>{y.dataRef.current=C},[C]),At([C.buttonRef,C.inputRef,C.optionsRef],()=>ge.closeCombobox(),C.comboboxState===0);let re=u.useMemo(()=>{var P,V,O;return{open:C.comboboxState===0,disabled:a,activeIndex:C.activeOptionIndex,activeOption:C.activeOptionIndex===null?null:C.virtual?C.virtual.options[(P=C.activeOptionIndex)!=null?P:0]:(O=(V=C.options[C.activeOptionIndex])==null?void 0:V.dataRef.current.value)!=null?O:null,value:E}},[C,a,E]),K=M(()=>{if(C.activeOptionIndex!==null){if(C.virtual)se(C.virtual.options[C.activeOptionIndex]);else{let{dataRef:P}=C.options[C.activeOptionIndex];se(P.current.value)}ge.goToOption(ie.Specific,C.activeOptionIndex)}}),j=M(()=>{N({type:0}),k.current=!0}),I=M(()=>{N({type:1}),k.current=!1}),_=M((P,V,O)=>(k.current=!1,P===ie.Specific?N({type:2,focus:ie.Specific,idx:V,trigger:O}):N({type:2,focus:P,trigger:O}))),Z=M((P,V)=>(N({type:3,payload:{id:P,dataRef:V}}),()=>{C.isActive(V.current.value)&&(k.current=!0),N({type:4,id:P})})),ee=M(P=>(N({type:5,id:P}),()=>N({type:5,id:null}))),se=M(P=>me(C.mode,{0(){return w==null?void 0:w(P)},1(){let V=C.value.slice(),O=V.findIndex(U=>W(U,P));return O===-1?V.push(P):V.splice(O,1),w==null?void 0:w(V)}})),ae=M(P=>{N({type:6,trigger:P})}),ge=u.useMemo(()=>({onChange:se,registerOption:Z,registerLabel:ee,goToOption:_,closeCombobox:I,openCombobox:j,setActivationTrigger:ae,selectActiveOption:K}),[]),we=n===null?{}:{ref:n},R=u.useRef(null),ue=ke();return u.useEffect(()=>{R.current&&r!==void 0&&ue.addEventListener(R.current,"reset",()=>{w==null||w(r)})},[R,w]),u.createElement(Ut.Provider,{value:ge},u.createElement(Ht.Provider,{value:C},u.createElement(Bt,{value:me(C.comboboxState,{0:he.Open,1:he.Closed})},l!=null&&E!=null&&Ln({[l]:E}).map(([P,V],O)=>u.createElement(Je,{features:He.Hidden,ref:O===0?U=>{var X;R.current=(X=U==null?void 0:U.closest("form"))!=null?X:null}:void 0,...vt({key:P,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:i,disabled:a,name:P,value:V})})),de({ourProps:we,theirProps:v,slot:re,defaultTag:jo,name:"Combobox"}))))}let No="input";function ko(e,n){var t,r,o,i,l;let s=be(),{id:a=`headlessui-combobox-input-${s}`,onChange:f,displayValue:d,type:h="text",...x}=e,m=Re("Combobox.Input"),v=et("Combobox.Input"),g=pe(m.inputRef,n),b=_e(m.inputRef),E=u.useRef(!1),w=ke(),y=M(()=>{v.onChange(null),m.optionsRef.current&&(m.optionsRef.current.scrollTop=0),v.goToOption(ie.Nothing)}),N=function(){var C;return typeof d=="function"&&m.value!==void 0?(C=d(m.value))!=null?C:"":typeof m.value=="string"?m.value:""}();Xe(([C,re],[K,j])=>{if(E.current)return;let I=m.inputRef.current;I&&((j===0&&re===1||C!==K)&&(I.value=C),requestAnimationFrame(()=>{if(E.current||!I||(b==null?void 0:b.activeElement)!==I)return;let{selectionStart:_,selectionEnd:Z}=I;Math.abs((Z??0)-(_??0))===0&&_===0&&I.setSelectionRange(I.value.length,I.value.length)}))},[N,m.comboboxState,b]),Xe(([C],[re])=>{if(C===0&&re===1){if(E.current)return;let K=m.inputRef.current;if(!K)return;let j=K.value,{selectionStart:I,selectionEnd:_,selectionDirection:Z}=K;K.value="",K.value=j,Z!==null?K.setSelectionRange(I,_,Z):K.setSelectionRange(I,_)}},[m.comboboxState]);let k=u.useRef(!1),L=M(()=>{k.current=!0}),B=M(()=>{w.nextFrame(()=>{k.current=!1})}),Y=M(C=>{switch(E.current=!0,C.key){case ne.Enter:if(E.current=!1,m.comboboxState!==0||k.current)return;if(C.preventDefault(),C.stopPropagation(),m.activeOptionIndex===null){v.closeCombobox();return}v.selectActiveOption(),m.mode===0&&v.closeCombobox();break;case ne.ArrowDown:return E.current=!1,C.preventDefault(),C.stopPropagation(),me(m.comboboxState,{0:()=>v.goToOption(ie.Next),1:()=>v.openCombobox()});case ne.ArrowUp:return E.current=!1,C.preventDefault(),C.stopPropagation(),me(m.comboboxState,{0:()=>v.goToOption(ie.Previous),1:()=>{v.openCombobox(),w.nextFrame(()=>{m.value||v.goToOption(ie.Last)})}});case ne.Home:if(C.shiftKey)break;return E.current=!1,C.preventDefault(),C.stopPropagation(),v.goToOption(ie.First);case ne.PageUp:return E.current=!1,C.preventDefault(),C.stopPropagation(),v.goToOption(ie.First);case ne.End:if(C.shiftKey)break;return E.current=!1,C.preventDefault(),C.stopPropagation(),v.goToOption(ie.Last);case ne.PageDown:return E.current=!1,C.preventDefault(),C.stopPropagation(),v.goToOption(ie.Last);case ne.Escape:return E.current=!1,m.comboboxState!==0?void 0:(C.preventDefault(),m.optionsRef.current&&!m.optionsPropsRef.current.static&&C.stopPropagation(),m.nullable&&m.mode===0&&m.value===null&&y(),v.closeCombobox());case ne.Tab:if(E.current=!1,m.comboboxState!==0)return;m.mode===0&&m.activationTrigger!==1&&v.selectActiveOption(),v.closeCombobox();break}}),D=M(C=>{f==null||f(C),m.nullable&&m.mode===0&&C.target.value===""&&y(),v.openCombobox()}),A=M(C=>{var re,K,j;let I=(re=C.relatedTarget)!=null?re:Oe.find(_=>_!==C.currentTarget);if(E.current=!1,!((K=m.optionsRef.current)!=null&&K.contains(I))&&!((j=m.buttonRef.current)!=null&&j.contains(I))&&m.comboboxState===0)return C.preventDefault(),m.mode===0&&(m.nullable&&m.value===null?y():m.activationTrigger!==1&&v.selectActiveOption()),v.closeCombobox()}),W=M(C=>{var re,K,j;let I=(re=C.relatedTarget)!=null?re:Oe.find(_=>_!==C.currentTarget);(K=m.buttonRef.current)!=null&&K.contains(I)||(j=m.optionsRef.current)!=null&&j.contains(I)||m.disabled||m.immediate&&m.comboboxState!==0&&(v.openCombobox(),w.nextFrame(()=>{v.setActivationTrigger(1)}))}),q=$t(()=>{if(m.labelId)return[m.labelId].join(" ")},[m.labelId]),G=u.useMemo(()=>({open:m.comboboxState===0,disabled:m.disabled}),[m]),Q={ref:g,id:a,role:"combobox",type:h,"aria-controls":(t=m.optionsRef.current)==null?void 0:t.id,"aria-expanded":m.comboboxState===0,"aria-activedescendant":m.activeOptionIndex===null?void 0:m.virtual?(r=m.options.find(C=>{var re;return!((re=m.virtual)!=null&&re.disabled(C.dataRef.current.value))&&m.compare(C.dataRef.current.value,m.virtual.options[m.activeOptionIndex])}))==null?void 0:r.id:(o=m.options[m.activeOptionIndex])==null?void 0:o.id,"aria-labelledby":q,"aria-autocomplete":"list",defaultValue:(l=(i=e.defaultValue)!=null?i:m.defaultValue!==void 0?d==null?void 0:d(m.defaultValue):null)!=null?l:m.defaultValue,disabled:m.disabled,onCompositionStart:L,onCompositionEnd:B,onKeyDown:Y,onChange:D,onFocus:W,onBlur:A};return de({ourProps:Q,theirProps:x,slot:G,defaultTag:No,name:"Combobox.Input"})}let Io="button";function $o(e,n){var t;let r=Re("Combobox.Button"),o=et("Combobox.Button"),i=pe(r.buttonRef,n),l=be(),{id:s=`headlessui-combobox-button-${l}`,...a}=e,f=ke(),d=M(g=>{switch(g.key){case ne.ArrowDown:return g.preventDefault(),g.stopPropagation(),r.comboboxState===1&&o.openCombobox(),f.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})});case ne.ArrowUp:return g.preventDefault(),g.stopPropagation(),r.comboboxState===1&&(o.openCombobox(),f.nextFrame(()=>{r.value||o.goToOption(ie.Last)})),f.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})});case ne.Escape:return r.comboboxState!==0?void 0:(g.preventDefault(),r.optionsRef.current&&!r.optionsPropsRef.current.static&&g.stopPropagation(),o.closeCombobox(),f.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})}));default:return}}),h=M(g=>{if(gt(g.currentTarget))return g.preventDefault();r.comboboxState===0?o.closeCombobox():(g.preventDefault(),o.openCombobox()),f.nextFrame(()=>{var b;return(b=r.inputRef.current)==null?void 0:b.focus({preventScroll:!0})})}),x=$t(()=>{if(r.labelId)return[r.labelId,s].join(" ")},[r.labelId,s]),m=u.useMemo(()=>({open:r.comboboxState===0,disabled:r.disabled,value:r.value}),[r]),v={ref:i,id:s,type:Dt(e,r.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(t=r.optionsRef.current)==null?void 0:t.id,"aria-expanded":r.comboboxState===0,"aria-labelledby":x,disabled:r.disabled,onClick:h,onKeyDown:d};return de({ourProps:v,theirProps:a,slot:m,defaultTag:Io,name:"Combobox.Button"})}let Fo="label";function Mo(e,n){let t=be(),{id:r=`headlessui-combobox-label-${t}`,...o}=e,i=Re("Combobox.Label"),l=et("Combobox.Label"),s=pe(i.labelRef,n);le(()=>l.registerLabel(r),[r]);let a=M(()=>{var d;return(d=i.inputRef.current)==null?void 0:d.focus({preventScroll:!0})}),f=u.useMemo(()=>({open:i.comboboxState===0,disabled:i.disabled}),[i]);return de({ourProps:{ref:s,id:r,onClick:a},theirProps:o,slot:f,defaultTag:Fo,name:"Combobox.Label"})}let Po="ul",Lo=Pe.RenderStrategy|Pe.Static;function Ao(e,n){let t=be(),{id:r=`headlessui-combobox-options-${t}`,hold:o=!1,...i}=e,l=Re("Combobox.Options"),s=pe(l.optionsRef,n),a=Qe(),f=a!==null?(a&he.Open)===he.Open:l.comboboxState===0;le(()=>{var m;l.optionsPropsRef.current.static=(m=e.static)!=null?m:!1},[l.optionsPropsRef,e.static]),le(()=>{l.optionsPropsRef.current.hold=o},[l.optionsPropsRef,o]),Mn({container:l.optionsRef.current,enabled:l.comboboxState===0,accept(m){return m.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:m.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(m){m.setAttribute("role","none")}});let d=$t(()=>{var m,v;return(v=l.labelId)!=null?v:(m=l.buttonRef.current)==null?void 0:m.id},[l.labelId,l.buttonRef.current]),h=u.useMemo(()=>({open:l.comboboxState===0,option:void 0}),[l]),x={"aria-labelledby":d,role:"listbox","aria-multiselectable":l.mode===1?!0:void 0,id:r,ref:s};return l.virtual&&l.comboboxState===0&&Object.assign(i,{children:u.createElement(Co,null,i.children)}),de({ourProps:x,theirProps:i,slot:h,defaultTag:Po,features:Lo,visible:f,name:"Combobox.Options"})}let Do="li";function _o(e,n){var t;let r=be(),{id:o=`headlessui-combobox-option-${r}`,disabled:i=!1,value:l,order:s=null,...a}=e,f=Re("Combobox.Option"),d=et("Combobox.Option"),h=f.virtual?f.activeOptionIndex===f.calculateIndex(l):f.activeOptionIndex===null?!1:((t=f.options[f.activeOptionIndex])==null?void 0:t.id)===o,x=f.isSelected(l),m=u.useRef(null),v=Te({disabled:i,value:l,domRef:m,order:s}),g=u.useContext(_n),b=pe(n,m,g?g.measureElement:null),E=M(()=>d.onChange(l));le(()=>d.registerOption(o,v),[v,o]);let w=u.useRef(!(f.virtual||f.__demoMode));le(()=>{if(!f.virtual||!f.__demoMode)return;let A=Ee();return A.requestAnimationFrame(()=>{w.current=!0}),A.dispose},[f.virtual,f.__demoMode]),le(()=>{if(!w.current||f.comboboxState!==0||!h||f.activationTrigger===0)return;let A=Ee();return A.requestAnimationFrame(()=>{var W,q;(q=(W=m.current)==null?void 0:W.scrollIntoView)==null||q.call(W,{block:"nearest"})}),A.dispose},[m,h,f.comboboxState,f.activationTrigger,f.activeOptionIndex]);let y=M(A=>{var W;if(i||(W=f.virtual)!=null&&W.disabled(l))return A.preventDefault();E(),On()||requestAnimationFrame(()=>{var q;return(q=f.inputRef.current)==null?void 0:q.focus({preventScroll:!0})}),f.mode===0&&requestAnimationFrame(()=>d.closeCombobox())}),N=M(()=>{var A;if(i||(A=f.virtual)!=null&&A.disabled(l))return d.goToOption(ie.Nothing);let W=f.calculateIndex(l);d.goToOption(ie.Specific,W)}),k=Fn(),L=M(A=>k.update(A)),B=M(A=>{var W;if(!k.wasMoved(A)||i||(W=f.virtual)!=null&&W.disabled(l)||h)return;let q=f.calculateIndex(l);d.goToOption(ie.Specific,q,0)}),Y=M(A=>{var W;k.wasMoved(A)&&(i||(W=f.virtual)!=null&&W.disabled(l)||h&&(f.optionsPropsRef.current.hold||d.goToOption(ie.Nothing)))}),D=u.useMemo(()=>({active:h,selected:x,disabled:i}),[h,x,i]);return de({ourProps:{id:o,ref:b,role:"option",tabIndex:i===!0?void 0:-1,"aria-disabled":i===!0?!0:void 0,"aria-selected":x,disabled:void 0,onClick:y,onFocus:N,onPointerEnter:L,onMouseEnter:L,onPointerMove:B,onMouseMove:B,onPointerLeave:Y,onMouseLeave:Y},theirProps:a,slot:D,defaultTag:Do,name:"Combobox.Option"})}let Ro=fe(Oo),Bo=fe($o),zo=fe(ko),Wo=fe(Mo),Uo=fe(Ao),Ho=fe(_o),$e=Object.assign(Ro,{Input:zo,Button:Bo,Label:Wo,Options:Uo,Option:Ho});function Rn(e,n,t,r){let o=Te(t);u.useEffect(()=>{e=e??window;function i(l){o.current(l)}return e.addEventListener(n,i,r),()=>e.removeEventListener(n,i,r)},[e,n,r])}function tt(){let e=u.useRef(!1);return le(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function Bn(e){let n=M(e),t=u.useRef(!1);u.useEffect(()=>(t.current=!1,()=>{t.current=!0,dt(()=>{t.current&&n()})}),[n])}var nt=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(nt||{});function Vo(){let e=u.useRef(0);return Nn("keydown",n=>{n.key==="Tab"&&(e.current=n.shiftKey?1:0)},!0),e}function zn(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let n=new Set;for(let t of e.current)t.current instanceof HTMLElement&&n.add(t.current);return n}let Yo="div";var Wn=(e=>(e[e.None=1]="None",e[e.InitialFocus=2]="InitialFocus",e[e.TabLock=4]="TabLock",e[e.FocusLock=8]="FocusLock",e[e.RestoreFocus=16]="RestoreFocus",e[e.All=30]="All",e))(Wn||{});function qo(e,n){let t=u.useRef(null),r=pe(t,n),{initialFocus:o,containers:i,features:l=30,...s}=e;Ue()||(l=1);let a=_e(t);Zo({ownerDocument:a},!!(l&16));let f=Xo({ownerDocument:a,container:t,initialFocus:o},!!(l&2));Jo({ownerDocument:a,container:t,containers:i,previousActiveElement:f},!!(l&8));let d=Vo(),h=M(g=>{let b=t.current;b&&(E=>E())(()=>{me(d.current,{[nt.Forwards]:()=>{Ze(b,Ie.First,{skipElements:[g.relatedTarget]})},[nt.Backwards]:()=>{Ze(b,Ie.Last,{skipElements:[g.relatedTarget]})}})})}),x=ke(),m=u.useRef(!1),v={ref:r,onKeyDown(g){g.key=="Tab"&&(m.current=!0,x.requestAnimationFrame(()=>{m.current=!1}))},onBlur(g){let b=zn(i);t.current instanceof HTMLElement&&b.add(t.current);let E=g.relatedTarget;E instanceof HTMLElement&&E.dataset.headlessuiFocusGuard!=="true"&&(Un(b,E)||(m.current?Ze(t.current,me(d.current,{[nt.Forwards]:()=>Ie.Next,[nt.Backwards]:()=>Ie.Previous})|Ie.WrapAround,{relativeTo:g.target}):g.target instanceof HTMLElement&&Me(g.target)))}};return u.createElement(u.Fragment,null,!!(l&4)&&u.createElement(Je,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:He.Focusable}),de({ourProps:v,theirProps:s,defaultTag:Yo,name:"FocusTrap"}),!!(l&4)&&u.createElement(Je,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:h,features:He.Focusable}))}let Go=fe(qo),rt=Object.assign(Go,{features:Wn});function Ko(e=!0){let n=u.useRef(Oe.slice());return Xe(([t],[r])=>{r===!0&&t===!1&&dt(()=>{n.current.splice(0)}),r===!1&&t===!0&&(n.current=Oe.slice())},[e,Oe,n]),M(()=>{var t;return(t=n.current.find(r=>r!=null&&r.isConnected))!=null?t:null})}function Zo({ownerDocument:e},n){let t=Ko(n);Xe(()=>{n||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&Me(t())},[n]),Bn(()=>{n&&Me(t())})}function Xo({ownerDocument:e,container:n,initialFocus:t},r){let o=u.useRef(null),i=tt();return Xe(()=>{if(!r)return;let l=n.current;l&&dt(()=>{if(!i.current)return;let s=e==null?void 0:e.activeElement;if(t!=null&&t.current){if((t==null?void 0:t.current)===s){o.current=s;return}}else if(l.contains(s)){o.current=s;return}t!=null&&t.current?Me(t.current):Ze(l,Ie.First)===Sn.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),o.current=e==null?void 0:e.activeElement})},[r]),o}function Jo({ownerDocument:e,container:n,containers:t,previousActiveElement:r},o){let i=tt();Rn(e==null?void 0:e.defaultView,"focus",l=>{if(!o||!i.current)return;let s=zn(t);n.current instanceof HTMLElement&&s.add(n.current);let a=r.current;if(!a)return;let f=l.target;f&&f instanceof HTMLElement?Un(s,f)?(r.current=f,Me(f)):(l.preventDefault(),l.stopPropagation(),Me(a)):Me(r.current)},!0)}function Un(e,n){for(let t of e)if(t.contains(n))return!0;return!1}let Hn=u.createContext(!1);function Qo(){return u.useContext(Hn)}function Vt(e){return u.createElement(Hn.Provider,{value:e.force},e.children)}function el(e){let n=Qo(),t=u.useContext(Vn),r=_e(e),[o,i]=u.useState(()=>{if(!n&&t!==null||Ne.isServer)return null;let l=r==null?void 0:r.getElementById("headlessui-portal-root");if(l)return l;if(r===null)return null;let s=r.createElement("div");return s.setAttribute("id","headlessui-portal-root"),r.body.appendChild(s)});return u.useEffect(()=>{o!==null&&(r!=null&&r.body.contains(o)||r==null||r.body.appendChild(o))},[o,r]),u.useEffect(()=>{n||t!==null&&i(t.current)},[t,i,n]),o}let tl=u.Fragment;function nl(e,n){let t=e,r=u.useRef(null),o=pe(co(d=>{r.current=d}),n),i=_e(r),l=el(r),[s]=u.useState(()=>{var d;return Ne.isServer?null:(d=i==null?void 0:i.createElement("div"))!=null?d:null}),a=u.useContext(Yt),f=Ue();return le(()=>{!l||!s||l.contains(s)||(s.setAttribute("data-headlessui-portal",""),l.appendChild(s))},[l,s]),le(()=>{if(s&&a)return a.register(s)},[a,s]),Bn(()=>{var d;!l||!s||(s instanceof Node&&l.contains(s)&&l.removeChild(s),l.childNodes.length<=0&&((d=l.parentElement)==null||d.removeChild(l)))}),f?!l||!s?null:jt.createPortal(de({ourProps:{ref:o},theirProps:t,defaultTag:tl,name:"Portal"}),s):null}let rl=u.Fragment,Vn=u.createContext(null);function ol(e,n){let{target:t,...r}=e,o={ref:pe(n)};return u.createElement(Vn.Provider,{value:t},de({ourProps:o,theirProps:r,defaultTag:rl,name:"Popover.Group"}))}let Yt=u.createContext(null);function ll(){let e=u.useContext(Yt),n=u.useRef([]),t=M(i=>(n.current.push(i),e&&e.register(i),()=>r(i))),r=M(i=>{let l=n.current.indexOf(i);l!==-1&&n.current.splice(l,1),e&&e.unregister(i)}),o=u.useMemo(()=>({register:t,unregister:r,portals:n}),[t,r,n]);return[n,u.useMemo(()=>function({children:i}){return u.createElement(Yt.Provider,{value:o},i)},[o])]}let il=fe(nl),sl=fe(ol),qt=Object.assign(il,{Group:sl});function al(e,n){return e===n&&(e!==0||1/e===1/n)||e!==e&&n!==n}const ul=typeof Object.is=="function"?Object.is:al,{useState:cl,useEffect:dl,useLayoutEffect:fl,useDebugValue:ml}=S;function pl(e,n,t){const r=n(),[{inst:o},i]=cl({inst:{value:r,getSnapshot:n}});return fl(()=>{o.value=r,o.getSnapshot=n,Gt(o)&&i({inst:o})},[e,r,n]),dl(()=>(Gt(o)&&i({inst:o}),e(()=>{Gt(o)&&i({inst:o})})),[e]),ml(r),r}function Gt(e){const n=e.getSnapshot,t=e.value;try{const r=n();return!ul(t,r)}catch{return!0}}function hl(e,n,t){return n()}const vl=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",gl=!vl,xl=gl?hl:pl,bl="useSyncExternalStore"in S?(e=>e.useSyncExternalStore)(S):xl;function wl(e){return bl(e.subscribe,e.getSnapshot,e.getSnapshot)}function yl(e,n){let t=e(),r=new Set;return{getSnapshot(){return t},subscribe(o){return r.add(o),()=>r.delete(o)},dispatch(o,...i){let l=n[o].call(t,...i);l&&(t=l,r.forEach(s=>s()))}}}function El(){let e;return{before({doc:n}){var t;let r=n.documentElement;e=((t=n.defaultView)!=null?t:window).innerWidth-r.clientWidth},after({doc:n,d:t}){let r=n.documentElement,o=r.clientWidth-r.offsetWidth,i=e-o;t.style(r,"paddingRight",`${i}px`)}}}function Sl(){return jn()?{before({doc:e,d:n,meta:t}){function r(o){return t.containers.flatMap(i=>i()).some(i=>i.contains(o))}n.microTask(()=>{var o;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let s=Ee();s.style(e.documentElement,"scrollBehavior","auto"),n.add(()=>n.microTask(()=>s.dispose()))}let i=(o=window.scrollY)!=null?o:window.pageYOffset,l=null;n.addEventListener(e,"click",s=>{if(s.target instanceof HTMLElement)try{let a=s.target.closest("a");if(!a)return;let{hash:f}=new URL(a.href),d=e.querySelector(f);d&&!r(d)&&(l=d)}catch{}},!0),n.addEventListener(e,"touchstart",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let a=s.target;for(;a.parentElement&&r(a.parentElement);)a=a.parentElement;n.style(a,"overscrollBehavior","contain")}else n.style(s.target,"touchAction","none")}),n.addEventListener(e,"touchmove",s=>{if(s.target instanceof HTMLElement)if(r(s.target)){let a=s.target;for(;a.parentElement&&a.dataset.headlessuiPortal!==""&&!(a.scrollHeight>a.clientHeight||a.scrollWidth>a.clientWidth);)a=a.parentElement;a.dataset.headlessuiPortal===""&&s.preventDefault()}else s.preventDefault()},{passive:!1}),n.add(()=>{var s;let a=(s=window.scrollY)!=null?s:window.pageYOffset;i!==a&&window.scrollTo(0,i),l&&l.isConnected&&(l.scrollIntoView({block:"nearest"}),l=null)})})}}:{}}function Cl(){return{before({doc:e,d:n}){n.style(e.documentElement,"overflow","hidden")}}}function Tl(e){let n={};for(let t of e)Object.assign(n,t(n));return n}let Be=yl(()=>new Map,{PUSH(e,n){var t;let r=(t=this.get(e))!=null?t:{doc:e,count:0,d:Ee(),meta:new Set};return r.count++,r.meta.add(n),this.set(e,r),this},POP(e,n){let t=this.get(e);return t&&(t.count--,t.meta.delete(n)),this},SCROLL_PREVENT({doc:e,d:n,meta:t}){let r={doc:e,d:n,meta:Tl(t)},o=[Sl(),El(),Cl()];o.forEach(({before:i})=>i==null?void 0:i(r)),o.forEach(({after:i})=>i==null?void 0:i(r))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});Be.subscribe(()=>{let e=Be.getSnapshot(),n=new Map;for(let[t]of e)n.set(t,t.documentElement.style.overflow);for(let t of e.values()){let r=n.get(t.doc)==="hidden",o=t.count!==0;(o&&!r||!o&&r)&&Be.dispatch(t.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",t),t.count===0&&Be.dispatch("TEARDOWN",t)}});function jl(e,n,t){let r=wl(Be),o=e?r.get(e):void 0,i=o?o.count>0:!1;return le(()=>{if(!(!e||!n))return Be.dispatch("PUSH",e,t),()=>Be.dispatch("POP",e,t)},[n,e]),i}let Kt=new Map,ot=new Map;function Yn(e,n=!0){le(()=>{var t;if(!n)return;let r=typeof e=="function"?e():e.current;if(!r)return;function o(){var l;if(!r)return;let s=(l=ot.get(r))!=null?l:1;if(s===1?ot.delete(r):ot.set(r,s-1),s!==1)return;let a=Kt.get(r);a&&(a["aria-hidden"]===null?r.removeAttribute("aria-hidden"):r.setAttribute("aria-hidden",a["aria-hidden"]),r.inert=a.inert,Kt.delete(r))}let i=(t=ot.get(r))!=null?t:0;return ot.set(r,i+1),i!==0||(Kt.set(r,{"aria-hidden":r.getAttribute("aria-hidden"),inert:r.inert}),r.setAttribute("aria-hidden","true"),r.inert=!0),o},[e,n])}function Ol({defaultContainers:e=[],portals:n,mainTreeNodeRef:t}={}){var r;let o=u.useRef((r=t==null?void 0:t.current)!=null?r:null),i=_e(o),l=M(()=>{var s,a,f;let d=[];for(let h of e)h!==null&&(h instanceof HTMLElement?d.push(h):"current"in h&&h.current instanceof HTMLElement&&d.push(h.current));if(n!=null&&n.current)for(let h of n.current)d.push(h);for(let h of(s=i==null?void 0:i.querySelectorAll("html > *, body > *"))!=null?s:[])h!==document.body&&h!==document.head&&h instanceof HTMLElement&&h.id!=="headlessui-portal-root"&&(h.contains(o.current)||h.contains((f=(a=o.current)==null?void 0:a.getRootNode())==null?void 0:f.host)||d.some(x=>h.contains(x))||d.push(h));return d});return{resolveContainers:l,contains:M(s=>l().some(a=>a.contains(s))),mainTreeNodeRef:o,MainTreeNode:u.useMemo(()=>function(){return t!=null?null:u.createElement(Je,{features:He.Hidden,ref:o})},[o,t])}}let Zt=u.createContext(()=>{});Zt.displayName="StackContext";var Xt=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(Xt||{});function Nl(){return u.useContext(Zt)}function kl({children:e,onUpdate:n,type:t,element:r,enabled:o}){let i=Nl(),l=M((...s)=>{n==null||n(...s),i(...s)});return le(()=>{let s=o===void 0||o===!0;return s&&l(0,t,r),()=>{s&&l(1,t,r)}},[l,t,r,o]),u.createElement(Zt.Provider,{value:l},e)}let qn=u.createContext(null);function Gn(){let e=u.useContext(qn);if(e===null){let n=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,Gn),n}return e}function Kn(){let[e,n]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(t){let r=M(i=>(n(l=>[...l,i]),()=>n(l=>{let s=l.slice(),a=s.indexOf(i);return a!==-1&&s.splice(a,1),s}))),o=u.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props}),[r,t.slot,t.name,t.props]);return u.createElement(qn.Provider,{value:o},t.children)},[n])]}let Il="p";function $l(e,n){let t=be(),{id:r=`headlessui-description-${t}`,...o}=e,i=Gn(),l=pe(n);le(()=>i.register(r),[r,i.register]);let s={ref:l,...i.props,id:r};return de({ourProps:s,theirProps:o,slot:i.slot||{},defaultTag:Il,name:i.name||"Description"})}let Fl=fe($l),Zn=Object.assign(Fl,{});var Ml=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ml||{}),Pl=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(Pl||{});let Ll={0(e,n){return e.titleId===n.id?e:{...e,titleId:n.id}}},xt=u.createContext(null);xt.displayName="DialogContext";function lt(e){let n=u.useContext(xt);if(n===null){let t=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,lt),t}return n}function Al(e,n,t=()=>[document.body]){jl(e,n,r=>{var o;return{containers:[...(o=r.containers)!=null?o:[],t]}})}function Dl(e,n){return me(n.type,Ll,e,n)}let _l="div",Rl=Pe.RenderStrategy|Pe.Static;function Bl(e,n){let t=be(),{id:r=`headlessui-dialog-${t}`,open:o,onClose:i,initialFocus:l,role:s="dialog",__demoMode:a=!1,...f}=e,[d,h]=u.useState(0),x=u.useRef(!1);s=function(){return s==="dialog"||s==="alertdialog"?s:(x.current||(x.current=!0,console.warn(`Invalid role [${s}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let m=Qe();o===void 0&&m!==null&&(o=(m&he.Open)===he.Open);let v=u.useRef(null),g=pe(v,n),b=_e(v),E=e.hasOwnProperty("open")||m!==null,w=e.hasOwnProperty("onClose");if(!E&&!w)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!E)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!w)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof o!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${o}`);if(typeof i!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${i}`);let y=o?0:1,[N,k]=u.useReducer(Dl,{titleId:null,descriptionId:null,panelRef:u.createRef()}),L=M(()=>i(!1)),B=M(O=>k({type:0,id:O})),Y=Ue()?a?!1:y===0:!1,D=d>1,A=u.useContext(xt)!==null,[W,q]=ll(),G={get current(){var O;return(O=N.panelRef.current)!=null?O:v.current}},{resolveContainers:Q,mainTreeNodeRef:C,MainTreeNode:re}=Ol({portals:W,defaultContainers:[G]}),K=D?"parent":"leaf",j=m!==null?(m&he.Closing)===he.Closing:!1,I=A||j?!1:Y,_=u.useCallback(()=>{var O,U;return(U=Array.from((O=b==null?void 0:b.querySelectorAll("body > *"))!=null?O:[]).find(X=>X.id==="headlessui-portal-root"?!1:X.contains(C.current)&&X instanceof HTMLElement))!=null?U:null},[C]);Yn(_,I);let Z=D?!0:Y,ee=u.useCallback(()=>{var O,U;return(U=Array.from((O=b==null?void 0:b.querySelectorAll("[data-headlessui-portal]"))!=null?O:[]).find(X=>X.contains(C.current)&&X instanceof HTMLElement))!=null?U:null},[C]);Yn(ee,Z),At(Q,O=>{O.preventDefault(),L()},!(!Y||D));let ae=!(D||y!==0);Rn(b==null?void 0:b.defaultView,"keydown",O=>{ae&&(O.defaultPrevented||O.key===ne.Escape&&(O.preventDefault(),O.stopPropagation(),L()))}),Al(b,!(j||y!==0||A),Q),u.useEffect(()=>{if(y!==0||!v.current)return;let O=new ResizeObserver(U=>{for(let X of U){let Se=X.target.getBoundingClientRect();Se.x===0&&Se.y===0&&Se.width===0&&Se.height===0&&L()}});return O.observe(v.current),()=>O.disconnect()},[y,v,L]);let[we,R]=Kn(),ue=u.useMemo(()=>[{dialogState:y,close:L,setTitleId:B},N],[y,N,L,B]),P=u.useMemo(()=>({open:y===0}),[y]),V={ref:g,id:r,role:s,"aria-modal":y===0?!0:void 0,"aria-labelledby":N.titleId,"aria-describedby":we};return u.createElement(kl,{type:"Dialog",enabled:y===0,element:v,onUpdate:M((O,U)=>{U==="Dialog"&&me(O,{[Xt.Add]:()=>h(X=>X+1),[Xt.Remove]:()=>h(X=>X-1)})})},u.createElement(Vt,{force:!0},u.createElement(qt,null,u.createElement(xt.Provider,{value:ue},u.createElement(qt.Group,{target:v},u.createElement(Vt,{force:!1},u.createElement(R,{slot:P,name:"Dialog.Description"},u.createElement(rt,{initialFocus:l,containers:Q,features:Y?me(K,{parent:rt.features.RestoreFocus,leaf:rt.features.All&~rt.features.FocusLock}):rt.features.None},u.createElement(q,null,de({ourProps:V,theirProps:f,slot:P,defaultTag:_l,features:Rl,visible:y===0,name:"Dialog"}))))))))),u.createElement(re,null))}let zl="div";function Wl(e,n){let t=be(),{id:r=`headlessui-dialog-overlay-${t}`,...o}=e,[{dialogState:i,close:l}]=lt("Dialog.Overlay"),s=pe(n),a=M(d=>{if(d.target===d.currentTarget){if(gt(d.currentTarget))return d.preventDefault();d.preventDefault(),d.stopPropagation(),l()}}),f=u.useMemo(()=>({open:i===0}),[i]);return de({ourProps:{ref:s,id:r,"aria-hidden":!0,onClick:a},theirProps:o,slot:f,defaultTag:zl,name:"Dialog.Overlay"})}let Ul="div";function Hl(e,n){let t=be(),{id:r=`headlessui-dialog-backdrop-${t}`,...o}=e,[{dialogState:i},l]=lt("Dialog.Backdrop"),s=pe(n);u.useEffect(()=>{if(l.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[l.panelRef]);let a=u.useMemo(()=>({open:i===0}),[i]);return u.createElement(Vt,{force:!0},u.createElement(qt,null,de({ourProps:{ref:s,id:r,"aria-hidden":!0},theirProps:o,slot:a,defaultTag:Ul,name:"Dialog.Backdrop"})))}let Vl="div";function Yl(e,n){let t=be(),{id:r=`headlessui-dialog-panel-${t}`,...o}=e,[{dialogState:i},l]=lt("Dialog.Panel"),s=pe(n,l.panelRef),a=u.useMemo(()=>({open:i===0}),[i]),f=M(d=>{d.stopPropagation()});return de({ourProps:{ref:s,id:r,onClick:f},theirProps:o,slot:a,defaultTag:Vl,name:"Dialog.Panel"})}let ql="h2";function Gl(e,n){let t=be(),{id:r=`headlessui-dialog-title-${t}`,...o}=e,[{dialogState:i,setTitleId:l}]=lt("Dialog.Title"),s=pe(n);u.useEffect(()=>(l(r),()=>l(null)),[r,l]);let a=u.useMemo(()=>({open:i===0}),[i]);return de({ourProps:{ref:s,id:r},theirProps:o,slot:a,defaultTag:ql,name:"Dialog.Title"})}let Kl=fe(Bl),Zl=fe(Hl),Xl=fe(Yl),Jl=fe(Wl),Ql=fe(Gl),Xn=Object.assign(Kl,{Backdrop:Zl,Panel:Xl,Overlay:Jl,Title:Ql,Description:Zn}),Jn=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Qn(e){var n,t;let r=(n=e.innerText)!=null?n:"",o=e.cloneNode(!0);if(!(o instanceof HTMLElement))return r;let i=!1;for(let s of o.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))s.remove(),i=!0;let l=i?(t=o.innerText)!=null?t:"":r;return Jn.test(l)&&(l=l.replace(Jn,"")),l}function ei(e){let n=e.getAttribute("aria-label");if(typeof n=="string")return n.trim();let t=e.getAttribute("aria-labelledby");if(t){let r=t.split(" ").map(o=>{let i=document.getElementById(o);if(i){let l=i.getAttribute("aria-label");return typeof l=="string"?l.trim():Qn(i).trim()}return null}).filter(Boolean);if(r.length>0)return r.join(", ")}return Qn(e).trim()}function ti(e){let n=u.useRef(""),t=u.useRef("");return M(()=>{let r=e.current;if(!r)return"";let o=r.innerText;if(n.current===o)return t.current;let i=ei(r).trim().toLowerCase();return n.current=o,t.current=i,i})}var ni=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(ni||{}),ri=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ri||{}),oi=(e=>(e[e.OpenMenu=0]="OpenMenu",e[e.CloseMenu=1]="CloseMenu",e[e.GoToItem=2]="GoToItem",e[e.Search=3]="Search",e[e.ClearSearch=4]="ClearSearch",e[e.RegisterItem=5]="RegisterItem",e[e.UnregisterItem=6]="UnregisterItem",e))(oi||{});function Jt(e,n=t=>t){let t=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,r=Lt(n(e.items.slice()),i=>i.dataRef.current.domRef.current),o=t?r.indexOf(t):null;return o===-1&&(o=null),{items:r,activeItemIndex:o}}let li={1(e){return e.menuState===1?e:{...e,activeItemIndex:null,menuState:1}},0(e){return e.menuState===0?e:{...e,__demoMode:!1,menuState:0}},2:(e,n)=>{var t;let r=Jt(e),o=zt(n,{resolveItems:()=>r.items,resolveActiveIndex:()=>r.activeItemIndex,resolveId:i=>i.id,resolveDisabled:i=>i.dataRef.current.disabled});return{...e,...r,searchQuery:"",activeItemIndex:o,activationTrigger:(t=n.trigger)!=null?t:1}},3:(e,n)=>{let t=e.searchQuery!==""?0:1,r=e.searchQuery+n.value.toLowerCase(),o=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+t).concat(e.items.slice(0,e.activeItemIndex+t)):e.items).find(l=>{var s;return((s=l.dataRef.current.textValue)==null?void 0:s.startsWith(r))&&!l.dataRef.current.disabled}),i=o?e.items.indexOf(o):-1;return i===-1||i===e.activeItemIndex?{...e,searchQuery:r}:{...e,searchQuery:r,activeItemIndex:i,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,n)=>{let t=Jt(e,r=>[...r,{id:n.id,dataRef:n.dataRef}]);return{...e,...t}},6:(e,n)=>{let t=Jt(e,r=>{let o=r.findIndex(i=>i.id===n.id);return o!==-1&&r.splice(o,1),r});return{...e,...t,activationTrigger:1}}},Qt=u.createContext(null);Qt.displayName="MenuContext";function bt(e){let n=u.useContext(Qt);if(n===null){let t=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(t,bt),t}return n}function ii(e,n){return me(n.type,li,e,n)}let si=u.Fragment;function ai(e,n){let{__demoMode:t=!1,...r}=e,o=u.useReducer(ii,{__demoMode:t,menuState:t?0:1,buttonRef:u.createRef(),itemsRef:u.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:i,itemsRef:l,buttonRef:s},a]=o,f=pe(n);At([s,l],(m,v)=>{var g;a({type:1}),Pt(v,Mt.Loose)||(m.preventDefault(),(g=s.current)==null||g.focus())},i===0);let d=M(()=>{a({type:1})}),h=u.useMemo(()=>({open:i===0,close:d}),[i,d]),x={ref:f};return u.createElement(Qt.Provider,{value:o},u.createElement(Bt,{value:me(i,{0:he.Open,1:he.Closed})},de({ourProps:x,theirProps:r,slot:h,defaultTag:si,name:"Menu"})))}let ui="button";function ci(e,n){var t;let r=be(),{id:o=`headlessui-menu-button-${r}`,...i}=e,[l,s]=bt("Menu.Button"),a=pe(l.buttonRef,n),f=ke(),d=M(g=>{switch(g.key){case ne.Space:case ne.Enter:case ne.ArrowDown:g.preventDefault(),g.stopPropagation(),s({type:0}),f.nextFrame(()=>s({type:2,focus:ie.First}));break;case ne.ArrowUp:g.preventDefault(),g.stopPropagation(),s({type:0}),f.nextFrame(()=>s({type:2,focus:ie.Last}));break}}),h=M(g=>{switch(g.key){case ne.Space:g.preventDefault();break}}),x=M(g=>{if(gt(g.currentTarget))return g.preventDefault();e.disabled||(l.menuState===0?(s({type:1}),f.nextFrame(()=>{var b;return(b=l.buttonRef.current)==null?void 0:b.focus({preventScroll:!0})})):(g.preventDefault(),s({type:0})))}),m=u.useMemo(()=>({open:l.menuState===0}),[l]),v={ref:a,id:o,type:Dt(e,l.buttonRef),"aria-haspopup":"menu","aria-controls":(t=l.itemsRef.current)==null?void 0:t.id,"aria-expanded":l.menuState===0,onKeyDown:d,onKeyUp:h,onClick:x};return de({ourProps:v,theirProps:i,slot:m,defaultTag:ui,name:"Menu.Button"})}let di="div",fi=Pe.RenderStrategy|Pe.Static;function mi(e,n){var t,r;let o=be(),{id:i=`headlessui-menu-items-${o}`,...l}=e,[s,a]=bt("Menu.Items"),f=pe(s.itemsRef,n),d=_e(s.itemsRef),h=ke(),x=Qe(),m=x!==null?(x&he.Open)===he.Open:s.menuState===0;u.useEffect(()=>{let w=s.itemsRef.current;w&&s.menuState===0&&w!==(d==null?void 0:d.activeElement)&&w.focus({preventScroll:!0})},[s.menuState,s.itemsRef,d]),Mn({container:s.itemsRef.current,enabled:s.menuState===0,accept(w){return w.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:w.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(w){w.setAttribute("role","none")}});let v=M(w=>{var y,N;switch(h.dispose(),w.key){case ne.Space:if(s.searchQuery!=="")return w.preventDefault(),w.stopPropagation(),a({type:3,value:w.key});case ne.Enter:if(w.preventDefault(),w.stopPropagation(),a({type:1}),s.activeItemIndex!==null){let{dataRef:k}=s.items[s.activeItemIndex];(N=(y=k.current)==null?void 0:y.domRef.current)==null||N.click()}Tn(s.buttonRef.current);break;case ne.ArrowDown:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:ie.Next});case ne.ArrowUp:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:ie.Previous});case ne.Home:case ne.PageUp:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:ie.First});case ne.End:case ne.PageDown:return w.preventDefault(),w.stopPropagation(),a({type:2,focus:ie.Last});case ne.Escape:w.preventDefault(),w.stopPropagation(),a({type:1}),Ee().nextFrame(()=>{var k;return(k=s.buttonRef.current)==null?void 0:k.focus({preventScroll:!0})});break;case ne.Tab:w.preventDefault(),w.stopPropagation(),a({type:1}),Ee().nextFrame(()=>{ao(s.buttonRef.current,w.shiftKey?Ie.Previous:Ie.Next)});break;default:w.key.length===1&&(a({type:3,value:w.key}),h.setTimeout(()=>a({type:4}),350));break}}),g=M(w=>{switch(w.key){case ne.Space:w.preventDefault();break}}),b=u.useMemo(()=>({open:s.menuState===0}),[s]),E={"aria-activedescendant":s.activeItemIndex===null||(t=s.items[s.activeItemIndex])==null?void 0:t.id,"aria-labelledby":(r=s.buttonRef.current)==null?void 0:r.id,id:i,onKeyDown:v,onKeyUp:g,role:"menu",tabIndex:0,ref:f};return de({ourProps:E,theirProps:l,slot:b,defaultTag:di,features:fi,visible:m,name:"Menu.Items"})}let pi=u.Fragment;function hi(e,n){let t=be(),{id:r=`headlessui-menu-item-${t}`,disabled:o=!1,...i}=e,[l,s]=bt("Menu.Item"),a=l.activeItemIndex!==null?l.items[l.activeItemIndex].id===r:!1,f=u.useRef(null),d=pe(n,f);le(()=>{if(l.__demoMode||l.menuState!==0||!a||l.activationTrigger===0)return;let k=Ee();return k.requestAnimationFrame(()=>{var L,B;(B=(L=f.current)==null?void 0:L.scrollIntoView)==null||B.call(L,{block:"nearest"})}),k.dispose},[l.__demoMode,f,a,l.menuState,l.activationTrigger,l.activeItemIndex]);let h=ti(f),x=u.useRef({disabled:o,domRef:f,get textValue(){return h()}});le(()=>{x.current.disabled=o},[x,o]),le(()=>(s({type:5,id:r,dataRef:x}),()=>s({type:6,id:r})),[x,r]);let m=M(()=>{s({type:1})}),v=M(k=>{if(o)return k.preventDefault();s({type:1}),Tn(l.buttonRef.current)}),g=M(()=>{if(o)return s({type:2,focus:ie.Nothing});s({type:2,focus:ie.Specific,id:r})}),b=Fn(),E=M(k=>b.update(k)),w=M(k=>{b.wasMoved(k)&&(o||a||s({type:2,focus:ie.Specific,id:r,trigger:0}))}),y=M(k=>{b.wasMoved(k)&&(o||a&&s({type:2,focus:ie.Nothing}))}),N=u.useMemo(()=>({active:a,disabled:o,close:m}),[a,o,m]);return de({ourProps:{id:r,ref:d,role:"menuitem",tabIndex:o===!0?void 0:-1,"aria-disabled":o===!0?!0:void 0,disabled:void 0,onClick:v,onFocus:g,onPointerEnter:E,onMouseEnter:E,onPointerMove:w,onMouseMove:w,onPointerLeave:y,onMouseLeave:y},theirProps:i,slot:N,defaultTag:pi,name:"Menu.Item"})}let vi=fe(ai),gi=fe(ci),xi=fe(mi),bi=fe(hi),wt=Object.assign(vi,{Button:gi,Items:xi,Item:bi}),er=u.createContext(null);function tr(){let e=u.useContext(er);if(e===null){let n=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(n,tr),n}return e}function wi(){let[e,n]=u.useState([]);return[e.length>0?e.join(" "):void 0,u.useMemo(()=>function(t){let r=M(i=>(n(l=>[...l,i]),()=>n(l=>{let s=l.slice(),a=s.indexOf(i);return a!==-1&&s.splice(a,1),s}))),o=u.useMemo(()=>({register:r,slot:t.slot,name:t.name,props:t.props}),[r,t.slot,t.name,t.props]);return u.createElement(er.Provider,{value:o},t.children)},[n])]}let yi="label";function Ei(e,n){let t=be(),{id:r=`headlessui-label-${t}`,passive:o=!1,...i}=e,l=tr(),s=pe(n);le(()=>l.register(r),[r,l.register]);let a={ref:s,...l.props,id:r};return o&&("onClick"in a&&(delete a.htmlFor,delete a.onClick),"onClick"in i&&delete i.onClick),de({ourProps:a,theirProps:i,slot:l.slot||{},defaultTag:yi,name:l.name||"Label"})}let Si=fe(Ei),Ci=Object.assign(Si,{});function Ti(e=0){let[n,t]=u.useState(e),r=tt(),o=u.useCallback(a=>{r.current&&t(f=>f|a)},[n,r]),i=u.useCallback(a=>!!(n&a),[n]),l=u.useCallback(a=>{r.current&&t(f=>f&~a)},[t,r]),s=u.useCallback(a=>{r.current&&t(f=>f^a)},[t]);return{flags:n,addFlag:o,hasFlag:i,removeFlag:l,toggleFlag:s}}let en=u.createContext(null);en.displayName="GroupContext";let ji=u.Fragment;function Oi(e){var n;let[t,r]=u.useState(null),[o,i]=wi(),[l,s]=Kn(),a=u.useMemo(()=>({switch:t,setSwitch:r,labelledby:o,describedby:l}),[t,r,o,l]),f={},d=e;return u.createElement(s,{name:"Switch.Description"},u.createElement(i,{name:"Switch.Label",props:{htmlFor:(n=a.switch)==null?void 0:n.id,onClick(h){t&&(h.currentTarget.tagName==="LABEL"&&h.preventDefault(),t.click(),t.focus({preventScroll:!0}))}}},u.createElement(en.Provider,{value:a},de({ourProps:f,theirProps:d,defaultTag:ji,name:"Switch.Group"}))))}let Ni="button";function ki(e,n){var t;let r=be(),{id:o=`headlessui-switch-${r}`,checked:i,defaultChecked:l=!1,onChange:s,disabled:a=!1,name:f,value:d,form:h,...x}=e,m=u.useContext(en),v=u.useRef(null),g=pe(v,n,m===null?null:m.setSwitch),[b,E]=yn(i,s,l),w=M(()=>E==null?void 0:E(!b)),y=M(D=>{if(gt(D.currentTarget))return D.preventDefault();D.preventDefault(),w()}),N=M(D=>{D.key===ne.Space?(D.preventDefault(),w()):D.key===ne.Enter&&xo(D.currentTarget)}),k=M(D=>D.preventDefault()),L=u.useMemo(()=>({checked:b}),[b]),B={id:o,ref:g,role:"switch",type:Dt(e,v),tabIndex:e.tabIndex===-1?0:(t=e.tabIndex)!=null?t:0,"aria-checked":b,"aria-labelledby":m==null?void 0:m.labelledby,"aria-describedby":m==null?void 0:m.describedby,disabled:a,onClick:y,onKeyUp:N,onKeyPress:k},Y=ke();return u.useEffect(()=>{var D;let A=(D=v.current)==null?void 0:D.closest("form");A&&l!==void 0&&Y.addEventListener(A,"reset",()=>{E(l)})},[v,E]),u.createElement(u.Fragment,null,f!=null&&b&&u.createElement(Je,{features:He.Hidden,...vt({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:a,form:h,checked:b,name:f,value:d})}),de({ourProps:B,theirProps:x,slot:L,defaultTag:Ni,name:"Switch"}))}let Ii=fe(ki),$i=Oi,Fi=Object.assign(Ii,{Group:$i,Label:Ci,Description:Zn});function Mi(e){let n={called:!1};return(...t)=>{if(!n.called)return n.called=!0,e(...t)}}function tn(e,...n){e&&n.length>0&&e.classList.add(...n)}function nn(e,...n){e&&n.length>0&&e.classList.remove(...n)}function Pi(e,n){let t=Ee();if(!e)return t.dispose;let{transitionDuration:r,transitionDelay:o}=getComputedStyle(e),[i,l]=[r,o].map(a=>{let[f=0]=a.split(",").filter(Boolean).map(d=>d.includes("ms")?parseFloat(d):parseFloat(d)*1e3).sort((d,h)=>h-d);return f}),s=i+l;if(s!==0){t.group(f=>{f.setTimeout(()=>{n(),f.dispose()},s),f.addEventListener(e,"transitionrun",d=>{d.target===d.currentTarget&&f.dispose()})});let a=t.addEventListener(e,"transitionend",f=>{f.target===f.currentTarget&&(n(),a())})}else n();return t.add(()=>n()),t.dispose}function Li(e,n,t,r){let o=t?"enter":"leave",i=Ee(),l=r!==void 0?Mi(r):()=>{};o==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let s=me(o,{enter:()=>n.enter,leave:()=>n.leave}),a=me(o,{enter:()=>n.enterTo,leave:()=>n.leaveTo}),f=me(o,{enter:()=>n.enterFrom,leave:()=>n.leaveFrom});return nn(e,...n.base,...n.enter,...n.enterTo,...n.enterFrom,...n.leave,...n.leaveFrom,...n.leaveTo,...n.entered),tn(e,...n.base,...s,...f),i.nextFrame(()=>{nn(e,...n.base,...s,...f),tn(e,...n.base,...s,...a),Pi(e,()=>(nn(e,...n.base,...s),tn(e,...n.base,...n.entered),l()))}),i.dispose}function Ai({immediate:e,container:n,direction:t,classes:r,onStart:o,onStop:i}){let l=tt(),s=ke(),a=Te(t);le(()=>{e&&(a.current="enter")},[e]),le(()=>{let f=Ee();s.add(f.dispose);let d=n.current;if(d&&a.current!=="idle"&&l.current)return f.dispose(),o.current(a.current),f.add(Li(d,r.current,a.current==="enter",()=>{f.dispose(),i.current(a.current)})),f.dispose},[t])}function Ae(e=""){return e.split(/\s+/).filter(n=>n.length>1)}let yt=u.createContext(null);yt.displayName="TransitionContext";var Di=(e=>(e.Visible="visible",e.Hidden="hidden",e))(Di||{});function _i(){let e=u.useContext(yt);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function Ri(){let e=u.useContext(Et);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Et=u.createContext(null);Et.displayName="NestingContext";function St(e){return"children"in e?St(e.children):e.current.filter(({el:n})=>n.current!==null).filter(({state:n})=>n==="visible").length>0}function nr(e,n){let t=Te(e),r=u.useRef([]),o=tt(),i=ke(),l=M((m,v=Le.Hidden)=>{let g=r.current.findIndex(({el:b})=>b===m);g!==-1&&(me(v,{[Le.Unmount](){r.current.splice(g,1)},[Le.Hidden](){r.current[g].state="hidden"}}),i.microTask(()=>{var b;!St(r)&&o.current&&((b=t.current)==null||b.call(t))}))}),s=M(m=>{let v=r.current.find(({el:g})=>g===m);return v?v.state!=="visible"&&(v.state="visible"):r.current.push({el:m,state:"visible"}),()=>l(m,Le.Unmount)}),a=u.useRef([]),f=u.useRef(Promise.resolve()),d=u.useRef({enter:[],leave:[],idle:[]}),h=M((m,v,g)=>{a.current.splice(0),n&&(n.chains.current[v]=n.chains.current[v].filter(([b])=>b!==m)),n==null||n.chains.current[v].push([m,new Promise(b=>{a.current.push(b)})]),n==null||n.chains.current[v].push([m,new Promise(b=>{Promise.all(d.current[v].map(([E,w])=>w)).then(()=>b())})]),v==="enter"?f.current=f.current.then(()=>n==null?void 0:n.wait.current).then(()=>g(v)):g(v)}),x=M((m,v,g)=>{Promise.all(d.current[v].splice(0).map(([b,E])=>E)).then(()=>{var b;(b=a.current.shift())==null||b()}).then(()=>g(v))});return u.useMemo(()=>({children:r,register:s,unregister:l,onStart:h,onStop:x,wait:f,chains:d}),[s,l,r,h,x,d,f])}function Bi(){}let zi=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function rr(e){var n;let t={};for(let r of zi)t[r]=(n=e[r])!=null?n:Bi;return t}function Wi(e){let n=u.useRef(rr(e));return u.useEffect(()=>{n.current=rr(e)},[e]),n}let Ui="div",or=Pe.RenderStrategy;function Hi(e,n){var t,r;let{beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:s,enter:a,enterFrom:f,enterTo:d,entered:h,leave:x,leaveFrom:m,leaveTo:v,...g}=e,b=u.useRef(null),E=pe(b,n),w=(t=g.unmount)==null||t?Le.Unmount:Le.Hidden,{show:y,appear:N,initial:k}=_i(),[L,B]=u.useState(y?"visible":"hidden"),Y=Ri(),{register:D,unregister:A}=Y;u.useEffect(()=>D(b),[D,b]),u.useEffect(()=>{if(w===Le.Hidden&&b.current){if(y&&L!=="visible"){B("visible");return}return me(L,{hidden:()=>A(b),visible:()=>D(b)})}},[L,b,D,A,y,w]);let W=Te({base:Ae(g.className),enter:Ae(a),enterFrom:Ae(f),enterTo:Ae(d),entered:Ae(h),leave:Ae(x),leaveFrom:Ae(m),leaveTo:Ae(v)}),q=Wi({beforeEnter:o,afterEnter:i,beforeLeave:l,afterLeave:s}),G=Ue();u.useEffect(()=>{if(G&&L==="visible"&&b.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[b,L,G]);let Q=k&&!N,C=N&&y&&k,re=!G||Q?"idle":y?"enter":"leave",K=Ti(0),j=M(ae=>me(ae,{enter:()=>{K.addFlag(he.Opening),q.current.beforeEnter()},leave:()=>{K.addFlag(he.Closing),q.current.beforeLeave()},idle:()=>{}})),I=M(ae=>me(ae,{enter:()=>{K.removeFlag(he.Opening),q.current.afterEnter()},leave:()=>{K.removeFlag(he.Closing),q.current.afterLeave()},idle:()=>{}})),_=nr(()=>{B("hidden"),A(b)},Y),Z=u.useRef(!1);Ai({immediate:C,container:b,classes:W,direction:re,onStart:Te(ae=>{Z.current=!0,_.onStart(b,ae,j)}),onStop:Te(ae=>{Z.current=!1,_.onStop(b,ae,I),ae==="leave"&&!St(_)&&(B("hidden"),A(b))})});let ee=g,se={ref:E};return C?ee={...ee,className:pt(g.className,...W.current.enter,...W.current.enterFrom)}:Z.current&&(ee.className=pt(g.className,(r=b.current)==null?void 0:r.className),ee.className===""&&delete ee.className),u.createElement(Et.Provider,{value:_},u.createElement(Bt,{value:me(L,{visible:he.Open,hidden:he.Closed})|K.flags},de({ourProps:se,theirProps:ee,defaultTag:Ui,features:or,visible:L==="visible",name:"Transition.Child"})))}function Vi(e,n){let{show:t,appear:r=!1,unmount:o=!0,...i}=e,l=u.useRef(null),s=pe(l,n);Ue();let a=Qe();if(t===void 0&&a!==null&&(t=(a&he.Open)===he.Open),![!0,!1].includes(t))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[f,d]=u.useState(t?"visible":"hidden"),h=nr(()=>{d("hidden")}),[x,m]=u.useState(!0),v=u.useRef([t]);le(()=>{x!==!1&&v.current[v.current.length-1]!==t&&(v.current.push(t),m(!1))},[v,t]);let g=u.useMemo(()=>({show:t,appear:r,initial:x}),[t,r,x]);u.useEffect(()=>{if(t)d("visible");else if(!St(h))d("hidden");else{let y=l.current;if(!y)return;let N=y.getBoundingClientRect();N.x===0&&N.y===0&&N.width===0&&N.height===0&&d("hidden")}},[t,h]);let b={unmount:o},E=M(()=>{var y;x&&m(!1),(y=e.beforeEnter)==null||y.call(e)}),w=M(()=>{var y;x&&m(!1),(y=e.beforeLeave)==null||y.call(e)});return u.createElement(Et.Provider,{value:h},u.createElement(yt.Provider,{value:g},de({ourProps:{...b,as:u.Fragment,children:u.createElement(lr,{ref:s,...b,...i,beforeEnter:E,beforeLeave:w})},theirProps:{},defaultTag:u.Fragment,features:or,visible:f==="visible",name:"Transition"})))}function Yi(e,n){let t=u.useContext(yt)!==null,r=Qe()!==null;return u.createElement(u.Fragment,null,!t&&r?u.createElement(rn,{ref:n,...e}):u.createElement(lr,{ref:n,...e}))}let rn=fe(Vi),lr=fe(Hi),qi=fe(Yi),De=Object.assign(rn,{Child:qi,Root:rn});function Gi({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M18 10a.75.75 0 0 1-.75.75H4.66l2.1 1.95a.75.75 0 1 1-1.02 1.1l-3.5-3.25a.75.75 0 0 1 0-1.1l3.5-3.25a.75.75 0 1 1 1.02 1.1l-2.1 1.95h12.59A.75.75 0 0 1 18 10Z",clipRule:"evenodd"}))}const Ki=S.forwardRef(Gi);function Zi({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M2 10a.75.75 0 0 1 .75-.75h12.59l-2.1-1.95a.75.75 0 1 1 1.02-1.1l3.5 3.25a.75.75 0 0 1 0 1.1l-3.5 3.25a.75.75 0 1 1-1.02-1.1l2.1-1.95H2.75A.75.75 0 0 1 2 10Z",clipRule:"evenodd"}))}const Xi=S.forwardRef(Zi);function Ji({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16Zm3.857-9.809a.75.75 0 0 0-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 1 0-1.06 1.061l2.5 2.5a.75.75 0 0 0 1.137-.089l4-5.5Z",clipRule:"evenodd"}))}const Qi=S.forwardRef(Ji);function es({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M16.704 4.153a.75.75 0 0 1 .143 1.052l-8 10.5a.75.75 0 0 1-1.127.075l-4.5-4.5a.75.75 0 0 1 1.06-1.06l3.894 3.893 7.48-9.817a.75.75 0 0 1 1.05-.143Z",clipRule:"evenodd"}))}const ts=S.forwardRef(es);function ns({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M5.22 8.22a.75.75 0 0 1 1.06 0L10 11.94l3.72-3.72a.75.75 0 1 1 1.06 1.06l-4.25 4.25a.75.75 0 0 1-1.06 0L5.22 9.28a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const on=S.forwardRef(ns);function rs({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-8-5a.75.75 0 0 1 .75.75v4.5a.75.75 0 0 1-1.5 0v-4.5A.75.75 0 0 1 10 5Zm0 10a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const ir=S.forwardRef(rs);function os({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M8.485 2.495c.673-1.167 2.357-1.167 3.03 0l6.28 10.875c.673 1.167-.17 2.625-1.516 2.625H3.72c-1.347 0-2.189-1.458-1.515-2.625L8.485 2.495ZM10 5a.75.75 0 0 1 .75.75v3.5a.75.75 0 0 1-1.5 0v-3.5A.75.75 0 0 1 10 5Zm0 9a1 1 0 1 0 0-2 1 1 0 0 0 0 2Z",clipRule:"evenodd"}))}const ls=S.forwardRef(os);function is({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M18 10a8 8 0 1 1-16 0 8 8 0 0 1 16 0Zm-7-4a1 1 0 1 1-2 0 1 1 0 0 1 2 0ZM9 9a.75.75 0 0 0 0 1.5h.253a.25.25 0 0 1 .244.304l-.459 2.066A1.75 1.75 0 0 0 10.747 15H11a.75.75 0 0 0 0-1.5h-.253a.25.25 0 0 1-.244-.304l.459-2.066A1.75 1.75 0 0 0 9.253 9H9Z",clipRule:"evenodd"}))}const ss=S.forwardRef(is);function as({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M10 18a8 8 0 1 0 0-16 8 8 0 0 0 0 16ZM8.28 7.22a.75.75 0 0 0-1.06 1.06L8.94 10l-1.72 1.72a.75.75 0 1 0 1.06 1.06L10 11.06l1.72 1.72a.75.75 0 1 0 1.06-1.06L11.06 10l1.72-1.72a.75.75 0 0 0-1.06-1.06L10 8.94 8.28 7.22Z",clipRule:"evenodd"}))}const us=S.forwardRef(as),cs={warning:{color:"bg-yellow-50",icon:c.jsx(ls,{className:"h-5 w-5 text-yellow-400","aria-hidden":"true"}),colorTitle:"text-yellow-800",colorText:"text-yellow-700"},error:{color:"bg-red-50",icon:c.jsx(us,{className:"h-5 w-5 text-red-400","aria-hidden":"true"}),colorTitle:"text-red-800",colorText:"text-red-700"},success:{color:"bg-green-50",icon:c.jsx(Qi,{className:"h-5 w-5 text-green-400","aria-hidden":"true"}),colorTitle:"text-green-800",colorText:"text-green-700"},info:{color:"bg-blue-50",icon:c.jsx(ss,{className:"h-5 w-5 text-blue-400","aria-hidden":"true"}),colorTitle:"text-blue-800",colorText:"text-blue-700"}},ds=({type:e="info",title:n,message:t,active:r=!1,time:o=1e3,onClose:i})=>{const[l,s]=u.useState(!1),a=u.useRef(null);u.useEffect(()=>(r&&(s(!0),a.current=setTimeout(()=>{s(!1),i&&i()},o)),()=>clearTimeout(a.current)),[r,o,i]);const f=cs[e];return l?c.jsx("div",{className:"fixed top-2.5 left-1/2 transform -translate-x-1/2 w-80 3xs:w-96 z-50",children:c.jsx(De,{as:u.Fragment,show:l,enter:"ease-out duration-300",enterFrom:"opacity-0 scale-95",enterTo:"opacity-100 scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 scale-100",leaveTo:"opacity-0 scale-95",children:c.jsxs("div",{className:$("rounded-md p-4 text-center",f.color),children:[c.jsxs("div",{className:"flex justify-center flex-shrink-0",children:[f.icon,c.jsx("h3",{className:$("text-sm font-medium ml-3",f.colorTitle),children:n})]}),c.jsx("div",{className:$("mt-2 text-sm",f.colorText),children:c.jsx("p",{children:t})})]})})}):null};function fs({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M11.47 2.47a.75.75 0 0 1 1.06 0l4.5 4.5a.75.75 0 0 1-1.06 1.06l-3.22-3.22V16.5a.75.75 0 0 1-1.5 0V4.81L8.03 8.03a.75.75 0 0 1-1.06-1.06l4.5-4.5ZM3 15.75a.75.75 0 0 1 .75.75v2.25a1.5 1.5 0 0 0 1.5 1.5h13.5a1.5 1.5 0 0 0 1.5-1.5V16.5a.75.75 0 0 1 1.5 0v2.25a3 3 0 0 1-3 3H5.25a3 3 0 0 1-3-3V16.5a.75.75 0 0 1 .75-.75Z",clipRule:"evenodd"}))}const ms=S.forwardRef(fs);function ps({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M7.72 12.53a.75.75 0 0 1 0-1.06l7.5-7.5a.75.75 0 1 1 1.06 1.06L9.31 12l6.97 6.97a.75.75 0 1 1-1.06 1.06l-7.5-7.5Z",clipRule:"evenodd"}))}const hs=S.forwardRef(ps);function vs({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M10.5 3.75a6.75 6.75 0 1 0 0 13.5 6.75 6.75 0 0 0 0-13.5ZM2.25 10.5a8.25 8.25 0 1 1 14.59 5.28l4.69 4.69a.75.75 0 1 1-1.06 1.06l-4.69-4.69A8.25 8.25 0 0 1 2.25 10.5Z",clipRule:"evenodd"}))}const gs=S.forwardRef(vs);function xs({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{d:"M21.731 2.269a2.625 2.625 0 0 0-3.712 0l-1.157 1.157 3.712 3.712 1.157-1.157a2.625 2.625 0 0 0 0-3.712ZM19.513 8.199l-3.712-3.712-8.4 8.4a5.25 5.25 0 0 0-1.32 2.214l-.8 2.685a.75.75 0 0 0 .933.933l2.685-.8a5.25 5.25 0 0 0 2.214-1.32l8.4-8.4Z"}),S.createElement("path",{d:"M5.25 5.25a3 3 0 0 0-3 3v10.5a3 3 0 0 0 3 3h10.5a3 3 0 0 0 3-3V13.5a.75.75 0 0 0-1.5 0v5.25a1.5 1.5 0 0 1-1.5 1.5H5.25a1.5 1.5 0 0 1-1.5-1.5V8.25a1.5 1.5 0 0 1 1.5-1.5h5.25a.75.75 0 0 0 0-1.5H5.25Z"}))}const bs=S.forwardRef(xs);function ws({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M18.685 19.097A9.723 9.723 0 0 0 21.75 12c0-5.385-4.365-9.75-9.75-9.75S2.25 6.615 2.25 12a9.723 9.723 0 0 0 3.065 7.097A9.716 9.716 0 0 0 12 21.75a9.716 9.716 0 0 0 6.685-2.653Zm-12.54-1.285A7.486 7.486 0 0 1 12 15a7.486 7.486 0 0 1 5.855 2.812A8.224 8.224 0 0 1 12 20.25a8.224 8.224 0 0 1-5.855-2.438ZM15.75 9a3.75 3.75 0 1 1-7.5 0 3.75 3.75 0 0 1 7.5 0Z",clipRule:"evenodd"}))}const ys=S.forwardRef(ws);function Es({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 24 24",fill:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{fillRule:"evenodd",d:"M5.47 5.47a.75.75 0 0 1 1.06 0L12 10.94l5.47-5.47a.75.75 0 1 1 1.06 1.06L13.06 12l5.47 5.47a.75.75 0 1 1-1.06 1.06L12 13.06l-5.47 5.47a.75.75 0 0 1-1.06-1.06L10.94 12 5.47 6.53a.75.75 0 0 1 0-1.06Z",clipRule:"evenodd"}))}const Ss=S.forwardRef(Es),Cs=({src:e,alt:n,width:t,height:r,className:o="",classNameIcon:i="",isIcon:l=!0,acronym:s=""})=>{function a(){if(typeof s!="string")return s;const f=s.toLowerCase(),d=f.split(" "),h=d[d.length-1];return f.charAt(0)+h.charAt(0)}return c.jsx(c.Fragment,{children:e?c.jsx("img",{src:e,alt:n,width:t,height:r,className:$(o!==""&&o),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s"},onLoad:f=>f.currentTarget.style.filter="none","data-testid":"img"}):l?c.jsx(ys,{className:$("bg-white text-default-4",i!==""?i:"w-7 h-7")}):c.jsx("div",{className:$("bg-gray-200 text-default-4 rounded-full font-bold uppercase flex justify-center items-center",i!==""?i:"w-7 h-7"),children:a()})})},Ts=({steps:e,onClick:n})=>{const[t,r]=u.useState(0),o=i=>{r(i),n(i)};return c.jsx("nav",{className:"flex items-center justify-center w-full","aria-label":"Progress","data-testid":"bullets",children:c.jsx("ol",{role:"list",className:"flex items-center space-x-5",children:new Array(e).fill(1).map((i,l)=>c.jsx("li",{children:t!==l?c.jsx("div",{className:"cursor-pointer block h-2.5 w-2.5 rounded-full bg-gray-500 hover:bg-gray-600",onClick:()=>o(l),"data-testid":`step-${l}`,children:c.jsx("span",{className:"sr-only",children:"step"})}):c.jsxs("div",{className:"relative flex items-center justify-center cursor-pointer","aria-current":"step",children:[c.jsx("span",{className:"absolute flex h-5 w-5 p-px","aria-hidden":"true",children:c.jsx("span",{className:"h-full w-full rounded-full bg-gray-300"})}),c.jsx("span",{className:"relative block h-2.5 w-2.5 rounded-full bg-gray-500","aria-hidden":"true"}),c.jsx("span",{className:"sr-only",children:"step"})]})},l))})})};var sr={exports:{}};/*!
|
|
32
|
-
Copyright (c) 2018 Jed Watson.
|
|
33
|
-
Licensed under the MIT License (MIT), see
|
|
34
|
-
http://jedwatson.github.io/classnames
|
|
35
|
-
*/(function(e){(function(){var n={}.hasOwnProperty;function t(){for(var i="",l=0;l<arguments.length;l++){var s=arguments[l];s&&(i=o(i,r(s)))}return i}function r(i){if(typeof i=="string"||typeof i=="number")return i;if(typeof i!="object")return"";if(Array.isArray(i))return t.apply(null,i);if(i.toString!==Object.prototype.toString&&!i.toString.toString().includes("[native code]"))return i.toString();var l="";for(var s in i)n.call(i,s)&&i[s]&&(l=o(l,s));return l}function o(i,l){return l?i?i+" "+l:i+l:i}e.exports?(t.default=t,e.exports=t):window.classNames=t})()})(sr);var js=sr.exports;const je=Dr(js),ar=({className:e="text-sm w-full rounded-md",children:n,icon:t=null,edge:r=null,disabled:o=!1,type:i="button",onClick:l,id:s})=>{const a=je({"ml-2":r==="start"&&t!==null,"mr-2":r==="end"&&t!==null});return c.jsxs("button",{className:$("flex justify-center items-center bg-white px-3 py-7px font-medium leading-6 shadow-sm ring-1 ring-inset ring-gray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-primary-7 bg-gray-50",e),type:i,onClick:l,disabled:o,"data-testid":`button-outline-${s}`,id:`button-outline-${s}`,children:[r==="start"&&t!==null&&c.jsx("span",{children:t}),c.jsx("span",{className:$("flex",a),id:s,children:n}),r==="end"&&t!==null&&c.jsx("span",{children:t})]})},ur=({children:e,className:n="",icon:t=null,edge:r=null,disabled:o=!1,type:i="button",onClick:l,id:s})=>{const a=je({"ml-2":r==="start"&&t!==null,"mr-2":r==="end"&&t!==null});return c.jsxs("button",{className:`${n} flex justify-center items-center`,edge:r,type:i,onClick:l,disabled:o,"data-testid":`button-${s}`,children:[r==="start"&&t!==null&&c.jsx("span",{children:t}),c.jsx("span",{className:a,children:e}),r==="end"&&t!==null&&c.jsx("span",{children:t})]})},cr={py:/^py-\d+(\.\d+)?$/,px:/^px-\d+(\.\d+)?$/,w:/^w-.+$/,rounded:/^rounded.*$/,text:/^(text-(xs|sm|base|lg|xl|2xl|3xl|4xl|5xl|6xl|7xl|8xl|9xl)|text-\d+)$/,font:/^(font-thin|font-extralight|font-light|font-normal|font-medium|font-semibold|font-bold|font-extrabold|font-black)$/},dr=(e="",n="")=>{const t=e.split(/\s+/),r=n.split(/\s+/),o=Object.entries(cr).filter(([l,s])=>r.some(a=>s.test(a))).map(([l])=>l);return[...t.filter(l=>!o.some(s=>cr[s].test(l))),...r].join(" ")},it=({children:e,classNameButton:n="bg-primary-7 hover:bg-primary-8 focus:outline-none focus:ring-2 focus:ring-primary-9 focus:ring-offset-2 focus:ring-offset-white shadow-primary-6 rounded font-semibold py-1.5 px-3 text-white w-full",classNameDisabled:t="",classNameText:r="",icon:o=null,edge:i=null,disabled:l=!1,type:s="button",onClick:a,id:f,classNameContainer:d=""})=>{const h="flex items-center justify-center leading-6 transition text-sm px-3 py-1.5 rounded w-full",x=`
|
|
36
|
-
bg-gray-300
|
|
37
|
-
text-white
|
|
38
|
-
cursor-not-allowed
|
|
39
|
-
shadow-none
|
|
40
|
-
focus:outline-none
|
|
41
|
-
focus:ring-0
|
|
42
|
-
`,m=je({"ml-2":i==="start"&&o!==null,"mr-2":i==="end"&&o!==null}),v=()=>{a&&a()},g=l?$(dr(h,t),x):$(dr(h,n));return c.jsx("div",{className:$("rounded-md p-0.5",d!==""&&d),"data-testid":"container-button",children:c.jsxs("button",{className:g,type:s,onClick:v,disabled:l,"data-testid":`button-solid-${f}`,children:[i==="start"&&o!==null&&c.jsx("span",{className:"flex",children:o}),c.jsx("span",{className:$(r.length===0&&m,r.length!==0&&r),children:e}),i==="end"&&o!==null&&c.jsx("span",{children:o})]})})},Os=({label:e=null,checked:n=!1,onChange:t,id:r,className:o="",classNameCheckbox:i="h-4 w-4",style:l={},disabled:s=!1})=>{const[a,f]=u.useState(!1);return u.useEffect(()=>{f(n)},[n]),c.jsxs("div",{className:"flex items-center",style:l,"data-testid":`container-check-${r}`,children:[c.jsx("input",{checked:a,id:`${e}-${r}`,value:r,"aria-describedby":"comments-description",type:"checkbox",onChange:t,className:$("cursor-pointer rounded border-gray-300 text-primary-7 focus:ring-primary-7",i!==""&&i),"data-testid":`checkbox-${r}`,disabled:s}),e!==null?c.jsx("label",{htmlFor:`${e}-${r}`,className:`ml-2.5 font-normal cursor-pointer ${o}`,id:`label-${r}`,"data-testid":"label",children:e}):null]})};function Ns({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const ks=S.forwardRef(Ns);function Is({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const fr=S.forwardRef(Is);function $s({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const Fs=S.forwardRef($s);function Ms({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m21 21-5.197-5.197m0 0A7.5 7.5 0 1 0 5.196 5.196a7.5 7.5 0 0 0 10.607 10.607Z"}))}const Ps=S.forwardRef(Ms);function Ls({title:e,titleId:n,...t},r){return S.createElement("svg",Object.assign({xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",strokeWidth:1.5,stroke:"currentColor","aria-hidden":"true","data-slot":"icon",ref:r,"aria-labelledby":n},t),e?S.createElement("title",{id:n},e):null,S.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"}))}const As=S.forwardRef(Ls);function mr({children:e,className:n="sm:max-w-sm w-11/12 sm:my-8",classNameContainer:t="",isOpen:r=!1,setIsOpen:o,showIconSuccess:i=!0,showButton:l=!0,style:s={}}){return c.jsx(De,{show:r,as:u.Fragment,children:c.jsxs(Xn,{as:"div",className:"z-50 relative",onClose:o,"data-testid":"modal",children:[c.jsx(De.Child,{as:u.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-5",leave:"ease-in duration-200",leaveFrom:"opacity-5",leaveTo:"opacity-0",children:c.jsx("div",{className:"fixed inset-0 bg-opacity-40 bg-gray-900 transition-opacity","data-testid":"window-close",onClick:()=>o(!1)})}),c.jsx("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:c.jsx("div",{className:"flex min-h-full items-center justify-center xs:p-2 p-4 text-center sm:items-center sm:p-0",children:c.jsx(De.Child,{as:u.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",enterTo:"opacity-100 translate-y-0 sm:scale-100",leave:"ease-in duration-200",leaveFrom:"opacity-100 translate-y-0 sm:scale-100",leaveTo:"opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95",children:c.jsxs(Xn.Panel,{className:$("relative transform rounded-lg bg-white px-4 pb-3 pt-5 text-left transition-all sm:w-full sm:pt-3 sm:px-3",n!==""&&n),style:s,children:[i&&c.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:c.jsx(ks,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})}),c.jsx("div",{className:$(t!==""&&t),"data-testid":"content",children:e}),l&&c.jsx("div",{className:"mt-5 sm:mt-6",children:c.jsx(it,{id:"close-modal",onClick:()=>o(!1),children:"Cerrar"})}),c.jsx("button",{className:"opacity-0 absolute"})]})})})})]})})}const Ds=({isOpenModalConfirmation:e,setIsOpenModalConfirmation:n,close:t,title:r="¿Estás seguro de abandonar la creación de la acción?",description:o="La información se perderá si no creas la acción",classNameTitle:i="",classNameDescription:l=""})=>{const s=()=>{n(!1),t()};return c.jsxs(mr,{isOpen:e,setIsOpen:()=>n(),showButton:!1,showIconSuccess:!1,children:[c.jsx("p",{className:$("text-center text-sm",i!==""&&i),children:r}),c.jsx("p",{className:$("text-center text-sm",l!==""&&l),children:o}),c.jsxs("div",{className:"flex w-full justify-center mt-5",children:[c.jsx(ar,{className:"rounded-md bg-white text-gray-500 text-sm shadow-sm ring-1 ring-inset ring-gray-300 bg-gray-50 w-24 h-9 mr-6",onClick:()=>n(),id:"cancel",children:"Cancelar"}),c.jsx(it,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 focus-visible:outline-secondary-2 shadow-secondary-2 rounded py-1.5 text-white w-full px-5",outline:"0px 0px 0px 2px #3758F9, 0px 0px 0px 2px #243BBD, 0px 1px 2px 0px rgba(0, 0, 0, 0.05)",onClick:s,id:"confirmation",children:"Aceptar"})]})]})},_s=({className:e="",style:n={}})=>c.jsx("div",{className:$("w-px",e!==""&&e),style:n}),Rs=({onClick:e,id:n="",className:t=""})=>c.jsxs("div",{className:$("flex items-center text-default-4",t!==""&&t),"data-testid":n,children:[c.jsx(hs,{className:"w-3 h-3 3xs:w-4 3xs:h-4 stroke-current cursor-pointer","data-testid":"chevron-left-icon",onClick:e}),c.jsx("span",{onClick:e,className:"text-sm cursor-pointer","data-testid":"go-back",children:"Volver"})]}),ln=({children:e,childRef:n,message:t="",className:r="",classNameContainer:o="",style:i={}})=>{const[l,s]=u.useState(!1),[a,f]=u.useState({top:0,left:0}),d=u.useRef(null),h=()=>{if(!t)return;const g=d.current.getBoundingClientRect();f({top:g.bottom+window.scrollY,left:g.left+window.scrollX}),s(!0)},x=()=>s(!1),m=c.jsx(De,{as:u.Fragment,enter:"transition ease-out duration-200",enterFrom:"opacity-0 translate-y-1",enterTo:"opacity-100 translate-y-0",leave:"transition ease-in duration-150",leaveFrom:"opacity-100 translate-y-0",leaveTo:"opacity-0 translate-y-1",show:l,children:c.jsx("div",{className:$("absolute z-40 px-4 mt-0 sm:px-0",r),style:{top:a.top,left:a.left,position:"absolute"},children:c.jsx("div",{className:"bg-white p-2 text-center rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",onMouseEnter:h,onMouseLeave:x,children:typeof t=="object"?"":t})})}),v=n?u.cloneElement(e,{ref:n}):e;return c.jsxs(c.Fragment,{children:[c.jsx("div",{ref:d,className:$("inline-block",o),onMouseEnter:h,onMouseLeave:x,style:i,children:v}),typeof window<"u"&&jt.createPortal(m,document.body)]})},st=u.forwardRef((e,n)=>{const{placeholder:t="",label:r="",htmlFor:o,type:i="text",name:l,handleChange:s,onClick:a=()=>{},value:f,isReadOnly:d=!1,isError:h=!1,helperText:x="",autocomplete:m="off",id:v,classNameLabel:g="",classNameContainerInput:b="",classNameContainer:E="",className:w="",icon:y=null,onKeyDown:N,onFocus:k,min:L,maxWidth:B=5e3,onPaste:Y}=e,[D,A]=u.useState(!1),W=je({"ring-red-300 focus:ring-red-300 text-red-900":h||D,"focus:ring-primary-7 text-gray-500":!h&&!D}),q=G=>{if(s&&s(G),i!=="email")return;const{value:Q}=G.target,C=pn(Q);A(!C)};return c.jsxs("div",{"data-testid":`container-input-${v}`,className:E,children:[r!==""&&c.jsx("label",{htmlFor:o,className:$("block text-sm font-medium leading-6",!g.includes("mb-")&&"mb-0.5",g!==""?g:"text-gray-700"),"data-testid":`label-${v}`,children:r}),c.jsxs("div",{className:$("relative rounded-md",b!==""&&b),children:[c.jsx(ln,{message:i==="password"?"":f,childRef:n,className:"text-sm",classNameContainer:"w-full",children:c.jsx("input",{id:v,name:l,type:i,autoComplete:m,placeholder:t,onChange:q,onClick:a,onKeyDown:N,onFocus:k,onPaste:Y,value:f,readOnly:d,"data-testid":`input-${v}`,min:L,className:$("block w-full rounded-md border-0 py-1.5 shadow-sm placeholder-gray-300 ring-1 ring-gray-300 ring-inset focus:ring-1 focus:ring-inset text-sm sm:leading-6 truncate focus:outline-none",W,w!==""&&w),style:{maxWidth:`${B}px`},ref:n})}),y!==null&&c.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:y}),h&&y===null&&c.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:c.jsx(ir,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),x.length===0||!h?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${v}`,children:x})]})});st.displayName="Input";function at({className:e="w-6 h-6",colorSpinner:n="text-primary-9"}){return c.jsxs("svg",{className:$("fill-current animate-spin",e,n),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[c.jsx("circle",{className:$("opacity-25 stroke-current",n),cx:"12",cy:"12",r:"10",strokeWidth:"4",fill:"none"}),c.jsx("path",{d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]})}function Bs(){return c.jsxs("div",{className:"fixed top-0 left-0 right-0 bottom-0 w-full h-screen overflow-hidden bg-stone-600 opacity-75 flex flex-col items-center justify-center","data-testid":"spinner",style:{zIndex:60},children:[c.jsx("div",{className:"inline-block h-12 w-12 animate-[spinner-grow_0.75s_linear_infinite] rounded-full bg-current align-[-0.125em] opacity-0 motion-reduce:animate-[spinner-grow_1.5s_linear_infinite]",role:"status"}),c.jsx(at,{className:"w-8 h-8 animate-spin text-primary-9"})]})}const pr=({height:e="36px",style:n={},styleMenu:t={},label:r="",onChange:o,isReadOnly:i=!1,isError:l=!1,helperText:s="",name:a,id:f,className:d="",classNameLabel:h="",classNameInput:x="",options:m,value:v=-1,defaultValue:g={value:-1,label:"",iconStart:null,iconEnd:null,selectedLabel:""},defaultLabel:b="label",defaultId:E="value",bgOptionSelect:w="bg-primary-7",isSearch:y=!1,loading:N=!1,isSingleOptionAndFirstLoad:k=!0,isTest:L=!1})=>{const B=u.useRef(!0),[Y,D]=u.useState(""),[A,W]=u.useState(g),[q,G]=u.useState(!1);u.useEffect(()=>{if((m==null?void 0:m.length)!==1||!B.current)return;B.current=!1;const[j]=m,I=j[E],_=j[b];W({value:I,label:_}),k&&o({target:{value:j,checked:!1,name:a,type:void 0,id:j[E]}})},[m,E,b,o,a,k]),u.useEffect(()=>{if(v===-1||(m==null?void 0:m.length)===0)return;const j=m==null?void 0:m.find(_=>_[E]===v),I=j&&j.selectedLabel?{...j,label:j.selectedLabel}:j;I&&W(I)},[v,m,E]),u.useEffect(()=>{v==="clear"&&(A[E]!==g[E]||A[b]!==g[b]||L)&&W(g)},[g,L,A,v,E,b]);const Q=Y===""?m:m.filter(j=>j[b].normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().includes(Y.toLowerCase())),C=je({"ring-red-300 focus:ring-red-300 text-red-900":l&&!i,"text-gray-500":!l,"focus:ring-primary-7":!l&&!i}),re=je({"text-red-400":l&&!i,"text-gray-400":!l}),K=j=>{const I=j.selectedLabel?{...j,label:j.selectedLabel}:j;W(I),o({target:{value:I,checked:!1,name:a,type:void 0,id:j[E]}})};return c.jsxs($e,{as:"div",value:A,children:[c.jsx($e.Label,{className:$("block text-sm font-medium leading-6 text-gray-500 mb-0.5",h!==""&&h),children:r}),c.jsxs("div",{className:$("relative",d!==""&&d),children:[c.jsx(ln,{className:"text-sm",classNameContainer:"w-full",message:A[b],children:c.jsxs($e.Button,{className:"w-full","data-testid":`listbox-button-${f}`,children:[A.iconStart&&c.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2",children:A.iconStart}),c.jsx($e.Input,{className:$("w-full rounded-md border-0 bg-white py-1.5 pr-10 text-gray-900 shadow-sm ring-1 ring-gray-300 sm:text-sm sm:leading-6 truncate block focus:outline-none",!l&&!i&&"ring-inset focus:ring-inset focus:ring-2 focus:ring-primary-7",i&&"focus:ring-gray-300",C,x!==""&&x),onChange:j=>D(j.target.value.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),displayValue:j=>{var I;return(I=j[b])==null?void 0:I.trim()},autoComplete:"off",readOnly:!y||i,style:{height:e,...n},"data-testid":"input-search",onClick:()=>G(i?!1:!q),onBlur:()=>G(!1)})]})}),A.iconEnd&&c.jsx("span",{className:"absolute inset-y-0 right-4 flex items-center pr-4",children:A.iconEnd}),!i&&c.jsx($e.Button,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",onClick:()=>G(i?!1:!q),"data-testid":"arrow-button",children:c.jsx(on,{className:$("h-5 w-5 ml-auto transition-transform","transform",q&&"rotate-180",re)})}),!i&&c.jsx(c.Fragment,{children:N?c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none flex justify-center items-center py-2",children:c.jsx(at,{})}):(Q??[]).length>0?c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden",style:t,children:Q.map((j,I)=>c.jsx($e.Option,{value:j,className:$(j[E]===A[E]?`${w} text-white`:"text-gray-900",`relative cursor-default select-none p-2 hover:text-white hover:${w}`),"data-testid":`select-${f}-${j[E]}`,onClick:()=>K(j),children:c.jsxs("div",{className:"flex justify-between items-center",children:[c.jsxs("div",{className:"flex items-center",children:[j.iconStart&&c.jsx("span",{className:"mr-2","aria-hidden":"true",children:j.iconStart}),c.jsx("span",{className:"font-normal hyphens-auto break-words overflow-hidden",children:j[b]})]}),j.iconEnd&&c.jsx("span",{className:"ml-2","aria-hidden":"true",children:j.iconEnd})]})},I))}):c.jsx($e.Options,{className:"absolute z-10 mt-1 max-h-60 w-full overflow-auto rounded-md bg-white text-base shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none sm:text-sm py-0.5 overflow-x-hidden flex justify-center items-center py-2",children:c.jsx("p",{"data-testid":"empty-options",children:"Sin opciones"})})})]}),s.length>0&&l&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${f}`,children:s})]})},zs=({isOpenMenu:e=null,placeholder:n="",label:t="",htmlFor:r,name:o,handleChange:i,onClick:l=()=>{},value:s,valueSelect:a,isReadOnly:f=!1,isError:d=!1,helperText:h="",autocomplete:x="on",id:m,classNameLabel:v="",classNameContainer:g="",className:b="",onKeyDown:E,options:w,idSelect:y,isMarginLeft:N=!0,classNameSelect:k="w-20",type:L="text"})=>{const B=u.useRef(null),Y=u.useRef(null),{width:D}=vn(),[A,W]=u.useState(0);u.useEffect(()=>{if(!(!B.current||e===null))return Y.current=window.setTimeout(()=>{const{offsetWidth:G}=B.current;W(G)},0),()=>window.clearTimeout(Y.current)},[e]);const q=je({"ring-red-300 focus:ring-red-300 text-red-900":d,"focus:ring-primary-7 text-gray-500":!d});return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
43
|
-
input[type="number"]::-webkit-inner-spin-button,
|
|
44
|
-
input[type="number"]::-webkit-outer-spin-button {
|
|
45
|
-
-webkit-appearance: none;
|
|
46
|
-
margin: 0;
|
|
47
|
-
}
|
|
48
|
-
input[type="number"] {
|
|
49
|
-
-moz-appearance: textfield;
|
|
50
|
-
}
|
|
51
|
-
`}),c.jsxs("div",{"data-testid":`container-input-${m}`,className:g,children:[t!==""&&c.jsx("label",{htmlFor:r,className:$("block text-sm font-medium leading-6",v!==""?v:"text-gray-700"),"data-testid":`label-${m}`,children:t}),c.jsxs("div",{className:"relative mt-0.5 rounded-md shadow-sm",children:[c.jsx("div",{className:"absolute flex items-center",style:{left:"2px",top:"1px"},children:c.jsx(pr,{name:y,onChange:G=>i(G),id:y,options:w,value:a,isReadOnly:f,className:k,height:D<=640?"28px":"32px",classNameInput:$(N&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},styleMenu:{width:e===null?"fit-content":`${A}px`},isDisabledFocus:!0})}),c.jsx("input",{ref:B,id:m,name:o,type:L,autoComplete:x,placeholder:n,readOnly:f,"data-testid":`input-${m}`,onClick:l,onKeyDown:E,onChange:G=>i(G),value:s,className:$("block w-full rounded-md border-0 py-1.5 pl-24 shadow-sm placeholder-gray-300 ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-1 focus:ring-inset text-sm sm:leading-6 focus:outline-none",q,b!==""&&b)}),d&&c.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:c.jsx(ir,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),h.length===0||!d?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${m}`,children:h})]})]})},Ws=({setValuesDefault:e,status:n=!1,isReadOnly:t=!1,handleClick:r,text:o="",updateStatus:i=!1,id:l="status",isHiddenText:s=!1,setForm:a,handleChange:f,textActive:d="Activo",textInactive:h="Inactivo"})=>{const[x,m]=u.useState(!1);u.useEffect(()=>{m(n),e(l,n),a(g=>({...g,[l]:n}))},[n,e,i,a,l]);const v=()=>{m(!x),e(l,!x),a(g=>({...g,[l]:!x})),f({target:{checked:!x,value:!x,name:l,type:"",id:""}}),r&&r()};return c.jsxs("div",{className:"flex",children:[c.jsxs(Fi,{checked:x,onChange:v,className:$("group relative inline-flex h-6 w-11 flex-shrink-0 cursor-pointer rounded-full border-2 border-transparent transition-colors duration-200 ease-in-out focus:outline-none focus:ring-2 focus:ring-success-5 focus:ring-offset-2 mt-1",x?"bg-success-5":"bg-gray-200"),"data-testid":`switch-${l}`,disabled:t,children:[c.jsx("span",{className:"sr-only",children:"Use setting"}),c.jsx("span",{"aria-hidden":"true",className:$("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",x?"translate-x-full":"translate-x-0")})]}),o!==""?c.jsx("p",{className:$("text-sm font-medium text-gray-500 ml-2 self-end",s&&"hidden"),children:o}):c.jsx("p",{className:$("text-sm font-medium text-gray-500 ml-2 self-end",s&&"hidden"),"data-testid":"text-switch",children:x?d:h})]})};function Us({label:e="",id:n,htmlFor:t="",classNameLabel:r="",className:o="",rows:i=4,name:l,placeholder:s="",helperText:a="",isReadOnly:f=!1,isError:d=!1,onChange:h,value:x,idInput:m,nameInput:v,placeholderInput:g="",isReadOnlyInput:b=!1,valueInput:E,infoTop:w=null,infoBottom:y=null,classNameInfoTop:N="h-4",classNameInfoBottom:k="h-2",isInputTitle:L=!1,hiddenBorder:B=!1}){const Y=je({"ring-red-300 focus:ring-red-300 text-red-900":d,"focus:ring-primary-7 text-gray-700":!d});return c.jsxs(c.Fragment,{children:[e!==""&&c.jsx("label",{htmlFor:t,className:$("leading-6 block text-sm",r!==""&&r),children:e}),c.jsxs("div",{className:"relative overflow-x-hidden",children:[w!==null&&c.jsx("div",{className:"absolute top-2 left-3 w-full",children:w}),c.jsxs("div",{className:$("overflow-hidden rounded-md shadow-sm ring-1 ring-inset ring-gray-300 focus-within:ring-2 focus-within:ring-primary-7 placeholder:text-gray-400 bg-white",Y),children:[w!==null&&c.jsx("div",{className:"py-2","aria-hidden":"true",children:c.jsx("div",{className:"py-px",children:c.jsx("div",{className:N})})}),L&&c.jsx("textarea",{name:v,id:m,className:"block w-full resize-none border-0 bg-transparent py-1.5 text-gray-400 placeholder:text-gray-400 focus:ring-0 text-sm",placeholder:g,value:E,onChange:h,rows:2,readOnly:b}),c.jsx("textarea",{placeholder:s,rows:i,name:l,id:n,className:$(L||B?"block w-full resize-none border-0 bg-transparent py-1.5 placeholder:text-gray-400 focus:ring-0":"block w-full rounded-md border-0 shadow-sm ring-1 ring-inset ring-gray-300 placeholder:text-gray-400 focus:ring-2 focus:ring-inset sm:leading-6",Y,o!==""&&o),readOnly:f,onChange:h,value:x,"data-testid":`textarea-${n}`}),y!==null&&c.jsx("div",{className:"py-2","aria-hidden":"true",children:c.jsx("div",{className:"py-px",children:c.jsx("div",{className:k})})})]}),y!==null&&c.jsx("div",{className:"absolute bottom-2 left-3 w-full",children:y})]}),a.length>0&&d&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${n}`,children:a})]})}const Hs=({children:e,data:n,className:t="",classNameTooltip:r="w-full",classNameMenu:o="",classNameMenuItems:i="",classNameContainerSearch:l="px-5",isSelectMultiple:s=!1,optionsSelect:a,propObject:f="name",propId:d="id",textNewItem:h="",defaultId:x=null,loading:m=!1,search:v=null,searchPlaceHolder:g="Buscar...",valueSearch:b=void 0,idsOptionSelect:E=null,isComponent:w,isSticky:y=!1,hiddenMenu:N=!1,id:k,onClick:L=()=>{},isRelative:B=!0,isMaxWidth:Y=!1,isTag:D=!1,isClear:A=!1,clear:W=null,applyButton:q=null,applyButtonText:G="Aplicar",tagsParent:Q=[],isClearTagsParent:C=!1,isReadOnly:re,isDisabledApplyButton:K=!0,isOpenMenu:j=void 0,onScroll:I=null})=>{const _=u.useRef(null),Z=u.useRef(null),[ee,se]=u.useState(new Set),[ae,ge]=u.useState(new Map);u.useEffect(()=>{E!==null&&se(new Set(new Set(E)))},[E]),u.useEffect(()=>{C&&ge(new Map)},[C]),u.useEffect(()=>{if(Q.length===0)return;const O=new Map;Q.forEach(U=>O.set(U.id,U)),ge(O)},[Q]),u.useEffect(()=>{A&&(se(new Set),ge(new Map),W&&W())},[W,A]);const we=O=>{let U=new Map(ae),X=new Set(ee),Se=null;if(x!==null&&(O[d]===x&&(Se=crypto.randomUUID()),Se!==null&&(O[d]=Se),Se!==null&&(O[f]=O[f].replace(h,"").trim())),X.has(O[d])?X.delete(O[d]):X.add(O[d]),U.has(O[d])?U.delete(O[d]):U.set(O[d],O),!s){const ze=Array.from(X),We=Array.from(U);ze.shift(),We.shift(),X=X.size===2?new Set(ze):X,U=U.size===2?new Map(We):U}a(O,Array.from(X),Se!==null),se(X),ge(U)},R=O=>{L(O===!0?-1:k)},ue=O=>{const U=new Set(ee),X=new Map(ae);U.delete(O[d]),X.delete(O[d]),a(O,Array.from(U)),se(U),ge(X)},P=()=>{if(ee.size===0)return;const O=new Set(ee),U=new Map(ae);O.clear(),U.clear(),a(null,Array.from(O)),se(O),ge(U)};function V(O){if(typeof O!="string")return O;const U=O.toLowerCase();return U.charAt(0).toUpperCase()+U.slice(1)}return c.jsxs(wt,{as:"div",className:$("inline-block text-left",B&&"relative",o!==""&&o),onClick:()=>R(!0),"data-testid":`menu-${k}`,id:k,ref:_,children:[c.jsx("style",{children:`
|
|
52
|
-
.blue {
|
|
53
|
-
background-color: #3758F9;
|
|
54
|
-
}
|
|
55
|
-
.w-custom {
|
|
56
|
-
width: 320px;
|
|
57
|
-
}
|
|
58
|
-
@media(min-width: 375px) {
|
|
59
|
-
.w-custom {
|
|
60
|
-
width: 375px;
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
@media(min-width: 500px) {
|
|
64
|
-
.w-custom {
|
|
65
|
-
width: 414px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
`}),c.jsx(wt.Button,{as:"div",onClick:()=>R(N),"data-testid":`menu-button-${k}`,ref:Z,children:e}),!re&&c.jsx("div",{className:$("absolute right-0 z-20",r,N&&"hidden",m&&"w-full"),children:c.jsx(De,{as:u.Fragment,enter:"transition ease-out duration-100",enterFrom:"transform opacity-0 scale-95",enterTo:"transform opacity-100 scale-100",leave:"transition ease-in duration-75",leaveFrom:"transform opacity-100 scale-100",leaveTo:"transform opacity-0 scale-95",show:j,children:c.jsx(wt.Items,{className:$("mt-1 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",m?"w-full":i===""&&"w-max",i!==""&&i),children:m?c.jsx("div",{className:"flex justify-center py-4",children:c.jsx(at,{})}):c.jsxs("div",{className:$(!w&&"pb-1",t!==""&&t,Y&&"w-custom"),"data-testid":"dropdown-menu",onScroll:I,children:[c.jsxs("div",{className:"sticky top-0 bg-white w-full z-20",children:[v!==null&&c.jsx("div",{className:$("py-2 w-full",l),children:c.jsx(st,{htmlFor:"search",id:`dropdown-search-${k}`,name:"search",type:"text",placeholder:g,handleChange:O=>v(O,k),icon:g!==""&&c.jsx(gs,{className:"w-4 h-4 text-primary-4"}),className:"pl-5 pr-4 h-8",classNameContainerInput:"w-full",value:b,onKeyDown:O=>O.key===" "&&O.stopPropagation(),autocomplete:"off"})}),q!==null&&c.jsxs("div",{className:$("pt-1.5 justify-end flex items-center",l),children:[c.jsx(it,{classNameButton:$("bg-gray-400 hover:bg-gray-400 font-medium px-2 py-1.5 rounded-md",ee.size>0?"opacity-1 cursor-pointer":"opacity-0 cursor-default"),outline:"",classNameText:"text-xs text-white text-center",id:"delete",onClick:P,children:"Descartar"}),c.jsx(it,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 font-medium px-2 py-1.5 rounded-md",outline:ee.size===0&&K?"":"0px 0px 0px 2px #3758F9, 0px 0px 0px 2px #243BBD, 0px 1px 2px 0px rgba(0, 0, 0, 0.05)",classNameText:"text-xs text-white text-center",id:"apply",disabled:ee.size===0&&K,onClick:()=>q({id:k,items:Array.from(ae.values())}),children:G})]})]}),D&&c.jsx("div",{className:"flex flex-wrap ml-7 pt-1",children:Array.from(ae).map((O,U)=>c.jsx("div",{className:"mr-1",children:c.jsxs("span",{className:"inline-flex items-center gap-x-0.5 rounded-md bg-gray-100 px-2 py-1 text-xs font-medium text-gray-600 mb-1",children:[O[1][f],c.jsx("button",{type:"button",className:"p-0.5 rounded-sm bg-gray-100 hover:bg-gray-300",onClick:()=>ue(O[1]),"data-testid":`tag-${O[0]}`,children:c.jsx(Ss,{className:"h-2.5 w-2.5 stroke-gray-700/50 group-hover:stroke-gray-700/75"})})]})},O))}),c.jsx("div",{className:"divide-y divide-gray-100",children:n.map((O,U)=>c.jsx("div",{className:$(!w&&"py-1",y&&U===0&&"sticky top-0"),children:w?c.jsx("div",{onClick:X=>{X.preventDefault(),a()},"data-testid":`item-component-${U}`,children:O}):c.jsx(wt.Item,{children:c.jsx("span",{className:$(ee.has(O[d])&&"blue text-white",!ee.has(O[d])&&"text-gray-700 hover:bg-gray-100 hover:text-gray-900","block px-4 py-2 text-13 lg:text-sm cursor-pointer font-normal"),"data-testid":`item-${U}`,onClick:X=>{X.preventDefault(),we(O)},children:V(O[f])})})},U))})]})})})})]})},sn=50,Vs=({total:e,handleNext:n,handlePrev:t,handleSelectPage:r,page:o=null,pageSize:i=sn})=>{const[l,s]=u.useState(1),[a,f]=u.useState([]),[d,h]=u.useState([]),[x,m]=u.useState(""),v=Math.ceil(e/i);u.useEffect(()=>{const y=[];for(let N=1;N<=v;N++)y.push(N);h(y)},[v]),u.useEffect(()=>{let y=[];const N="...",k="... ",L=" ...";if(d.length<6)y=d;else if(l>=1&&l<=3)y=[1,2,3,4,N,d.length];else if(l===4)y=[...d.slice(0,5),N,d.length];else if(l>4&&l<d.length-2){const B=d.slice(l-2,l),Y=d.slice(l,l+1);y=[1,k,...B,...Y,L,d.length]}else if(l>d.length-3){const B=d.slice(d.length-4);y=[1,k,...B]}f(y)},[l,d]),u.useEffect(()=>{o!==null&&o!==l&&s(o)},[o,l]);const g=y=>{m(""),s(y),r(y)},b=()=>{m(""),l>1&&s(l-1),l>1&&t(l-1)},E=()=>{m(""),l<d.length&&s(l+1),l<d.length&&n(l+1)},w=y=>{const{value:N}=y.target;if(!/^\d*$/.test(N))return;const k=Math.ceil(e/sn);N>k||m(N)};return u.useEffect(()=>{const y=setTimeout(()=>{const N=Number(x);!isNaN(N)&&N>=1&&N<=v&&(r(N),s(N))},500);return()=>clearTimeout(y)},[x,v,r]),c.jsxs("nav",{className:"flex items-center justify-between border-t border-gray-200 px-4 sm:px-0",children:[c.jsx("div",{className:"-mt-px flex w-0 flex-1",children:c.jsxs("span",{className:"inline-flex items-center border-t-2 border-transparent pr-1 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 cursor-pointer",onClick:b,"data-testid":"prev",children:[c.jsx(Ki,{className:"mr-3 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Anterior"]})}),c.jsxs("div",{className:"hidden md:-mt-px md:flex",children:[c.jsxs("div",{children:[c.jsx("span",{className:"text-sm text-gray-500 font-medium mr-1",children:"Ir a"}),c.jsx("div",{className:"inline-flex items-center border-t-2 pr-2 pt-1 text-sm font-medium border-transparent text-gray-500",style:{width:"45px"},children:c.jsx(st,{htmlFor:"",id:"pager",name:"pager",handleChange:w,value:x,className:"pl-1.5 pr-1 h-7"})})]}),a.map((y,N)=>c.jsx(ur,{className:$("inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",l===y?"border-primary-6 text-primary-7":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),"aria-current":"page",onClick:()=>y!=="..."&&y!==" ..."&&y!=="... "&&g(y),id:`page-${N+1}`,children:y},N))]}),c.jsx("div",{className:"-mt-px flex w-0 flex-1 justify-end",children:c.jsxs("span",{className:"inline-flex items-center border-t-2 border-transparent pl-1 pt-4 text-sm font-medium text-gray-500 hover:border-gray-300 hover:text-gray-700 cursor-pointer",onClick:E,"data-testid":"next",children:["Siguiente",c.jsx(Xi,{className:"ml-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]})})]})},Ys=({setForm:e,setValuesDefault:n,className:t="",classNameContainer:r="",classNameContainerImg:o="",src:i=null,alt:l=null,width:s,height:a,title:f="Logo (Opcional)",fileFormatsDescription:d="PNG, JPG, GIF up to 10MB",acceptTypes:h,maxFileSize:x,onError:m,helperText:v="",isError:g=!1})=>{const b=i===null?"":i.split("."),E=w=>{const{files:y}=w.target,[N]=y;if(!N)return;if(h&&!h.includes(N.type)){m&&m("Tipo de archivo no permitido");return}if(x&&N.size>x){m&&m(`El archivo no puede superar ${x/(1024*1024)} MB`);return}const k=new FileReader;k.readAsDataURL(N),k.onload=function(){N.type.startsWith("image/")?(e(B=>({...B,photo:k.result})),n("photo",k.result)):(e(B=>({...B,photo:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png"})),n("photo",k.result))}};return c.jsxs("div",{className:$("col-span-full",r!==""&&r),children:[c.jsx("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-500",children:f}),c.jsxs("div",{className:$("mt-2 flex justify-center rounded-lg border-2 border-dotted cursor-pointer relative",g?"border-red-300":"border-gray-300",o!==""&&o),children:[i?c.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(b[b.length-1])||i.startsWith("data:image/")?i:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:l,width:s,height:a,className:$(t!==""&&t),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:a},onLoad:w=>w.currentTarget.style.filter="none","data-testid":"img"}):c.jsxs("div",{className:"text-center",children:[c.jsx(ms,{"aria-hidden":"true",className:$("mt-3 mx-auto h-9 w-9",g?"text-red-900":"text-gray-300")}),c.jsxs("div",{className:$("mt-4 flex text-sm leading-6",g?"text-red-900":"text-gray-600"),children:[c.jsx("label",{htmlFor:"file-upload",className:$("relative cursor-pointer rounded-md bg-white font-semibold focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-7 focus-within:ring-offset-2 hover:text-primary-6",g?"text-red-900":"text-primary-7"),children:c.jsx("span",{children:"Subir un archivo"})}),c.jsx("p",{className:"pl-1",children:"o arrástralo y suéltalo aquí"})]}),c.jsx("p",{className:$("text-xs leading-5",g?"text-red-900":"text-gray-600"),children:d})]}),c.jsx("input",{id:"file-upload",name:"file-upload",type:"file",className:"absolute w-full h-full opacity-0 cursor-pointer",onChange:E})]}),v.length===0||!g?null:c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":"helperText-upload",children:v})]})},qs=({children:e,openDefault:n=!1,setForm:t,setValuesDefault:r,title:o,type:i,data:l,setData:s,id:a,defaultData:f,showAlert:d,isAdd:h=!0,search:x=null,isPadding:m=!0,isReadOnly:v=!1,isEdit:g=!1,deleteItem:b=null,validateAdd:E=null,loading:w=!1,internalEdit:y=!0,isDataEmpty:N=!0,typeProp:k="value",setAdd:L=null,hasNoRecords:B=!0,tabs:Y=null,selectTab:D=null,className:A="mt-7"})=>{const[q,G]=u.useState(!1),[Q,C]=u.useState(!1),[,re]=u.useState(!1),[K,j]=u.useState(""),[I,_]=u.useState(1);u.useEffect(()=>{G(n),re(v)},[n,v]);const Z=({e:R,index:ue})=>{const P=Ot(l),{name:V,value:O}=R.target;!(E===null?!1:E({value:O,copyData:P,index:ue}))&&(P[ue][V]=O),s(P),r(a,P),t(X=>({...X,[a]:P}))},ee=()=>{if(l.some(ue=>Object.values(ue).some(O=>O[k]===-1))||l.length===0)return d({title:"",message:"Todos los campos son requeridos",type:"warning"});t(ue=>({...ue,data:l})),r(a,l),s([...l,f]),L&&L([...l,f])},se=({index:R,item:ue})=>{if(l.length===1&&!g)return;let P=Ot(l);P.length===1&&(P=[f]),P.length>1&&P.splice(R,1),t(V=>({...V,data:P})),r(a,P),s(P),b&&b({index:R,item:ue,data:P}),R===l.length-1&&g&&P.length===0&&(t(V=>({...V,data:P})),r(a,P),s([...P,f]))},ae=()=>{C(!Q),re(!1)},ge=()=>{if(l.length>1)return;if(l.length===0)return!0;const[R]=l;return!R||typeof R!="object"?!0:Object.keys(R).filter(V=>{const O=R[V];return O&&typeof O=="object"&&"value"in O}).every(V=>R[V].value===-1)},we=({tab:R})=>{_(R.id),D&&D({tab:R})};return c.jsxs("div",{className:$("divide-y divide-gray-200 rounded-lg bg-white shadow",A),children:[c.jsxs("div",{className:"px-4 py-3.5 sm:px-6 flex justify-between items-center cursor-pointer",onClick:()=>G(!q),"data-testid":`open-accordion-${a}`,children:[typeof o=="string"?c.jsx("p",{className:"text-gray-500 uppercase text-xs font-bold",children:o}):o,c.jsxs("div",{className:"flex items-center",children:[x&&c.jsx(st,{htmlFor:"search",id:"search",name:"search",type:"text",autoComplete:"search",placeholder:"Buscar...",handleChange:R=>{x(R),j(R.target.value)},icon:c.jsx(Ps,{className:"w-6 h-6 text-primary-4"}),className:"h-9",classNameContainerInput:"w-52 2xs:w-64 max-w-64 mr-8 hidden sm:block",value:K,onClick:R=>R.stopPropagation(),onFocus:()=>G(!0)}),q?c.jsx(Fs,{className:"w-5 h-5 text-default-4"}):c.jsx(fr,{className:"w-5 h-5 text-default-4"})]})]}),c.jsx(De,{as:u.Fragment,show:q,enter:"transition duration-[400ms]",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-200 transition ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:c.jsxs("div",{children:[Y&&c.jsx("nav",{className:"flex justify-center border-b border-gray-200","aria-label":"Tabs",children:Y.map(R=>c.jsx("span",{className:$(I===R.id?"border-primary-6 text-gray-900":"border-gray-300 text-gray-500 hover:border-primary-6","whitespace-nowrap border-b-2 py-2.5 px-2 text-sm font-medium cursor-pointer"),"aria-current":I===R.id?"page":void 0,onClick:()=>we({tab:R}),"data-testid":`tab-${R.id}`,children:R.name},R.name))}),c.jsxs("div",{className:$("sm:mt-2.5 py-3.5 relative",m&&Y===null&&"px-4 sm:p-6",m&&Y!==null&&"px-4 sm:px-6 sm:pb-6 sm:pt-2.5"),children:[y&&!Q&&c.jsx(bs,{className:"w-5 h-5 text-gray-400 cursor-pointer absolute right-4",onClick:ae,"data-testid":`edit-role-${a}`}),w&&c.jsx("div",{className:"flex justify-center mt-5",children:c.jsx(at,{})}),N&&ge()&&B&&!w&&(y?!Q:!g)&&c.jsx("p",{className:"text-gray-800 text-center","data-testid":"records-empty",children:"No hay registros para mostrar"}),!w&&l.map((R,ue)=>c.jsxs("div",{className:$("flex flex-col 3xs:flex-row mb-4",m&&"ml-0 3xs:ml-3"),children:[typeof e=="function"?e({item:R,index:ue,handleChange:Z,isEdit:y?Q:g}):e,h&&(y?Q:g)&&c.jsx("div",{style:{backgroundColor:"#B0B8BF",width:"25px",height:"25px"},className:$("rounded-full flex justify-center items-center mt-4 3xs:mt-7 ml-2 3xs:ml-5 self-start 3xs:self-center",l.length===1&&!g&&"opacity-0"),children:c.jsx(As,{className:$("w-6 h-4",(l.length>1||g)&&"cursor-pointer"),style:{color:"#637381"},strokeWidth:2.5,onClick:()=>se({index:ue,item:R}),"data-testid":`delete-item-${ue}-${a}`})})]},ue)),h&&(y?Q:g)&&!w&&c.jsx("p",{className:"text-secondary-2 text-sm font-medium ml-3 cursor-pointer",onClick:ee,"data-testid":`add-item-${a}`,style:{width:"fit-content"},children:`+ Añadir ${i}`})]})]})})]})},Gs=({src:e,alt:n,width:t,height:r,className:o="",priority:i=!1,style:l={},id:s="",onClick:a=null,objectFit:f="cover"})=>{const[d,h]=u.useState(!1),x={filter:d?"none":"blur(10px)",transition:"filter 0.3s ease-out",objectFit:f,...t?{width:t}:{},...r?{height:r}:{},...l};return c.jsx("img",{src:e,alt:n,...t?{width:t}:{},...r?{height:r}:{},className:$(o!==""&&o),loading:i?"eager":"lazy",decoding:"async",style:x,onLoad:()=>h(!0),"data-testid":`image-${s}`,onClick:a})},Ks=["icon-analytics-alt-1","icon-bell-remove","icon-calculator-alt","icon-cart-full","icon-cloud-sun","icon-coding","icon-cottage-alt","icon-flag-alt","icon-gallery","icon-grow","icon-head-idea","icon-idea-share","icon-highlight-alt","icon-invention","icon-Jurisdiction","icon-layout-2","icon-lock","icon-map-alt","icon-megaphone","icon-personal-data","icon-personal-file","icon-phone-ring","icon-pie-chart-dollar","icon-pointer-right","icon-portfolio","icon-presentation-chart-line","icon-pyramid","icon-puzzle","icon-revenue","icon-rocket-growth-2","icon-ruler-pencil","icon-save","icon-search-home","icon-shoe-print","icon-strategy","icon-target","icon-time-settings","icon-vector-1","icon-user-alt-3","icon-world-2","icon-write","icon-website-money","icon-website","icon-alarm-clock","icon-arc","icon-bot","icon-control-panel","icon-corner","icon-dashboard","icon-full-battery","icon-help","icon-networking-startup","icon-share-alt","icon-thumbnail","icon-ux","icon-travel","icon-music","icon-heart","icon-book-mark","icon-map-pin","icon-star","icon-microphone","icon-clipboard-document","icon-arrow-down-tray","icon-reports"];function Zs({value:e,onChange:n,disabled:t,id:r,label:o="",classNameLabel:i="",helperText:l="",isError:s=!1,isReadOnly:a=!1,name:f}){const[d,h]=u.useState(!1),x=u.useRef(null);u.useEffect(()=>{function v(g){d&&x.current&&!x.current.contains(g.target)&&h(!1)}return document.addEventListener("mousedown",v),()=>document.removeEventListener("mousedown",v)},[d]);const m=je({"border-red-300 focus:border-red-300 text-red-900":s&&!a,"text-gray-500":!s,"focus:border-primary-7":!s&&!a});return c.jsxs(c.Fragment,{children:[c.jsx("style",{children:`
|
|
69
|
-
.black-icon::before {
|
|
70
|
-
color: rgb(51, 51, 51);
|
|
71
|
-
}
|
|
72
|
-
`}),o!==""&&c.jsx("p",{className:$("block text-sm font-medium leading-6",i!==""?i:"text-gray-700"),"data-testid":`label-${r}`,children:o}),c.jsxs("div",{style:{position:"relative",width:"100%"},className:$("border rounded-md",m),ref:x,children:[c.jsxs("div",{className:"flex items-center gap-2 dropdown-trigger border border-default-2 rounded-md p-1.5",onClick:()=>!t&&h(!d),style:{cursor:t?"not-allowed":"pointer"},title:e||"Selecciona un icono","data-testid":"open",children:[c.jsx("div",{className:"rounded border border-default-2 p-1 h-6 w-6 bg-default-2 flex items-center justify-center",children:e&&c.jsx("i",{className:$(e,"text-normal block")})}),c.jsx("div",{className:"truncate",style:{flexGrow:1,minWidth:0,overflow:"hidden"},children:e}),c.jsx(fr,{className:$("h-5 w-5 ml-auto transition-transform flex-shrink-0",{"transform rotate-180":d})})]}),d&&c.jsx("div",{className:"openIconSelect absolute z-10 bg-white p-3 rounded-lg",style:{top:48,left:"0",width:"100%",maxWidth:500,border:"1px solid #ccc",boxShadow:"0 2px 8px rgba(0,0,0,0.15)",maxHeight:300,overflowY:"auto"},children:c.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:"repeat(auto-fill, minmax(30px, 1fr))",gap:12},children:Ks.map(v=>c.jsx("button",{type:"button",className:"icon-picker-btn",style:{width:"100%",aspectRatio:"1",borderRadius:4,border:e===v?"2px solid #007bff":"1px solid #eee",background:"#f9f9f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,color:e===v?"#007bff":"#333",outline:"none",cursor:"pointer"},onClick:()=>{n({target:{value:v,checked:!1,name:f,id:r}}),h(!1)},title:v,children:c.jsx("i",{className:$(v,"black-icon")})},v))})})]}),l.length>0&&s&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${r}`,children:l})]})}const Ct=(e,n,t)=>{const r=t*n,o=r*(1-Math.abs(e/60%2-1)),i=t-r;let l,s,a;return e<60?[l,s,a]=[r,o,0]:e<120?[l,s,a]=[o,r,0]:e<180?[l,s,a]=[0,r,o]:e<240?[l,s,a]=[0,o,r]:e<300?[l,s,a]=[o,0,r]:[l,s,a]=[r,0,o],[Math.round((l+i)*255),Math.round((s+i)*255),Math.round((a+i)*255)]},an=(e,n,t)=>{e/=255,n/=255,t/=255;const r=Math.max(e,n,t),o=Math.min(e,n,t),i=r-o;let l;const s=r,a=r===0?0:i/r;if(r===o)l=0;else{switch(r){case e:l=(n-t)/i+(n<t?6:0);break;case n:l=(t-e)/i+2;break;case t:l=(e-n)/i+4;break}l*=60}return[l,a,s]},ut=(e,n,t)=>"#"+[e,n,t].map(r=>r.toString(16).padStart(2,"0")).join("").toUpperCase(),hr=e=>/^#[0-9A-Fa-f]{6}$/.test(e)?[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]:[255,0,0];function Xs({value:e,onChange:n,disabled:t,label:r="",classNameLabel:o="",helperText:i="",isError:l=!1,isReadOnly:s=!1,name:a}){const f=u.useRef(!0),d=u.useRef(null),h=u.useRef(null),[x,m]=u.useState(!1),[v,g]=u.useState([182.2,.849,.494]),[b,E]=u.useState(e),w=u.useCallback(j=>{n({target:{value:j,name:a}})},[a,n]);u.useEffect(()=>{if(e&&/^#[0-9A-Fa-f]{6}$/.test(e)){const j=hr(e);g(an(...j)),E(e.toUpperCase())}},[e]);const[y,N,k]=v,[L,B,Y]=Ct(y,N,k),D=ut(L,B,Y);u.useEffect(()=>{E(D)},[D]),u.useEffect(()=>{!f.current||s||(f.current=!1,w(D))},[D,w,s]),u.useEffect(()=>{function j(_){if(!d.current||!d.current._dragging)return;const Z=d.current.getBoundingClientRect();let ee=(_.touches?_.touches[0].clientX:_.clientX)-Z.left,se=(_.touches?_.touches[0].clientY:_.clientY)-Z.top;ee=Math.max(0,Math.min(Z.width,ee)),se=Math.max(0,Math.min(Z.height,se));const ae=ee/Z.width,ge=1-se/Z.height;g([y,ae,ge]);const[we,R,ue]=Ct(y,ae,ge),P=ut(we,R,ue);E(P),w(P)}function I(){d.current&&(d.current._dragging=!1),window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",I),window.removeEventListener("touchmove",j),window.removeEventListener("touchend",I)}return d.current&&d.current._dragging&&(window.addEventListener("mousemove",j),window.addEventListener("mouseup",I),window.addEventListener("touchmove",j),window.addEventListener("touchend",I)),()=>{window.removeEventListener("mousemove",j),window.removeEventListener("mouseup",I),window.removeEventListener("touchmove",j),window.removeEventListener("touchend",I)}},[w,y]),u.useEffect(()=>{function j(I){x&&h.current&&!h.current.contains(I.target)&&m(!1)}return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[x]);const A=j=>{if(!d.current)return;const I=d.current.getBoundingClientRect();let _=(j.touches?j.touches[0].clientX:j.clientX)-I.left,Z=(j.touches?j.touches[0].clientY:j.clientY)-I.top;_=Math.max(0,Math.min(I.width,_)),Z=Math.max(0,Math.min(I.height,Z));const ee=_/I.width,se=1-Z/I.height;g([y,ee,se]);const[ae,ge,we]=Ct(y,ee,se),R=ut(ae,ge,we);E(R),w(R)},W=j=>{t||(d.current&&(d.current._dragging=!0),A(j))},q=()=>{d.current&&(d.current._dragging=!1)},G=j=>{const I=Number(j.target.value);g([I,N,k]);const[_,Z,ee]=Ct(I,N,k),se=ut(_,Z,ee);E(se),w(se)},Q=j=>{const I=j.target.value;if(E(I),/^#[0-9A-Fa-f]{6}$/.test(I)){const _=hr(I);g(an(..._)),w(I.toUpperCase())}},C=(j,I)=>{const _=[L,B,Y];_[j]=Math.max(0,Math.min(255,Number(I)||0)),g(an(..._));const Z=ut(..._);E(Z),w(Z)},re=N*180,K=(1-k)*180;return c.jsxs(c.Fragment,{children:[r&&c.jsx("p",{className:je("block text-sm font-medium leading-6",o||"text-gray-700"),children:r}),c.jsxs("div",{style:{position:"relative",display:"inline-block"},ref:h,className:"w-full",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2 dropdown-trigger rounded-md border p-2 border-default-2 w-full",onClick:()=>!t&&m(!x),children:[c.jsx("div",{className:"rounded border border-default-2 flex-shrink-0 w-6 h-6",style:{backgroundColor:s?"":D}}),c.jsx("input",{type:"text",className:"px-2 py-1 border-b border-t-0 border-l-0 border-r-0 border-default-7 text-xs focus:border-default-5 focus:ring-0 w-full",value:s?"":b,disabled:t,onChange:Q,readOnly:s}),c.jsx(on,{className:je("h-5 w-5 ml-2 transition-transform",{"transform rotate-180":x&&!s})})]}),x&&!s&&c.jsxs("div",{className:"openSketch absolute z-20 top-14 left-0 bg-white border border-default-5 rounded-md p-4 shadow-md w-full",children:[c.jsxs("div",{className:"relative rounded mb-2 cursor-crosshair",ref:d,style:{backgroundColor:`hsl(${y}, 100%, 50%)`,height:"200px"},onMouseDown:W,onMouseMove:j=>d.current&&d.current._dragging&&A(j),onMouseUp:q,onMouseLeave:q,onTouchStart:W,onTouchMove:j=>d.current&&d.current._dragging&&A(j),onTouchEnd:q,children:[c.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to right, #fff, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),c.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, #000, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),c.jsx("div",{className:"absolute w-4 h-4 rounded-full border-2 border-white shadow",style:{left:`calc(${re}px - 8px)`,top:`calc(${K}px - 8px)`,background:D,pointerEvents:"none"}})]}),c.jsx("input",{type:"range",min:0,max:359,value:y,onChange:G,className:"w-full mb-2",style:{background:"linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red)"},disabled:t}),c.jsx("div",{className:"flex gap-2 mb-2",children:["R","G","B"].map((j,I)=>c.jsxs("div",{children:[c.jsx("label",{className:"text-center block",children:j}),c.jsx("input",{type:"number",min:0,max:255,className:"w-14 px-2 py-1 border border-gray-300 rounded text-sm",value:[L,B,Y][I],onChange:_=>C(I,_.target.value),disabled:t,placeholder:j})]},I))})]})]}),i&&l&&c.jsx("p",{className:"text-red-600 text-sm text-left mt-1",children:i})]})}const Js=["#FFCEC7","#2ecc71","#3498db","#9b59b6","#34495e","#1abc9c","#e74c3c","#7f8c8d","#f1c40f","#e67e22","#000000"],Qs=({className:e="",label:n="",onChange:t,name:r,id:o,value:i="#FFCEC7"})=>{const[l,s]=u.useState(!1),[a,f]=u.useState("#FFCEC7");hn({id:"menu-colors",close:()=>s(!1)}),u.useEffect(()=>{f(i)},[i]);const d=h=>{f(h),s(!1),t({target:{value:h,checked:!1,name:r,type:void 0,id:o}})};return c.jsxs("div",{className:$("relative",e!==""&&e),children:[n&&c.jsx("p",{className:"text-sm font-medium leading-6 text-gray-500 mb-0.5",children:n}),c.jsxs("div",{className:"flex justify-center items-center bg-gray-100 px-3 rounded-md h-10 w-20 gap-4 cursor-pointer",onClick:()=>s(!l),id:"menu-colors","data-testid":"menu-colors",children:[c.jsx("div",{style:{width:"18px",height:"18px",backgroundColor:a},className:"rounded-full"}),c.jsx(on,{className:$("h-5 w-5 transition-transform",l&&"transform rotate-180")})]}),c.jsx(De,{show:l,enter:"transition-opacity duration-75",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"transition-opacity duration-150",leaveFrom:"opacity-100",leaveTo:"opacity-0",id:"menu-colors",className:"absolute top-full",children:c.jsx("div",{id:"menu-colors",className:"bg-gray-100 shadow grid gap-2 p-2 mt-2 rounded",style:{gridTemplateColumns:"repeat(auto-fill, minmax(17px, 1fr))",maxWidth:"180px"},children:Js.map((h,x)=>c.jsx("div",{style:{width:"17px",height:"17px",backgroundColor:h},className:"rounded-full cursor-pointer flex justify-center items-center",onClick:()=>d(h),"data-testid":`color-${x}`,children:a===h&&c.jsx(ts,{className:"w-3 h-3 text-white",stroke:"2"})},x))})})]})};z.Accordion=qs,z.Alert=ds,z.Avatar=Cs,z.Bullets=Ts,z.ButtonOutline=ar,z.ButtonPagination=ur,z.ButtonSolid=it,z.Checkbox=Os,z.ConfirmationAbandoningCreation=Ds,z.CoverPhoto=Ys,z.Divider=_s,z.Dropdown=Hs,z.GoBack=Rs,z.IconSelectPicker=Zs,z.Image=Gs,z.Input=st,z.InputDropdown=zs,z.MESSAGE_ABORT_CONTROLLER=Mr,z.MESSAGE_SIGNAL_ABORTED_WITHOUT_REASON=Pr,z.Modal=mr,z.Pagination=Vs,z.Select=pr,z.SelectColor=Qs,z.SketchColorPicker=Xs,z.Spinner=Bs,z.SpinnerIcon=at,z.Switch=Ws,z.Textarea=Us,z.Tooltip=ln,z.classNames=$,z.copyOptions=Ot,z.generateAvatarInitials=Ir,z.groupBy=$r,z.isPromise=Fr,z.rowsPerPage=sn,z.useCloseModal=hn,z.useForm=Lr,z.useMediaQuery=Ar,z.useWindowDimensions=vn,z.validateEmail=pn,Object.defineProperty(z,Symbol.toStringTag,{value:"Module"})});
|