cemtrik-dependencies 1.0.201 → 1.0.202
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +5 -5
- package/package.json +1 -9
package/dist/index.js
CHANGED
|
@@ -28,11 +28,11 @@ Check the top-level render call using <`+Q+">.")}return H}}function Ln(j,H){{if(
|
|
|
28
28
|
color: hsl(${Math.max(0,Math.min(120-120*R,120))}deg 100% 31%);`,r==null?void 0:r.key)}return(v=r==null?void 0:r.onChange)==null||v.call(r,u),u}}function no(e,o){if(e===void 0)throw new Error("Unexpected undefined");return e}const ps=(e,o)=>Math.abs(e-o)<1,ms=(e,o,r)=>{let n;return function(...u){e.clearTimeout(n),n=e.setTimeout(()=>o.apply(this,u),r)}},hs=e=>e,vs=e=>{const o=Math.max(e.startIndex-e.overscan,0),r=Math.min(e.endIndex+e.overscan,e.count-1),n=[];for(let u=o;u<=r;u++)n.push(u);return n},gs=(e,o)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;const u=a=>{const{width:m,height:v}=a;o({width:Math.round(m),height:Math.round(v)})};if(u(r.getBoundingClientRect()),!n.ResizeObserver)return()=>{};const f=new n.ResizeObserver(a=>{const m=a[0];if(m!=null&&m.borderBoxSize){const v=m.borderBoxSize[0];if(v){u({width:v.inlineSize,height:v.blockSize});return}}u(r.getBoundingClientRect())});return f.observe(r,{box:"border-box"}),()=>{f.unobserve(r)}},bi={passive:!0},bs=typeof window>"u"?!0:"onscrollend"in window,xs=(e,o)=>{const r=e.scrollElement;if(!r)return;const n=e.targetWindow;if(!n)return;let u=0;const f=bs?()=>{}:ms(n,()=>{o(u,!1)},e.options.isScrollingResetDelay),a=x=>()=>{u=r[e.options.horizontal?"scrollLeft":"scrollTop"],f(),o(u,x)},m=a(!0),v=a(!1);return v(),r.addEventListener("scroll",m,bi),r.addEventListener("scrollend",v,bi),()=>{r.removeEventListener("scroll",m),r.removeEventListener("scrollend",v)}},ys=(e,o,r)=>{if(o!=null&&o.borderBoxSize){const n=o.borderBoxSize[0];if(n)return Math.round(n[r.options.horizontal?"inlineSize":"blockSize"])}return Math.round(e.getBoundingClientRect()[r.options.horizontal?"width":"height"])},ws=(e,{adjustments:o=0,behavior:r},n)=>{var u,f;const a=e+o;(f=(u=n.scrollElement)==null?void 0:u.scrollTo)==null||f.call(u,{[n.options.horizontal?"left":"top"]:a,behavior:r})};class Es{constructor(o){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 r=null;const n=()=>r||(!this.targetWindow||!this.targetWindow.ResizeObserver?null:r=new this.targetWindow.ResizeObserver(u=>{u.forEach(f=>{this._measureElement(f.target,f)})}));return{disconnect:()=>{var u;return(u=n())==null?void 0:u.disconnect()},observe:u=>{var f;return(f=n())==null?void 0:f.observe(u,{box:"border-box"})},unobserve:u=>{var f;return(f=n())==null?void 0:f.unobserve(u)}}})(),this.range=null,this.setOptions=r=>{Object.entries(r).forEach(([n,u])=>{typeof u>"u"&&delete r[n]}),this.options={debug:!1,initialOffset:0,overscan:1,paddingStart:0,paddingEnd:0,scrollPaddingStart:0,scrollPaddingEnd:0,horizontal:!1,getItemKey:hs,rangeExtractor:vs,onChange:()=>{},measureElement:ys,initialRect:{width:0,height:0},scrollMargin:0,gap:0,indexAttribute:"data-index",initialMeasurementsCache:[],lanes:1,isScrollingResetDelay:150,enabled:!0,...r}},this.notify=(r,n)=>{var u,f;const{startIndex:a,endIndex:m}=this.range??{startIndex:void 0,endIndex:void 0},v=this.calculateRange();(r||a!==(v==null?void 0:v.startIndex)||m!==(v==null?void 0:v.endIndex))&&((f=(u=this.options).onChange)==null||f.call(u,this,n))},this.cleanup=()=>{this.unsubs.filter(Boolean).forEach(r=>r()),this.unsubs=[],this.scrollElement=null,this.targetWindow=null,this.observer.disconnect(),this.elementsCache.clear()},this._didMount=()=>()=>{this.cleanup()},this._willUpdate=()=>{var r;const n=this.options.enabled?this.options.getScrollElement():null;if(this.scrollElement!==n){if(this.cleanup(),!n){this.notify(!1,!1);return}this.scrollElement=n,this.scrollElement&&"ownerDocument"in this.scrollElement?this.targetWindow=this.scrollElement.ownerDocument.defaultView:this.targetWindow=((r=this.scrollElement)==null?void 0:r.window)??null,this._scrollToOffset(this.getScrollOffset(),{adjustments:void 0,behavior:void 0}),this.unsubs.push(this.options.observeElementRect(this,u=>{this.scrollRect=u,this.notify(!1,!1)})),this.unsubs.push(this.options.observeElementOffset(this,(u,f)=>{this.scrollAdjustments=0,this.scrollDirection=f?this.getScrollOffset()<u?"forward":"backward":null,this.scrollOffset=u;const a=this.isScrolling;this.isScrolling=f,this.notify(a!==f,f)}))}},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=(r,n)=>{const u=new Map,f=new Map;for(let a=n-1;a>=0;a--){const m=r[a];if(u.has(m.lane))continue;const v=f.get(m.lane);if(v==null||m.end>v.end?f.set(m.lane,m):m.end<v.end&&u.set(m.lane,!0),u.size===this.options.lanes)break}return f.size===this.options.lanes?Array.from(f.values()).sort((a,m)=>a.end===m.end?a.index-m.index:a.end-m.end)[0]:void 0},this.getMeasurementOptions=zn(()=>[this.options.count,this.options.paddingStart,this.options.scrollMargin,this.options.getItemKey,this.options.enabled],(r,n,u,f,a)=>(this.pendingMeasuredCacheIndexes=[],{count:r,paddingStart:n,scrollMargin:u,getItemKey:f,enabled:a}),{key:!1}),this.getMeasurements=zn(()=>[this.getMeasurementOptions(),this.itemSizeCache],({count:r,paddingStart:n,scrollMargin:u,getItemKey:f,enabled:a},m)=>{var v;if(!a)return this.measurementsCache=[],this.itemSizeCache.clear(),[];this.measurementsCache.length===0&&(this.measurementsCache=this.options.initialMeasurementsCache,this.measurementsCache.forEach(k=>{this.itemSizeCache.set(k.key,k.size)}));const x=this.pendingMeasuredCacheIndexes.length>0?Math.min(...this.pendingMeasuredCacheIndexes):0;this.pendingMeasuredCacheIndexes=[];const E=this.measurementsCache.slice(0,x);for(let k=x;k<r;k++){let P=(v=this.measurementsCache[k])==null?void 0:v.measureElement;P||(P=X=>{const ee=f(k),ue=this.elementsCache.get(ee);if(!X){ue&&(this.observer.unobserve(ue),this.elementsCache.delete(ee));return}ue!==X&&(ue&&this.observer.unobserve(ue),this.observer.observe(X),this.elementsCache.set(ee,X)),X.isConnected&&this.resizeItem(k,this.options.measureElement(X,void 0,this))});const C=f(k),M=this.options.lanes===1?E[k-1]:this.getFurthestMeasurement(E,k),R=M?M.end+this.options.gap:n+u,L=m.get(C),B=typeof L=="number"?L:this.options.estimateSize(k),_=R+B,z=M?M.lane:k%this.options.lanes;E[k]={index:k,start:R,size:B,end:_,key:C,lane:z,measureElement:P}}return this.measurementsCache=E,E},{key:process.env.NODE_ENV!=="production"&&"getMeasurements",debug:()=>this.options.debug}),this.calculateRange=zn(()=>[this.getMeasurements(),this.getSize(),this.getScrollOffset()],(r,n,u)=>this.range=r.length>0&&n>0?Ss({measurements:r,outerSize:n,scrollOffset:u}):null,{key:process.env.NODE_ENV!=="production"&&"calculateRange",debug:()=>this.options.debug}),this.getIndexes=zn(()=>[this.options.rangeExtractor,this.calculateRange(),this.options.overscan,this.options.count],(r,n,u,f)=>n===null?[]:r({startIndex:n.startIndex,endIndex:n.endIndex,overscan:u,count:f}),{key:process.env.NODE_ENV!=="production"&&"getIndexes",debug:()=>this.options.debug}),this.indexFromElement=r=>{const n=this.options.indexAttribute,u=r.getAttribute(n);return u?parseInt(u,10):(console.warn(`Missing attribute name '${n}={index}' on measured element.`),-1)},this._measureElement=(r,n)=>{const u=this.indexFromElement(r),f=this.getMeasurements()[u];if(!f||!r.isConnected){this.elementsCache.forEach((m,v)=>{m===r&&(this.observer.unobserve(r),this.elementsCache.delete(v))});return}const a=this.elementsCache.get(f.key);a!==r&&(a&&this.observer.unobserve(a),this.observer.observe(r),this.elementsCache.set(f.key,r)),this.resizeItem(u,this.options.measureElement(r,n,this))},this.resizeItem=(r,n)=>{const u=this.getMeasurements()[r];if(!u)return;const f=this.itemSizeCache.get(u.key)??u.size,a=n-f;a!==0&&((this.shouldAdjustScrollPositionOnItemSizeChange!==void 0?this.shouldAdjustScrollPositionOnItemSizeChange(u,a,this):u.start<this.getScrollOffset()+this.scrollAdjustments)&&(process.env.NODE_ENV!=="production"&&this.options.debug&&console.info("correction",a),this._scrollToOffset(this.getScrollOffset(),{adjustments:this.scrollAdjustments+=a,behavior:void 0})),this.pendingMeasuredCacheIndexes.push(u.index),this.itemSizeCache=new Map(this.itemSizeCache.set(u.key,n)),this.notify(!0,!1))},this.measureElement=r=>{r&&this._measureElement(r,void 0)},this.getVirtualItems=zn(()=>[this.getIndexes(),this.getMeasurements()],(r,n)=>{const u=[];for(let f=0,a=r.length;f<a;f++){const m=r[f],v=n[m];u.push(v)}return u},{key:process.env.NODE_ENV!=="production"&&"getVirtualItems",debug:()=>this.options.debug}),this.getVirtualItemForOffset=r=>{const n=this.getMeasurements();if(n.length!==0)return no(n[xi(0,n.length-1,u=>no(n[u]).start,r)])},this.getOffsetForAlignment=(r,n)=>{const u=this.getSize(),f=this.getScrollOffset();n==="auto"&&(r<=f?n="start":r>=f+u?n="end":n="start"),n==="start"?r=r:n==="end"?r=r-u:n==="center"&&(r=r-u/2);const a=this.options.horizontal?"scrollWidth":"scrollHeight",v=(this.scrollElement?"document"in this.scrollElement?this.scrollElement.document.documentElement[a]:this.scrollElement[a]:0)-u;return Math.max(Math.min(v,r),0)},this.getOffsetForIndex=(r,n="auto")=>{r=Math.max(0,Math.min(r,this.options.count-1));const u=this.getMeasurements()[r];if(!u)return;const f=this.getSize(),a=this.getScrollOffset();if(n==="auto")if(u.end>=a+f-this.options.scrollPaddingEnd)n="end";else if(u.start<=a+this.options.scrollPaddingStart)n="start";else return[a,n];const m=n==="end"?u.end+this.options.scrollPaddingEnd:u.start-this.options.scrollPaddingStart;return[this.getOffsetForAlignment(m,n),n]},this.isDynamicMode=()=>this.elementsCache.size>0,this.cancelScrollToIndex=()=>{this.scrollToIndexTimeoutId!==null&&this.targetWindow&&(this.targetWindow.clearTimeout(this.scrollToIndexTimeoutId),this.scrollToIndexTimeoutId=null)},this.scrollToOffset=(r,{align:n="start",behavior:u}={})=>{this.cancelScrollToIndex(),u==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getOffsetForAlignment(r,n),{adjustments:void 0,behavior:u})},this.scrollToIndex=(r,{align:n="auto",behavior:u}={})=>{r=Math.max(0,Math.min(r,this.options.count-1)),this.cancelScrollToIndex(),u==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size.");const f=this.getOffsetForIndex(r,n);if(!f)return;const[a,m]=f;this._scrollToOffset(a,{adjustments:void 0,behavior:u}),u!=="smooth"&&this.isDynamicMode()&&this.targetWindow&&(this.scrollToIndexTimeoutId=this.targetWindow.setTimeout(()=>{if(this.scrollToIndexTimeoutId=null,this.elementsCache.has(this.options.getItemKey(r))){const[x]=no(this.getOffsetForIndex(r,m));ps(x,this.getScrollOffset())||this.scrollToIndex(r,{align:m,behavior:u})}else this.scrollToIndex(r,{align:m,behavior:u})}))},this.scrollBy=(r,{behavior:n}={})=>{this.cancelScrollToIndex(),n==="smooth"&&this.isDynamicMode()&&console.warn("The `smooth` scroll behavior is not fully supported with dynamic size."),this._scrollToOffset(this.getScrollOffset()+r,{adjustments:void 0,behavior:n})},this.getTotalSize=()=>{var r;const n=this.getMeasurements();let u;return n.length===0?u=this.options.paddingStart:u=this.options.lanes===1?((r=n[n.length-1])==null?void 0:r.end)??0:Math.max(...n.slice(-this.options.lanes).map(f=>f.end)),u-this.options.scrollMargin+this.options.paddingEnd},this._scrollToOffset=(r,{adjustments:n,behavior:u})=>{this.options.scrollToFn(r,{behavior:u,adjustments:n},this)},this.measure=()=>{var r,n;this.itemSizeCache=new Map,(n=(r=this.options).onChange)==null||n.call(r,this,!1)},this.setOptions(o)}}const xi=(e,o,r,n)=>{for(;e<=o;){const u=(e+o)/2|0,f=r(u);if(f<n)e=u+1;else if(f>n)o=u-1;else return u}return e>0?e-1:0};function Ss({measurements:e,outerSize:o,scrollOffset:r}){const n=e.length-1,f=xi(0,n,m=>e[m].start,r);let a=f;for(;a<n&&e[a].end<r+o;)a++;return{startIndex:f,endIndex:a}}const Cs=typeof document<"u"?Z.useLayoutEffect:Z.useEffect;function js(e){const o=Z.useReducer(()=>({}),{})[1],r={...e,onChange:(u,f)=>{var a;f?Sr.flushSync(o):o(),(a=e.onChange)==null||a.call(e,u,f)}},[n]=Z.useState(()=>new Es(r));return n.setOptions(r),Z.useEffect(()=>n._didMount(),[]),Cs(()=>n._willUpdate()),n}function Ts(e){return js({observeElementRect:gs,observeElementOffset:xs,scrollToFn:ws,...e})}var Ns=Object.defineProperty,Os=(e,o,r)=>o in e?Ns(e,o,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[o]=r,ro=(e,o,r)=>(Os(e,typeof o!="symbol"?o+"":o,r),r);let ks=class{constructor(){ro(this,"current",this.detect()),ro(this,"handoffState","pending"),ro(this,"currentId",0)}set(o){this.current!==o&&(this.handoffState="pending",this.currentId=0,this.current=o)}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"}},tn=new ks,ot=(e,o)=>{tn.isServer?g.useEffect(e,o):g.useLayoutEffect(e,o)};function Vt(e){let o=g.useRef(e);return ot(()=>{o.current=e},[e]),o}function oo(e,o){let[r,n]=g.useState(e),u=Vt(e);return ot(()=>n(u.current),[u,n,...o]),r}let ie=function(e){let o=Vt(e);return g.useCallback((...r)=>o.current(...r),[o])};function yi(e,o,r){let[n,u]=g.useState(r),f=e!==void 0,a=g.useRef(f),m=g.useRef(!1),v=g.useRef(!1);return f&&!a.current&&!m.current?(m.current=!0,a.current=f,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.")):!f&&a.current&&!v.current&&(v.current=!0,a.current=f,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.")),[f?e:n,ie(x=>(f||u(x),o==null?void 0:o(x)))]}function Cr(e){typeof queueMicrotask=="function"?queueMicrotask(e):Promise.resolve().then(e).catch(o=>setTimeout(()=>{throw o}))}function Wt(){let e=[],o={addEventListener(r,n,u,f){return r.addEventListener(n,u,f),o.add(()=>r.removeEventListener(n,u,f))},requestAnimationFrame(...r){let n=requestAnimationFrame(...r);return o.add(()=>cancelAnimationFrame(n))},nextFrame(...r){return o.requestAnimationFrame(()=>o.requestAnimationFrame(...r))},setTimeout(...r){let n=setTimeout(...r);return o.add(()=>clearTimeout(n))},microTask(...r){let n={current:!0};return Cr(()=>{n.current&&r[0]()}),o.add(()=>{n.current=!1})},style(r,n,u){let f=r.style.getPropertyValue(n);return Object.assign(r.style,{[n]:u}),this.add(()=>{Object.assign(r.style,{[n]:f})})},group(r){let n=Wt();return r(n),this.add(()=>n.dispose())},add(r){return e.push(r),()=>{let n=e.indexOf(r);if(n>=0)for(let u of e.splice(n,1))u()}},dispose(){for(let r of e.splice(0))r()}};return o}function nn(){let[e]=g.useState(Wt);return g.useEffect(()=>()=>e.dispose(),[e]),e}function Is(){let e=typeof document>"u";return"useSyncExternalStore"in Z?(o=>o.useSyncExternalStore)(Z)(()=>()=>{},()=>!1,()=>!e):!1}function Mn(){let e=Is(),[o,r]=Z.useState(tn.isHandoffComplete);return o&&tn.isHandoffComplete===!1&&r(!1),Z.useEffect(()=>{o!==!0&&r(!0)},[o]),Z.useEffect(()=>tn.handoff(),[]),e?!1:o}var wi;let Dt=(wi=g.useId)!=null?wi:function(){let e=Mn(),[o,r]=g.useState(e?()=>tn.nextId():null);return ot(()=>{o===null&&r(tn.nextId())},[o]),o!=null?""+o:void 0};function xt(e,o,...r){if(e in o){let u=o[e];return typeof u=="function"?u(...r):u}let n=new Error(`Tried to handle "${e}" but there is no handler defined. Only defined handlers are: ${Object.keys(o).map(u=>`"${u}"`).join(", ")}.`);throw Error.captureStackTrace&&Error.captureStackTrace(n,xt),n}function jr(e){return tn.isServer?null:e instanceof Node?e.ownerDocument:e!=null&&e.hasOwnProperty("current")&&e.current instanceof Node?e.current.ownerDocument:document}let io=["[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 rn=(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))(rn||{}),Ei=(e=>(e[e.Error=0]="Error",e[e.Overflow=1]="Overflow",e[e.Success=2]="Success",e[e.Underflow=3]="Underflow",e))(Ei||{}),Ms=(e=>(e[e.Previous=-1]="Previous",e[e.Next=1]="Next",e))(Ms||{});function Si(e=document.body){return e==null?[]:Array.from(e.querySelectorAll(io)).sort((o,r)=>Math.sign((o.tabIndex||Number.MAX_SAFE_INTEGER)-(r.tabIndex||Number.MAX_SAFE_INTEGER)))}var lo=(e=>(e[e.Strict=0]="Strict",e[e.Loose=1]="Loose",e))(lo||{});function so(e,o=0){var r;return e===((r=jr(e))==null?void 0:r.body)?!1:xt(o,{0(){return e.matches(io)},1(){let n=e;for(;n!==null;){if(n.matches(io))return!0;n=n.parentElement}return!1}})}function Ci(e){let o=jr(e);Wt().nextFrame(()=>{o&&!so(o.activeElement,0)&&fn(e)})}var Ps=(e=>(e[e.Keyboard=0]="Keyboard",e[e.Mouse=1]="Mouse",e))(Ps||{});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 fn(e){e==null||e.focus({preventScroll:!0})}let Fs=["textarea","input"].join(",");function Rs(e){var o,r;return(r=(o=e==null?void 0:e.matches)==null?void 0:o.call(e,Fs))!=null?r:!1}function ao(e,o=r=>r){return e.slice().sort((r,n)=>{let u=o(r),f=o(n);if(u===null||f===null)return 0;let a=u.compareDocumentPosition(f);return a&Node.DOCUMENT_POSITION_FOLLOWING?-1:a&Node.DOCUMENT_POSITION_PRECEDING?1:0})}function Ls(e,o){return Wn(Si(),o,{relativeTo:e})}function Wn(e,o,{sorted:r=!0,relativeTo:n=null,skipElements:u=[]}={}){let f=Array.isArray(e)?e.length>0?e[0].ownerDocument:document:e.ownerDocument,a=Array.isArray(e)?r?ao(e):e:Si(e);u.length>0&&a.length>1&&(a=a.filter(C=>!u.includes(C))),n=n??f.activeElement;let m=(()=>{if(o&5)return 1;if(o&10)return-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),v=(()=>{if(o&1)return 0;if(o&2)return Math.max(0,a.indexOf(n))-1;if(o&4)return Math.max(0,a.indexOf(n))+1;if(o&8)return a.length-1;throw new Error("Missing Focus.First, Focus.Previous, Focus.Next or Focus.Last")})(),x=o&32?{preventScroll:!0}:{},E=0,k=a.length,P;do{if(E>=k||E+k<=0)return 0;let C=v+E;if(o&16)C=(C+k)%k;else{if(C<0)return 3;if(C>=k)return 1}P=a[C],P==null||P.focus(x),E+=m}while(P!==f.activeElement);return o&6&&Rs(P)&&P.select(),2}function ji(){return/iPhone/gi.test(window.navigator.platform)||/Mac/gi.test(window.navigator.platform)&&window.navigator.maxTouchPoints>0}function As(){return/Android/gi.test(window.navigator.userAgent)}function Ti(){return ji()||As()}function Tr(e,o,r){let n=Vt(o);g.useEffect(()=>{function u(f){n.current(f)}return document.addEventListener(e,u,r),()=>document.removeEventListener(e,u,r)},[e,r])}function Ni(e,o,r){let n=Vt(o);g.useEffect(()=>{function u(f){n.current(f)}return window.addEventListener(e,u,r),()=>window.removeEventListener(e,u,r)},[e,r])}function uo(e,o,r=!0){let n=g.useRef(!1);g.useEffect(()=>{requestAnimationFrame(()=>{n.current=r})},[r]);function u(a,m){if(!n.current||a.defaultPrevented)return;let v=m(a);if(v===null||!v.getRootNode().contains(v)||!v.isConnected)return;let x=function E(k){return typeof k=="function"?E(k()):Array.isArray(k)||k instanceof Set?k:[k]}(e);for(let E of x){if(E===null)continue;let k=E instanceof HTMLElement?E:E.current;if(k!=null&&k.contains(v)||a.composed&&a.composedPath().includes(k))return}return!so(v,lo.Loose)&&v.tabIndex!==-1&&a.preventDefault(),o(a,v)}let f=g.useRef(null);Tr("pointerdown",a=>{var m,v;n.current&&(f.current=((v=(m=a.composedPath)==null?void 0:m.call(a))==null?void 0:v[0])||a.target)},!0),Tr("mousedown",a=>{var m,v;n.current&&(f.current=((v=(m=a.composedPath)==null?void 0:m.call(a))==null?void 0:v[0])||a.target)},!0),Tr("click",a=>{Ti()||f.current&&(u(a,()=>f.current),f.current=null)},!0),Tr("touchend",a=>u(a,()=>a.target instanceof HTMLElement?a.target:null),!0),Ni("blur",a=>u(a,()=>window.document.activeElement instanceof HTMLIFrameElement?window.document.activeElement:null),!0)}function Sn(...e){return g.useMemo(()=>jr(...e),[...e])}function Oi(e){var o;if(e.type)return e.type;let r=(o=e.as)!=null?o:"button";if(typeof r=="string"&&r.toLowerCase()==="button")return"button"}function co(e,o){let[r,n]=g.useState(()=>Oi(e));return ot(()=>{n(Oi(e))},[e.type,e.as]),ot(()=>{r||o.current&&o.current instanceof HTMLButtonElement&&!o.current.hasAttribute("type")&&n("button")},[r,o]),r}let ki=Symbol();function Ds(e,o=!0){return Object.assign(e,{[ki]:o})}function Et(...e){let o=g.useRef(e);g.useEffect(()=>{o.current=e},[e]);let r=ie(n=>{for(let u of o.current)u!=null&&(typeof u=="function"?u(n):u.current=n)});return e.every(n=>n==null||(n==null?void 0:n[ki]))?void 0:r}function Ii(e){return[e.screenX,e.screenY]}function Mi(){let e=g.useRef([-1,-1]);return{wasMoved(o){let r=Ii(o);return e.current[0]===r[0]&&e.current[1]===r[1]?!1:(e.current=r,!0)},update(o){e.current=Ii(o)}}}function Pi({container:e,accept:o,walk:r,enabled:n=!0}){let u=g.useRef(o),f=g.useRef(r);g.useEffect(()=>{u.current=o,f.current=r},[o,r]),ot(()=>{if(!e||!n)return;let a=jr(e);if(!a)return;let m=u.current,v=f.current,x=Object.assign(k=>m(k),{acceptNode:m}),E=a.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,x,!1);for(;E.nextNode();)v(E.currentNode)},[e,n,u,f])}function Hn(e,o){let r=g.useRef([]),n=ie(e);g.useEffect(()=>{let u=[...r.current];for(let[f,a]of o.entries())if(r.current[f]!==a){let m=n(o,u);return r.current=o,m}},[n,...o])}function Nr(...e){return Array.from(new Set(e.flatMap(o=>typeof o=="string"?o.split(" "):[]))).filter(Boolean).join(" ")}var pn=(e=>(e[e.None=0]="None",e[e.RenderStrategy=1]="RenderStrategy",e[e.Static=2]="Static",e))(pn||{}),mn=(e=>(e[e.Unmount=0]="Unmount",e[e.Hidden=1]="Hidden",e))(mn||{});function ht({ourProps:e,theirProps:o,slot:r,defaultTag:n,features:u,visible:f=!0,name:a,mergeRefs:m}){m=m??$s;let v=Fi(o,e);if(f)return Or(v,r,n,a,m);let x=u??0;if(x&2){let{static:E=!1,...k}=v;if(E)return Or(k,r,n,a,m)}if(x&1){let{unmount:E=!0,...k}=v;return xt(E?0:1,{0(){return null},1(){return Or({...k,hidden:!0,style:{display:"none"}},r,n,a,m)}})}return Or(v,r,n,a,m)}function Or(e,o={},r,n,u){let{as:f=r,children:a,refName:m="ref",...v}=fo(e,["unmount","static"]),x=e.ref!==void 0?{[m]:e.ref}:{},E=typeof a=="function"?a(o):a;"className"in v&&v.className&&typeof v.className=="function"&&(v.className=v.className(o));let k={};if(o){let P=!1,C=[];for(let[M,R]of Object.entries(o))typeof R=="boolean"&&(P=!0),R===!0&&C.push(M);P&&(k["data-headlessui-state"]=C.join(" "))}if(f===g.Fragment&&Object.keys(kr(v)).length>0){if(!g.isValidElement(E)||Array.isArray(E)&&E.length>1)throw new Error(['Passing props on "Fragment"!',"",`The current component <${n} /> is rendering a "Fragment".`,"However we need to passthrough the following props:",Object.keys(v).map(R=>` - ${R}`).join(`
|
|
29
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(R=>` - ${R}`).join(`
|
|
30
30
|
`)].join(`
|
|
31
|
-
`));let P=E.props,C=typeof(P==null?void 0:P.className)=="function"?(...R)=>Nr(P==null?void 0:P.className(...R),v.className):Nr(P==null?void 0:P.className,v.className),M=C?{className:C}:{};return g.cloneElement(E,Object.assign({},Fi(E.props,kr(fo(v,["ref"]))),k,x,{ref:u(E.ref,x.ref)},M))}return g.createElement(f,Object.assign({},fo(v,["ref"]),f!==g.Fragment&&x,f!==g.Fragment&&k),E)}function $s(...e){return e.every(o=>o==null)?void 0:o=>{for(let r of e)r!=null&&(typeof r=="function"?r(o):r.current=o)}}function Fi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let o={},r={};for(let n of e)for(let u in n)u.startsWith("on")&&typeof n[u]=="function"?(r[u]!=null||(r[u]=[]),r[u].push(n[u])):o[u]=n[u];if(o.disabled||o["aria-disabled"])return Object.assign(o,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(o,{[n](u,...f){let a=r[n];for(let m of a){if((u instanceof Event||(u==null?void 0:u.nativeEvent)instanceof Event)&&u.defaultPrevented)return;m(u,...f)}}});return o}function vt(e){var o;return Object.assign(g.forwardRef(e),{displayName:(o=e.displayName)!=null?o:e.name})}function kr(e){let o=Object.assign({},e);for(let r in o)o[r]===void 0&&delete o[r];return o}function fo(e,o=[]){let r=Object.assign({},e);for(let n of o)n in r&&delete r[n];return r}let _s="div";var Pn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Pn||{});function Bs(e,o){var r;let{features:n=1,...u}=e,f={ref:o,"aria-hidden":(n&2)===2?!0:(r=u["aria-hidden"])!=null?r:void 0,hidden:(n&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",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return ht({ourProps:f,theirProps:u,slot:{},defaultTag:_s,name:"Hidden"})}let Un=vt(Bs),po=g.createContext(null);po.displayName="OpenClosedContext";var jt=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(jt||{});function Vn(){return g.useContext(po)}function mo({value:e,children:o}){return g.createElement(po.Provider,{value:e},o)}function zs(e){function o(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",o))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",o),o())}let Kt=[];zs(()=>{function e(o){o.target instanceof HTMLElement&&o.target!==document.body&&Kt[0]!==o.target&&(Kt.unshift(o.target),Kt=Kt.filter(r=>r!=null&&r.isConnected),Kt.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 Ir(e){let o=e.parentElement,r=null;for(;o&&!(o instanceof HTMLFieldSetElement);)o instanceof HTMLLegendElement&&(r=o),o=o.parentElement;let n=(o==null?void 0:o.getAttribute("disabled"))==="";return n&&Ws(r)?!1:n}function Ws(e){if(!e)return!1;let o=e.previousElementSibling;for(;o!==null;){if(o instanceof HTMLLegendElement)return!1;o=o.previousElementSibling}return!0}function Hs(e){throw new Error("Unexpected object: "+e)}var it=(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))(it||{});function ho(e,o){let r=o.resolveItems();if(r.length<=0)return null;let n=o.resolveActiveIndex(),u=n??-1;switch(e.focus){case 0:{for(let f=0;f<r.length;++f)if(!o.resolveDisabled(r[f],f,r))return f;return n}case 1:{for(let f=u-1;f>=0;--f)if(!o.resolveDisabled(r[f],f,r))return f;return n}case 2:{for(let f=u+1;f<r.length;++f)if(!o.resolveDisabled(r[f],f,r))return f;return n}case 3:{for(let f=r.length-1;f>=0;--f)if(!o.resolveDisabled(r[f],f,r))return f;return n}case 4:{for(let f=0;f<r.length;++f)if(o.resolveId(r[f],f,r)===e.id)return f;return n}case 5:return null;default:Hs(e)}}function Ri(e={},o=null,r=[]){for(let[n,u]of Object.entries(e))Ai(r,Li(o,n),u);return r}function Li(e,o){return e?e+"["+o+"]":o}function Ai(e,o,r){if(Array.isArray(r))for(let[n,u]of r.entries())Ai(e,Li(o,n.toString()),u);else r instanceof Date?e.push([o,r.toISOString()]):typeof r=="boolean"?e.push([o,r?"1":"0"]):typeof r=="string"?e.push([o,r]):typeof r=="number"?e.push([o,`${r}`]):r==null?e.push([o,""]):Ri(r,o,e)}function Us(e){var o,r;let n=(o=e==null?void 0:e.form)!=null?o:e.closest("form");if(n){for(let u of n.elements)if(u!==e&&(u.tagName==="INPUT"&&u.type==="submit"||u.tagName==="BUTTON"&&u.type==="submit"||u.nodeName==="INPUT"&&u.type==="image")){u.click();return}(r=n.requestSubmit)==null||r.call(n)}}var Xe=(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))(Xe||{}),Vs=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Vs||{}),Zs=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Zs||{}),Ys=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Ys||{}),Gs=(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))(Gs||{});function vo(e,o=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=o(e.options.slice()),u=n.length>0&&n[0].dataRef.current.order!==null?n.sort((a,m)=>a.dataRef.current.order-m.dataRef.current.order):ao(n,a=>a.dataRef.current.domRef.current),f=r?u.indexOf(r):null;return f===-1&&(f=null),{options:u,activeOptionIndex:f}}let qs={1(e){var o;return(o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var o,r;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===0)return e;if((r=e.dataRef.current)!=null&&r.value){let n=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(n!==-1)return{...e,activeOptionIndex:n,comboboxState:0}}return{...e,comboboxState:0}},2(e,o){var r,n,u,f,a;if((r=e.dataRef.current)!=null&&r.disabled||(n=e.dataRef.current)!=null&&n.optionsRef.current&&!((u=e.dataRef.current)!=null&&u.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let E=o.focus===it.Specific?o.idx:ho(o,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var P,C;return(C=(P=e.activeOptionIndex)!=null?P:e.virtual.options.findIndex(M=>!e.virtual.disabled(M)))!=null?C:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),k=(f=o.trigger)!=null?f:2;return e.activeOptionIndex===E&&e.activationTrigger===k?e:{...e,activeOptionIndex:E,activationTrigger:k}}let m=vo(e);if(m.activeOptionIndex===null){let E=m.options.findIndex(k=>!k.dataRef.current.disabled);E!==-1&&(m.activeOptionIndex=E)}let v=o.focus===it.Specific?o.idx:ho(o,{resolveItems:()=>m.options,resolveActiveIndex:()=>m.activeOptionIndex,resolveId:E=>E.id,resolveDisabled:E=>E.dataRef.current.disabled}),x=(a=o.trigger)!=null?a:2;return e.activeOptionIndex===v&&e.activationTrigger===x?e:{...e,...m,activeOptionIndex:v,activationTrigger:x}},3:(e,o)=>{var r,n,u;if((r=e.dataRef.current)!=null&&r.virtual)return{...e,options:[...e.options,o.payload]};let f=o.payload,a=vo(e,v=>(v.push(f),v));e.activeOptionIndex===null&&(n=e.dataRef.current)!=null&&n.isSelected(o.payload.dataRef.current.value)&&(a.activeOptionIndex=a.options.indexOf(f));let m={...e,...a,activationTrigger:2};return(u=e.dataRef.current)!=null&&u.__demoMode&&e.dataRef.current.value===void 0&&(m.activeOptionIndex=0),m},4:(e,o)=>{var r;if((r=e.dataRef.current)!=null&&r.virtual)return{...e,options:e.options.filter(u=>u.id!==o.id)};let n=vo(e,u=>{let f=u.findIndex(a=>a.id===o.id);return f!==-1&&u.splice(f,1),u});return{...e,...n,activationTrigger:2}},5:(e,o)=>e.labelId===o.id?e:{...e,labelId:o.id},6:(e,o)=>e.activationTrigger===o.trigger?e:{...e,activationTrigger:o.trigger},7:(e,o)=>{var r;if(((r=e.virtual)==null?void 0:r.options)===o.options)return e;let n=e.activeOptionIndex;if(e.activeOptionIndex!==null){let u=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);u!==-1?n=u:n=null}return{...e,activeOptionIndex:n,virtual:Object.assign({},e.virtual,{options:o.options})}}},go=g.createContext(null);go.displayName="ComboboxActionsContext";function Zn(e){let o=g.useContext(go);if(o===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Zn),r}return o}let Di=g.createContext(null);function Ks(e){var o;let r=Cn("VirtualProvider"),[n,u]=g.useMemo(()=>{let v=r.optionsRef.current;if(!v)return[0,0];let x=window.getComputedStyle(v);return[parseFloat(x.paddingBlockStart||x.paddingTop),parseFloat(x.paddingBlockEnd||x.paddingBottom)]},[r.optionsRef.current]),f=Ts({scrollPaddingStart:n,scrollPaddingEnd:u,count:r.virtual.options.length,estimateSize(){return 40},getScrollElement(){var v;return(v=r.optionsRef.current)!=null?v:null},overscan:12}),[a,m]=g.useState(0);return ot(()=>{m(v=>v+1)},[(o=r.virtual)==null?void 0:o.options]),g.createElement(Di.Provider,{value:f},g.createElement("div",{style:{position:"relative",width:"100%",height:`${f.getTotalSize()}px`},ref:v=>{if(v){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||r.activationTrigger===0)return;r.activeOptionIndex!==null&&r.virtual.options.length>r.activeOptionIndex&&f.scrollToIndex(r.activeOptionIndex)}}},f.getVirtualItems().map(v=>{var x;return g.createElement(g.Fragment,{key:v.key},g.cloneElement((x=e.children)==null?void 0:x.call(e,{option:r.virtual.options[v.index],open:r.comboboxState===0}),{key:`${a}-${v.key}`,"data-index":v.index,"aria-setsize":r.virtual.options.length,"aria-posinset":v.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${v.start}px)`,overflowAnchor:"none"}}))})))}let bo=g.createContext(null);bo.displayName="ComboboxDataContext";function Cn(e){let o=g.useContext(bo);if(o===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Cn),r}return o}function Xs(e,o){return xt(o.type,qs,e,o)}let Js=g.Fragment;function Qs(e,o){let{value:r,defaultValue:n,onChange:u,form:f,name:a,by:m=null,disabled:v=!1,__demoMode:x=!1,nullable:E=!1,multiple:k=!1,immediate:P=!1,virtual:C=null,...M}=e,R=!1,L=null,[B=k?[]:void 0,_]=yi(r,u,n),[z,X]=g.useReducer(Xs,{dataRef:g.createRef(),comboboxState:x?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),ee=g.useRef(!1),ue=g.useRef({static:!1,hold:!1}),we=g.useRef(null),Oe=g.useRef(null),be=g.useRef(null),y=g.useRef(null),he=ie(typeof m=="string"?(re,Ce)=>{let V=m;return(re==null?void 0:re[V])===(Ce==null?void 0:Ce[V])}:m??((re,Ce)=>re===Ce)),Pe=ie(re=>z.options.findIndex(Ce=>he(Ce.dataRef.current.value,re))),Ze=g.useCallback(re=>xt(Y.mode,{1:()=>B.some(Ce=>he(Ce,re)),0:()=>he(B,re)}),[B]),Ye=ie(re=>z.activeOptionIndex===Pe(re)),Y=g.useMemo(()=>({...z,immediate:R,optionsPropsRef:ue,labelRef:we,inputRef:Oe,buttonRef:be,optionsRef:y,value:B,defaultValue:n,disabled:v,mode:k?1:0,virtual:z.virtual,get activeOptionIndex(){if(ee.current&&z.activeOptionIndex===null&&z.options.length>0){let re=z.options.findIndex(Ce=>!Ce.dataRef.current.disabled);if(re!==-1)return re}return z.activeOptionIndex},calculateIndex:Pe,compare:he,isSelected:Ze,isActive:Ye,nullable:E,__demoMode:x}),[B,n,v,k,E,x,z,L]);ot(()=>{},[L,void 0]),ot(()=>{z.dataRef.current=Y},[Y]),uo([Y.buttonRef,Y.inputRef,Y.optionsRef],()=>St.closeCombobox(),Y.comboboxState===0);let Je=g.useMemo(()=>{var re,Ce,V;return{open:Y.comboboxState===0,disabled:v,activeIndex:Y.activeOptionIndex,activeOption:Y.activeOptionIndex===null?null:Y.virtual?Y.virtual.options[(re=Y.activeOptionIndex)!=null?re:0]:(V=(Ce=Y.options[Y.activeOptionIndex])==null?void 0:Ce.dataRef.current.value)!=null?V:null,value:B}},[Y,v,B]),Re=ie(()=>{if(Y.activeOptionIndex!==null){if(Y.virtual)lt(Y.virtual.options[Y.activeOptionIndex]);else{let{dataRef:re}=Y.options[Y.activeOptionIndex];lt(re.current.value)}St.goToOption(it.Specific,Y.activeOptionIndex)}}),q=ie(()=>{X({type:0}),ee.current=!0}),te=ie(()=>{X({type:1}),ee.current=!1}),ve=ie((re,Ce,V)=>(ee.current=!1,re===it.Specific?X({type:2,focus:it.Specific,idx:Ce,trigger:V}):X({type:2,focus:re,trigger:V}))),$e=ie((re,Ce)=>(X({type:3,payload:{id:re,dataRef:Ce}}),()=>{Y.isActive(Ce.current.value)&&(ee.current=!0),X({type:4,id:re})})),We=ie(re=>(X({type:5,id:re}),()=>X({type:5,id:null}))),lt=ie(re=>xt(Y.mode,{0(){return _==null?void 0:_(re)},1(){let Ce=Y.value.slice(),V=Ce.findIndex(Ee=>he(Ee,re));return V===-1?Ce.push(re):Ce.splice(V,1),_==null?void 0:_(Ce)}})),tt=ie(re=>{X({type:6,trigger:re})}),St=g.useMemo(()=>({onChange:lt,registerOption:$e,registerLabel:We,goToOption:ve,closeCombobox:te,openCombobox:q,setActivationTrigger:tt,selectActiveOption:Re}),[]),Lt=o===null?{}:{ref:o},ge=g.useRef(null),st=nn();return g.useEffect(()=>{ge.current&&n!==void 0&&st.addEventListener(ge.current,"reset",()=>{_==null||_(n)})},[ge,_]),g.createElement(go.Provider,{value:St},g.createElement(bo.Provider,{value:Y},g.createElement(mo,{value:xt(Y.comboboxState,{0:jt.Open,1:jt.Closed})},a!=null&&B!=null&&Ri({[a]:B}).map(([re,Ce],V)=>g.createElement(Un,{features:Pn.Hidden,ref:V===0?Ee=>{var ke;ge.current=(ke=Ee==null?void 0:Ee.closest("form"))!=null?ke:null}:void 0,...kr({key:re,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:f,disabled:v,name:re,value:Ce})})),ht({ourProps:Lt,theirProps:M,slot:Je,defaultTag:Js,name:"Combobox"}))))}let ea="input";function ta(e,o){var r,n,u,f,a;let m=Dt(),{id:v=`headlessui-combobox-input-${m}`,onChange:x,displayValue:E,type:k="text",...P}=e,C=Cn("Combobox.Input"),M=Zn("Combobox.Input"),R=Et(C.inputRef,o),L=Sn(C.inputRef),B=g.useRef(!1),_=nn(),z=ie(()=>{M.onChange(null),C.optionsRef.current&&(C.optionsRef.current.scrollTop=0),M.goToOption(it.Nothing)}),X=function(){var Y;return typeof E=="function"&&C.value!==void 0?(Y=E(C.value))!=null?Y:"":typeof C.value=="string"?C.value:""}();Hn(([Y,Je],[Re,q])=>{if(B.current)return;let te=C.inputRef.current;te&&((q===0&&Je===1||Y!==Re)&&(te.value=Y),requestAnimationFrame(()=>{if(B.current||!te||(L==null?void 0:L.activeElement)!==te)return;let{selectionStart:ve,selectionEnd:$e}=te;Math.abs(($e??0)-(ve??0))===0&&ve===0&&te.setSelectionRange(te.value.length,te.value.length)}))},[X,C.comboboxState,L]),Hn(([Y],[Je])=>{if(Y===0&&Je===1){if(B.current)return;let Re=C.inputRef.current;if(!Re)return;let q=Re.value,{selectionStart:te,selectionEnd:ve,selectionDirection:$e}=Re;Re.value="",Re.value=q,$e!==null?Re.setSelectionRange(te,ve,$e):Re.setSelectionRange(te,ve)}},[C.comboboxState]);let ee=g.useRef(!1),ue=ie(()=>{ee.current=!0}),we=ie(()=>{_.nextFrame(()=>{ee.current=!1})}),Oe=ie(Y=>{switch(B.current=!0,Y.key){case Xe.Enter:if(B.current=!1,C.comboboxState!==0||ee.current)return;if(Y.preventDefault(),Y.stopPropagation(),C.activeOptionIndex===null){M.closeCombobox();return}M.selectActiveOption(),C.mode===0&&M.closeCombobox();break;case Xe.ArrowDown:return B.current=!1,Y.preventDefault(),Y.stopPropagation(),xt(C.comboboxState,{0:()=>M.goToOption(it.Next),1:()=>M.openCombobox()});case Xe.ArrowUp:return B.current=!1,Y.preventDefault(),Y.stopPropagation(),xt(C.comboboxState,{0:()=>M.goToOption(it.Previous),1:()=>{M.openCombobox(),_.nextFrame(()=>{C.value||M.goToOption(it.Last)})}});case Xe.Home:if(Y.shiftKey)break;return B.current=!1,Y.preventDefault(),Y.stopPropagation(),M.goToOption(it.First);case Xe.PageUp:return B.current=!1,Y.preventDefault(),Y.stopPropagation(),M.goToOption(it.First);case Xe.End:if(Y.shiftKey)break;return B.current=!1,Y.preventDefault(),Y.stopPropagation(),M.goToOption(it.Last);case Xe.PageDown:return B.current=!1,Y.preventDefault(),Y.stopPropagation(),M.goToOption(it.Last);case Xe.Escape:return B.current=!1,C.comboboxState!==0?void 0:(Y.preventDefault(),C.optionsRef.current&&!C.optionsPropsRef.current.static&&Y.stopPropagation(),C.nullable&&C.mode===0&&C.value===null&&z(),M.closeCombobox());case Xe.Tab:if(B.current=!1,C.comboboxState!==0)return;C.mode===0&&C.activationTrigger!==1&&M.selectActiveOption(),M.closeCombobox();break}}),be=ie(Y=>{x==null||x(Y),C.nullable&&C.mode===0&&Y.target.value===""&&z(),M.openCombobox()}),y=ie(Y=>{var Je,Re,q;let te=(Je=Y.relatedTarget)!=null?Je:Kt.find(ve=>ve!==Y.currentTarget);if(B.current=!1,!((Re=C.optionsRef.current)!=null&&Re.contains(te))&&!((q=C.buttonRef.current)!=null&&q.contains(te))&&C.comboboxState===0)return Y.preventDefault(),C.mode===0&&(C.nullable&&C.value===null?z():C.activationTrigger!==1&&M.selectActiveOption()),M.closeCombobox()}),he=ie(Y=>{var Je,Re,q;let te=(Je=Y.relatedTarget)!=null?Je:Kt.find(ve=>ve!==Y.currentTarget);(Re=C.buttonRef.current)!=null&&Re.contains(te)||(q=C.optionsRef.current)!=null&&q.contains(te)||C.disabled||C.immediate&&C.comboboxState!==0&&(M.openCombobox(),_.nextFrame(()=>{M.setActivationTrigger(1)}))}),Pe=oo(()=>{if(C.labelId)return[C.labelId].join(" ")},[C.labelId]),Ze=g.useMemo(()=>({open:C.comboboxState===0,disabled:C.disabled}),[C]),Ye={ref:R,id:v,role:"combobox",type:k,"aria-controls":(r=C.optionsRef.current)==null?void 0:r.id,"aria-expanded":C.comboboxState===0,"aria-activedescendant":C.activeOptionIndex===null?void 0:C.virtual?(n=C.options.find(Y=>{var Je;return!((Je=C.virtual)!=null&&Je.disabled(Y.dataRef.current.value))&&C.compare(Y.dataRef.current.value,C.virtual.options[C.activeOptionIndex])}))==null?void 0:n.id:(u=C.options[C.activeOptionIndex])==null?void 0:u.id,"aria-labelledby":Pe,"aria-autocomplete":"list",defaultValue:(a=(f=e.defaultValue)!=null?f:C.defaultValue!==void 0?E==null?void 0:E(C.defaultValue):null)!=null?a:C.defaultValue,disabled:C.disabled,onCompositionStart:ue,onCompositionEnd:we,onKeyDown:Oe,onChange:be,onFocus:he,onBlur:y};return ht({ourProps:Ye,theirProps:P,slot:Ze,defaultTag:ea,name:"Combobox.Input"})}let na="button";function ra(e,o){var r;let n=Cn("Combobox.Button"),u=Zn("Combobox.Button"),f=Et(n.buttonRef,o),a=Dt(),{id:m=`headlessui-combobox-button-${a}`,...v}=e,x=nn(),E=ie(R=>{switch(R.key){case Xe.ArrowDown:return R.preventDefault(),R.stopPropagation(),n.comboboxState===1&&u.openCombobox(),x.nextFrame(()=>{var L;return(L=n.inputRef.current)==null?void 0:L.focus({preventScroll:!0})});case Xe.ArrowUp:return R.preventDefault(),R.stopPropagation(),n.comboboxState===1&&(u.openCombobox(),x.nextFrame(()=>{n.value||u.goToOption(it.Last)})),x.nextFrame(()=>{var L;return(L=n.inputRef.current)==null?void 0:L.focus({preventScroll:!0})});case Xe.Escape:return n.comboboxState!==0?void 0:(R.preventDefault(),n.optionsRef.current&&!n.optionsPropsRef.current.static&&R.stopPropagation(),u.closeCombobox(),x.nextFrame(()=>{var L;return(L=n.inputRef.current)==null?void 0:L.focus({preventScroll:!0})}));default:return}}),k=ie(R=>{if(Ir(R.currentTarget))return R.preventDefault();n.comboboxState===0?u.closeCombobox():(R.preventDefault(),u.openCombobox()),x.nextFrame(()=>{var L;return(L=n.inputRef.current)==null?void 0:L.focus({preventScroll:!0})})}),P=oo(()=>{if(n.labelId)return[n.labelId,m].join(" ")},[n.labelId,m]),C=g.useMemo(()=>({open:n.comboboxState===0,disabled:n.disabled,value:n.value}),[n]),M={ref:f,id:m,type:co(e,n.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(r=n.optionsRef.current)==null?void 0:r.id,"aria-expanded":n.comboboxState===0,"aria-labelledby":P,disabled:n.disabled,onClick:k,onKeyDown:E};return ht({ourProps:M,theirProps:v,slot:C,defaultTag:na,name:"Combobox.Button"})}let oa="label";function ia(e,o){let r=Dt(),{id:n=`headlessui-combobox-label-${r}`,...u}=e,f=Cn("Combobox.Label"),a=Zn("Combobox.Label"),m=Et(f.labelRef,o);ot(()=>a.registerLabel(n),[n]);let v=ie(()=>{var E;return(E=f.inputRef.current)==null?void 0:E.focus({preventScroll:!0})}),x=g.useMemo(()=>({open:f.comboboxState===0,disabled:f.disabled}),[f]);return ht({ourProps:{ref:m,id:n,onClick:v},theirProps:u,slot:x,defaultTag:oa,name:"Combobox.Label"})}let la="ul",sa=pn.RenderStrategy|pn.Static;function aa(e,o){let r=Dt(),{id:n=`headlessui-combobox-options-${r}`,hold:u=!1,...f}=e,a=Cn("Combobox.Options"),m=Et(a.optionsRef,o),v=Vn(),x=v!==null?(v&jt.Open)===jt.Open:a.comboboxState===0;ot(()=>{var C;a.optionsPropsRef.current.static=(C=e.static)!=null?C:!1},[a.optionsPropsRef,e.static]),ot(()=>{a.optionsPropsRef.current.hold=u},[a.optionsPropsRef,u]),Pi({container:a.optionsRef.current,enabled:a.comboboxState===0,accept(C){return C.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:C.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(C){C.setAttribute("role","none")}});let E=oo(()=>{var C,M;return(M=a.labelId)!=null?M:(C=a.buttonRef.current)==null?void 0:C.id},[a.labelId,a.buttonRef.current]),k=g.useMemo(()=>({open:a.comboboxState===0,option:void 0}),[a]),P={"aria-labelledby":E,role:"listbox","aria-multiselectable":a.mode===1?!0:void 0,id:n,ref:m};return a.virtual&&a.comboboxState===0&&Object.assign(f,{children:g.createElement(Ks,null,f.children)}),ht({ourProps:P,theirProps:f,slot:k,defaultTag:la,features:sa,visible:x,name:"Combobox.Options"})}let ua="li";function ca(e,o){var r;let n=Dt(),{id:u=`headlessui-combobox-option-${n}`,disabled:f=!1,value:a,order:m=null,...v}=e,x=Cn("Combobox.Option"),E=Zn("Combobox.Option"),k=x.virtual?x.activeOptionIndex===x.calculateIndex(a):x.activeOptionIndex===null?!1:((r=x.options[x.activeOptionIndex])==null?void 0:r.id)===u,P=x.isSelected(a),C=g.useRef(null),M=Vt({disabled:f,value:a,domRef:C,order:m}),R=g.useContext(Di),L=Et(o,C,R?R.measureElement:null),B=ie(()=>E.onChange(a));ot(()=>E.registerOption(u,M),[M,u]);let _=g.useRef(!(x.virtual||x.__demoMode));ot(()=>{if(!x.virtual||!x.__demoMode)return;let y=Wt();return y.requestAnimationFrame(()=>{_.current=!0}),y.dispose},[x.virtual,x.__demoMode]),ot(()=>{if(!_.current||x.comboboxState!==0||!k||x.activationTrigger===0)return;let y=Wt();return y.requestAnimationFrame(()=>{var he,Pe;(Pe=(he=C.current)==null?void 0:he.scrollIntoView)==null||Pe.call(he,{block:"nearest"})}),y.dispose},[C,k,x.comboboxState,x.activationTrigger,x.activeOptionIndex]);let z=ie(y=>{var he;if(f||(he=x.virtual)!=null&&he.disabled(a))return y.preventDefault();B(),Ti()||requestAnimationFrame(()=>{var Pe;return(Pe=x.inputRef.current)==null?void 0:Pe.focus({preventScroll:!0})}),x.mode===0&&requestAnimationFrame(()=>E.closeCombobox())}),X=ie(()=>{var y;if(f||(y=x.virtual)!=null&&y.disabled(a))return E.goToOption(it.Nothing);let he=x.calculateIndex(a);E.goToOption(it.Specific,he)}),ee=Mi(),ue=ie(y=>ee.update(y)),we=ie(y=>{var he;if(!ee.wasMoved(y)||f||(he=x.virtual)!=null&&he.disabled(a)||k)return;let Pe=x.calculateIndex(a);E.goToOption(it.Specific,Pe,0)}),Oe=ie(y=>{var he;ee.wasMoved(y)&&(f||(he=x.virtual)!=null&&he.disabled(a)||k&&(x.optionsPropsRef.current.hold||E.goToOption(it.Nothing)))}),be=g.useMemo(()=>({active:k,selected:P,disabled:f}),[k,P,f]);return ht({ourProps:{id:u,ref:L,role:"option",tabIndex:f===!0?void 0:-1,"aria-disabled":f===!0?!0:void 0,"aria-selected":P,disabled:void 0,onClick:z,onFocus:X,onPointerEnter:ue,onMouseEnter:ue,onPointerMove:we,onMouseMove:we,onPointerLeave:Oe,onMouseLeave:Oe},theirProps:v,slot:be,defaultTag:ua,name:"Combobox.Option"})}let da=vt(Qs),fa=vt(ra),pa=vt(ta),ma=vt(ia),ha=vt(aa),va=vt(ca),on=Object.assign(da,{Input:pa,Button:fa,Label:ma,Options:ha,Option:va});function $i(e,o,r,n){let u=Vt(r);g.useEffect(()=>{e=e??window;function f(a){u.current(a)}return e.addEventListener(o,f,n),()=>e.removeEventListener(o,f,n)},[e,o,n])}function Yn(){let e=g.useRef(!1);return ot(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function _i(e){let o=ie(e),r=g.useRef(!1);g.useEffect(()=>(r.current=!1,()=>{r.current=!0,Cr(()=>{r.current&&o()})}),[o])}var Gn=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Gn||{});function ga(){let e=g.useRef(0);return Ni("keydown",o=>{o.key==="Tab"&&(e.current=o.shiftKey?1:0)},!0),e}function Bi(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let o=new Set;for(let r of e.current)r.current instanceof HTMLElement&&o.add(r.current);return o}let ba="div";var zi=(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))(zi||{});function xa(e,o){let r=g.useRef(null),n=Et(r,o),{initialFocus:u,containers:f,features:a=30,...m}=e;Mn()||(a=1);let v=Sn(r);Ea({ownerDocument:v},!!(a&16));let x=Sa({ownerDocument:v,container:r,initialFocus:u},!!(a&2));Ca({ownerDocument:v,container:r,containers:f,previousActiveElement:x},!!(a&8));let E=ga(),k=ie(R=>{let L=r.current;L&&(B=>B())(()=>{xt(E.current,{[Gn.Forwards]:()=>{Wn(L,rn.First,{skipElements:[R.relatedTarget]})},[Gn.Backwards]:()=>{Wn(L,rn.Last,{skipElements:[R.relatedTarget]})}})})}),P=nn(),C=g.useRef(!1),M={ref:n,onKeyDown(R){R.key=="Tab"&&(C.current=!0,P.requestAnimationFrame(()=>{C.current=!1}))},onBlur(R){let L=Bi(f);r.current instanceof HTMLElement&&L.add(r.current);let B=R.relatedTarget;B instanceof HTMLElement&&B.dataset.headlessuiFocusGuard!=="true"&&(Wi(L,B)||(C.current?Wn(r.current,xt(E.current,{[Gn.Forwards]:()=>rn.Next,[Gn.Backwards]:()=>rn.Previous})|rn.WrapAround,{relativeTo:R.target}):R.target instanceof HTMLElement&&fn(R.target)))}};return g.createElement(g.Fragment,null,!!(a&4)&&g.createElement(Un,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:k,features:Pn.Focusable}),ht({ourProps:M,theirProps:m,defaultTag:ba,name:"FocusTrap"}),!!(a&4)&&g.createElement(Un,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:k,features:Pn.Focusable}))}let ya=vt(xa),qn=Object.assign(ya,{features:zi});function wa(e=!0){let o=g.useRef(Kt.slice());return Hn(([r],[n])=>{n===!0&&r===!1&&Cr(()=>{o.current.splice(0)}),n===!1&&r===!0&&(o.current=Kt.slice())},[e,Kt,o]),ie(()=>{var r;return(r=o.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function Ea({ownerDocument:e},o){let r=wa(o);Hn(()=>{o||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&fn(r())},[o]),_i(()=>{o&&fn(r())})}function Sa({ownerDocument:e,container:o,initialFocus:r},n){let u=g.useRef(null),f=Yn();return Hn(()=>{if(!n)return;let a=o.current;a&&Cr(()=>{if(!f.current)return;let m=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===m){u.current=m;return}}else if(a.contains(m)){u.current=m;return}r!=null&&r.current?fn(r.current):Wn(a,rn.First)===Ei.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),u.current=e==null?void 0:e.activeElement})},[n]),u}function Ca({ownerDocument:e,container:o,containers:r,previousActiveElement:n},u){let f=Yn();$i(e==null?void 0:e.defaultView,"focus",a=>{if(!u||!f.current)return;let m=Bi(r);o.current instanceof HTMLElement&&m.add(o.current);let v=n.current;if(!v)return;let x=a.target;x&&x instanceof HTMLElement?Wi(m,x)?(n.current=x,fn(x)):(a.preventDefault(),a.stopPropagation(),fn(v)):fn(n.current)},!0)}function Wi(e,o){for(let r of e)if(r.contains(o))return!0;return!1}let Hi=g.createContext(!1);function ja(){return g.useContext(Hi)}function xo(e){return g.createElement(Hi.Provider,{value:e.force},e.children)}function Ta(e){let o=ja(),r=g.useContext(Ui),n=Sn(e),[u,f]=g.useState(()=>{if(!o&&r!==null||tn.isServer)return null;let a=n==null?void 0:n.getElementById("headlessui-portal-root");if(a)return a;if(n===null)return null;let m=n.createElement("div");return m.setAttribute("id","headlessui-portal-root"),n.body.appendChild(m)});return g.useEffect(()=>{u!==null&&(n!=null&&n.body.contains(u)||n==null||n.body.appendChild(u))},[u,n]),g.useEffect(()=>{o||r!==null&&f(r.current)},[r,f,o]),u}let Na=g.Fragment;function Oa(e,o){let r=e,n=g.useRef(null),u=Et(Ds(E=>{n.current=E}),o),f=Sn(n),a=Ta(n),[m]=g.useState(()=>{var E;return tn.isServer?null:(E=f==null?void 0:f.createElement("div"))!=null?E:null}),v=g.useContext(yo),x=Mn();return ot(()=>{!a||!m||a.contains(m)||(m.setAttribute("data-headlessui-portal",""),a.appendChild(m))},[a,m]),ot(()=>{if(m&&v)return v.register(m)},[v,m]),_i(()=>{var E;!a||!m||(m instanceof Node&&a.contains(m)&&a.removeChild(m),a.childNodes.length<=0&&((E=a.parentElement)==null||E.removeChild(a)))}),x?!a||!m?null:Sr.createPortal(ht({ourProps:{ref:u},theirProps:r,defaultTag:Na,name:"Portal"}),m):null}let ka=g.Fragment,Ui=g.createContext(null);function Ia(e,o){let{target:r,...n}=e,u={ref:Et(o)};return g.createElement(Ui.Provider,{value:r},ht({ourProps:u,theirProps:n,defaultTag:ka,name:"Popover.Group"}))}let yo=g.createContext(null);function Ma(){let e=g.useContext(yo),o=g.useRef([]),r=ie(f=>(o.current.push(f),e&&e.register(f),()=>n(f))),n=ie(f=>{let a=o.current.indexOf(f);a!==-1&&o.current.splice(a,1),e&&e.unregister(f)}),u=g.useMemo(()=>({register:r,unregister:n,portals:o}),[r,n,o]);return[o,g.useMemo(()=>function({children:f}){return g.createElement(yo.Provider,{value:u},f)},[u])]}let Pa=vt(Oa),Fa=vt(Ia),wo=Object.assign(Pa,{Group:Fa});function Ra(e,o){return e===o&&(e!==0||1/e===1/o)||e!==e&&o!==o}const La=typeof Object.is=="function"?Object.is:Ra,{useState:Aa,useEffect:Da,useLayoutEffect:$a,useDebugValue:_a}=Z;function Ba(e,o,r){const n=o(),[{inst:u},f]=Aa({inst:{value:n,getSnapshot:o}});return $a(()=>{u.value=n,u.getSnapshot=o,Eo(u)&&f({inst:u})},[e,n,o]),Da(()=>(Eo(u)&&f({inst:u}),e(()=>{Eo(u)&&f({inst:u})})),[e]),_a(n),n}function Eo(e){const o=e.getSnapshot,r=e.value;try{const n=o();return!La(r,n)}catch{return!0}}function za(e,o,r){return o()}const Wa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ha=!Wa,Ua=Ha?za:Ba,Va="useSyncExternalStore"in Z?(e=>e.useSyncExternalStore)(Z):Ua;function Za(e){return Va(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ya(e,o){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(u){return n.add(u),()=>n.delete(u)},dispatch(u,...f){let a=o[u].call(r,...f);a&&(r=a,n.forEach(m=>m()))}}}function Ga(){let e;return{before({doc:o}){var r;let n=o.documentElement;e=((r=o.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:o,d:r}){let n=o.documentElement,u=n.clientWidth-n.offsetWidth,f=e-u;r.style(n,"paddingRight",`${f}px`)}}}function qa(){return ji()?{before({doc:e,d:o,meta:r}){function n(u){return r.containers.flatMap(f=>f()).some(f=>f.contains(u))}o.microTask(()=>{var u;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let m=Wt();m.style(e.documentElement,"scrollBehavior","auto"),o.add(()=>o.microTask(()=>m.dispose()))}let f=(u=window.scrollY)!=null?u:window.pageYOffset,a=null;o.addEventListener(e,"click",m=>{if(m.target instanceof HTMLElement)try{let v=m.target.closest("a");if(!v)return;let{hash:x}=new URL(v.href),E=e.querySelector(x);E&&!n(E)&&(a=E)}catch{}},!0),o.addEventListener(e,"touchstart",m=>{if(m.target instanceof HTMLElement)if(n(m.target)){let v=m.target;for(;v.parentElement&&n(v.parentElement);)v=v.parentElement;o.style(v,"overscrollBehavior","contain")}else o.style(m.target,"touchAction","none")}),o.addEventListener(e,"touchmove",m=>{if(m.target instanceof HTMLElement)if(n(m.target)){let v=m.target;for(;v.parentElement&&v.dataset.headlessuiPortal!==""&&!(v.scrollHeight>v.clientHeight||v.scrollWidth>v.clientWidth);)v=v.parentElement;v.dataset.headlessuiPortal===""&&m.preventDefault()}else m.preventDefault()},{passive:!1}),o.add(()=>{var m;let v=(m=window.scrollY)!=null?m:window.pageYOffset;f!==v&&window.scrollTo(0,f),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function Ka(){return{before({doc:e,d:o}){o.style(e.documentElement,"overflow","hidden")}}}function Xa(e){let o={};for(let r of e)Object.assign(o,r(o));return o}let jn=Ya(()=>new Map,{PUSH(e,o){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Wt(),meta:new Set};return n.count++,n.meta.add(o),this.set(e,n),this},POP(e,o){let r=this.get(e);return r&&(r.count--,r.meta.delete(o)),this},SCROLL_PREVENT({doc:e,d:o,meta:r}){let n={doc:e,d:o,meta:Xa(r)},u=[qa(),Ga(),Ka()];u.forEach(({before:f})=>f==null?void 0:f(n)),u.forEach(({after:f})=>f==null?void 0:f(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});jn.subscribe(()=>{let e=jn.getSnapshot(),o=new Map;for(let[r]of e)o.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=o.get(r.doc)==="hidden",u=r.count!==0;(u&&!n||!u&&n)&&jn.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&jn.dispatch("TEARDOWN",r)}});function Ja(e,o,r){let n=Za(jn),u=e?n.get(e):void 0,f=u?u.count>0:!1;return ot(()=>{if(!(!e||!o))return jn.dispatch("PUSH",e,r),()=>jn.dispatch("POP",e,r)},[o,e]),f}let So=new Map,Kn=new Map;function Vi(e,o=!0){ot(()=>{var r;if(!o)return;let n=typeof e=="function"?e():e.current;if(!n)return;function u(){var a;if(!n)return;let m=(a=Kn.get(n))!=null?a:1;if(m===1?Kn.delete(n):Kn.set(n,m-1),m!==1)return;let v=So.get(n);v&&(v["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",v["aria-hidden"]),n.inert=v.inert,So.delete(n))}let f=(r=Kn.get(n))!=null?r:0;return Kn.set(n,f+1),f!==0||(So.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),u},[e,o])}function Qa({defaultContainers:e=[],portals:o,mainTreeNodeRef:r}={}){var n;let u=g.useRef((n=r==null?void 0:r.current)!=null?n:null),f=Sn(u),a=ie(()=>{var m,v,x;let E=[];for(let k of e)k!==null&&(k instanceof HTMLElement?E.push(k):"current"in k&&k.current instanceof HTMLElement&&E.push(k.current));if(o!=null&&o.current)for(let k of o.current)E.push(k);for(let k of(m=f==null?void 0:f.querySelectorAll("html > *, body > *"))!=null?m:[])k!==document.body&&k!==document.head&&k instanceof HTMLElement&&k.id!=="headlessui-portal-root"&&(k.contains(u.current)||k.contains((x=(v=u.current)==null?void 0:v.getRootNode())==null?void 0:x.host)||E.some(P=>k.contains(P))||E.push(k));return E});return{resolveContainers:a,contains:ie(m=>a().some(v=>v.contains(m))),mainTreeNodeRef:u,MainTreeNode:g.useMemo(()=>function(){return r!=null?null:g.createElement(Un,{features:Pn.Hidden,ref:u})},[u,r])}}let Co=g.createContext(()=>{});Co.displayName="StackContext";var jo=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(jo||{});function eu(){return g.useContext(Co)}function tu({children:e,onUpdate:o,type:r,element:n,enabled:u}){let f=eu(),a=ie((...m)=>{o==null||o(...m),f(...m)});return ot(()=>{let m=u===void 0||u===!0;return m&&a(0,r,n),()=>{m&&a(1,r,n)}},[a,r,n,u]),g.createElement(Co.Provider,{value:a},e)}let Zi=g.createContext(null);function Yi(){let e=g.useContext(Zi);if(e===null){let o=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Yi),o}return e}function Gi(){let[e,o]=g.useState([]);return[e.length>0?e.join(" "):void 0,g.useMemo(()=>function(r){let n=ie(f=>(o(a=>[...a,f]),()=>o(a=>{let m=a.slice(),v=m.indexOf(f);return v!==-1&&m.splice(v,1),m}))),u=g.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return g.createElement(Zi.Provider,{value:u},r.children)},[o])]}let nu="p";function ru(e,o){let r=Dt(),{id:n=`headlessui-description-${r}`,...u}=e,f=Yi(),a=Et(o);ot(()=>f.register(n),[n,f.register]);let m={ref:a,...f.props,id:n};return ht({ourProps:m,theirProps:u,slot:f.slot||{},defaultTag:nu,name:f.name||"Description"})}let ou=vt(ru),qi=Object.assign(ou,{});var iu=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(iu||{}),lu=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(lu||{});let su={0(e,o){return e.titleId===o.id?e:{...e,titleId:o.id}}},Mr=g.createContext(null);Mr.displayName="DialogContext";function Xn(e){let o=g.useContext(Mr);if(o===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Xn),r}return o}function au(e,o,r=()=>[document.body]){Ja(e,o,n=>{var u;return{containers:[...(u=n.containers)!=null?u:[],r]}})}function uu(e,o){return xt(o.type,su,e,o)}let cu="div",du=pn.RenderStrategy|pn.Static;function fu(e,o){let r=Dt(),{id:n=`headlessui-dialog-${r}`,open:u,onClose:f,initialFocus:a,role:m="dialog",__demoMode:v=!1,...x}=e,[E,k]=g.useState(0),P=g.useRef(!1);m=function(){return m==="dialog"||m==="alertdialog"?m:(P.current||(P.current=!0,console.warn(`Invalid role [${m}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let C=Vn();u===void 0&&C!==null&&(u=(C&jt.Open)===jt.Open);let M=g.useRef(null),R=Et(M,o),L=Sn(M),B=e.hasOwnProperty("open")||C!==null,_=e.hasOwnProperty("onClose");if(!B&&!_)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!B)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!_)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof u!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${u}`);if(typeof f!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${f}`);let z=u?0:1,[X,ee]=g.useReducer(uu,{titleId:null,descriptionId:null,panelRef:g.createRef()}),ue=ie(()=>f(!1)),we=ie(V=>ee({type:0,id:V})),Oe=Mn()?v?!1:z===0:!1,be=E>1,y=g.useContext(Mr)!==null,[he,Pe]=Ma(),Ze={get current(){var V;return(V=X.panelRef.current)!=null?V:M.current}},{resolveContainers:Ye,mainTreeNodeRef:Y,MainTreeNode:Je}=Qa({portals:he,defaultContainers:[Ze]}),Re=be?"parent":"leaf",q=C!==null?(C&jt.Closing)===jt.Closing:!1,te=y||q?!1:Oe,ve=g.useCallback(()=>{var V,Ee;return(Ee=Array.from((V=L==null?void 0:L.querySelectorAll("body > *"))!=null?V:[]).find(ke=>ke.id==="headlessui-portal-root"?!1:ke.contains(Y.current)&&ke instanceof HTMLElement))!=null?Ee:null},[Y]);Vi(ve,te);let $e=be?!0:Oe,We=g.useCallback(()=>{var V,Ee;return(Ee=Array.from((V=L==null?void 0:L.querySelectorAll("[data-headlessui-portal]"))!=null?V:[]).find(ke=>ke.contains(Y.current)&&ke instanceof HTMLElement))!=null?Ee:null},[Y]);Vi(We,$e),uo(Ye,V=>{V.preventDefault(),ue()},!(!Oe||be));let tt=!(be||z!==0);$i(L==null?void 0:L.defaultView,"keydown",V=>{tt&&(V.defaultPrevented||V.key===Xe.Escape&&(V.preventDefault(),V.stopPropagation(),ue()))}),au(L,!(q||z!==0||y),Ye),g.useEffect(()=>{if(z!==0||!M.current)return;let V=new ResizeObserver(Ee=>{for(let ke of Ee){let Fe=ke.target.getBoundingClientRect();Fe.x===0&&Fe.y===0&&Fe.width===0&&Fe.height===0&&ue()}});return V.observe(M.current),()=>V.disconnect()},[z,M,ue]);let[Lt,ge]=Gi(),st=g.useMemo(()=>[{dialogState:z,close:ue,setTitleId:we},X],[z,X,ue,we]),re=g.useMemo(()=>({open:z===0}),[z]),Ce={ref:R,id:n,role:m,"aria-modal":z===0?!0:void 0,"aria-labelledby":X.titleId,"aria-describedby":Lt};return g.createElement(tu,{type:"Dialog",enabled:z===0,element:M,onUpdate:ie((V,Ee)=>{Ee==="Dialog"&&xt(V,{[jo.Add]:()=>k(ke=>ke+1),[jo.Remove]:()=>k(ke=>ke-1)})})},g.createElement(xo,{force:!0},g.createElement(wo,null,g.createElement(Mr.Provider,{value:st},g.createElement(wo.Group,{target:M},g.createElement(xo,{force:!1},g.createElement(ge,{slot:re,name:"Dialog.Description"},g.createElement(qn,{initialFocus:a,containers:Ye,features:Oe?xt(Re,{parent:qn.features.RestoreFocus,leaf:qn.features.All&~qn.features.FocusLock}):qn.features.None},g.createElement(Pe,null,ht({ourProps:Ce,theirProps:x,slot:re,defaultTag:cu,features:du,visible:z===0,name:"Dialog"}))))))))),g.createElement(Je,null))}let pu="div";function mu(e,o){let r=Dt(),{id:n=`headlessui-dialog-overlay-${r}`,...u}=e,[{dialogState:f,close:a}]=Xn("Dialog.Overlay"),m=Et(o),v=ie(E=>{if(E.target===E.currentTarget){if(Ir(E.currentTarget))return E.preventDefault();E.preventDefault(),E.stopPropagation(),a()}}),x=g.useMemo(()=>({open:f===0}),[f]);return ht({ourProps:{ref:m,id:n,"aria-hidden":!0,onClick:v},theirProps:u,slot:x,defaultTag:pu,name:"Dialog.Overlay"})}let hu="div";function vu(e,o){let r=Dt(),{id:n=`headlessui-dialog-backdrop-${r}`,...u}=e,[{dialogState:f},a]=Xn("Dialog.Backdrop"),m=Et(o);g.useEffect(()=>{if(a.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let v=g.useMemo(()=>({open:f===0}),[f]);return g.createElement(xo,{force:!0},g.createElement(wo,null,ht({ourProps:{ref:m,id:n,"aria-hidden":!0},theirProps:u,slot:v,defaultTag:hu,name:"Dialog.Backdrop"})))}let gu="div";function bu(e,o){let r=Dt(),{id:n=`headlessui-dialog-panel-${r}`,...u}=e,[{dialogState:f},a]=Xn("Dialog.Panel"),m=Et(o,a.panelRef),v=g.useMemo(()=>({open:f===0}),[f]),x=ie(E=>{E.stopPropagation()});return ht({ourProps:{ref:m,id:n,onClick:x},theirProps:u,slot:v,defaultTag:gu,name:"Dialog.Panel"})}let xu="h2";function yu(e,o){let r=Dt(),{id:n=`headlessui-dialog-title-${r}`,...u}=e,[{dialogState:f,setTitleId:a}]=Xn("Dialog.Title"),m=Et(o);g.useEffect(()=>(a(n),()=>a(null)),[n,a]);let v=g.useMemo(()=>({open:f===0}),[f]);return ht({ourProps:{ref:m,id:n},theirProps:u,slot:v,defaultTag:xu,name:"Dialog.Title"})}let wu=vt(fu),Eu=vt(vu),Su=vt(bu),Cu=vt(mu),ju=vt(yu),Ki=Object.assign(wu,{Backdrop:Eu,Panel:Su,Overlay:Cu,Title:ju,Description:qi}),Xi=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Ji(e){var o,r;let n=(o=e.innerText)!=null?o:"",u=e.cloneNode(!0);if(!(u instanceof HTMLElement))return n;let f=!1;for(let m of u.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))m.remove(),f=!0;let a=f?(r=u.innerText)!=null?r:"":n;return Xi.test(a)&&(a=a.replace(Xi,"")),a}function Tu(e){let o=e.getAttribute("aria-label");if(typeof o=="string")return o.trim();let r=e.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(u=>{let f=document.getElementById(u);if(f){let a=f.getAttribute("aria-label");return typeof a=="string"?a.trim():Ji(f).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return Ji(e).trim()}function Nu(e){let o=g.useRef(""),r=g.useRef("");return ie(()=>{let n=e.current;if(!n)return"";let u=n.innerText;if(o.current===u)return r.current;let f=Tu(n).trim().toLowerCase();return o.current=u,r.current=f,f})}var Ou=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ou||{}),ku=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ku||{}),Iu=(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))(Iu||{});function To(e,o=r=>r){let r=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,n=ao(o(e.items.slice()),f=>f.dataRef.current.domRef.current),u=r?n.indexOf(r):null;return u===-1&&(u=null),{items:n,activeItemIndex:u}}let Mu={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,o)=>{var r;let n=To(e),u=ho(o,{resolveItems:()=>n.items,resolveActiveIndex:()=>n.activeItemIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});return{...e,...n,searchQuery:"",activeItemIndex:u,activationTrigger:(r=o.trigger)!=null?r:1}},3:(e,o)=>{let r=e.searchQuery!==""?0:1,n=e.searchQuery+o.value.toLowerCase(),u=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+r).concat(e.items.slice(0,e.activeItemIndex+r)):e.items).find(a=>{var m;return((m=a.dataRef.current.textValue)==null?void 0:m.startsWith(n))&&!a.dataRef.current.disabled}),f=u?e.items.indexOf(u):-1;return f===-1||f===e.activeItemIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeItemIndex:f,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,o)=>{let r=To(e,n=>[...n,{id:o.id,dataRef:o.dataRef}]);return{...e,...r}},6:(e,o)=>{let r=To(e,n=>{let u=n.findIndex(f=>f.id===o.id);return u!==-1&&n.splice(u,1),n});return{...e,...r,activationTrigger:1}}},No=g.createContext(null);No.displayName="MenuContext";function Pr(e){let o=g.useContext(No);if(o===null){let r=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Pr),r}return o}function Pu(e,o){return xt(o.type,Mu,e,o)}let Fu=g.Fragment;function Ru(e,o){let{__demoMode:r=!1,...n}=e,u=g.useReducer(Pu,{__demoMode:r,menuState:r?0:1,buttonRef:g.createRef(),itemsRef:g.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:f,itemsRef:a,buttonRef:m},v]=u,x=Et(o);uo([m,a],(C,M)=>{var R;v({type:1}),so(M,lo.Loose)||(C.preventDefault(),(R=m.current)==null||R.focus())},f===0);let E=ie(()=>{v({type:1})}),k=g.useMemo(()=>({open:f===0,close:E}),[f,E]),P={ref:x};return g.createElement(No.Provider,{value:u},g.createElement(mo,{value:xt(f,{0:jt.Open,1:jt.Closed})},ht({ourProps:P,theirProps:n,slot:k,defaultTag:Fu,name:"Menu"})))}let Lu="button";function Au(e,o){var r;let n=Dt(),{id:u=`headlessui-menu-button-${n}`,...f}=e,[a,m]=Pr("Menu.Button"),v=Et(a.buttonRef,o),x=nn(),E=ie(R=>{switch(R.key){case Xe.Space:case Xe.Enter:case Xe.ArrowDown:R.preventDefault(),R.stopPropagation(),m({type:0}),x.nextFrame(()=>m({type:2,focus:it.First}));break;case Xe.ArrowUp:R.preventDefault(),R.stopPropagation(),m({type:0}),x.nextFrame(()=>m({type:2,focus:it.Last}));break}}),k=ie(R=>{switch(R.key){case Xe.Space:R.preventDefault();break}}),P=ie(R=>{if(Ir(R.currentTarget))return R.preventDefault();e.disabled||(a.menuState===0?(m({type:1}),x.nextFrame(()=>{var L;return(L=a.buttonRef.current)==null?void 0:L.focus({preventScroll:!0})})):(R.preventDefault(),m({type:0})))}),C=g.useMemo(()=>({open:a.menuState===0}),[a]),M={ref:v,id:u,type:co(e,a.buttonRef),"aria-haspopup":"menu","aria-controls":(r=a.itemsRef.current)==null?void 0:r.id,"aria-expanded":a.menuState===0,onKeyDown:E,onKeyUp:k,onClick:P};return ht({ourProps:M,theirProps:f,slot:C,defaultTag:Lu,name:"Menu.Button"})}let Du="div",$u=pn.RenderStrategy|pn.Static;function _u(e,o){var r,n;let u=Dt(),{id:f=`headlessui-menu-items-${u}`,...a}=e,[m,v]=Pr("Menu.Items"),x=Et(m.itemsRef,o),E=Sn(m.itemsRef),k=nn(),P=Vn(),C=P!==null?(P&jt.Open)===jt.Open:m.menuState===0;g.useEffect(()=>{let _=m.itemsRef.current;_&&m.menuState===0&&_!==(E==null?void 0:E.activeElement)&&_.focus({preventScroll:!0})},[m.menuState,m.itemsRef,E]),Pi({container:m.itemsRef.current,enabled:m.menuState===0,accept(_){return _.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:_.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(_){_.setAttribute("role","none")}});let M=ie(_=>{var z,X;switch(k.dispose(),_.key){case Xe.Space:if(m.searchQuery!=="")return _.preventDefault(),_.stopPropagation(),v({type:3,value:_.key});case Xe.Enter:if(_.preventDefault(),_.stopPropagation(),v({type:1}),m.activeItemIndex!==null){let{dataRef:ee}=m.items[m.activeItemIndex];(X=(z=ee.current)==null?void 0:z.domRef.current)==null||X.click()}Ci(m.buttonRef.current);break;case Xe.ArrowDown:return _.preventDefault(),_.stopPropagation(),v({type:2,focus:it.Next});case Xe.ArrowUp:return _.preventDefault(),_.stopPropagation(),v({type:2,focus:it.Previous});case Xe.Home:case Xe.PageUp:return _.preventDefault(),_.stopPropagation(),v({type:2,focus:it.First});case Xe.End:case Xe.PageDown:return _.preventDefault(),_.stopPropagation(),v({type:2,focus:it.Last});case Xe.Escape:_.preventDefault(),_.stopPropagation(),v({type:1}),Wt().nextFrame(()=>{var ee;return(ee=m.buttonRef.current)==null?void 0:ee.focus({preventScroll:!0})});break;case Xe.Tab:_.preventDefault(),_.stopPropagation(),v({type:1}),Wt().nextFrame(()=>{Ls(m.buttonRef.current,_.shiftKey?rn.Previous:rn.Next)});break;default:_.key.length===1&&(v({type:3,value:_.key}),k.setTimeout(()=>v({type:4}),350));break}}),R=ie(_=>{switch(_.key){case Xe.Space:_.preventDefault();break}}),L=g.useMemo(()=>({open:m.menuState===0}),[m]),B={"aria-activedescendant":m.activeItemIndex===null||(r=m.items[m.activeItemIndex])==null?void 0:r.id,"aria-labelledby":(n=m.buttonRef.current)==null?void 0:n.id,id:f,onKeyDown:M,onKeyUp:R,role:"menu",tabIndex:0,ref:x};return ht({ourProps:B,theirProps:a,slot:L,defaultTag:Du,features:$u,visible:C,name:"Menu.Items"})}let Bu=g.Fragment;function zu(e,o){let r=Dt(),{id:n=`headlessui-menu-item-${r}`,disabled:u=!1,...f}=e,[a,m]=Pr("Menu.Item"),v=a.activeItemIndex!==null?a.items[a.activeItemIndex].id===n:!1,x=g.useRef(null),E=Et(o,x);ot(()=>{if(a.__demoMode||a.menuState!==0||!v||a.activationTrigger===0)return;let ee=Wt();return ee.requestAnimationFrame(()=>{var ue,we;(we=(ue=x.current)==null?void 0:ue.scrollIntoView)==null||we.call(ue,{block:"nearest"})}),ee.dispose},[a.__demoMode,x,v,a.menuState,a.activationTrigger,a.activeItemIndex]);let k=Nu(x),P=g.useRef({disabled:u,domRef:x,get textValue(){return k()}});ot(()=>{P.current.disabled=u},[P,u]),ot(()=>(m({type:5,id:n,dataRef:P}),()=>m({type:6,id:n})),[P,n]);let C=ie(()=>{m({type:1})}),M=ie(ee=>{if(u)return ee.preventDefault();m({type:1}),Ci(a.buttonRef.current)}),R=ie(()=>{if(u)return m({type:2,focus:it.Nothing});m({type:2,focus:it.Specific,id:n})}),L=Mi(),B=ie(ee=>L.update(ee)),_=ie(ee=>{L.wasMoved(ee)&&(u||v||m({type:2,focus:it.Specific,id:n,trigger:0}))}),z=ie(ee=>{L.wasMoved(ee)&&(u||v&&m({type:2,focus:it.Nothing}))}),X=g.useMemo(()=>({active:v,disabled:u,close:C}),[v,u,C]);return ht({ourProps:{id:n,ref:E,role:"menuitem",tabIndex:u===!0?void 0:-1,"aria-disabled":u===!0?!0:void 0,disabled:void 0,onClick:M,onFocus:R,onPointerEnter:B,onMouseEnter:B,onPointerMove:_,onMouseMove:_,onPointerLeave:z,onMouseLeave:z},theirProps:f,slot:X,defaultTag:Bu,name:"Menu.Item"})}let Wu=vt(Ru),Hu=vt(Au),Uu=vt(_u),Vu=vt(zu),Fr=Object.assign(Wu,{Button:Hu,Items:Uu,Item:Vu}),Qi=g.createContext(null);function el(){let e=g.useContext(Qi);if(e===null){let o=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(o,el),o}return e}function Zu(){let[e,o]=g.useState([]);return[e.length>0?e.join(" "):void 0,g.useMemo(()=>function(r){let n=ie(f=>(o(a=>[...a,f]),()=>o(a=>{let m=a.slice(),v=m.indexOf(f);return v!==-1&&m.splice(v,1),m}))),u=g.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return g.createElement(Qi.Provider,{value:u},r.children)},[o])]}let Yu="label";function Gu(e,o){let r=Dt(),{id:n=`headlessui-label-${r}`,passive:u=!1,...f}=e,a=el(),m=Et(o);ot(()=>a.register(n),[n,a.register]);let v={ref:m,...a.props,id:n};return u&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in f&&delete f.onClick),ht({ourProps:v,theirProps:f,slot:a.slot||{},defaultTag:Yu,name:a.name||"Label"})}let qu=vt(Gu),Ku=Object.assign(qu,{});function Xu(e=0){let[o,r]=g.useState(e),n=Yn(),u=g.useCallback(v=>{n.current&&r(x=>x|v)},[o,n]),f=g.useCallback(v=>!!(o&v),[o]),a=g.useCallback(v=>{n.current&&r(x=>x&~v)},[r,n]),m=g.useCallback(v=>{n.current&&r(x=>x^v)},[r]);return{flags:o,addFlag:u,hasFlag:f,removeFlag:a,toggleFlag:m}}let Oo=g.createContext(null);Oo.displayName="GroupContext";let Ju=g.Fragment;function Qu(e){var o;let[r,n]=g.useState(null),[u,f]=Zu(),[a,m]=Gi(),v=g.useMemo(()=>({switch:r,setSwitch:n,labelledby:u,describedby:a}),[r,n,u,a]),x={},E=e;return g.createElement(m,{name:"Switch.Description"},g.createElement(f,{name:"Switch.Label",props:{htmlFor:(o=v.switch)==null?void 0:o.id,onClick(k){r&&(k.currentTarget.tagName==="LABEL"&&k.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},g.createElement(Oo.Provider,{value:v},ht({ourProps:x,theirProps:E,defaultTag:Ju,name:"Switch.Group"}))))}let ec="button";function tc(e,o){var r;let n=Dt(),{id:u=`headlessui-switch-${n}`,checked:f,defaultChecked:a=!1,onChange:m,disabled:v=!1,name:x,value:E,form:k,...P}=e,C=g.useContext(Oo),M=g.useRef(null),R=Et(M,o,C===null?null:C.setSwitch),[L,B]=yi(f,m,a),_=ie(()=>B==null?void 0:B(!L)),z=ie(be=>{if(Ir(be.currentTarget))return be.preventDefault();be.preventDefault(),_()}),X=ie(be=>{be.key===Xe.Space?(be.preventDefault(),_()):be.key===Xe.Enter&&Us(be.currentTarget)}),ee=ie(be=>be.preventDefault()),ue=g.useMemo(()=>({checked:L}),[L]),we={id:u,ref:R,role:"switch",type:co(e,M),tabIndex:e.tabIndex===-1?0:(r=e.tabIndex)!=null?r:0,"aria-checked":L,"aria-labelledby":C==null?void 0:C.labelledby,"aria-describedby":C==null?void 0:C.describedby,disabled:v,onClick:z,onKeyUp:X,onKeyPress:ee},Oe=nn();return g.useEffect(()=>{var be;let y=(be=M.current)==null?void 0:be.closest("form");y&&a!==void 0&&Oe.addEventListener(y,"reset",()=>{B(a)})},[M,B]),g.createElement(g.Fragment,null,x!=null&&L&&g.createElement(Un,{features:Pn.Hidden,...kr({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:v,form:k,checked:L,name:x,value:E})}),ht({ourProps:we,theirProps:P,slot:ue,defaultTag:ec,name:"Switch"}))}let nc=vt(tc),rc=Qu,oc=Object.assign(nc,{Group:rc,Label:Ku,Description:qi});function ic(e){let o={called:!1};return(...r)=>{if(!o.called)return o.called=!0,e(...r)}}function ko(e,...o){e&&o.length>0&&e.classList.add(...o)}function Io(e,...o){e&&o.length>0&&e.classList.remove(...o)}function lc(e,o){let r=Wt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:u}=getComputedStyle(e),[f,a]=[n,u].map(v=>{let[x=0]=v.split(",").filter(Boolean).map(E=>E.includes("ms")?parseFloat(E):parseFloat(E)*1e3).sort((E,k)=>k-E);return x}),m=f+a;if(m!==0){r.group(x=>{x.setTimeout(()=>{o(),x.dispose()},m),x.addEventListener(e,"transitionrun",E=>{E.target===E.currentTarget&&x.dispose()})});let v=r.addEventListener(e,"transitionend",x=>{x.target===x.currentTarget&&(o(),v())})}else o();return r.add(()=>o()),r.dispose}function sc(e,o,r,n){let u=r?"enter":"leave",f=Wt(),a=n!==void 0?ic(n):()=>{};u==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let m=xt(u,{enter:()=>o.enter,leave:()=>o.leave}),v=xt(u,{enter:()=>o.enterTo,leave:()=>o.leaveTo}),x=xt(u,{enter:()=>o.enterFrom,leave:()=>o.leaveFrom});return Io(e,...o.base,...o.enter,...o.enterTo,...o.enterFrom,...o.leave,...o.leaveFrom,...o.leaveTo,...o.entered),ko(e,...o.base,...m,...x),f.nextFrame(()=>{Io(e,...o.base,...m,...x),ko(e,...o.base,...m,...v),lc(e,()=>(Io(e,...o.base,...m),ko(e,...o.base,...o.entered),a()))}),f.dispose}function ac({immediate:e,container:o,direction:r,classes:n,onStart:u,onStop:f}){let a=Yn(),m=nn(),v=Vt(r);ot(()=>{e&&(v.current="enter")},[e]),ot(()=>{let x=Wt();m.add(x.dispose);let E=o.current;if(E&&v.current!=="idle"&&a.current)return x.dispose(),u.current(v.current),x.add(sc(E,n.current,v.current==="enter",()=>{x.dispose(),f.current(v.current)})),x.dispose},[r])}function hn(e=""){return e.split(/\s+/).filter(o=>o.length>1)}let Rr=g.createContext(null);Rr.displayName="TransitionContext";var uc=(e=>(e.Visible="visible",e.Hidden="hidden",e))(uc||{});function cc(){let e=g.useContext(Rr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function dc(){let e=g.useContext(Lr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Lr=g.createContext(null);Lr.displayName="NestingContext";function Ar(e){return"children"in e?Ar(e.children):e.current.filter(({el:o})=>o.current!==null).filter(({state:o})=>o==="visible").length>0}function tl(e,o){let r=Vt(e),n=g.useRef([]),u=Yn(),f=nn(),a=ie((C,M=mn.Hidden)=>{let R=n.current.findIndex(({el:L})=>L===C);R!==-1&&(xt(M,{[mn.Unmount](){n.current.splice(R,1)},[mn.Hidden](){n.current[R].state="hidden"}}),f.microTask(()=>{var L;!Ar(n)&&u.current&&((L=r.current)==null||L.call(r))}))}),m=ie(C=>{let M=n.current.find(({el:R})=>R===C);return M?M.state!=="visible"&&(M.state="visible"):n.current.push({el:C,state:"visible"}),()=>a(C,mn.Unmount)}),v=g.useRef([]),x=g.useRef(Promise.resolve()),E=g.useRef({enter:[],leave:[],idle:[]}),k=ie((C,M,R)=>{v.current.splice(0),o&&(o.chains.current[M]=o.chains.current[M].filter(([L])=>L!==C)),o==null||o.chains.current[M].push([C,new Promise(L=>{v.current.push(L)})]),o==null||o.chains.current[M].push([C,new Promise(L=>{Promise.all(E.current[M].map(([B,_])=>_)).then(()=>L())})]),M==="enter"?x.current=x.current.then(()=>o==null?void 0:o.wait.current).then(()=>R(M)):R(M)}),P=ie((C,M,R)=>{Promise.all(E.current[M].splice(0).map(([L,B])=>B)).then(()=>{var L;(L=v.current.shift())==null||L()}).then(()=>R(M))});return g.useMemo(()=>({children:n,register:m,unregister:a,onStart:k,onStop:P,wait:x,chains:E}),[m,a,n,k,P,E,x])}function fc(){}let pc=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function nl(e){var o;let r={};for(let n of pc)r[n]=(o=e[n])!=null?o:fc;return r}function mc(e){let o=g.useRef(nl(e));return g.useEffect(()=>{o.current=nl(e)},[e]),o}let hc="div",rl=pn.RenderStrategy;function vc(e,o){var r,n;let{beforeEnter:u,afterEnter:f,beforeLeave:a,afterLeave:m,enter:v,enterFrom:x,enterTo:E,entered:k,leave:P,leaveFrom:C,leaveTo:M,...R}=e,L=g.useRef(null),B=Et(L,o),_=(r=R.unmount)==null||r?mn.Unmount:mn.Hidden,{show:z,appear:X,initial:ee}=cc(),[ue,we]=g.useState(z?"visible":"hidden"),Oe=dc(),{register:be,unregister:y}=Oe;g.useEffect(()=>be(L),[be,L]),g.useEffect(()=>{if(_===mn.Hidden&&L.current){if(z&&ue!=="visible"){we("visible");return}return xt(ue,{hidden:()=>y(L),visible:()=>be(L)})}},[ue,L,be,y,z,_]);let he=Vt({base:hn(R.className),enter:hn(v),enterFrom:hn(x),enterTo:hn(E),entered:hn(k),leave:hn(P),leaveFrom:hn(C),leaveTo:hn(M)}),Pe=mc({beforeEnter:u,afterEnter:f,beforeLeave:a,afterLeave:m}),Ze=Mn();g.useEffect(()=>{if(Ze&&ue==="visible"&&L.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[L,ue,Ze]);let Ye=ee&&!X,Y=X&&z&&ee,Je=!Ze||Ye?"idle":z?"enter":"leave",Re=Xu(0),q=ie(tt=>xt(tt,{enter:()=>{Re.addFlag(jt.Opening),Pe.current.beforeEnter()},leave:()=>{Re.addFlag(jt.Closing),Pe.current.beforeLeave()},idle:()=>{}})),te=ie(tt=>xt(tt,{enter:()=>{Re.removeFlag(jt.Opening),Pe.current.afterEnter()},leave:()=>{Re.removeFlag(jt.Closing),Pe.current.afterLeave()},idle:()=>{}})),ve=tl(()=>{we("hidden"),y(L)},Oe),$e=g.useRef(!1);ac({immediate:Y,container:L,classes:he,direction:Je,onStart:Vt(tt=>{$e.current=!0,ve.onStart(L,tt,q)}),onStop:Vt(tt=>{$e.current=!1,ve.onStop(L,tt,te),tt==="leave"&&!Ar(ve)&&(we("hidden"),y(L))})});let We=R,lt={ref:B};return Y?We={...We,className:Nr(R.className,...he.current.enter,...he.current.enterFrom)}:$e.current&&(We.className=Nr(R.className,(n=L.current)==null?void 0:n.className),We.className===""&&delete We.className),g.createElement(Lr.Provider,{value:ve},g.createElement(mo,{value:xt(ue,{visible:jt.Open,hidden:jt.Closed})|Re.flags},ht({ourProps:lt,theirProps:We,defaultTag:hc,features:rl,visible:ue==="visible",name:"Transition.Child"})))}function gc(e,o){let{show:r,appear:n=!1,unmount:u=!0,...f}=e,a=g.useRef(null),m=Et(a,o);Mn();let v=Vn();if(r===void 0&&v!==null&&(r=(v&jt.Open)===jt.Open),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[x,E]=g.useState(r?"visible":"hidden"),k=tl(()=>{E("hidden")}),[P,C]=g.useState(!0),M=g.useRef([r]);ot(()=>{P!==!1&&M.current[M.current.length-1]!==r&&(M.current.push(r),C(!1))},[M,r]);let R=g.useMemo(()=>({show:r,appear:n,initial:P}),[r,n,P]);g.useEffect(()=>{if(r)E("visible");else if(!Ar(k))E("hidden");else{let z=a.current;if(!z)return;let X=z.getBoundingClientRect();X.x===0&&X.y===0&&X.width===0&&X.height===0&&E("hidden")}},[r,k]);let L={unmount:u},B=ie(()=>{var z;P&&C(!1),(z=e.beforeEnter)==null||z.call(e)}),_=ie(()=>{var z;P&&C(!1),(z=e.beforeLeave)==null||z.call(e)});return g.createElement(Lr.Provider,{value:k},g.createElement(Rr.Provider,{value:R},ht({ourProps:{...L,as:g.Fragment,children:g.createElement(ol,{ref:m,...L,...f,beforeEnter:B,beforeLeave:_})},theirProps:{},defaultTag:g.Fragment,features:rl,visible:x==="visible",name:"Transition"})))}function bc(e,o){let r=g.useContext(Rr)!==null,n=Vn()!==null;return g.createElement(g.Fragment,null,!r&&n?g.createElement(Mo,{ref:o,...e}):g.createElement(ol,{ref:o,...e}))}let Mo=vt(gc),ol=vt(vc),xc=vt(bc),vn=Object.assign(Mo,{Child:xc,Root:Mo});function yc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 wc=Z.forwardRef(yc);function Ec({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Sc=Z.forwardRef(Ec);function Cc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 jc=Z.forwardRef(Cc);function Tc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Nc=Z.forwardRef(Tc);function Oc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Po=Z.forwardRef(Oc);function kc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 il=Z.forwardRef(kc);function Ic({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Mc=Z.forwardRef(Ic);function Pc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Fc=Z.forwardRef(Pc);function Rc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Lc=Z.forwardRef(Rc),Ac={warning:{color:"bg-yellow-50",icon:w.jsx(Mc,{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:w.jsx(Lc,{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:w.jsx(jc,{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:w.jsx(Fc,{className:"h-5 w-5 text-blue-400","aria-hidden":"true"}),colorTitle:"text-blue-800",colorText:"text-blue-700"}},Dc=({type:e="info",title:o,message:r,active:n=!1,time:u=1e3,onClose:f})=>{const[a,m]=g.useState(!1),v=g.useRef(null);g.useEffect(()=>(n&&(m(!0),v.current=setTimeout(()=>{m(!1),f&&f()},u)),()=>clearTimeout(v.current)),[n,u,f]);const x=Ac[e];return a?w.jsx("div",{className:"fixed top-2.5 left-1/2 transform -translate-x-1/2 w-80 3xs:w-96 z-50",children:w.jsx(vn,{as:g.Fragment,show:a,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:w.jsxs("div",{className:ae("rounded-md p-4 text-center",x.color),children:[w.jsxs("div",{className:"flex justify-center flex-shrink-0",children:[x.icon,w.jsx("h3",{className:ae("text-sm font-medium ml-3",x.colorTitle),children:o})]}),w.jsx("div",{className:ae("mt-2 text-sm",x.colorText),children:w.jsx("p",{children:r})})]})})}):null};function $c({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 _c=Z.forwardRef($c);function Bc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 zc=Z.forwardRef(Bc);function Wc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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"}),Z.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 Hc=Z.forwardRef(Wc);function Uc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.createElement("path",{fillRule:"evenodd",d:"M1.5 6a2.25 2.25 0 0 1 2.25-2.25h16.5A2.25 2.25 0 0 1 22.5 6v12a2.25 2.25 0 0 1-2.25 2.25H3.75A2.25 2.25 0 0 1 1.5 18V6ZM3 16.06V18c0 .414.336.75.75.75h16.5A.75.75 0 0 0 21 18v-1.94l-2.69-2.689a1.5 1.5 0 0 0-2.12 0l-.88.879.97.97a.75.75 0 1 1-1.06 1.06l-5.16-5.159a1.5 1.5 0 0 0-2.12 0L3 16.061Zm10.125-7.81a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Z",clipRule:"evenodd"}))}const Vc=Z.forwardRef(Uc);function Zc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Yc=Z.forwardRef(Zc);function Gc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 qc=Z.forwardRef(Gc),Kc=({src:e,alt:o,width:r,height:n,className:u="",classNameIcon:f="",isIcon:a=!0,acronym:m=""})=>{function v(){if(typeof m!="string")return m;const x=m.toLowerCase(),E=x.split(" "),k=E[E.length-1];return x.charAt(0)+k.charAt(0)}return w.jsx(w.Fragment,{children:e?w.jsx("img",{src:e,alt:o,width:r,height:n,className:ae(u!==""&&u),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s"},onLoad:x=>x.currentTarget.style.filter="none","data-testid":"img"}):a?w.jsx(Yc,{className:ae("bg-white text-default-5",f!==""?f:"w-7 h-7")}):w.jsx("div",{className:ae("bg-gray-200 text-default-5 rounded-full font-bold uppercase flex justify-center items-center",f!==""?f:"w-7 h-7"),children:v()})})},Xc=({steps:e,onClick:o})=>{const[r,n]=g.useState(0),u=f=>{n(f),o(f)};return w.jsx("nav",{className:"flex items-center justify-center w-full","aria-label":"Progress","data-testid":"bullets",children:w.jsx("ol",{role:"list",className:"flex items-center space-x-5",children:new Array(e).fill(1).map((f,a)=>w.jsx("li",{children:r!==a?w.jsx("div",{className:"cursor-pointer block h-2.5 w-2.5 rounded-full bg-gray-500 hover:bg-gray-600",onClick:()=>u(a),"data-testid":`step-${a}`,children:w.jsx("span",{className:"sr-only",children:"step"})}):w.jsxs("div",{className:"relative flex items-center justify-center cursor-pointer","aria-current":"step",children:[w.jsx("span",{className:"absolute flex h-5 w-5 p-px","aria-hidden":"true",children:w.jsx("span",{className:"h-full w-full rounded-full bg-gray-300"})}),w.jsx("span",{className:"relative block h-2.5 w-2.5 rounded-full bg-gray-500","aria-hidden":"true"}),w.jsx("span",{className:"sr-only",children:"step"})]})},a))})})};var ll={exports:{}};/*!
|
|
31
|
+
`));let P=E.props,C=typeof(P==null?void 0:P.className)=="function"?(...R)=>Nr(P==null?void 0:P.className(...R),v.className):Nr(P==null?void 0:P.className,v.className),M=C?{className:C}:{};return g.cloneElement(E,Object.assign({},Fi(E.props,kr(fo(v,["ref"]))),k,x,{ref:u(E.ref,x.ref)},M))}return g.createElement(f,Object.assign({},fo(v,["ref"]),f!==g.Fragment&&x,f!==g.Fragment&&k),E)}function $s(...e){return e.every(o=>o==null)?void 0:o=>{for(let r of e)r!=null&&(typeof r=="function"?r(o):r.current=o)}}function Fi(...e){if(e.length===0)return{};if(e.length===1)return e[0];let o={},r={};for(let n of e)for(let u in n)u.startsWith("on")&&typeof n[u]=="function"?(r[u]!=null||(r[u]=[]),r[u].push(n[u])):o[u]=n[u];if(o.disabled||o["aria-disabled"])return Object.assign(o,Object.fromEntries(Object.keys(r).map(n=>[n,void 0])));for(let n in r)Object.assign(o,{[n](u,...f){let a=r[n];for(let m of a){if((u instanceof Event||(u==null?void 0:u.nativeEvent)instanceof Event)&&u.defaultPrevented)return;m(u,...f)}}});return o}function vt(e){var o;return Object.assign(g.forwardRef(e),{displayName:(o=e.displayName)!=null?o:e.name})}function kr(e){let o=Object.assign({},e);for(let r in o)o[r]===void 0&&delete o[r];return o}function fo(e,o=[]){let r=Object.assign({},e);for(let n of o)n in r&&delete r[n];return r}let _s="div";var Pn=(e=>(e[e.None=1]="None",e[e.Focusable=2]="Focusable",e[e.Hidden=4]="Hidden",e))(Pn||{});function Bs(e,o){var r;let{features:n=1,...u}=e,f={ref:o,"aria-hidden":(n&2)===2?!0:(r=u["aria-hidden"])!=null?r:void 0,hidden:(n&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",...(n&4)===4&&(n&2)!==2&&{display:"none"}}};return ht({ourProps:f,theirProps:u,slot:{},defaultTag:_s,name:"Hidden"})}let Un=vt(Bs),po=g.createContext(null);po.displayName="OpenClosedContext";var jt=(e=>(e[e.Open=1]="Open",e[e.Closed=2]="Closed",e[e.Closing=4]="Closing",e[e.Opening=8]="Opening",e))(jt||{});function Vn(){return g.useContext(po)}function mo({value:e,children:o}){return g.createElement(po.Provider,{value:e},o)}function zs(e){function o(){document.readyState!=="loading"&&(e(),document.removeEventListener("DOMContentLoaded",o))}typeof window<"u"&&typeof document<"u"&&(document.addEventListener("DOMContentLoaded",o),o())}let Kt=[];zs(()=>{function e(o){o.target instanceof HTMLElement&&o.target!==document.body&&Kt[0]!==o.target&&(Kt.unshift(o.target),Kt=Kt.filter(r=>r!=null&&r.isConnected),Kt.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 Ir(e){let o=e.parentElement,r=null;for(;o&&!(o instanceof HTMLFieldSetElement);)o instanceof HTMLLegendElement&&(r=o),o=o.parentElement;let n=(o==null?void 0:o.getAttribute("disabled"))==="";return n&&Ws(r)?!1:n}function Ws(e){if(!e)return!1;let o=e.previousElementSibling;for(;o!==null;){if(o instanceof HTMLLegendElement)return!1;o=o.previousElementSibling}return!0}function Hs(e){throw new Error("Unexpected object: "+e)}var it=(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))(it||{});function ho(e,o){let r=o.resolveItems();if(r.length<=0)return null;let n=o.resolveActiveIndex(),u=n??-1;switch(e.focus){case 0:{for(let f=0;f<r.length;++f)if(!o.resolveDisabled(r[f],f,r))return f;return n}case 1:{for(let f=u-1;f>=0;--f)if(!o.resolveDisabled(r[f],f,r))return f;return n}case 2:{for(let f=u+1;f<r.length;++f)if(!o.resolveDisabled(r[f],f,r))return f;return n}case 3:{for(let f=r.length-1;f>=0;--f)if(!o.resolveDisabled(r[f],f,r))return f;return n}case 4:{for(let f=0;f<r.length;++f)if(o.resolveId(r[f],f,r)===e.id)return f;return n}case 5:return null;default:Hs(e)}}function Ri(e={},o=null,r=[]){for(let[n,u]of Object.entries(e))Ai(r,Li(o,n),u);return r}function Li(e,o){return e?e+"["+o+"]":o}function Ai(e,o,r){if(Array.isArray(r))for(let[n,u]of r.entries())Ai(e,Li(o,n.toString()),u);else r instanceof Date?e.push([o,r.toISOString()]):typeof r=="boolean"?e.push([o,r?"1":"0"]):typeof r=="string"?e.push([o,r]):typeof r=="number"?e.push([o,`${r}`]):r==null?e.push([o,""]):Ri(r,o,e)}function Us(e){var o,r;let n=(o=e==null?void 0:e.form)!=null?o:e.closest("form");if(n){for(let u of n.elements)if(u!==e&&(u.tagName==="INPUT"&&u.type==="submit"||u.tagName==="BUTTON"&&u.type==="submit"||u.nodeName==="INPUT"&&u.type==="image")){u.click();return}(r=n.requestSubmit)==null||r.call(n)}}var Xe=(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))(Xe||{}),Vs=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Vs||{}),Zs=(e=>(e[e.Single=0]="Single",e[e.Multi=1]="Multi",e))(Zs||{}),Ys=(e=>(e[e.Pointer=0]="Pointer",e[e.Focus=1]="Focus",e[e.Other=2]="Other",e))(Ys||{}),Gs=(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))(Gs||{});function vo(e,o=r=>r){let r=e.activeOptionIndex!==null?e.options[e.activeOptionIndex]:null,n=o(e.options.slice()),u=n.length>0&&n[0].dataRef.current.order!==null?n.sort((a,m)=>a.dataRef.current.order-m.dataRef.current.order):ao(n,a=>a.dataRef.current.domRef.current),f=r?u.indexOf(r):null;return f===-1&&(f=null),{options:u,activeOptionIndex:f}}let qs={1(e){var o;return(o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===1?e:{...e,activeOptionIndex:null,comboboxState:1}},0(e){var o,r;if((o=e.dataRef.current)!=null&&o.disabled||e.comboboxState===0)return e;if((r=e.dataRef.current)!=null&&r.value){let n=e.dataRef.current.calculateIndex(e.dataRef.current.value);if(n!==-1)return{...e,activeOptionIndex:n,comboboxState:0}}return{...e,comboboxState:0}},2(e,o){var r,n,u,f,a;if((r=e.dataRef.current)!=null&&r.disabled||(n=e.dataRef.current)!=null&&n.optionsRef.current&&!((u=e.dataRef.current)!=null&&u.optionsPropsRef.current.static)&&e.comboboxState===1)return e;if(e.virtual){let E=o.focus===it.Specific?o.idx:ho(o,{resolveItems:()=>e.virtual.options,resolveActiveIndex:()=>{var P,C;return(C=(P=e.activeOptionIndex)!=null?P:e.virtual.options.findIndex(M=>!e.virtual.disabled(M)))!=null?C:null},resolveDisabled:e.virtual.disabled,resolveId(){throw new Error("Function not implemented.")}}),k=(f=o.trigger)!=null?f:2;return e.activeOptionIndex===E&&e.activationTrigger===k?e:{...e,activeOptionIndex:E,activationTrigger:k}}let m=vo(e);if(m.activeOptionIndex===null){let E=m.options.findIndex(k=>!k.dataRef.current.disabled);E!==-1&&(m.activeOptionIndex=E)}let v=o.focus===it.Specific?o.idx:ho(o,{resolveItems:()=>m.options,resolveActiveIndex:()=>m.activeOptionIndex,resolveId:E=>E.id,resolveDisabled:E=>E.dataRef.current.disabled}),x=(a=o.trigger)!=null?a:2;return e.activeOptionIndex===v&&e.activationTrigger===x?e:{...e,...m,activeOptionIndex:v,activationTrigger:x}},3:(e,o)=>{var r,n,u;if((r=e.dataRef.current)!=null&&r.virtual)return{...e,options:[...e.options,o.payload]};let f=o.payload,a=vo(e,v=>(v.push(f),v));e.activeOptionIndex===null&&(n=e.dataRef.current)!=null&&n.isSelected(o.payload.dataRef.current.value)&&(a.activeOptionIndex=a.options.indexOf(f));let m={...e,...a,activationTrigger:2};return(u=e.dataRef.current)!=null&&u.__demoMode&&e.dataRef.current.value===void 0&&(m.activeOptionIndex=0),m},4:(e,o)=>{var r;if((r=e.dataRef.current)!=null&&r.virtual)return{...e,options:e.options.filter(u=>u.id!==o.id)};let n=vo(e,u=>{let f=u.findIndex(a=>a.id===o.id);return f!==-1&&u.splice(f,1),u});return{...e,...n,activationTrigger:2}},5:(e,o)=>e.labelId===o.id?e:{...e,labelId:o.id},6:(e,o)=>e.activationTrigger===o.trigger?e:{...e,activationTrigger:o.trigger},7:(e,o)=>{var r;if(((r=e.virtual)==null?void 0:r.options)===o.options)return e;let n=e.activeOptionIndex;if(e.activeOptionIndex!==null){let u=o.options.indexOf(e.virtual.options[e.activeOptionIndex]);u!==-1?n=u:n=null}return{...e,activeOptionIndex:n,virtual:Object.assign({},e.virtual,{options:o.options})}}},go=g.createContext(null);go.displayName="ComboboxActionsContext";function Zn(e){let o=g.useContext(go);if(o===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Zn),r}return o}let Di=g.createContext(null);function Ks(e){var o;let r=Cn("VirtualProvider"),[n,u]=g.useMemo(()=>{let v=r.optionsRef.current;if(!v)return[0,0];let x=window.getComputedStyle(v);return[parseFloat(x.paddingBlockStart||x.paddingTop),parseFloat(x.paddingBlockEnd||x.paddingBottom)]},[r.optionsRef.current]),f=Ts({scrollPaddingStart:n,scrollPaddingEnd:u,count:r.virtual.options.length,estimateSize(){return 40},getScrollElement(){var v;return(v=r.optionsRef.current)!=null?v:null},overscan:12}),[a,m]=g.useState(0);return ot(()=>{m(v=>v+1)},[(o=r.virtual)==null?void 0:o.options]),g.createElement(Di.Provider,{value:f},g.createElement("div",{style:{position:"relative",width:"100%",height:`${f.getTotalSize()}px`},ref:v=>{if(v){if(typeof process<"u"&&process.env.JEST_WORKER_ID!==void 0||r.activationTrigger===0)return;r.activeOptionIndex!==null&&r.virtual.options.length>r.activeOptionIndex&&f.scrollToIndex(r.activeOptionIndex)}}},f.getVirtualItems().map(v=>{var x;return g.createElement(g.Fragment,{key:v.key},g.cloneElement((x=e.children)==null?void 0:x.call(e,{option:r.virtual.options[v.index],open:r.comboboxState===0}),{key:`${a}-${v.key}`,"data-index":v.index,"aria-setsize":r.virtual.options.length,"aria-posinset":v.index+1,style:{position:"absolute",top:0,left:0,transform:`translateY(${v.start}px)`,overflowAnchor:"none"}}))})))}let bo=g.createContext(null);bo.displayName="ComboboxDataContext";function Cn(e){let o=g.useContext(bo);if(o===null){let r=new Error(`<${e} /> is missing a parent <Combobox /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Cn),r}return o}function Xs(e,o){return xt(o.type,qs,e,o)}let Js=g.Fragment;function Qs(e,o){let{value:r,defaultValue:n,onChange:u,form:f,name:a,by:m=null,disabled:v=!1,__demoMode:x=!1,nullable:E=!1,multiple:k=!1,immediate:P=!1,virtual:C=null,...M}=e,R=!1,L=null,[B=k?[]:void 0,_]=yi(r,u,n),[z,X]=g.useReducer(Xs,{dataRef:g.createRef(),comboboxState:x?0:1,options:[],virtual:null,activeOptionIndex:null,activationTrigger:2,labelId:null}),ee=g.useRef(!1),ue=g.useRef({static:!1,hold:!1}),we=g.useRef(null),Oe=g.useRef(null),be=g.useRef(null),y=g.useRef(null),he=ie(typeof m=="string"?(re,Ce)=>{let V=m;return(re==null?void 0:re[V])===(Ce==null?void 0:Ce[V])}:m??((re,Ce)=>re===Ce)),Pe=ie(re=>z.options.findIndex(Ce=>he(Ce.dataRef.current.value,re))),Ze=g.useCallback(re=>xt(Y.mode,{1:()=>B.some(Ce=>he(Ce,re)),0:()=>he(B,re)}),[B]),Ye=ie(re=>z.activeOptionIndex===Pe(re)),Y=g.useMemo(()=>({...z,immediate:R,optionsPropsRef:ue,labelRef:we,inputRef:Oe,buttonRef:be,optionsRef:y,value:B,defaultValue:n,disabled:v,mode:k?1:0,virtual:z.virtual,get activeOptionIndex(){if(ee.current&&z.activeOptionIndex===null&&z.options.length>0){let re=z.options.findIndex(Ce=>!Ce.dataRef.current.disabled);if(re!==-1)return re}return z.activeOptionIndex},calculateIndex:Pe,compare:he,isSelected:Ze,isActive:Ye,nullable:E,__demoMode:x}),[B,n,v,k,E,x,z,L]);ot(()=>{},[L,void 0]),ot(()=>{z.dataRef.current=Y},[Y]),uo([Y.buttonRef,Y.inputRef,Y.optionsRef],()=>St.closeCombobox(),Y.comboboxState===0);let Je=g.useMemo(()=>{var re,Ce,V;return{open:Y.comboboxState===0,disabled:v,activeIndex:Y.activeOptionIndex,activeOption:Y.activeOptionIndex===null?null:Y.virtual?Y.virtual.options[(re=Y.activeOptionIndex)!=null?re:0]:(V=(Ce=Y.options[Y.activeOptionIndex])==null?void 0:Ce.dataRef.current.value)!=null?V:null,value:B}},[Y,v,B]),Re=ie(()=>{if(Y.activeOptionIndex!==null){if(Y.virtual)lt(Y.virtual.options[Y.activeOptionIndex]);else{let{dataRef:re}=Y.options[Y.activeOptionIndex];lt(re.current.value)}St.goToOption(it.Specific,Y.activeOptionIndex)}}),q=ie(()=>{X({type:0}),ee.current=!0}),te=ie(()=>{X({type:1}),ee.current=!1}),ve=ie((re,Ce,V)=>(ee.current=!1,re===it.Specific?X({type:2,focus:it.Specific,idx:Ce,trigger:V}):X({type:2,focus:re,trigger:V}))),$e=ie((re,Ce)=>(X({type:3,payload:{id:re,dataRef:Ce}}),()=>{Y.isActive(Ce.current.value)&&(ee.current=!0),X({type:4,id:re})})),We=ie(re=>(X({type:5,id:re}),()=>X({type:5,id:null}))),lt=ie(re=>xt(Y.mode,{0(){return _==null?void 0:_(re)},1(){let Ce=Y.value.slice(),V=Ce.findIndex(Ee=>he(Ee,re));return V===-1?Ce.push(re):Ce.splice(V,1),_==null?void 0:_(Ce)}})),tt=ie(re=>{X({type:6,trigger:re})}),St=g.useMemo(()=>({onChange:lt,registerOption:$e,registerLabel:We,goToOption:ve,closeCombobox:te,openCombobox:q,setActivationTrigger:tt,selectActiveOption:Re}),[]),Lt=o===null?{}:{ref:o},ge=g.useRef(null),st=nn();return g.useEffect(()=>{ge.current&&n!==void 0&&st.addEventListener(ge.current,"reset",()=>{_==null||_(n)})},[ge,_]),g.createElement(go.Provider,{value:St},g.createElement(bo.Provider,{value:Y},g.createElement(mo,{value:xt(Y.comboboxState,{0:jt.Open,1:jt.Closed})},a!=null&&B!=null&&Ri({[a]:B}).map(([re,Ce],V)=>g.createElement(Un,{features:Pn.Hidden,ref:V===0?Ee=>{var ke;ge.current=(ke=Ee==null?void 0:Ee.closest("form"))!=null?ke:null}:void 0,...kr({key:re,as:"input",type:"hidden",hidden:!0,readOnly:!0,form:f,disabled:v,name:re,value:Ce})})),ht({ourProps:Lt,theirProps:M,slot:Je,defaultTag:Js,name:"Combobox"}))))}let ea="input";function ta(e,o){var r,n,u,f,a;let m=Dt(),{id:v=`headlessui-combobox-input-${m}`,onChange:x,displayValue:E,type:k="text",...P}=e,C=Cn("Combobox.Input"),M=Zn("Combobox.Input"),R=Et(C.inputRef,o),L=Sn(C.inputRef),B=g.useRef(!1),_=nn(),z=ie(()=>{M.onChange(null),C.optionsRef.current&&(C.optionsRef.current.scrollTop=0),M.goToOption(it.Nothing)}),X=function(){var Y;return typeof E=="function"&&C.value!==void 0?(Y=E(C.value))!=null?Y:"":typeof C.value=="string"?C.value:""}();Hn(([Y,Je],[Re,q])=>{if(B.current)return;let te=C.inputRef.current;te&&((q===0&&Je===1||Y!==Re)&&(te.value=Y),requestAnimationFrame(()=>{if(B.current||!te||(L==null?void 0:L.activeElement)!==te)return;let{selectionStart:ve,selectionEnd:$e}=te;Math.abs(($e??0)-(ve??0))===0&&ve===0&&te.setSelectionRange(te.value.length,te.value.length)}))},[X,C.comboboxState,L]),Hn(([Y],[Je])=>{if(Y===0&&Je===1){if(B.current)return;let Re=C.inputRef.current;if(!Re)return;let q=Re.value,{selectionStart:te,selectionEnd:ve,selectionDirection:$e}=Re;Re.value="",Re.value=q,$e!==null?Re.setSelectionRange(te,ve,$e):Re.setSelectionRange(te,ve)}},[C.comboboxState]);let ee=g.useRef(!1),ue=ie(()=>{ee.current=!0}),we=ie(()=>{_.nextFrame(()=>{ee.current=!1})}),Oe=ie(Y=>{switch(B.current=!0,Y.key){case Xe.Enter:if(B.current=!1,C.comboboxState!==0||ee.current)return;if(Y.preventDefault(),Y.stopPropagation(),C.activeOptionIndex===null){M.closeCombobox();return}M.selectActiveOption(),C.mode===0&&M.closeCombobox();break;case Xe.ArrowDown:return B.current=!1,Y.preventDefault(),Y.stopPropagation(),xt(C.comboboxState,{0:()=>M.goToOption(it.Next),1:()=>M.openCombobox()});case Xe.ArrowUp:return B.current=!1,Y.preventDefault(),Y.stopPropagation(),xt(C.comboboxState,{0:()=>M.goToOption(it.Previous),1:()=>{M.openCombobox(),_.nextFrame(()=>{C.value||M.goToOption(it.Last)})}});case Xe.Home:if(Y.shiftKey)break;return B.current=!1,Y.preventDefault(),Y.stopPropagation(),M.goToOption(it.First);case Xe.PageUp:return B.current=!1,Y.preventDefault(),Y.stopPropagation(),M.goToOption(it.First);case Xe.End:if(Y.shiftKey)break;return B.current=!1,Y.preventDefault(),Y.stopPropagation(),M.goToOption(it.Last);case Xe.PageDown:return B.current=!1,Y.preventDefault(),Y.stopPropagation(),M.goToOption(it.Last);case Xe.Escape:return B.current=!1,C.comboboxState!==0?void 0:(Y.preventDefault(),C.optionsRef.current&&!C.optionsPropsRef.current.static&&Y.stopPropagation(),C.nullable&&C.mode===0&&C.value===null&&z(),M.closeCombobox());case Xe.Tab:if(B.current=!1,C.comboboxState!==0)return;C.mode===0&&C.activationTrigger!==1&&M.selectActiveOption(),M.closeCombobox();break}}),be=ie(Y=>{x==null||x(Y),C.nullable&&C.mode===0&&Y.target.value===""&&z(),M.openCombobox()}),y=ie(Y=>{var Je,Re,q;let te=(Je=Y.relatedTarget)!=null?Je:Kt.find(ve=>ve!==Y.currentTarget);if(B.current=!1,!((Re=C.optionsRef.current)!=null&&Re.contains(te))&&!((q=C.buttonRef.current)!=null&&q.contains(te))&&C.comboboxState===0)return Y.preventDefault(),C.mode===0&&(C.nullable&&C.value===null?z():C.activationTrigger!==1&&M.selectActiveOption()),M.closeCombobox()}),he=ie(Y=>{var Je,Re,q;let te=(Je=Y.relatedTarget)!=null?Je:Kt.find(ve=>ve!==Y.currentTarget);(Re=C.buttonRef.current)!=null&&Re.contains(te)||(q=C.optionsRef.current)!=null&&q.contains(te)||C.disabled||C.immediate&&C.comboboxState!==0&&(M.openCombobox(),_.nextFrame(()=>{M.setActivationTrigger(1)}))}),Pe=oo(()=>{if(C.labelId)return[C.labelId].join(" ")},[C.labelId]),Ze=g.useMemo(()=>({open:C.comboboxState===0,disabled:C.disabled}),[C]),Ye={ref:R,id:v,role:"combobox",type:k,"aria-controls":(r=C.optionsRef.current)==null?void 0:r.id,"aria-expanded":C.comboboxState===0,"aria-activedescendant":C.activeOptionIndex===null?void 0:C.virtual?(n=C.options.find(Y=>{var Je;return!((Je=C.virtual)!=null&&Je.disabled(Y.dataRef.current.value))&&C.compare(Y.dataRef.current.value,C.virtual.options[C.activeOptionIndex])}))==null?void 0:n.id:(u=C.options[C.activeOptionIndex])==null?void 0:u.id,"aria-labelledby":Pe,"aria-autocomplete":"list",defaultValue:(a=(f=e.defaultValue)!=null?f:C.defaultValue!==void 0?E==null?void 0:E(C.defaultValue):null)!=null?a:C.defaultValue,disabled:C.disabled,onCompositionStart:ue,onCompositionEnd:we,onKeyDown:Oe,onChange:be,onFocus:he,onBlur:y};return ht({ourProps:Ye,theirProps:P,slot:Ze,defaultTag:ea,name:"Combobox.Input"})}let na="button";function ra(e,o){var r;let n=Cn("Combobox.Button"),u=Zn("Combobox.Button"),f=Et(n.buttonRef,o),a=Dt(),{id:m=`headlessui-combobox-button-${a}`,...v}=e,x=nn(),E=ie(R=>{switch(R.key){case Xe.ArrowDown:return R.preventDefault(),R.stopPropagation(),n.comboboxState===1&&u.openCombobox(),x.nextFrame(()=>{var L;return(L=n.inputRef.current)==null?void 0:L.focus({preventScroll:!0})});case Xe.ArrowUp:return R.preventDefault(),R.stopPropagation(),n.comboboxState===1&&(u.openCombobox(),x.nextFrame(()=>{n.value||u.goToOption(it.Last)})),x.nextFrame(()=>{var L;return(L=n.inputRef.current)==null?void 0:L.focus({preventScroll:!0})});case Xe.Escape:return n.comboboxState!==0?void 0:(R.preventDefault(),n.optionsRef.current&&!n.optionsPropsRef.current.static&&R.stopPropagation(),u.closeCombobox(),x.nextFrame(()=>{var L;return(L=n.inputRef.current)==null?void 0:L.focus({preventScroll:!0})}));default:return}}),k=ie(R=>{if(Ir(R.currentTarget))return R.preventDefault();n.comboboxState===0?u.closeCombobox():(R.preventDefault(),u.openCombobox()),x.nextFrame(()=>{var L;return(L=n.inputRef.current)==null?void 0:L.focus({preventScroll:!0})})}),P=oo(()=>{if(n.labelId)return[n.labelId,m].join(" ")},[n.labelId,m]),C=g.useMemo(()=>({open:n.comboboxState===0,disabled:n.disabled,value:n.value}),[n]),M={ref:f,id:m,type:co(e,n.buttonRef),tabIndex:-1,"aria-haspopup":"listbox","aria-controls":(r=n.optionsRef.current)==null?void 0:r.id,"aria-expanded":n.comboboxState===0,"aria-labelledby":P,disabled:n.disabled,onClick:k,onKeyDown:E};return ht({ourProps:M,theirProps:v,slot:C,defaultTag:na,name:"Combobox.Button"})}let oa="label";function ia(e,o){let r=Dt(),{id:n=`headlessui-combobox-label-${r}`,...u}=e,f=Cn("Combobox.Label"),a=Zn("Combobox.Label"),m=Et(f.labelRef,o);ot(()=>a.registerLabel(n),[n]);let v=ie(()=>{var E;return(E=f.inputRef.current)==null?void 0:E.focus({preventScroll:!0})}),x=g.useMemo(()=>({open:f.comboboxState===0,disabled:f.disabled}),[f]);return ht({ourProps:{ref:m,id:n,onClick:v},theirProps:u,slot:x,defaultTag:oa,name:"Combobox.Label"})}let la="ul",sa=pn.RenderStrategy|pn.Static;function aa(e,o){let r=Dt(),{id:n=`headlessui-combobox-options-${r}`,hold:u=!1,...f}=e,a=Cn("Combobox.Options"),m=Et(a.optionsRef,o),v=Vn(),x=v!==null?(v&jt.Open)===jt.Open:a.comboboxState===0;ot(()=>{var C;a.optionsPropsRef.current.static=(C=e.static)!=null?C:!1},[a.optionsPropsRef,e.static]),ot(()=>{a.optionsPropsRef.current.hold=u},[a.optionsPropsRef,u]),Pi({container:a.optionsRef.current,enabled:a.comboboxState===0,accept(C){return C.getAttribute("role")==="option"?NodeFilter.FILTER_REJECT:C.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(C){C.setAttribute("role","none")}});let E=oo(()=>{var C,M;return(M=a.labelId)!=null?M:(C=a.buttonRef.current)==null?void 0:C.id},[a.labelId,a.buttonRef.current]),k=g.useMemo(()=>({open:a.comboboxState===0,option:void 0}),[a]),P={"aria-labelledby":E,role:"listbox","aria-multiselectable":a.mode===1?!0:void 0,id:n,ref:m};return a.virtual&&a.comboboxState===0&&Object.assign(f,{children:g.createElement(Ks,null,f.children)}),ht({ourProps:P,theirProps:f,slot:k,defaultTag:la,features:sa,visible:x,name:"Combobox.Options"})}let ua="li";function ca(e,o){var r;let n=Dt(),{id:u=`headlessui-combobox-option-${n}`,disabled:f=!1,value:a,order:m=null,...v}=e,x=Cn("Combobox.Option"),E=Zn("Combobox.Option"),k=x.virtual?x.activeOptionIndex===x.calculateIndex(a):x.activeOptionIndex===null?!1:((r=x.options[x.activeOptionIndex])==null?void 0:r.id)===u,P=x.isSelected(a),C=g.useRef(null),M=Vt({disabled:f,value:a,domRef:C,order:m}),R=g.useContext(Di),L=Et(o,C,R?R.measureElement:null),B=ie(()=>E.onChange(a));ot(()=>E.registerOption(u,M),[M,u]);let _=g.useRef(!(x.virtual||x.__demoMode));ot(()=>{if(!x.virtual||!x.__demoMode)return;let y=Wt();return y.requestAnimationFrame(()=>{_.current=!0}),y.dispose},[x.virtual,x.__demoMode]),ot(()=>{if(!_.current||x.comboboxState!==0||!k||x.activationTrigger===0)return;let y=Wt();return y.requestAnimationFrame(()=>{var he,Pe;(Pe=(he=C.current)==null?void 0:he.scrollIntoView)==null||Pe.call(he,{block:"nearest"})}),y.dispose},[C,k,x.comboboxState,x.activationTrigger,x.activeOptionIndex]);let z=ie(y=>{var he;if(f||(he=x.virtual)!=null&&he.disabled(a))return y.preventDefault();B(),Ti()||requestAnimationFrame(()=>{var Pe;return(Pe=x.inputRef.current)==null?void 0:Pe.focus({preventScroll:!0})}),x.mode===0&&requestAnimationFrame(()=>E.closeCombobox())}),X=ie(()=>{var y;if(f||(y=x.virtual)!=null&&y.disabled(a))return E.goToOption(it.Nothing);let he=x.calculateIndex(a);E.goToOption(it.Specific,he)}),ee=Mi(),ue=ie(y=>ee.update(y)),we=ie(y=>{var he;if(!ee.wasMoved(y)||f||(he=x.virtual)!=null&&he.disabled(a)||k)return;let Pe=x.calculateIndex(a);E.goToOption(it.Specific,Pe,0)}),Oe=ie(y=>{var he;ee.wasMoved(y)&&(f||(he=x.virtual)!=null&&he.disabled(a)||k&&(x.optionsPropsRef.current.hold||E.goToOption(it.Nothing)))}),be=g.useMemo(()=>({active:k,selected:P,disabled:f}),[k,P,f]);return ht({ourProps:{id:u,ref:L,role:"option",tabIndex:f===!0?void 0:-1,"aria-disabled":f===!0?!0:void 0,"aria-selected":P,disabled:void 0,onClick:z,onFocus:X,onPointerEnter:ue,onMouseEnter:ue,onPointerMove:we,onMouseMove:we,onPointerLeave:Oe,onMouseLeave:Oe},theirProps:v,slot:be,defaultTag:ua,name:"Combobox.Option"})}let da=vt(Qs),fa=vt(ra),pa=vt(ta),ma=vt(ia),ha=vt(aa),va=vt(ca),on=Object.assign(da,{Input:pa,Button:fa,Label:ma,Options:ha,Option:va});function $i(e,o,r,n){let u=Vt(r);g.useEffect(()=>{e=e??window;function f(a){u.current(a)}return e.addEventListener(o,f,n),()=>e.removeEventListener(o,f,n)},[e,o,n])}function Yn(){let e=g.useRef(!1);return ot(()=>(e.current=!0,()=>{e.current=!1}),[]),e}function _i(e){let o=ie(e),r=g.useRef(!1);g.useEffect(()=>(r.current=!1,()=>{r.current=!0,Cr(()=>{r.current&&o()})}),[o])}var Gn=(e=>(e[e.Forwards=0]="Forwards",e[e.Backwards=1]="Backwards",e))(Gn||{});function ga(){let e=g.useRef(0);return Ni("keydown",o=>{o.key==="Tab"&&(e.current=o.shiftKey?1:0)},!0),e}function Bi(e){if(!e)return new Set;if(typeof e=="function")return new Set(e());let o=new Set;for(let r of e.current)r.current instanceof HTMLElement&&o.add(r.current);return o}let ba="div";var zi=(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))(zi||{});function xa(e,o){let r=g.useRef(null),n=Et(r,o),{initialFocus:u,containers:f,features:a=30,...m}=e;Mn()||(a=1);let v=Sn(r);Ea({ownerDocument:v},!!(a&16));let x=Sa({ownerDocument:v,container:r,initialFocus:u},!!(a&2));Ca({ownerDocument:v,container:r,containers:f,previousActiveElement:x},!!(a&8));let E=ga(),k=ie(R=>{let L=r.current;L&&(B=>B())(()=>{xt(E.current,{[Gn.Forwards]:()=>{Wn(L,rn.First,{skipElements:[R.relatedTarget]})},[Gn.Backwards]:()=>{Wn(L,rn.Last,{skipElements:[R.relatedTarget]})}})})}),P=nn(),C=g.useRef(!1),M={ref:n,onKeyDown(R){R.key=="Tab"&&(C.current=!0,P.requestAnimationFrame(()=>{C.current=!1}))},onBlur(R){let L=Bi(f);r.current instanceof HTMLElement&&L.add(r.current);let B=R.relatedTarget;B instanceof HTMLElement&&B.dataset.headlessuiFocusGuard!=="true"&&(Wi(L,B)||(C.current?Wn(r.current,xt(E.current,{[Gn.Forwards]:()=>rn.Next,[Gn.Backwards]:()=>rn.Previous})|rn.WrapAround,{relativeTo:R.target}):R.target instanceof HTMLElement&&fn(R.target)))}};return g.createElement(g.Fragment,null,!!(a&4)&&g.createElement(Un,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:k,features:Pn.Focusable}),ht({ourProps:M,theirProps:m,defaultTag:ba,name:"FocusTrap"}),!!(a&4)&&g.createElement(Un,{as:"button",type:"button","data-headlessui-focus-guard":!0,onFocus:k,features:Pn.Focusable}))}let ya=vt(xa),qn=Object.assign(ya,{features:zi});function wa(e=!0){let o=g.useRef(Kt.slice());return Hn(([r],[n])=>{n===!0&&r===!1&&Cr(()=>{o.current.splice(0)}),n===!1&&r===!0&&(o.current=Kt.slice())},[e,Kt,o]),ie(()=>{var r;return(r=o.current.find(n=>n!=null&&n.isConnected))!=null?r:null})}function Ea({ownerDocument:e},o){let r=wa(o);Hn(()=>{o||(e==null?void 0:e.activeElement)===(e==null?void 0:e.body)&&fn(r())},[o]),_i(()=>{o&&fn(r())})}function Sa({ownerDocument:e,container:o,initialFocus:r},n){let u=g.useRef(null),f=Yn();return Hn(()=>{if(!n)return;let a=o.current;a&&Cr(()=>{if(!f.current)return;let m=e==null?void 0:e.activeElement;if(r!=null&&r.current){if((r==null?void 0:r.current)===m){u.current=m;return}}else if(a.contains(m)){u.current=m;return}r!=null&&r.current?fn(r.current):Wn(a,rn.First)===Ei.Error&&console.warn("There are no focusable elements inside the <FocusTrap />"),u.current=e==null?void 0:e.activeElement})},[n]),u}function Ca({ownerDocument:e,container:o,containers:r,previousActiveElement:n},u){let f=Yn();$i(e==null?void 0:e.defaultView,"focus",a=>{if(!u||!f.current)return;let m=Bi(r);o.current instanceof HTMLElement&&m.add(o.current);let v=n.current;if(!v)return;let x=a.target;x&&x instanceof HTMLElement?Wi(m,x)?(n.current=x,fn(x)):(a.preventDefault(),a.stopPropagation(),fn(v)):fn(n.current)},!0)}function Wi(e,o){for(let r of e)if(r.contains(o))return!0;return!1}let Hi=g.createContext(!1);function ja(){return g.useContext(Hi)}function xo(e){return g.createElement(Hi.Provider,{value:e.force},e.children)}function Ta(e){let o=ja(),r=g.useContext(Ui),n=Sn(e),[u,f]=g.useState(()=>{if(!o&&r!==null||tn.isServer)return null;let a=n==null?void 0:n.getElementById("headlessui-portal-root");if(a)return a;if(n===null)return null;let m=n.createElement("div");return m.setAttribute("id","headlessui-portal-root"),n.body.appendChild(m)});return g.useEffect(()=>{u!==null&&(n!=null&&n.body.contains(u)||n==null||n.body.appendChild(u))},[u,n]),g.useEffect(()=>{o||r!==null&&f(r.current)},[r,f,o]),u}let Na=g.Fragment;function Oa(e,o){let r=e,n=g.useRef(null),u=Et(Ds(E=>{n.current=E}),o),f=Sn(n),a=Ta(n),[m]=g.useState(()=>{var E;return tn.isServer?null:(E=f==null?void 0:f.createElement("div"))!=null?E:null}),v=g.useContext(yo),x=Mn();return ot(()=>{!a||!m||a.contains(m)||(m.setAttribute("data-headlessui-portal",""),a.appendChild(m))},[a,m]),ot(()=>{if(m&&v)return v.register(m)},[v,m]),_i(()=>{var E;!a||!m||(m instanceof Node&&a.contains(m)&&a.removeChild(m),a.childNodes.length<=0&&((E=a.parentElement)==null||E.removeChild(a)))}),x?!a||!m?null:Sr.createPortal(ht({ourProps:{ref:u},theirProps:r,defaultTag:Na,name:"Portal"}),m):null}let ka=g.Fragment,Ui=g.createContext(null);function Ia(e,o){let{target:r,...n}=e,u={ref:Et(o)};return g.createElement(Ui.Provider,{value:r},ht({ourProps:u,theirProps:n,defaultTag:ka,name:"Popover.Group"}))}let yo=g.createContext(null);function Ma(){let e=g.useContext(yo),o=g.useRef([]),r=ie(f=>(o.current.push(f),e&&e.register(f),()=>n(f))),n=ie(f=>{let a=o.current.indexOf(f);a!==-1&&o.current.splice(a,1),e&&e.unregister(f)}),u=g.useMemo(()=>({register:r,unregister:n,portals:o}),[r,n,o]);return[o,g.useMemo(()=>function({children:f}){return g.createElement(yo.Provider,{value:u},f)},[u])]}let Pa=vt(Oa),Fa=vt(Ia),wo=Object.assign(Pa,{Group:Fa});function Ra(e,o){return e===o&&(e!==0||1/e===1/o)||e!==e&&o!==o}const La=typeof Object.is=="function"?Object.is:Ra,{useState:Aa,useEffect:Da,useLayoutEffect:$a,useDebugValue:_a}=Z;function Ba(e,o,r){const n=o(),[{inst:u},f]=Aa({inst:{value:n,getSnapshot:o}});return $a(()=>{u.value=n,u.getSnapshot=o,Eo(u)&&f({inst:u})},[e,n,o]),Da(()=>(Eo(u)&&f({inst:u}),e(()=>{Eo(u)&&f({inst:u})})),[e]),_a(n),n}function Eo(e){const o=e.getSnapshot,r=e.value;try{const n=o();return!La(r,n)}catch{return!0}}function za(e,o,r){return o()}const Wa=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Ha=!Wa,Ua=Ha?za:Ba,Va="useSyncExternalStore"in Z?(e=>e.useSyncExternalStore)(Z):Ua;function Za(e){return Va(e.subscribe,e.getSnapshot,e.getSnapshot)}function Ya(e,o){let r=e(),n=new Set;return{getSnapshot(){return r},subscribe(u){return n.add(u),()=>n.delete(u)},dispatch(u,...f){let a=o[u].call(r,...f);a&&(r=a,n.forEach(m=>m()))}}}function Ga(){let e;return{before({doc:o}){var r;let n=o.documentElement;e=((r=o.defaultView)!=null?r:window).innerWidth-n.clientWidth},after({doc:o,d:r}){let n=o.documentElement,u=n.clientWidth-n.offsetWidth,f=e-u;r.style(n,"paddingRight",`${f}px`)}}}function qa(){return ji()?{before({doc:e,d:o,meta:r}){function n(u){return r.containers.flatMap(f=>f()).some(f=>f.contains(u))}o.microTask(()=>{var u;if(window.getComputedStyle(e.documentElement).scrollBehavior!=="auto"){let m=Wt();m.style(e.documentElement,"scrollBehavior","auto"),o.add(()=>o.microTask(()=>m.dispose()))}let f=(u=window.scrollY)!=null?u:window.pageYOffset,a=null;o.addEventListener(e,"click",m=>{if(m.target instanceof HTMLElement)try{let v=m.target.closest("a");if(!v)return;let{hash:x}=new URL(v.href),E=e.querySelector(x);E&&!n(E)&&(a=E)}catch{}},!0),o.addEventListener(e,"touchstart",m=>{if(m.target instanceof HTMLElement)if(n(m.target)){let v=m.target;for(;v.parentElement&&n(v.parentElement);)v=v.parentElement;o.style(v,"overscrollBehavior","contain")}else o.style(m.target,"touchAction","none")}),o.addEventListener(e,"touchmove",m=>{if(m.target instanceof HTMLElement)if(n(m.target)){let v=m.target;for(;v.parentElement&&v.dataset.headlessuiPortal!==""&&!(v.scrollHeight>v.clientHeight||v.scrollWidth>v.clientWidth);)v=v.parentElement;v.dataset.headlessuiPortal===""&&m.preventDefault()}else m.preventDefault()},{passive:!1}),o.add(()=>{var m;let v=(m=window.scrollY)!=null?m:window.pageYOffset;f!==v&&window.scrollTo(0,f),a&&a.isConnected&&(a.scrollIntoView({block:"nearest"}),a=null)})})}}:{}}function Ka(){return{before({doc:e,d:o}){o.style(e.documentElement,"overflow","hidden")}}}function Xa(e){let o={};for(let r of e)Object.assign(o,r(o));return o}let jn=Ya(()=>new Map,{PUSH(e,o){var r;let n=(r=this.get(e))!=null?r:{doc:e,count:0,d:Wt(),meta:new Set};return n.count++,n.meta.add(o),this.set(e,n),this},POP(e,o){let r=this.get(e);return r&&(r.count--,r.meta.delete(o)),this},SCROLL_PREVENT({doc:e,d:o,meta:r}){let n={doc:e,d:o,meta:Xa(r)},u=[qa(),Ga(),Ka()];u.forEach(({before:f})=>f==null?void 0:f(n)),u.forEach(({after:f})=>f==null?void 0:f(n))},SCROLL_ALLOW({d:e}){e.dispose()},TEARDOWN({doc:e}){this.delete(e)}});jn.subscribe(()=>{let e=jn.getSnapshot(),o=new Map;for(let[r]of e)o.set(r,r.documentElement.style.overflow);for(let r of e.values()){let n=o.get(r.doc)==="hidden",u=r.count!==0;(u&&!n||!u&&n)&&jn.dispatch(r.count>0?"SCROLL_PREVENT":"SCROLL_ALLOW",r),r.count===0&&jn.dispatch("TEARDOWN",r)}});function Ja(e,o,r){let n=Za(jn),u=e?n.get(e):void 0,f=u?u.count>0:!1;return ot(()=>{if(!(!e||!o))return jn.dispatch("PUSH",e,r),()=>jn.dispatch("POP",e,r)},[o,e]),f}let So=new Map,Kn=new Map;function Vi(e,o=!0){ot(()=>{var r;if(!o)return;let n=typeof e=="function"?e():e.current;if(!n)return;function u(){var a;if(!n)return;let m=(a=Kn.get(n))!=null?a:1;if(m===1?Kn.delete(n):Kn.set(n,m-1),m!==1)return;let v=So.get(n);v&&(v["aria-hidden"]===null?n.removeAttribute("aria-hidden"):n.setAttribute("aria-hidden",v["aria-hidden"]),n.inert=v.inert,So.delete(n))}let f=(r=Kn.get(n))!=null?r:0;return Kn.set(n,f+1),f!==0||(So.set(n,{"aria-hidden":n.getAttribute("aria-hidden"),inert:n.inert}),n.setAttribute("aria-hidden","true"),n.inert=!0),u},[e,o])}function Qa({defaultContainers:e=[],portals:o,mainTreeNodeRef:r}={}){var n;let u=g.useRef((n=r==null?void 0:r.current)!=null?n:null),f=Sn(u),a=ie(()=>{var m,v,x;let E=[];for(let k of e)k!==null&&(k instanceof HTMLElement?E.push(k):"current"in k&&k.current instanceof HTMLElement&&E.push(k.current));if(o!=null&&o.current)for(let k of o.current)E.push(k);for(let k of(m=f==null?void 0:f.querySelectorAll("html > *, body > *"))!=null?m:[])k!==document.body&&k!==document.head&&k instanceof HTMLElement&&k.id!=="headlessui-portal-root"&&(k.contains(u.current)||k.contains((x=(v=u.current)==null?void 0:v.getRootNode())==null?void 0:x.host)||E.some(P=>k.contains(P))||E.push(k));return E});return{resolveContainers:a,contains:ie(m=>a().some(v=>v.contains(m))),mainTreeNodeRef:u,MainTreeNode:g.useMemo(()=>function(){return r!=null?null:g.createElement(Un,{features:Pn.Hidden,ref:u})},[u,r])}}let Co=g.createContext(()=>{});Co.displayName="StackContext";var jo=(e=>(e[e.Add=0]="Add",e[e.Remove=1]="Remove",e))(jo||{});function eu(){return g.useContext(Co)}function tu({children:e,onUpdate:o,type:r,element:n,enabled:u}){let f=eu(),a=ie((...m)=>{o==null||o(...m),f(...m)});return ot(()=>{let m=u===void 0||u===!0;return m&&a(0,r,n),()=>{m&&a(1,r,n)}},[a,r,n,u]),g.createElement(Co.Provider,{value:a},e)}let Zi=g.createContext(null);function Yi(){let e=g.useContext(Zi);if(e===null){let o=new Error("You used a <Description /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(o,Yi),o}return e}function Gi(){let[e,o]=g.useState([]);return[e.length>0?e.join(" "):void 0,g.useMemo(()=>function(r){let n=ie(f=>(o(a=>[...a,f]),()=>o(a=>{let m=a.slice(),v=m.indexOf(f);return v!==-1&&m.splice(v,1),m}))),u=g.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return g.createElement(Zi.Provider,{value:u},r.children)},[o])]}let nu="p";function ru(e,o){let r=Dt(),{id:n=`headlessui-description-${r}`,...u}=e,f=Yi(),a=Et(o);ot(()=>f.register(n),[n,f.register]);let m={ref:a,...f.props,id:n};return ht({ourProps:m,theirProps:u,slot:f.slot||{},defaultTag:nu,name:f.name||"Description"})}let ou=vt(ru),qi=Object.assign(ou,{});var iu=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(iu||{}),lu=(e=>(e[e.SetTitleId=0]="SetTitleId",e))(lu||{});let su={0(e,o){return e.titleId===o.id?e:{...e,titleId:o.id}}},Mr=g.createContext(null);Mr.displayName="DialogContext";function Xn(e){let o=g.useContext(Mr);if(o===null){let r=new Error(`<${e} /> is missing a parent <Dialog /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Xn),r}return o}function au(e,o,r=()=>[document.body]){Ja(e,o,n=>{var u;return{containers:[...(u=n.containers)!=null?u:[],r]}})}function uu(e,o){return xt(o.type,su,e,o)}let cu="div",du=pn.RenderStrategy|pn.Static;function fu(e,o){let r=Dt(),{id:n=`headlessui-dialog-${r}`,open:u,onClose:f,initialFocus:a,role:m="dialog",__demoMode:v=!1,...x}=e,[E,k]=g.useState(0),P=g.useRef(!1);m=function(){return m==="dialog"||m==="alertdialog"?m:(P.current||(P.current=!0,console.warn(`Invalid role [${m}] passed to <Dialog />. Only \`dialog\` and and \`alertdialog\` are supported. Using \`dialog\` instead.`)),"dialog")}();let C=Vn();u===void 0&&C!==null&&(u=(C&jt.Open)===jt.Open);let M=g.useRef(null),R=Et(M,o),L=Sn(M),B=e.hasOwnProperty("open")||C!==null,_=e.hasOwnProperty("onClose");if(!B&&!_)throw new Error("You have to provide an `open` and an `onClose` prop to the `Dialog` component.");if(!B)throw new Error("You provided an `onClose` prop to the `Dialog`, but forgot an `open` prop.");if(!_)throw new Error("You provided an `open` prop to the `Dialog`, but forgot an `onClose` prop.");if(typeof u!="boolean")throw new Error(`You provided an \`open\` prop to the \`Dialog\`, but the value is not a boolean. Received: ${u}`);if(typeof f!="function")throw new Error(`You provided an \`onClose\` prop to the \`Dialog\`, but the value is not a function. Received: ${f}`);let z=u?0:1,[X,ee]=g.useReducer(uu,{titleId:null,descriptionId:null,panelRef:g.createRef()}),ue=ie(()=>f(!1)),we=ie(V=>ee({type:0,id:V})),Oe=Mn()?v?!1:z===0:!1,be=E>1,y=g.useContext(Mr)!==null,[he,Pe]=Ma(),Ze={get current(){var V;return(V=X.panelRef.current)!=null?V:M.current}},{resolveContainers:Ye,mainTreeNodeRef:Y,MainTreeNode:Je}=Qa({portals:he,defaultContainers:[Ze]}),Re=be?"parent":"leaf",q=C!==null?(C&jt.Closing)===jt.Closing:!1,te=y||q?!1:Oe,ve=g.useCallback(()=>{var V,Ee;return(Ee=Array.from((V=L==null?void 0:L.querySelectorAll("body > *"))!=null?V:[]).find(ke=>ke.id==="headlessui-portal-root"?!1:ke.contains(Y.current)&&ke instanceof HTMLElement))!=null?Ee:null},[Y]);Vi(ve,te);let $e=be?!0:Oe,We=g.useCallback(()=>{var V,Ee;return(Ee=Array.from((V=L==null?void 0:L.querySelectorAll("[data-headlessui-portal]"))!=null?V:[]).find(ke=>ke.contains(Y.current)&&ke instanceof HTMLElement))!=null?Ee:null},[Y]);Vi(We,$e),uo(Ye,V=>{V.preventDefault(),ue()},!(!Oe||be));let tt=!(be||z!==0);$i(L==null?void 0:L.defaultView,"keydown",V=>{tt&&(V.defaultPrevented||V.key===Xe.Escape&&(V.preventDefault(),V.stopPropagation(),ue()))}),au(L,!(q||z!==0||y),Ye),g.useEffect(()=>{if(z!==0||!M.current)return;let V=new ResizeObserver(Ee=>{for(let ke of Ee){let Fe=ke.target.getBoundingClientRect();Fe.x===0&&Fe.y===0&&Fe.width===0&&Fe.height===0&&ue()}});return V.observe(M.current),()=>V.disconnect()},[z,M,ue]);let[Lt,ge]=Gi(),st=g.useMemo(()=>[{dialogState:z,close:ue,setTitleId:we},X],[z,X,ue,we]),re=g.useMemo(()=>({open:z===0}),[z]),Ce={ref:R,id:n,role:m,"aria-modal":z===0?!0:void 0,"aria-labelledby":X.titleId,"aria-describedby":Lt};return g.createElement(tu,{type:"Dialog",enabled:z===0,element:M,onUpdate:ie((V,Ee)=>{Ee==="Dialog"&&xt(V,{[jo.Add]:()=>k(ke=>ke+1),[jo.Remove]:()=>k(ke=>ke-1)})})},g.createElement(xo,{force:!0},g.createElement(wo,null,g.createElement(Mr.Provider,{value:st},g.createElement(wo.Group,{target:M},g.createElement(xo,{force:!1},g.createElement(ge,{slot:re,name:"Dialog.Description"},g.createElement(qn,{initialFocus:a,containers:Ye,features:Oe?xt(Re,{parent:qn.features.RestoreFocus,leaf:qn.features.All&~qn.features.FocusLock}):qn.features.None},g.createElement(Pe,null,ht({ourProps:Ce,theirProps:x,slot:re,defaultTag:cu,features:du,visible:z===0,name:"Dialog"}))))))))),g.createElement(Je,null))}let pu="div";function mu(e,o){let r=Dt(),{id:n=`headlessui-dialog-overlay-${r}`,...u}=e,[{dialogState:f,close:a}]=Xn("Dialog.Overlay"),m=Et(o),v=ie(E=>{if(E.target===E.currentTarget){if(Ir(E.currentTarget))return E.preventDefault();E.preventDefault(),E.stopPropagation(),a()}}),x=g.useMemo(()=>({open:f===0}),[f]);return ht({ourProps:{ref:m,id:n,"aria-hidden":!0,onClick:v},theirProps:u,slot:x,defaultTag:pu,name:"Dialog.Overlay"})}let hu="div";function vu(e,o){let r=Dt(),{id:n=`headlessui-dialog-backdrop-${r}`,...u}=e,[{dialogState:f},a]=Xn("Dialog.Backdrop"),m=Et(o);g.useEffect(()=>{if(a.panelRef.current===null)throw new Error("A <Dialog.Backdrop /> component is being used, but a <Dialog.Panel /> component is missing.")},[a.panelRef]);let v=g.useMemo(()=>({open:f===0}),[f]);return g.createElement(xo,{force:!0},g.createElement(wo,null,ht({ourProps:{ref:m,id:n,"aria-hidden":!0},theirProps:u,slot:v,defaultTag:hu,name:"Dialog.Backdrop"})))}let gu="div";function bu(e,o){let r=Dt(),{id:n=`headlessui-dialog-panel-${r}`,...u}=e,[{dialogState:f},a]=Xn("Dialog.Panel"),m=Et(o,a.panelRef),v=g.useMemo(()=>({open:f===0}),[f]),x=ie(E=>{E.stopPropagation()});return ht({ourProps:{ref:m,id:n,onClick:x},theirProps:u,slot:v,defaultTag:gu,name:"Dialog.Panel"})}let xu="h2";function yu(e,o){let r=Dt(),{id:n=`headlessui-dialog-title-${r}`,...u}=e,[{dialogState:f,setTitleId:a}]=Xn("Dialog.Title"),m=Et(o);g.useEffect(()=>(a(n),()=>a(null)),[n,a]);let v=g.useMemo(()=>({open:f===0}),[f]);return ht({ourProps:{ref:m,id:n},theirProps:u,slot:v,defaultTag:xu,name:"Dialog.Title"})}let wu=vt(fu),Eu=vt(vu),Su=vt(bu),Cu=vt(mu),ju=vt(yu),Ki=Object.assign(wu,{Backdrop:Eu,Panel:Su,Overlay:Cu,Title:ju,Description:qi}),Xi=/([\u2700-\u27BF]|[\uE000-\uF8FF]|\uD83C[\uDC00-\uDFFF]|\uD83D[\uDC00-\uDFFF]|[\u2011-\u26FF]|\uD83E[\uDD10-\uDDFF])/g;function Ji(e){var o,r;let n=(o=e.innerText)!=null?o:"",u=e.cloneNode(!0);if(!(u instanceof HTMLElement))return n;let f=!1;for(let m of u.querySelectorAll('[hidden],[aria-hidden],[role="img"]'))m.remove(),f=!0;let a=f?(r=u.innerText)!=null?r:"":n;return Xi.test(a)&&(a=a.replace(Xi,"")),a}function Tu(e){let o=e.getAttribute("aria-label");if(typeof o=="string")return o.trim();let r=e.getAttribute("aria-labelledby");if(r){let n=r.split(" ").map(u=>{let f=document.getElementById(u);if(f){let a=f.getAttribute("aria-label");return typeof a=="string"?a.trim():Ji(f).trim()}return null}).filter(Boolean);if(n.length>0)return n.join(", ")}return Ji(e).trim()}function Nu(e){let o=g.useRef(""),r=g.useRef("");return ie(()=>{let n=e.current;if(!n)return"";let u=n.innerText;if(o.current===u)return r.current;let f=Tu(n).trim().toLowerCase();return o.current=u,r.current=f,f})}var Ou=(e=>(e[e.Open=0]="Open",e[e.Closed=1]="Closed",e))(Ou||{}),ku=(e=>(e[e.Pointer=0]="Pointer",e[e.Other=1]="Other",e))(ku||{}),Iu=(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))(Iu||{});function To(e,o=r=>r){let r=e.activeItemIndex!==null?e.items[e.activeItemIndex]:null,n=ao(o(e.items.slice()),f=>f.dataRef.current.domRef.current),u=r?n.indexOf(r):null;return u===-1&&(u=null),{items:n,activeItemIndex:u}}let Mu={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,o)=>{var r;let n=To(e),u=ho(o,{resolveItems:()=>n.items,resolveActiveIndex:()=>n.activeItemIndex,resolveId:f=>f.id,resolveDisabled:f=>f.dataRef.current.disabled});return{...e,...n,searchQuery:"",activeItemIndex:u,activationTrigger:(r=o.trigger)!=null?r:1}},3:(e,o)=>{let r=e.searchQuery!==""?0:1,n=e.searchQuery+o.value.toLowerCase(),u=(e.activeItemIndex!==null?e.items.slice(e.activeItemIndex+r).concat(e.items.slice(0,e.activeItemIndex+r)):e.items).find(a=>{var m;return((m=a.dataRef.current.textValue)==null?void 0:m.startsWith(n))&&!a.dataRef.current.disabled}),f=u?e.items.indexOf(u):-1;return f===-1||f===e.activeItemIndex?{...e,searchQuery:n}:{...e,searchQuery:n,activeItemIndex:f,activationTrigger:1}},4(e){return e.searchQuery===""?e:{...e,searchQuery:"",searchActiveItemIndex:null}},5:(e,o)=>{let r=To(e,n=>[...n,{id:o.id,dataRef:o.dataRef}]);return{...e,...r}},6:(e,o)=>{let r=To(e,n=>{let u=n.findIndex(f=>f.id===o.id);return u!==-1&&n.splice(u,1),n});return{...e,...r,activationTrigger:1}}},No=g.createContext(null);No.displayName="MenuContext";function Pr(e){let o=g.useContext(No);if(o===null){let r=new Error(`<${e} /> is missing a parent <Menu /> component.`);throw Error.captureStackTrace&&Error.captureStackTrace(r,Pr),r}return o}function Pu(e,o){return xt(o.type,Mu,e,o)}let Fu=g.Fragment;function Ru(e,o){let{__demoMode:r=!1,...n}=e,u=g.useReducer(Pu,{__demoMode:r,menuState:r?0:1,buttonRef:g.createRef(),itemsRef:g.createRef(),items:[],searchQuery:"",activeItemIndex:null,activationTrigger:1}),[{menuState:f,itemsRef:a,buttonRef:m},v]=u,x=Et(o);uo([m,a],(C,M)=>{var R;v({type:1}),so(M,lo.Loose)||(C.preventDefault(),(R=m.current)==null||R.focus())},f===0);let E=ie(()=>{v({type:1})}),k=g.useMemo(()=>({open:f===0,close:E}),[f,E]),P={ref:x};return g.createElement(No.Provider,{value:u},g.createElement(mo,{value:xt(f,{0:jt.Open,1:jt.Closed})},ht({ourProps:P,theirProps:n,slot:k,defaultTag:Fu,name:"Menu"})))}let Lu="button";function Au(e,o){var r;let n=Dt(),{id:u=`headlessui-menu-button-${n}`,...f}=e,[a,m]=Pr("Menu.Button"),v=Et(a.buttonRef,o),x=nn(),E=ie(R=>{switch(R.key){case Xe.Space:case Xe.Enter:case Xe.ArrowDown:R.preventDefault(),R.stopPropagation(),m({type:0}),x.nextFrame(()=>m({type:2,focus:it.First}));break;case Xe.ArrowUp:R.preventDefault(),R.stopPropagation(),m({type:0}),x.nextFrame(()=>m({type:2,focus:it.Last}));break}}),k=ie(R=>{switch(R.key){case Xe.Space:R.preventDefault();break}}),P=ie(R=>{if(Ir(R.currentTarget))return R.preventDefault();e.disabled||(a.menuState===0?(m({type:1}),x.nextFrame(()=>{var L;return(L=a.buttonRef.current)==null?void 0:L.focus({preventScroll:!0})})):(R.preventDefault(),m({type:0})))}),C=g.useMemo(()=>({open:a.menuState===0}),[a]),M={ref:v,id:u,type:co(e,a.buttonRef),"aria-haspopup":"menu","aria-controls":(r=a.itemsRef.current)==null?void 0:r.id,"aria-expanded":a.menuState===0,onKeyDown:E,onKeyUp:k,onClick:P};return ht({ourProps:M,theirProps:f,slot:C,defaultTag:Lu,name:"Menu.Button"})}let Du="div",$u=pn.RenderStrategy|pn.Static;function _u(e,o){var r,n;let u=Dt(),{id:f=`headlessui-menu-items-${u}`,...a}=e,[m,v]=Pr("Menu.Items"),x=Et(m.itemsRef,o),E=Sn(m.itemsRef),k=nn(),P=Vn(),C=P!==null?(P&jt.Open)===jt.Open:m.menuState===0;g.useEffect(()=>{let _=m.itemsRef.current;_&&m.menuState===0&&_!==(E==null?void 0:E.activeElement)&&_.focus({preventScroll:!0})},[m.menuState,m.itemsRef,E]),Pi({container:m.itemsRef.current,enabled:m.menuState===0,accept(_){return _.getAttribute("role")==="menuitem"?NodeFilter.FILTER_REJECT:_.hasAttribute("role")?NodeFilter.FILTER_SKIP:NodeFilter.FILTER_ACCEPT},walk(_){_.setAttribute("role","none")}});let M=ie(_=>{var z,X;switch(k.dispose(),_.key){case Xe.Space:if(m.searchQuery!=="")return _.preventDefault(),_.stopPropagation(),v({type:3,value:_.key});case Xe.Enter:if(_.preventDefault(),_.stopPropagation(),v({type:1}),m.activeItemIndex!==null){let{dataRef:ee}=m.items[m.activeItemIndex];(X=(z=ee.current)==null?void 0:z.domRef.current)==null||X.click()}Ci(m.buttonRef.current);break;case Xe.ArrowDown:return _.preventDefault(),_.stopPropagation(),v({type:2,focus:it.Next});case Xe.ArrowUp:return _.preventDefault(),_.stopPropagation(),v({type:2,focus:it.Previous});case Xe.Home:case Xe.PageUp:return _.preventDefault(),_.stopPropagation(),v({type:2,focus:it.First});case Xe.End:case Xe.PageDown:return _.preventDefault(),_.stopPropagation(),v({type:2,focus:it.Last});case Xe.Escape:_.preventDefault(),_.stopPropagation(),v({type:1}),Wt().nextFrame(()=>{var ee;return(ee=m.buttonRef.current)==null?void 0:ee.focus({preventScroll:!0})});break;case Xe.Tab:_.preventDefault(),_.stopPropagation(),v({type:1}),Wt().nextFrame(()=>{Ls(m.buttonRef.current,_.shiftKey?rn.Previous:rn.Next)});break;default:_.key.length===1&&(v({type:3,value:_.key}),k.setTimeout(()=>v({type:4}),350));break}}),R=ie(_=>{switch(_.key){case Xe.Space:_.preventDefault();break}}),L=g.useMemo(()=>({open:m.menuState===0}),[m]),B={"aria-activedescendant":m.activeItemIndex===null||(r=m.items[m.activeItemIndex])==null?void 0:r.id,"aria-labelledby":(n=m.buttonRef.current)==null?void 0:n.id,id:f,onKeyDown:M,onKeyUp:R,role:"menu",tabIndex:0,ref:x};return ht({ourProps:B,theirProps:a,slot:L,defaultTag:Du,features:$u,visible:C,name:"Menu.Items"})}let Bu=g.Fragment;function zu(e,o){let r=Dt(),{id:n=`headlessui-menu-item-${r}`,disabled:u=!1,...f}=e,[a,m]=Pr("Menu.Item"),v=a.activeItemIndex!==null?a.items[a.activeItemIndex].id===n:!1,x=g.useRef(null),E=Et(o,x);ot(()=>{if(a.__demoMode||a.menuState!==0||!v||a.activationTrigger===0)return;let ee=Wt();return ee.requestAnimationFrame(()=>{var ue,we;(we=(ue=x.current)==null?void 0:ue.scrollIntoView)==null||we.call(ue,{block:"nearest"})}),ee.dispose},[a.__demoMode,x,v,a.menuState,a.activationTrigger,a.activeItemIndex]);let k=Nu(x),P=g.useRef({disabled:u,domRef:x,get textValue(){return k()}});ot(()=>{P.current.disabled=u},[P,u]),ot(()=>(m({type:5,id:n,dataRef:P}),()=>m({type:6,id:n})),[P,n]);let C=ie(()=>{m({type:1})}),M=ie(ee=>{if(u)return ee.preventDefault();m({type:1}),Ci(a.buttonRef.current)}),R=ie(()=>{if(u)return m({type:2,focus:it.Nothing});m({type:2,focus:it.Specific,id:n})}),L=Mi(),B=ie(ee=>L.update(ee)),_=ie(ee=>{L.wasMoved(ee)&&(u||v||m({type:2,focus:it.Specific,id:n,trigger:0}))}),z=ie(ee=>{L.wasMoved(ee)&&(u||v&&m({type:2,focus:it.Nothing}))}),X=g.useMemo(()=>({active:v,disabled:u,close:C}),[v,u,C]);return ht({ourProps:{id:n,ref:E,role:"menuitem",tabIndex:u===!0?void 0:-1,"aria-disabled":u===!0?!0:void 0,disabled:void 0,onClick:M,onFocus:R,onPointerEnter:B,onMouseEnter:B,onPointerMove:_,onMouseMove:_,onPointerLeave:z,onMouseLeave:z},theirProps:f,slot:X,defaultTag:Bu,name:"Menu.Item"})}let Wu=vt(Ru),Hu=vt(Au),Uu=vt(_u),Vu=vt(zu),Fr=Object.assign(Wu,{Button:Hu,Items:Uu,Item:Vu}),Qi=g.createContext(null);function el(){let e=g.useContext(Qi);if(e===null){let o=new Error("You used a <Label /> component, but it is not inside a relevant parent.");throw Error.captureStackTrace&&Error.captureStackTrace(o,el),o}return e}function Zu(){let[e,o]=g.useState([]);return[e.length>0?e.join(" "):void 0,g.useMemo(()=>function(r){let n=ie(f=>(o(a=>[...a,f]),()=>o(a=>{let m=a.slice(),v=m.indexOf(f);return v!==-1&&m.splice(v,1),m}))),u=g.useMemo(()=>({register:n,slot:r.slot,name:r.name,props:r.props}),[n,r.slot,r.name,r.props]);return g.createElement(Qi.Provider,{value:u},r.children)},[o])]}let Yu="label";function Gu(e,o){let r=Dt(),{id:n=`headlessui-label-${r}`,passive:u=!1,...f}=e,a=el(),m=Et(o);ot(()=>a.register(n),[n,a.register]);let v={ref:m,...a.props,id:n};return u&&("onClick"in v&&(delete v.htmlFor,delete v.onClick),"onClick"in f&&delete f.onClick),ht({ourProps:v,theirProps:f,slot:a.slot||{},defaultTag:Yu,name:a.name||"Label"})}let qu=vt(Gu),Ku=Object.assign(qu,{});function Xu(e=0){let[o,r]=g.useState(e),n=Yn(),u=g.useCallback(v=>{n.current&&r(x=>x|v)},[o,n]),f=g.useCallback(v=>!!(o&v),[o]),a=g.useCallback(v=>{n.current&&r(x=>x&~v)},[r,n]),m=g.useCallback(v=>{n.current&&r(x=>x^v)},[r]);return{flags:o,addFlag:u,hasFlag:f,removeFlag:a,toggleFlag:m}}let Oo=g.createContext(null);Oo.displayName="GroupContext";let Ju=g.Fragment;function Qu(e){var o;let[r,n]=g.useState(null),[u,f]=Zu(),[a,m]=Gi(),v=g.useMemo(()=>({switch:r,setSwitch:n,labelledby:u,describedby:a}),[r,n,u,a]),x={},E=e;return g.createElement(m,{name:"Switch.Description"},g.createElement(f,{name:"Switch.Label",props:{htmlFor:(o=v.switch)==null?void 0:o.id,onClick(k){r&&(k.currentTarget.tagName==="LABEL"&&k.preventDefault(),r.click(),r.focus({preventScroll:!0}))}}},g.createElement(Oo.Provider,{value:v},ht({ourProps:x,theirProps:E,defaultTag:Ju,name:"Switch.Group"}))))}let ec="button";function tc(e,o){var r;let n=Dt(),{id:u=`headlessui-switch-${n}`,checked:f,defaultChecked:a=!1,onChange:m,disabled:v=!1,name:x,value:E,form:k,...P}=e,C=g.useContext(Oo),M=g.useRef(null),R=Et(M,o,C===null?null:C.setSwitch),[L,B]=yi(f,m,a),_=ie(()=>B==null?void 0:B(!L)),z=ie(be=>{if(Ir(be.currentTarget))return be.preventDefault();be.preventDefault(),_()}),X=ie(be=>{be.key===Xe.Space?(be.preventDefault(),_()):be.key===Xe.Enter&&Us(be.currentTarget)}),ee=ie(be=>be.preventDefault()),ue=g.useMemo(()=>({checked:L}),[L]),we={id:u,ref:R,role:"switch",type:co(e,M),tabIndex:e.tabIndex===-1?0:(r=e.tabIndex)!=null?r:0,"aria-checked":L,"aria-labelledby":C==null?void 0:C.labelledby,"aria-describedby":C==null?void 0:C.describedby,disabled:v,onClick:z,onKeyUp:X,onKeyPress:ee},Oe=nn();return g.useEffect(()=>{var be;let y=(be=M.current)==null?void 0:be.closest("form");y&&a!==void 0&&Oe.addEventListener(y,"reset",()=>{B(a)})},[M,B]),g.createElement(g.Fragment,null,x!=null&&L&&g.createElement(Un,{features:Pn.Hidden,...kr({as:"input",type:"checkbox",hidden:!0,readOnly:!0,disabled:v,form:k,checked:L,name:x,value:E})}),ht({ourProps:we,theirProps:P,slot:ue,defaultTag:ec,name:"Switch"}))}let nc=vt(tc),rc=Qu,oc=Object.assign(nc,{Group:rc,Label:Ku,Description:qi});function ic(e){let o={called:!1};return(...r)=>{if(!o.called)return o.called=!0,e(...r)}}function ko(e,...o){e&&o.length>0&&e.classList.add(...o)}function Io(e,...o){e&&o.length>0&&e.classList.remove(...o)}function lc(e,o){let r=Wt();if(!e)return r.dispose;let{transitionDuration:n,transitionDelay:u}=getComputedStyle(e),[f,a]=[n,u].map(v=>{let[x=0]=v.split(",").filter(Boolean).map(E=>E.includes("ms")?parseFloat(E):parseFloat(E)*1e3).sort((E,k)=>k-E);return x}),m=f+a;if(m!==0){r.group(x=>{x.setTimeout(()=>{o(),x.dispose()},m),x.addEventListener(e,"transitionrun",E=>{E.target===E.currentTarget&&x.dispose()})});let v=r.addEventListener(e,"transitionend",x=>{x.target===x.currentTarget&&(o(),v())})}else o();return r.add(()=>o()),r.dispose}function sc(e,o,r,n){let u=r?"enter":"leave",f=Wt(),a=n!==void 0?ic(n):()=>{};u==="enter"&&(e.removeAttribute("hidden"),e.style.display="");let m=xt(u,{enter:()=>o.enter,leave:()=>o.leave}),v=xt(u,{enter:()=>o.enterTo,leave:()=>o.leaveTo}),x=xt(u,{enter:()=>o.enterFrom,leave:()=>o.leaveFrom});return Io(e,...o.base,...o.enter,...o.enterTo,...o.enterFrom,...o.leave,...o.leaveFrom,...o.leaveTo,...o.entered),ko(e,...o.base,...m,...x),f.nextFrame(()=>{Io(e,...o.base,...m,...x),ko(e,...o.base,...m,...v),lc(e,()=>(Io(e,...o.base,...m),ko(e,...o.base,...o.entered),a()))}),f.dispose}function ac({immediate:e,container:o,direction:r,classes:n,onStart:u,onStop:f}){let a=Yn(),m=nn(),v=Vt(r);ot(()=>{e&&(v.current="enter")},[e]),ot(()=>{let x=Wt();m.add(x.dispose);let E=o.current;if(E&&v.current!=="idle"&&a.current)return x.dispose(),u.current(v.current),x.add(sc(E,n.current,v.current==="enter",()=>{x.dispose(),f.current(v.current)})),x.dispose},[r])}function hn(e=""){return e.split(/\s+/).filter(o=>o.length>1)}let Rr=g.createContext(null);Rr.displayName="TransitionContext";var uc=(e=>(e.Visible="visible",e.Hidden="hidden",e))(uc||{});function cc(){let e=g.useContext(Rr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}function dc(){let e=g.useContext(Lr);if(e===null)throw new Error("A <Transition.Child /> is used but it is missing a parent <Transition /> or <Transition.Root />.");return e}let Lr=g.createContext(null);Lr.displayName="NestingContext";function Ar(e){return"children"in e?Ar(e.children):e.current.filter(({el:o})=>o.current!==null).filter(({state:o})=>o==="visible").length>0}function tl(e,o){let r=Vt(e),n=g.useRef([]),u=Yn(),f=nn(),a=ie((C,M=mn.Hidden)=>{let R=n.current.findIndex(({el:L})=>L===C);R!==-1&&(xt(M,{[mn.Unmount](){n.current.splice(R,1)},[mn.Hidden](){n.current[R].state="hidden"}}),f.microTask(()=>{var L;!Ar(n)&&u.current&&((L=r.current)==null||L.call(r))}))}),m=ie(C=>{let M=n.current.find(({el:R})=>R===C);return M?M.state!=="visible"&&(M.state="visible"):n.current.push({el:C,state:"visible"}),()=>a(C,mn.Unmount)}),v=g.useRef([]),x=g.useRef(Promise.resolve()),E=g.useRef({enter:[],leave:[],idle:[]}),k=ie((C,M,R)=>{v.current.splice(0),o&&(o.chains.current[M]=o.chains.current[M].filter(([L])=>L!==C)),o==null||o.chains.current[M].push([C,new Promise(L=>{v.current.push(L)})]),o==null||o.chains.current[M].push([C,new Promise(L=>{Promise.all(E.current[M].map(([B,_])=>_)).then(()=>L())})]),M==="enter"?x.current=x.current.then(()=>o==null?void 0:o.wait.current).then(()=>R(M)):R(M)}),P=ie((C,M,R)=>{Promise.all(E.current[M].splice(0).map(([L,B])=>B)).then(()=>{var L;(L=v.current.shift())==null||L()}).then(()=>R(M))});return g.useMemo(()=>({children:n,register:m,unregister:a,onStart:k,onStop:P,wait:x,chains:E}),[m,a,n,k,P,E,x])}function fc(){}let pc=["beforeEnter","afterEnter","beforeLeave","afterLeave"];function nl(e){var o;let r={};for(let n of pc)r[n]=(o=e[n])!=null?o:fc;return r}function mc(e){let o=g.useRef(nl(e));return g.useEffect(()=>{o.current=nl(e)},[e]),o}let hc="div",rl=pn.RenderStrategy;function vc(e,o){var r,n;let{beforeEnter:u,afterEnter:f,beforeLeave:a,afterLeave:m,enter:v,enterFrom:x,enterTo:E,entered:k,leave:P,leaveFrom:C,leaveTo:M,...R}=e,L=g.useRef(null),B=Et(L,o),_=(r=R.unmount)==null||r?mn.Unmount:mn.Hidden,{show:z,appear:X,initial:ee}=cc(),[ue,we]=g.useState(z?"visible":"hidden"),Oe=dc(),{register:be,unregister:y}=Oe;g.useEffect(()=>be(L),[be,L]),g.useEffect(()=>{if(_===mn.Hidden&&L.current){if(z&&ue!=="visible"){we("visible");return}return xt(ue,{hidden:()=>y(L),visible:()=>be(L)})}},[ue,L,be,y,z,_]);let he=Vt({base:hn(R.className),enter:hn(v),enterFrom:hn(x),enterTo:hn(E),entered:hn(k),leave:hn(P),leaveFrom:hn(C),leaveTo:hn(M)}),Pe=mc({beforeEnter:u,afterEnter:f,beforeLeave:a,afterLeave:m}),Ze=Mn();g.useEffect(()=>{if(Ze&&ue==="visible"&&L.current===null)throw new Error("Did you forget to passthrough the `ref` to the actual DOM node?")},[L,ue,Ze]);let Ye=ee&&!X,Y=X&&z&&ee,Je=!Ze||Ye?"idle":z?"enter":"leave",Re=Xu(0),q=ie(tt=>xt(tt,{enter:()=>{Re.addFlag(jt.Opening),Pe.current.beforeEnter()},leave:()=>{Re.addFlag(jt.Closing),Pe.current.beforeLeave()},idle:()=>{}})),te=ie(tt=>xt(tt,{enter:()=>{Re.removeFlag(jt.Opening),Pe.current.afterEnter()},leave:()=>{Re.removeFlag(jt.Closing),Pe.current.afterLeave()},idle:()=>{}})),ve=tl(()=>{we("hidden"),y(L)},Oe),$e=g.useRef(!1);ac({immediate:Y,container:L,classes:he,direction:Je,onStart:Vt(tt=>{$e.current=!0,ve.onStart(L,tt,q)}),onStop:Vt(tt=>{$e.current=!1,ve.onStop(L,tt,te),tt==="leave"&&!Ar(ve)&&(we("hidden"),y(L))})});let We=R,lt={ref:B};return Y?We={...We,className:Nr(R.className,...he.current.enter,...he.current.enterFrom)}:$e.current&&(We.className=Nr(R.className,(n=L.current)==null?void 0:n.className),We.className===""&&delete We.className),g.createElement(Lr.Provider,{value:ve},g.createElement(mo,{value:xt(ue,{visible:jt.Open,hidden:jt.Closed})|Re.flags},ht({ourProps:lt,theirProps:We,defaultTag:hc,features:rl,visible:ue==="visible",name:"Transition.Child"})))}function gc(e,o){let{show:r,appear:n=!1,unmount:u=!0,...f}=e,a=g.useRef(null),m=Et(a,o);Mn();let v=Vn();if(r===void 0&&v!==null&&(r=(v&jt.Open)===jt.Open),![!0,!1].includes(r))throw new Error("A <Transition /> is used but it is missing a `show={true | false}` prop.");let[x,E]=g.useState(r?"visible":"hidden"),k=tl(()=>{E("hidden")}),[P,C]=g.useState(!0),M=g.useRef([r]);ot(()=>{P!==!1&&M.current[M.current.length-1]!==r&&(M.current.push(r),C(!1))},[M,r]);let R=g.useMemo(()=>({show:r,appear:n,initial:P}),[r,n,P]);g.useEffect(()=>{if(r)E("visible");else if(!Ar(k))E("hidden");else{let z=a.current;if(!z)return;let X=z.getBoundingClientRect();X.x===0&&X.y===0&&X.width===0&&X.height===0&&E("hidden")}},[r,k]);let L={unmount:u},B=ie(()=>{var z;P&&C(!1),(z=e.beforeEnter)==null||z.call(e)}),_=ie(()=>{var z;P&&C(!1),(z=e.beforeLeave)==null||z.call(e)});return g.createElement(Lr.Provider,{value:k},g.createElement(Rr.Provider,{value:R},ht({ourProps:{...L,as:g.Fragment,children:g.createElement(ol,{ref:m,...L,...f,beforeEnter:B,beforeLeave:_})},theirProps:{},defaultTag:g.Fragment,features:rl,visible:x==="visible",name:"Transition"})))}function bc(e,o){let r=g.useContext(Rr)!==null,n=Vn()!==null;return g.createElement(g.Fragment,null,!r&&n?g.createElement(Mo,{ref:o,...e}):g.createElement(ol,{ref:o,...e}))}let Mo=vt(gc),ol=vt(vc),xc=vt(bc),vn=Object.assign(Mo,{Child:xc,Root:Mo});function yc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 wc=Z.forwardRef(yc);function Ec({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Sc=Z.forwardRef(Ec);function Cc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 jc=Z.forwardRef(Cc);function Tc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Nc=Z.forwardRef(Tc);function Oc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Po=Z.forwardRef(Oc);function kc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 il=Z.forwardRef(kc);function Ic({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Mc=Z.forwardRef(Ic);function Pc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Fc=Z.forwardRef(Pc);function Rc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Lc=Z.forwardRef(Rc),Ac={warning:{color:"bg-yellow-50",icon:w.jsx(Mc,{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:w.jsx(Lc,{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:w.jsx(jc,{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:w.jsx(Fc,{className:"h-5 w-5 text-blue-400","aria-hidden":"true"}),colorTitle:"text-blue-800",colorText:"text-blue-700"}},Dc=({type:e="info",title:o,message:r,active:n=!1,time:u=1e3,onClose:f})=>{const[a,m]=g.useState(!1),v=g.useRef(null);g.useEffect(()=>(n&&(m(!0),v.current=setTimeout(()=>{m(!1),f&&f()},u)),()=>clearTimeout(v.current)),[n,u,f]);const x=Ac[e];return a?w.jsx("div",{className:"fixed top-2.5 left-1/2 transform -translate-x-1/2 w-80 3xs:w-96 z-50",children:w.jsx(vn,{as:g.Fragment,show:a,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:w.jsxs("div",{className:ae("rounded-md p-4 text-center",x.color),children:[w.jsxs("div",{className:"flex justify-center flex-shrink-0",children:[x.icon,w.jsx("h3",{className:ae("text-sm font-medium ml-3",x.colorTitle),children:o})]}),w.jsx("div",{className:ae("mt-2 text-sm",x.colorText),children:w.jsx("p",{children:r})})]})})}):null};function $c({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 _c=Z.forwardRef($c);function Bc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 zc=Z.forwardRef(Bc);function Wc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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"}),Z.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 Hc=Z.forwardRef(Wc);function Uc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.createElement("path",{fillRule:"evenodd",d:"M1.5 6a2.25 2.25 0 0 1 2.25-2.25h16.5A2.25 2.25 0 0 1 22.5 6v12a2.25 2.25 0 0 1-2.25 2.25H3.75A2.25 2.25 0 0 1 1.5 18V6ZM3 16.06V18c0 .414.336.75.75.75h16.5A.75.75 0 0 0 21 18v-1.94l-2.69-2.689a1.5 1.5 0 0 0-2.12 0l-.88.879.97.97a.75.75 0 1 1-1.06 1.06l-5.16-5.159a1.5 1.5 0 0 0-2.12 0L3 16.061Zm10.125-7.81a1.125 1.125 0 1 1 2.25 0 1.125 1.125 0 0 1-2.25 0Z",clipRule:"evenodd"}))}const Vc=Z.forwardRef(Uc);function Zc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 Yc=Z.forwardRef(Zc);function Gc({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 qc=Z.forwardRef(Gc),Kc=({src:e,alt:o,width:r,height:n,className:u="",classNameIcon:f="",isIcon:a=!0,acronym:m=""})=>{function v(){if(typeof m!="string")return m;const x=m.toLowerCase(),E=x.split(" "),k=E[E.length-1];return x.charAt(0)+k.charAt(0)}return w.jsx(w.Fragment,{children:e?w.jsx("img",{src:e,alt:o,width:r,height:n,className:ae(u!==""&&u),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s"},onLoad:x=>x.currentTarget.style.filter="none","data-testid":"img"}):a?w.jsx(Yc,{className:ae("bg-white text-default-4",f!==""?f:"w-7 h-7")}):w.jsx("div",{className:ae("bg-gray-200 text-default-4 rounded-full font-bold uppercase flex justify-center items-center",f!==""?f:"w-7 h-7"),children:v()})})},Xc=({steps:e,onClick:o})=>{const[r,n]=g.useState(0),u=f=>{n(f),o(f)};return w.jsx("nav",{className:"flex items-center justify-center w-full","aria-label":"Progress","data-testid":"bullets",children:w.jsx("ol",{role:"list",className:"flex items-center space-x-5",children:new Array(e).fill(1).map((f,a)=>w.jsx("li",{children:r!==a?w.jsx("div",{className:"cursor-pointer block h-2.5 w-2.5 rounded-full bg-gray-500 hover:bg-gray-600",onClick:()=>u(a),"data-testid":`step-${a}`,children:w.jsx("span",{className:"sr-only",children:"step"})}):w.jsxs("div",{className:"relative flex items-center justify-center cursor-pointer","aria-current":"step",children:[w.jsx("span",{className:"absolute flex h-5 w-5 p-px","aria-hidden":"true",children:w.jsx("span",{className:"h-full w-full rounded-full bg-gray-300"})}),w.jsx("span",{className:"relative block h-2.5 w-2.5 rounded-full bg-gray-500","aria-hidden":"true"}),w.jsx("span",{className:"sr-only",children:"step"})]})},a))})})};var ll={exports:{}};/*!
|
|
32
32
|
Copyright (c) 2018 Jed Watson.
|
|
33
33
|
Licensed under the MIT License (MIT), see
|
|
34
34
|
http://jedwatson.github.io/classnames
|
|
35
|
-
*/(function(e){(function(){var o={}.hasOwnProperty;function r(){for(var f="",a=0;a<arguments.length;a++){var m=arguments[a];m&&(f=u(f,n(m)))}return f}function n(f){if(typeof f=="string"||typeof f=="number")return f;if(typeof f!="object")return"";if(Array.isArray(f))return r.apply(null,f);if(f.toString!==Object.prototype.toString&&!f.toString.toString().includes("[native code]"))return f.toString();var a="";for(var m in f)o.call(f,m)&&f[m]&&(a=u(a,m));return a}function u(f,a){return a?f?f+" "+a:f+a:f}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(ll);var Jc=ll.exports;const Zt=cs(Jc),sl=({className:e="text-sm w-full rounded-md",children:o,icon:r=null,edge:n=null,disabled:u=!1,type:f="button",onClick:a,id:m})=>{const v=Zt({"ml-2":n==="start"&&r!==null,"mr-2":n==="end"&&r!==null});return w.jsxs("button",{className:ae("flex justify-center items-center bg-white px-3 py-7px font-medium leading-6 text-white shadow-sm ring-1 ring-inset ring-gray-300 focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-indigo-600 bg-gray-50",e),type:f,onClick:a,disabled:u,"data-testid":`button-outline-${m}`,id:`button-outline-${m}`,children:[n==="start"&&r!==null&&w.jsx("span",{children:r}),w.jsx("span",{className:ae("flex",v),id:m,children:o}),n==="end"&&r!==null&&w.jsx("span",{children:r})]})},Qc=({children:e,className:o="",icon:r=null,edge:n=null,disabled:u=!1,type:f="button",onClick:a,id:m})=>{const v=Zt({"ml-2":n==="start"&&r!==null,"mr-2":n==="end"&&r!==null});return w.jsxs("button",{className:`${o} flex justify-center items-center`,edge:n,type:f,onClick:a,disabled:u,"data-testid":`button-${m}`,children:[n==="start"&&r!==null&&w.jsx("span",{children:r}),w.jsx("span",{className:v,children:e}),n==="end"&&r!==null&&w.jsx("span",{children:r})]})},Jn=({children:e,classNameButton:o="bg-indigo-600 hover:bg-indigo-700 focus-visible:outline-indigo-600 shadow-indigo-500 rounded font-semibold px-3 py-1.5 text-white w-full",classNameText:r="",icon:n=null,edge:u=null,disabled:f=!1,type:a="button",onClick:m,id:v,outline:x="0px 0px 0px 2px #6366F1, 0px 0px 0px 2px #FFF, 0px 1px 2px 0px rgba(0, 0, 0, 0.05)",classNameContainer:E=""})=>{const[k,P]=g.useState(!1),C=Zt({"ml-2":u==="start"&&n!==null,"mr-2":u==="end"&&n!==null}),M=()=>{m&&m()};return w.jsx("div",{className:ae("rounded-md p-0.5",E!==""&&E),style:{boxShadow:k?x:"0px 0px 0px 0px #6366F1, 0px 0px 0px 0px #FFF, 0px 0px 0px 0px rgba(0, 0, 0, 0.05)",transition:"box-shadow .1s ease-in-out"},"data-testid":"container-button",children:w.jsxs("button",{className:ae("flex justify-center items-center text-sm leading-6 shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",f&&"text-white bg-gray-300 rounded focus:outline-none cursor-default",f?o.replace(/\bbg-\w+\b/g,""):o),type:a,onClick:M,onFocus:()=>P(!0),onBlur:()=>P(!1),disabled:f,"data-testid":`button-solid-${v}`,children:[u==="start"&&n!==null&&w.jsx("span",{className:"flex",children:n}),w.jsx("span",{className:ae(r.length===0&&C,r.length!==0&&r),children:e}),u==="end"&&n!==null&&w.jsx("span",{children:n})]})})},ed=({label:e=null,checked:o=!1,onChange:r,id:n,className:u="",classNameCheckbox:f="h-4 w-4",style:a={},disabled:m=!1})=>{const[v,x]=g.useState(!1);return g.useEffect(()=>{x(o)},[o]),w.jsxs("div",{className:"flex items-center",style:a,"data-testid":`container-check-${n}`,children:[w.jsx("input",{checked:v,id:`${e}-${n}`,value:n,"aria-describedby":"comments-description",type:"checkbox",onChange:r,className:ae("cursor-pointer rounded border-gray-300 text-indigo-600 focus:ring-indigo-600",f!==""&&f),"data-testid":`checkbox-${n}`,disabled:m}),e!==null?w.jsx("label",{htmlFor:`${e}-${n}`,className:`ml-2.5 font-normal cursor-pointer ${u}`,id:`label-${n}`,"data-testid":"label",children:e}):null]})};function td({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const nd=Z.forwardRef(td);function rd({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const al=Z.forwardRef(rd);function od({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const id=Z.forwardRef(od);function ld({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 sd=Z.forwardRef(ld);function ad({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 ud=Z.forwardRef(ad);function ul({children:e,className:o="sm:max-w-sm w-11/12 sm:my-8",classNameContainer:r="",isOpen:n=!1,setIsOpen:u,showIconSuccess:f=!0,showButton:a=!0,style:m={}}){return w.jsx(vn,{show:n,as:g.Fragment,children:w.jsxs(Ki,{as:"div",className:"z-50 relative",onClose:u,"data-testid":"modal",children:[w.jsx(vn.Child,{as:g.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-5",leave:"ease-in duration-200",leaveFrom:"opacity-5",leaveTo:"opacity-0",children:w.jsx("div",{className:"fixed inset-0 bg-opacity-40 bg-gray-900 transition-opacity","data-testid":"window-close",onClick:()=>u(!1)})}),w.jsx("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:w.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:w.jsx(vn.Child,{as:g.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:w.jsxs(Ki.Panel,{className:ae("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",o!==""&&o),style:m,children:[f&&w.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:w.jsx(nd,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})}),w.jsx("div",{className:ae(r!==""&&r),"data-testid":"content",children:e}),a&&w.jsx("div",{className:"mt-5 sm:mt-6",children:w.jsx(Jn,{id:"close-modal",onClick:()=>u(!1),children:"Cerrar"})}),w.jsx("button",{className:"opacity-0 absolute"})]})})})})]})})}const cd=({isOpenModalConfirmation:e,setIsOpenModalConfirmation:o,close:r,title:n="¿Estás seguro de abandonar la creación de la acción?",description:u="La información se perderá si no creas la acción",classNameTitle:f="",classNameDescription:a=""})=>{const m=()=>{o(!1),r()};return w.jsxs(ul,{isOpen:e,setIsOpen:()=>o(),showButton:!1,showIconSuccess:!1,children:[w.jsx("p",{className:ae("text-center text-sm",f!==""&&f),children:n}),w.jsx("p",{className:ae("text-center text-sm",a!==""&&a),children:u}),w.jsxs("div",{className:"flex w-full justify-center mt-5",children:[w.jsx(sl,{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:()=>o(),id:"cancel",children:"Cancelar"}),w.jsx(Jn,{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:m,id:"confirmation",children:"Aceptar"})]})]})},dd=({className:e="",style:o={}})=>w.jsx("div",{className:ae("w-px",e!==""&&e),style:o}),fd=({onClick:e,id:o="",className:r=""})=>w.jsxs("div",{className:ae("flex items-center text-default-5",r!==""&&r),"data-testid":o,children:[w.jsx(_c,{className:"w-3 h-3 3xs:w-4 3xs:h-4 stroke-current cursor-pointer","data-testid":"chevron-left-icon",onClick:e}),w.jsx("span",{onClick:e,className:"text-sm cursor-pointer","data-testid":"go-back",children:"Volver"})]});var Fo={exports:{}};(function(e,o){(function(r,n){n(o,g,Sr)})(us,function(r,n,u){function f(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(l,i,s.get?s:{enumerable:!0,get:()=>t[i]})}}return l.default=t,Object.freeze(l)}const a=f(n),m=(t,l=!1)=>{function i(s){if(typeof s!="object"||s===null)return s;const c=Array.isArray(s)?[]:{};for(const d in s)s.hasOwnProperty(d)&&!l&&(c[d]=i(s[d]));return c}return t.map(s=>i(s))},v=t=>/^(?:[^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*|"[^\n"]+")@(?:[^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,63}$/i.test(t);function x(...t){return t.filter(Boolean).join(" ")}const E=t=>{const l=t.split(" ");let i=t.slice(0,2);return l.length>1&&(i=`${t.at(0)}${l[l.length-1].slice(0,1)}`),i},k=t=>typeof t!="string"&&Promise.resolve(t)instanceof Promise,P="The user aborted a request.",C="signal is aborted without reason",M=({id:t,close:l,isPathsTest:i=!1,isTest:s=!1})=>{const c=n.useCallback(d=>{d.some(p=>p.getAttribute===void 0?!1:p.getAttribute("id")===t)||l()},[l,t]);n.useEffect(()=>{const d=p=>{const h=p.composedPath();h===void 0||i||(s&&(h[0].getAttribute=()=>t),c(h))};return window.addEventListener("click",d),()=>{window.removeEventListener("click",d)}},[c,i,s,t])},R=()=>{const t=n.useRef({}),[l,i]=n.useState({}),[s,c]=n.useState({}),[d,p]=n.useState([]);n.useEffect(()=>{t.current={}},[]);const h=I=>A=>{A.preventDefault(),A.stopPropagation(),I(l)},b=(I,A,O)=>{const{checked:D,value:F,name:$,type:U,id:W}=I.target,J={radio:W,checkbox:D};t.current={...O,...t.current,[$]:J[U]??F},i({...t.current,[$]:J[U]??F}),A({...t.current,[$]:J[U]??F})},S=n.useCallback((I,A)=>{t.current={...t.current,[I]:A},i(O=>({...O,[I]:A}))},[]),N=n.useCallback((I,A)=>{const O=A.filter(D=>I[D]===""||I[D]===void 0);return O.forEach(D=>c(F=>({...F,[D]:"Este campo es requerido"}))),p(O),O.length>0},[]);return{handleSubmit:h,handleChange:b,setValuesDefault:S,validateFields:N,errors:d,model:l,handleError:(I,A)=>{A.forEach(O=>c(D=>({...D,[O]:I}))),p(A)},messageError:s,setModel:i}},L=t=>{const[l,i]=n.useState(!0),[s,c]=n.useState(!1),d=n.useCallback((p,h)=>{const b=t.match(/[0-9]+/g);if(b===null)return;const[S]=b;h=Math.min(window.innerWidth,window.outerWidth);const N=p?h>=Number(S):h<=Number(S);c(N)},[t]);return n.useEffect(()=>{const p=/\(min-width:\s?[0-9]+px\)/gi.test(t),h=/\(max-width:\s?[0-9]+px\)/gi.test(t);if(!p&&!h&&i(!1),!p&&!h)return;const b=Math.min(window.innerWidth,window.outerWidth);d(p,b)},[t,d]),n.useEffect(()=>{if(!l)return;const p=Math.min(window.innerWidth,window.outerWidth);function h(){const b=/min-width/gi.test(t);d(b,p)}return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[l,t,d]),s},B=()=>{const[t,l]=n.useState({width:0,height:0});return n.useEffect(()=>{const i=()=>{const s=Math.min(window.innerWidth,window.outerWidth),c=Math.min(window.innerHeight,window.outerHeight);l({width:s,height:c})};return requestAnimationFrame(()=>i()),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),t};function _(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z={exports:{}},X={};/**
|
|
35
|
+
*/(function(e){(function(){var o={}.hasOwnProperty;function r(){for(var f="",a=0;a<arguments.length;a++){var m=arguments[a];m&&(f=u(f,n(m)))}return f}function n(f){if(typeof f=="string"||typeof f=="number")return f;if(typeof f!="object")return"";if(Array.isArray(f))return r.apply(null,f);if(f.toString!==Object.prototype.toString&&!f.toString.toString().includes("[native code]"))return f.toString();var a="";for(var m in f)o.call(f,m)&&f[m]&&(a=u(a,m));return a}function u(f,a){return a?f?f+" "+a:f+a:f}e.exports?(r.default=r,e.exports=r):window.classNames=r})()})(ll);var Jc=ll.exports;const Zt=cs(Jc),sl=({className:e="text-sm w-full rounded-md",children:o,icon:r=null,edge:n=null,disabled:u=!1,type:f="button",onClick:a,id:m})=>{const v=Zt({"ml-2":n==="start"&&r!==null,"mr-2":n==="end"&&r!==null});return w.jsxs("button",{className:ae("flex justify-center items-center bg-white px-3 py-7px font-medium leading-6 text-white 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:f,onClick:a,disabled:u,"data-testid":`button-outline-${m}`,id:`button-outline-${m}`,children:[n==="start"&&r!==null&&w.jsx("span",{children:r}),w.jsx("span",{className:ae("flex",v),id:m,children:o}),n==="end"&&r!==null&&w.jsx("span",{children:r})]})},Qc=({children:e,className:o="",icon:r=null,edge:n=null,disabled:u=!1,type:f="button",onClick:a,id:m})=>{const v=Zt({"ml-2":n==="start"&&r!==null,"mr-2":n==="end"&&r!==null});return w.jsxs("button",{className:`${o} flex justify-center items-center`,edge:n,type:f,onClick:a,disabled:u,"data-testid":`button-${m}`,children:[n==="start"&&r!==null&&w.jsx("span",{children:r}),w.jsx("span",{className:v,children:e}),n==="end"&&r!==null&&w.jsx("span",{children:r})]})},Jn=({children:e,classNameButton:o="bg-primary-7 hover:bg-primary-8 focus-visible:outline-primary-7 shadow-primary-6 rounded font-semibold px-3 py-1.5 text-white w-full",classNameText:r="",icon:n=null,edge:u=null,disabled:f=!1,type:a="button",onClick:m,id:v,outline:x="0px 0px 0px 2px #6366F1, 0px 0px 0px 2px #FFF, 0px 1px 2px 0px rgba(0, 0, 0, 0.05)",classNameContainer:E=""})=>{const[k,P]=g.useState(!1),C=Zt({"ml-2":u==="start"&&n!==null,"mr-2":u==="end"&&n!==null}),M=()=>{m&&m()};return w.jsx("div",{className:ae("rounded-md p-0.5",E!==""&&E),style:{boxShadow:k?x:"0px 0px 0px 0px #6366F1, 0px 0px 0px 0px #FFF, 0px 0px 0px 0px rgba(0, 0, 0, 0.05)",transition:"box-shadow .1s ease-in-out"},"data-testid":"container-button",children:w.jsxs("button",{className:ae("flex justify-center items-center text-sm leading-6 shadow-sm focus-visible:outline focus-visible:outline-2 focus-visible:outline-offset-2",f&&"text-white bg-gray-300 rounded focus:outline-none cursor-default",f?o.replace(/\bbg-\w+\b/g,""):o),type:a,onClick:M,onFocus:()=>P(!0),onBlur:()=>P(!1),disabled:f,"data-testid":`button-solid-${v}`,children:[u==="start"&&n!==null&&w.jsx("span",{className:"flex",children:n}),w.jsx("span",{className:ae(r.length===0&&C,r.length!==0&&r),children:e}),u==="end"&&n!==null&&w.jsx("span",{children:n})]})})},ed=({label:e=null,checked:o=!1,onChange:r,id:n,className:u="",classNameCheckbox:f="h-4 w-4",style:a={},disabled:m=!1})=>{const[v,x]=g.useState(!1);return g.useEffect(()=>{x(o)},[o]),w.jsxs("div",{className:"flex items-center",style:a,"data-testid":`container-check-${n}`,children:[w.jsx("input",{checked:v,id:`${e}-${n}`,value:n,"aria-describedby":"comments-description",type:"checkbox",onChange:r,className:ae("cursor-pointer rounded border-gray-300 text-primary-7 focus:ring-primary-7",f!==""&&f),"data-testid":`checkbox-${n}`,disabled:m}),e!==null?w.jsx("label",{htmlFor:`${e}-${n}`,className:`ml-2.5 font-normal cursor-pointer ${u}`,id:`label-${n}`,"data-testid":"label",children:e}):null]})};function td({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 12.75 6 6 9-13.5"}))}const nd=Z.forwardRef(td);function rd({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m19.5 8.25-7.5 7.5-7.5-7.5"}))}const al=Z.forwardRef(rd);function od({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.createElement("path",{strokeLinecap:"round",strokeLinejoin:"round",d:"m4.5 15.75 7.5-7.5 7.5 7.5"}))}const id=Z.forwardRef(od);function ld({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 sd=Z.forwardRef(ld);function ad({title:e,titleId:o,...r},n){return Z.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:n,"aria-labelledby":o},r),e?Z.createElement("title",{id:o},e):null,Z.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 ud=Z.forwardRef(ad);function ul({children:e,className:o="sm:max-w-sm w-11/12 sm:my-8",classNameContainer:r="",isOpen:n=!1,setIsOpen:u,showIconSuccess:f=!0,showButton:a=!0,style:m={}}){return w.jsx(vn,{show:n,as:g.Fragment,children:w.jsxs(Ki,{as:"div",className:"z-50 relative",onClose:u,"data-testid":"modal",children:[w.jsx(vn.Child,{as:g.Fragment,enter:"ease-out duration-300",enterFrom:"opacity-0",enterTo:"opacity-5",leave:"ease-in duration-200",leaveFrom:"opacity-5",leaveTo:"opacity-0",children:w.jsx("div",{className:"fixed inset-0 bg-opacity-40 bg-gray-900 transition-opacity","data-testid":"window-close",onClick:()=>u(!1)})}),w.jsx("div",{className:"fixed inset-0 z-10 overflow-y-auto",children:w.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:w.jsx(vn.Child,{as:g.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:w.jsxs(Ki.Panel,{className:ae("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",o!==""&&o),style:m,children:[f&&w.jsx("div",{className:"mx-auto flex h-12 w-12 items-center justify-center rounded-full bg-green-100",children:w.jsx(nd,{className:"h-6 w-6 text-green-600","aria-hidden":"true"})}),w.jsx("div",{className:ae(r!==""&&r),"data-testid":"content",children:e}),a&&w.jsx("div",{className:"mt-5 sm:mt-6",children:w.jsx(Jn,{id:"close-modal",onClick:()=>u(!1),children:"Cerrar"})}),w.jsx("button",{className:"opacity-0 absolute"})]})})})})]})})}const cd=({isOpenModalConfirmation:e,setIsOpenModalConfirmation:o,close:r,title:n="¿Estás seguro de abandonar la creación de la acción?",description:u="La información se perderá si no creas la acción",classNameTitle:f="",classNameDescription:a=""})=>{const m=()=>{o(!1),r()};return w.jsxs(ul,{isOpen:e,setIsOpen:()=>o(),showButton:!1,showIconSuccess:!1,children:[w.jsx("p",{className:ae("text-center text-sm",f!==""&&f),children:n}),w.jsx("p",{className:ae("text-center text-sm",a!==""&&a),children:u}),w.jsxs("div",{className:"flex w-full justify-center mt-5",children:[w.jsx(sl,{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:()=>o(),id:"cancel",children:"Cancelar"}),w.jsx(Jn,{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:m,id:"confirmation",children:"Aceptar"})]})]})},dd=({className:e="",style:o={}})=>w.jsx("div",{className:ae("w-px",e!==""&&e),style:o}),fd=({onClick:e,id:o="",className:r=""})=>w.jsxs("div",{className:ae("flex items-center text-default-4",r!==""&&r),"data-testid":o,children:[w.jsx(_c,{className:"w-3 h-3 3xs:w-4 3xs:h-4 stroke-current cursor-pointer","data-testid":"chevron-left-icon",onClick:e}),w.jsx("span",{onClick:e,className:"text-sm cursor-pointer","data-testid":"go-back",children:"Volver"})]});var Fo={exports:{}};(function(e,o){(function(r,n){n(o,g,Sr)})(us,function(r,n,u){function f(t){const l=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const s=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(l,i,s.get?s:{enumerable:!0,get:()=>t[i]})}}return l.default=t,Object.freeze(l)}const a=f(n),m=(t,l=!1)=>{function i(s){if(typeof s!="object"||s===null)return s;const c=Array.isArray(s)?[]:{};for(const d in s)s.hasOwnProperty(d)&&!l&&(c[d]=i(s[d]));return c}return t.map(s=>i(s))},v=t=>/^(?:[^<>()[\].,;:\s@"]+(\.[^<>()[\].,;:\s@"]+)*|"[^\n"]+")@(?:[^<>()[\].,;:\s@"]+\.)+[^<>()[\].,;:\s@"]{2,63}$/i.test(t);function x(...t){return t.filter(Boolean).join(" ")}const E=t=>{const l=t.split(" ");let i=t.slice(0,2);return l.length>1&&(i=`${t.at(0)}${l[l.length-1].slice(0,1)}`),i},k=t=>typeof t!="string"&&Promise.resolve(t)instanceof Promise,P="The user aborted a request.",C="signal is aborted without reason",M=({id:t,close:l,isPathsTest:i=!1,isTest:s=!1})=>{const c=n.useCallback(d=>{d.some(p=>p.getAttribute===void 0?!1:p.getAttribute("id")===t)||l()},[l,t]);n.useEffect(()=>{const d=p=>{const h=p.composedPath();h===void 0||i||(s&&(h[0].getAttribute=()=>t),c(h))};return window.addEventListener("click",d),()=>{window.removeEventListener("click",d)}},[c,i,s,t])},R=()=>{const t=n.useRef({}),[l,i]=n.useState({}),[s,c]=n.useState({}),[d,p]=n.useState([]);n.useEffect(()=>{t.current={}},[]);const h=I=>A=>{A.preventDefault(),A.stopPropagation(),I(l)},b=(I,A,O)=>{const{checked:D,value:F,name:$,type:U,id:W}=I.target,J={radio:W,checkbox:D};t.current={...O,...t.current,[$]:J[U]??F},i({...t.current,[$]:J[U]??F}),A({...t.current,[$]:J[U]??F})},S=n.useCallback((I,A)=>{t.current={...t.current,[I]:A},i(O=>({...O,[I]:A}))},[]),N=n.useCallback((I,A)=>{const O=A.filter(D=>I[D]===""||I[D]===void 0);return O.forEach(D=>c(F=>({...F,[D]:"Este campo es requerido"}))),p(O),O.length>0},[]);return{handleSubmit:h,handleChange:b,setValuesDefault:S,validateFields:N,errors:d,model:l,handleError:(I,A)=>{A.forEach(O=>c(D=>({...D,[O]:I}))),p(A)},messageError:s,setModel:i}},L=t=>{const[l,i]=n.useState(!0),[s,c]=n.useState(!1),d=n.useCallback((p,h)=>{const b=t.match(/[0-9]+/g);if(b===null)return;const[S]=b;h=Math.min(window.innerWidth,window.outerWidth);const N=p?h>=Number(S):h<=Number(S);c(N)},[t]);return n.useEffect(()=>{const p=/\(min-width:\s?[0-9]+px\)/gi.test(t),h=/\(max-width:\s?[0-9]+px\)/gi.test(t);if(!p&&!h&&i(!1),!p&&!h)return;const b=Math.min(window.innerWidth,window.outerWidth);d(p,b)},[t,d]),n.useEffect(()=>{if(!l)return;const p=Math.min(window.innerWidth,window.outerWidth);function h(){const b=/min-width/gi.test(t);d(b,p)}return window.addEventListener("resize",h),()=>window.removeEventListener("resize",h)},[l,t,d]),s},B=()=>{const[t,l]=n.useState({width:0,height:0});return n.useEffect(()=>{const i=()=>{const s=Math.min(window.innerWidth,window.outerWidth),c=Math.min(window.innerHeight,window.outerHeight);l({width:s,height:c})};return requestAnimationFrame(()=>i()),window.addEventListener("resize",i),()=>window.removeEventListener("resize",i)},[]),t};function _(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}var z={exports:{}},X={};/**
|
|
36
36
|
* @license React
|
|
37
37
|
* react-jsx-runtime.production.min.js
|
|
38
38
|
*
|
|
@@ -92,7 +92,7 @@ Check the top-level render call using <`+oe+">.")}return G}}function Xl(T,G){{if
|
|
|
92
92
|
width: 414px;
|
|
93
93
|
}
|
|
94
94
|
}
|
|
95
|
-
`}),y.jsx(Kr.Button,{as:"div",onClick:()=>Ne(de),"data-testid":`menu-button-${se}`,ref:Ue,children:t}),u.createPortal(y.jsx("div",{style:De,className:x(s,de&&"hidden",O&&"w-full"),children:y.jsx(kn,{as:n.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:bt,children:y.jsx(Kr.Items,{className:x("mt-1 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",O?"w-full":d===""&&"w-max",d!==""&&d),children:O?y.jsx("div",{className:"flex justify-center py-4",children:y.jsx(yr,{})}):y.jsxs("div",{className:x(!W&&"pb-1",i!==""&&i,He&&"w-custom"),"data-testid":"dropdown-menu",children:[y.jsxs("div",{className:"sticky top-0 bg-white w-full",children:[D!==null&&y.jsx("div",{className:x("py-2 w-full",p),children:y.jsx(si,{htmlFor:"search",id:`dropdown-search-${se}`,name:"search",type:"text",placeholder:F,handleChange:fe=>D(fe,se),icon:F!==""&&y.jsx(km,{className:"w-4 h-4 text-indigo-300"}),className:"pl-5 pr-4 h-8",classNameContainerInput:"w-full",value:$,onKeyDown:fe=>fe.key===" "&&fe.stopPropagation(),autocomplete:"off"})}),Be!==null&&y.jsxs("div",{className:x("pt-1.5 justify-end flex items-center",p),children:[y.jsx(xr,{classNameButton:x("bg-gray-400 hover:bg-gray-400 font-medium px-2 py-1.5 rounded-md",ut.size>0?"opacity-1 cursor-pointer":"opacity-0 cursor-default"),outline:"",classNameText:"text-xs text-white text-center",id:"delete",onClick:zt,children:"Descartar"}),y.jsx(xr,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 font-medium px-2 py-1.5 rounded-md",outline:ut.size===0&&ze?"":"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:ut.size===0&&ze,onClick:()=>Be({id:se,items:Array.from(Rt.values())}),children:ct})]})]}),ye&&!dt&&y.jsx("div",{className:"flex flex-wrap ml-7 pt-1",children:Array.from(Rt).map((fe,Ve)=>y.jsx("div",{className:"mr-1",children:y.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:[fe[1][S],y.jsx("button",{type:"button",className:"p-0.5 rounded-sm bg-gray-100 hover:bg-gray-300",onClick:()=>nt(fe[1]),"data-testid":`tag-${fe[0]}`,children:y.jsx(Dm,{className:"h-2.5 w-2.5 stroke-gray-700/50 group-hover:stroke-gray-700/75"})})]})},fe))}),y.jsx("div",{className:"divide-y divide-gray-100",children:(dt?[]:l).map((fe,Ve)=>y.jsx("div",{className:x(!W&&"py-1",J&&Ve===0&&"sticky top-0"),children:W?y.jsx("div",{onClick:Ot=>{Ot.preventDefault(),b()},"data-testid":`item-component-${Ve}`,children:fe}):y.jsx(Kr.Item,{children:y.jsx("span",{className:x(ut.has(fe[N])&&"blue text-white",!ut.has(fe[N])&&"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-${Ve}`,onClick:Ot=>{Ot.preventDefault(),le(fe)},children:An(fe[S])})})},Ve))})]})})})}),document.body)]})},Hl=50,l0=({total:t,handleNext:l,handlePrev:i,handleSelectPage:s,page:c=null})=>{const[d,p]=n.useState(1),[h,b]=n.useState([]),[S,N]=n.useState([]),I=Math.ceil(t/Hl);n.useEffect(()=>{const F=[];for(let $=1;$<=I;$++)F.push($);N(F)},[I]),n.useEffect(()=>{let F=[];const $="...",U="... ",W=" ...";if(S.length<6)F=S;else if(d>=1&&d<=3)F=[1,2,3,4,$,S.length];else if(d===4)F=[...S.slice(0,5),$,S.length];else if(d>4&&d<S.length-2){const J=S.slice(d-2,d),de=S.slice(d,d+1);F=[1,U,...J,...de,W,S.length]}else if(d>S.length-3){const J=S.slice(S.length-4);F=[1,U,...J]}b(F)},[d,S]),n.useEffect(()=>{c!==null&&c!==d&&p(c)},[c,d]);const A=F=>{p(F),s(F)},O=()=>{p(d===1?d:d-1),d>1&&i(d-1)},D=()=>{d===S.length?p(d):p(d+1),d<S.length&&l(d+1)};return y.jsxs("nav",{className:"flex items-center justify-between border-t border-gray-200 px-4 sm:px-0",children:[y.jsx("div",{className:"-mt-px flex w-0 flex-1",children:y.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:O,"data-testid":"prev",children:[y.jsx(am,{className:"mr-3 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Anterior"]})}),y.jsx("div",{className:"hidden md:-mt-px md:flex",children:h.map((F,$)=>y.jsx(Bl,{className:x("inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",d===F?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),"aria-current":"page",onClick:()=>F!=="..."&&F!==" ..."&&F!=="... "&&A(F),id:`page-${$+1}`,children:F},$))}),y.jsx("div",{className:"-mt-px flex w-0 flex-1 justify-end",children:y.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:D,"data-testid":"next",children:["Siguiente",y.jsx(cm,{className:"ml-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]})})]})},s0=({setForm:t,setValuesDefault:l,className:i="",classNameContainer:s="",classNameContainerImg:c="",src:d=null,alt:p=null,width:h,height:b})=>{const S=N=>{const{files:I}=N.target,[A]=I,O=new FileReader;O.readAsDataURL(A),O.onload=function(){t(D=>({...D,photo:O.result})),l("photo",O.result)}};return y.jsxs("div",{className:x("col-span-full",s!==""&&s),children:[y.jsx("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-500",children:"Logo (Opcional)"}),y.jsxs("div",{className:x("mt-2 flex justify-center rounded-lg border-2 border-dotted border-gray-300 cursor-pointer relative",d===null&&"px-9 pt-6 pb-2.5",c!==""&&c),children:[d?y.jsx("img",{src:d,alt:p,width:h,height:b,className:x(i!==""&&i),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:b},onLoad:N=>N.currentTarget.style.filter="none","data-testid":"img"}):y.jsxs("div",{className:"text-center",children:[y.jsx(Fm,{"aria-hidden":"true",className:"mx-auto h-12 w-12 text-gray-300"}),y.jsxs("div",{className:"mt-4 flex text-sm leading-6 text-gray-600",children:[y.jsx("label",{htmlFor:"file-upload",className:"relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500",children:y.jsx("span",{children:"Upload a file"})}),y.jsx("p",{className:"pl-1",children:"or drag and drop"})]}),y.jsx("p",{className:"text-xs leading-5 text-gray-600",children:"PNG, JPG, GIF up to 10MB"})]}),y.jsx("input",{id:"file-upload",name:"file-upload",type:"file",className:"absolute w-full h-full opacity-0 cursor-pointer",onChange:S})]})]})},a0=({children:t,openDefault:l=!1,setForm:i,setValuesDefault:s,title:c,type:d,data:p,setData:h,id:b,defaultData:S,dispatch:N,isAdd:I=!0,search:A=null,isPadding:O=!0,isReadOnly:D=!1,isEdit:F=!1,deleteItem:$=null,validateAdd:U=null,loading:W=!1,internalEdit:J=!0,isDataEmpty:de=!0,typeProp:se="value",setAdd:xe=null,hasNoRecords:qe=!0,tabs:He=null,selectTab:ye=null})=>{const[Te,Me]=n.useState(!1),[Be,ct]=n.useState(!1),[,mt]=n.useState(!1),[K,dt]=n.useState(""),[ze,bt]=n.useState(1);n.useEffect(()=>{Me(l),mt(D)},[l,D]);const ce=({e:De,index:Ct})=>{const et=m(p),{name:At,value:le}=De.target;!(U!==null&&U({value:le,copyData:et,index:Ct}))&&(et[Ct][At]=le),h(et),s(b,et),i(Ne=>({...Ne,[b]:et}))},Ue=()=>{if(p.some(De=>Object.values(De).some(Ct=>Ct[se]===-1))||p.length===0)return N({type:"ALERT",payload:{title:"",message:"Todos los campos son requeridos",typeAlert:"warning",active:!0}});i(De=>({...De,data:p})),s(b,p),h([...p,S]),xe&&xe([...p,S])},ut=({index:De,item:Ct})=>{if(p.length===1&&!F)return;const et=m(p);et.splice(De,1),i(At=>({...At,data:et})),s(b,et),h(et),$&&$({index:De,item:Ct,data:et}),De===p.length-1&&F&&et.length===0&&(i(At=>({...At,data:et})),s(b,et),h([...et,S]))},Nt=()=>{ct(!Be),mt(!1)},Rt=()=>{if(p.length>1)return;if(p.length===0)return!0;const[De]=p,{rol:Ct,privileges:et,limitedPrivileges:At,...le}=De;return Object.values(le).every(Ne=>Object.values(Ne)[0]===-1)},wt=({tab:De})=>{bt(De.id),ye&&ye({tab:De})};return y.jsxs("div",{className:"divide-y divide-gray-200 rounded-lg bg-white shadow mt-7",children:[y.jsxs("div",{className:"px-4 py-3.5 sm:px-6 flex justify-between items-center cursor-pointer",onClick:()=>Me(!Te),"data-testid":`open-accordion-${b}`,children:[y.jsx("p",{className:"text-gray-500 uppercase text-xs font-bold",children:c}),y.jsxs("div",{className:"flex items-center",children:[A&&y.jsx(si,{htmlFor:"search",id:"search",name:"search",type:"text",autoComplete:"search",placeholder:"Buscar...",handleChange:De=>{A(De),dt(De.target.value)},icon:y.jsx(qm,{className:"w-6 h-6 text-indigo-300"}),className:"h-9",classNameContainerInput:"w-52 2xs:w-64 max-w-64 mr-8 hidden sm:block",value:K,onClick:De=>De.stopPropagation(),onFocus:()=>Me(!0)}),Te?y.jsx(Ym,{className:"w-5 h-5 text-default-5"}):y.jsx(Vm,{className:"w-5 h-5 text-default-5"})]})]}),y.jsx(kn,{as:n.Fragment,show:Te,enter:"transition duration-[400ms]",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-200 transition ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:y.jsxs("div",{children:[He&&y.jsx("nav",{className:"flex justify-center border-b border-gray-200","aria-label":"Tabs",children:He.map(De=>y.jsx("span",{className:x(ze===De.id?"border-indigo-500 text-gray-900":"border-gray-300 text-gray-500 hover:border-indigo-500","whitespace-nowrap border-b-2 py-2.5 px-2 text-sm font-medium cursor-pointer"),"aria-current":ze===De.id?"page":void 0,onClick:()=>wt({tab:De}),"data-testid":`tab-${De.id}`,children:De.name},De.name))}),y.jsxs("div",{className:x("sm:mt-2.5 py-3.5 relative",O&&He===null&&"px-4 sm:p-6",O&&He!==null&&"px-4 sm:px-6 sm:pb-6 sm:pt-2.5"),children:[J&&!Be&&y.jsx(Mm,{className:"w-5 h-5 text-gray-400 cursor-pointer absolute right-4",onClick:Nt,"data-testid":`edit-role-${b}`}),W&&y.jsx("div",{className:"flex justify-center mt-5",children:y.jsx(yr,{})}),de&&Rt()&&qe&&!W&&(J?!Be:!F)&&y.jsx("p",{className:"text-gray-800 text-center","data-testid":"records-empty",children:"No hay registros para mostrar"}),!W&&p.map((De,Ct)=>y.jsxs("div",{className:x("flex flex-col 3xs:flex-row mb-4",O&&"ml-0 3xs:ml-3"),children:[typeof t=="function"?t({item:De,index:Ct,handleChange:ce,isEdit:J?Be:F}):t,I&&(J?Be:F)&&y.jsx("div",{style:{backgroundColor:"#B0B8BF",width:"25px",height:"25px"},className:x("rounded-full flex justify-center items-center mt-4 3xs:mt-7 ml-2 3xs:ml-5 self-start 3xs:self-center",p.length===1&&!F&&"opacity-0"),children:y.jsx(Xm,{className:x("w-6 h-4",(p.length>1||F)&&"cursor-pointer"),style:{color:"#637381"},strokeWidth:2.5,onClick:()=>ut({index:Ct,item:De}),"data-testid":`delete-item-${Ct}-${b}`})})]},Ct)),I&&(J?Be:F)&&!W&&y.jsx("p",{className:"text-secondary-2 text-sm font-medium ml-3 cursor-pointer",onClick:Ue,"data-testid":`add-item-${b}`,style:{width:"fit-content"},children:`+ Añadir ${d}`})]})]})})]})},u0=({src:t,alt:l,width:i,height:s,className:c="",priority:d=!1,style:p={},id:h=""})=>{const[b,S]=n.useState(!1),N={filter:b?"none":"blur(10px)",transition:"filter 0.3s ease-out",objectFit:"cover",...i?{width:i}:{},...s?{height:s}:{},...p};return y.jsx("img",{src:t,alt:l,...i?{width:i}:{},...s?{height:s}:{},className:x(c!==""&&c),loading:d?"eager":"lazy",decoding:"async",style:N,onLoad:()=>S(!0),"data-testid":`image-${h}`})};r.Accordion=a0,r.Alert=jm,r.Avatar=$m,r.Bullets=_m,r.ButtonOutline=_l,r.ButtonPagination=Bl,r.ButtonSolid=xr,r.Checkbox=zm,r.ConfirmationAbandoningCreation=Jm,r.CoverPhoto=s0,r.Divider=Qm,r.Dropdown=i0,r.GoBack=e0,r.Image=u0,r.Input=si,r.InputDropdown=n0,r.MESSAGE_ABORT_CONTROLLER=P,r.MESSAGE_SIGNAL_ABORTED_WITHOUT_REASON=C,r.Modal=zl,r.Pagination=l0,r.Select=Wl,r.Spinner=t0,r.SpinnerIcon=yr,r.Switch=r0,r.Textarea=o0,r.Tooltip=li,r.classNames=x,r.copyOptions=m,r.generateAvatarInitials=E,r.isPromise=k,r.rowsPerPage=Hl,r.useCloseModal=M,r.useForm=R,r.useMediaQuery=L,r.useWindowDimensions=B,r.validateEmail=v,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})})})(Fo,Fo.exports);var ln=Fo.exports;const Ro=({className:e="",classNameContainer:o="",children:r,message:n="",style:u={}})=>{const[f,a]=g.useState(!1),[m,v]=g.useState({top:0,left:0}),x=g.useRef(null),E=()=>{if(n==="")return;const C=x.current.getBoundingClientRect();v({top:C.bottom+window.scrollY,left:C.left+window.scrollX}),a(!0)},k=()=>{a(!1)},P=w.jsx(vn,{as:g.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:f,children:w.jsx("div",{className:ln.classNames("absolute z-40 px-4 mt-0 sm:px-0",e!==""&&e),style:{top:m.top,left:m.left,position:"absolute"},children:w.jsx("div",{className:"bg-white p-2 text-center rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",onMouseEnter:E,onMouseLeave:k,"data-testid":"message",children:typeof n=="object"?"":n})})});return w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:x,className:ln.classNames("inline-block",o!==""&&o),onMouseEnter:E,onMouseLeave:k,"data-testid":"container-tooltip",style:u,children:r}),typeof window<"u"&&Sr.createPortal(P,document.body)]})},Lo=({placeholder:e="",label:o="",htmlFor:r,type:n="text",name:u,handleChange:f,onClick:a=()=>{},value:m,isReadOnly:v=!1,isError:x=!1,helperText:E="",autocomplete:k="off",id:P,classNameLabel:C="",classNameContainerInput:M="",classNameContainer:R="",className:L="",icon:B=null,onKeyDown:_,onFocus:z,min:X,max:ee,maxWidth:ue=5e3})=>{const[we,Oe]=g.useState(!1),be=Zt({"ring-red-300 focus:ring-red-300 text-red-900":x||we,"focus:ring-indigo-600 text-gray-500":!x&&!we}),y=he=>{if(f&&f(he),n!=="email")return;const{value:Pe}=he.target,Ze=pi(Pe);Oe(!Ze)};return w.jsxs("div",{"data-testid":`container-input-${P}`,className:R,children:[o!==""&&w.jsx("label",{htmlFor:r,className:ae("block text-sm font-medium leading-6",!C.includes("mb-")&&"mb-0.5",C!==""?C:"text-gray-700"),"data-testid":`label-${P}`,children:o}),w.jsxs("div",{className:ae("relative rounded-md",M!==""&&M),children:[w.jsx(Ro,{className:"text-sm",classNameContainer:"w-full",message:n==="password"?"":m,children:w.jsx("input",{id:P,name:u,type:n,autoComplete:k,placeholder:e,onChange:y,onClick:a,onKeyDown:_,onFocus:z,value:m,readOnly:v,"data-testid":`input-${P}`,min:X,className:ae("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",be,L!==""&&L),style:{maxWidth:`${ue}px`}})}),B!==null&&w.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:B}),x&&B===null&&w.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:w.jsx(il,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),E.length===0||!x?null:w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${P}`,children:E})]})};function Qn({className:e="w-6 h-6",color:o="#3730a3"}){return w.jsxs("svg",{className:ae("fill-current animate-spin",e),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"4",fill:"none"}),w.jsx("path",{fill:o,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 pd(){return w.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:[w.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"}),w.jsx(Qn,{className:"w-8 h-8 animate-spin"})]})}const cl=({height:e="36px",style:o={},styleMenu:r={},label:n="",onChange:u,isReadOnly:f=!1,isError:a=!1,helperText:m="",name:v,id:x,className:E="",classNameLabel:k="",classNameInput:P="",options:C,value:M=-1,defaultValue:R={value:-1,label:"",iconStart:null,iconEnd:null},defaultLabel:L="label",defaultId:B="value",bgOptionSelect:_="bg-indigo-600",isSearch:z=!1,loading:X=!1,isSingleOptionAndFirstLoad:ee=!0,isTest:ue=!1})=>{const we=g.useRef(!0),[Oe,be]=g.useState(""),[y,he]=g.useState(R),[Pe,Ze]=g.useState(!1);g.useEffect(()=>{if((C==null?void 0:C.length)!==1||!we.current)return;we.current=!1;const[q]=C,te=q[B],ve=q[L];he({value:te,label:ve}),ee&&u({target:{value:q,checked:!1,name:v,type:void 0,id:q[B]}})},[C,B,L,u,v,ee]),g.useEffect(()=>{if(M===-1||(C==null?void 0:C.length)===0)return;const q=C==null?void 0:C.find(te=>te[B]===M);q&&he(q)},[M,C,B]),g.useEffect(()=>{M==="clear"&&(y[B]!==R[B]||y[L]!==R[L]||ue)&&he(R)},[R,ue,y,M,B,L]);const Ye=Oe===""?C:C.filter(q=>q[L].normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().includes(Oe.toLowerCase())),Y=Zt({"ring-red-300 focus:ring-red-300 text-red-900":a&&!f,"text-gray-500":!a,"focus:ring-indigo-600":!a&&!f}),Je=Zt({"text-red-400":a&&!f,"text-gray-400":!a}),Re=q=>{he(q),u({target:{value:q,checked:!1,name:v,type:void 0,id:q[B]}})};return w.jsxs(on,{as:"div",value:y,children:[w.jsx(on.Label,{className:ae("block text-sm font-medium leading-6 text-gray-500 mb-0.5",k!==""&&k),children:n}),w.jsxs("div",{className:ae("relative",E!==""&&E),children:[w.jsx(Ro,{className:"text-sm",classNameContainer:"w-full",message:y[L],children:w.jsxs(on.Button,{className:"w-full","data-testid":`listbox-button-${x}`,children:[y.iconStart&&w.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2",children:y.iconStart}),w.jsx(on.Input,{className:ae("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",!a&&!f&&"ring-inset focus:ring-inset focus:ring-2 focus:ring-indigo-600",f&&"focus:ring-gray-300",Y,P!==""&&P),onChange:q=>be(q.target.value.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),displayValue:q=>{var te;return(te=q[L])==null?void 0:te.trim()},autoComplete:"off",readOnly:!z||f,style:{height:e,...o},"data-testid":"input-search",onClick:()=>Ze(f?!1:!Pe),onBlur:()=>Ze(!1)})]})}),y.iconEnd&&w.jsx("span",{className:"absolute inset-y-0 right-4 flex items-center pr-4",children:y.iconEnd}),!f&&w.jsx(on.Button,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",onClick:()=>Ze(f?!1:!Pe),"data-testid":"arrow-button",children:w.jsx(Po,{className:ae("h-5 w-5 ml-auto transition-transform","transform",Pe&&"rotate-180",Je)})}),!f&&w.jsx(w.Fragment,{children:X?w.jsx(on.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:w.jsx(Qn,{})}):(Ye??[]).length>0?w.jsx(on.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:r,children:Ye.map((q,te)=>w.jsx(on.Option,{value:q,className:ae(q[B]===y[B]?`${_} text-white`:"text-gray-900",`relative cursor-default select-none p-2 hover:text-white hover:${_}`),"data-testid":`select-${x}-${q[B]}`,onClick:()=>Re(q),children:w.jsxs("div",{className:"flex justify-between items-center",children:[w.jsxs("div",{className:"flex items-center",children:[q.iconStart&&w.jsx("span",{className:"mr-2","aria-hidden":"true",children:q.iconStart}),w.jsx("span",{className:"font-normal hyphens-auto break-words overflow-hidden",children:q[L]})]}),q.iconEnd&&w.jsx("span",{className:"ml-2","aria-hidden":"true",children:q.iconEnd})]})},te))}):w.jsx(on.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:w.jsx("p",{"data-testid":"empty-options",children:"Sin opciones"})})})]}),m.length>0&&a&&w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${x}`,children:m})]})},md=({placeholder:e="",label:o="",htmlFor:r,name:n,handleChange:u,onClick:f=()=>{},value:a,valueSelect:m,isReadOnly:v=!1,isError:x=!1,helperText:E="",autocomplete:k="on",id:P,classNameLabel:C="",classNameContainer:M="",className:R="",onKeyDown:L,options:B,idSelect:_,isMarginLeft:z=!0,classNameSelect:X="w-20",type:ee="text"})=>{const{width:ue}=hi(),we=Zt({"ring-red-300 focus:ring-red-300 text-red-900":x,"focus:ring-indigo-600 text-gray-500":!x});return w.jsxs(w.Fragment,{children:[w.jsx("style",{children:`
|
|
95
|
+
`}),y.jsx(Kr.Button,{as:"div",onClick:()=>Ne(de),"data-testid":`menu-button-${se}`,ref:Ue,children:t}),u.createPortal(y.jsx("div",{style:De,className:x(s,de&&"hidden",O&&"w-full"),children:y.jsx(kn,{as:n.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:bt,children:y.jsx(Kr.Items,{className:x("mt-1 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",O?"w-full":d===""&&"w-max",d!==""&&d),children:O?y.jsx("div",{className:"flex justify-center py-4",children:y.jsx(yr,{})}):y.jsxs("div",{className:x(!W&&"pb-1",i!==""&&i,He&&"w-custom"),"data-testid":"dropdown-menu",children:[y.jsxs("div",{className:"sticky top-0 bg-white w-full",children:[D!==null&&y.jsx("div",{className:x("py-2 w-full",p),children:y.jsx(si,{htmlFor:"search",id:`dropdown-search-${se}`,name:"search",type:"text",placeholder:F,handleChange:fe=>D(fe,se),icon:F!==""&&y.jsx(km,{className:"w-4 h-4 text-indigo-300"}),className:"pl-5 pr-4 h-8",classNameContainerInput:"w-full",value:$,onKeyDown:fe=>fe.key===" "&&fe.stopPropagation(),autocomplete:"off"})}),Be!==null&&y.jsxs("div",{className:x("pt-1.5 justify-end flex items-center",p),children:[y.jsx(xr,{classNameButton:x("bg-gray-400 hover:bg-gray-400 font-medium px-2 py-1.5 rounded-md",ut.size>0?"opacity-1 cursor-pointer":"opacity-0 cursor-default"),outline:"",classNameText:"text-xs text-white text-center",id:"delete",onClick:zt,children:"Descartar"}),y.jsx(xr,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 font-medium px-2 py-1.5 rounded-md",outline:ut.size===0&&ze?"":"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:ut.size===0&&ze,onClick:()=>Be({id:se,items:Array.from(Rt.values())}),children:ct})]})]}),ye&&!dt&&y.jsx("div",{className:"flex flex-wrap ml-7 pt-1",children:Array.from(Rt).map((fe,Ve)=>y.jsx("div",{className:"mr-1",children:y.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:[fe[1][S],y.jsx("button",{type:"button",className:"p-0.5 rounded-sm bg-gray-100 hover:bg-gray-300",onClick:()=>nt(fe[1]),"data-testid":`tag-${fe[0]}`,children:y.jsx(Dm,{className:"h-2.5 w-2.5 stroke-gray-700/50 group-hover:stroke-gray-700/75"})})]})},fe))}),y.jsx("div",{className:"divide-y divide-gray-100",children:(dt?[]:l).map((fe,Ve)=>y.jsx("div",{className:x(!W&&"py-1",J&&Ve===0&&"sticky top-0"),children:W?y.jsx("div",{onClick:Ot=>{Ot.preventDefault(),b()},"data-testid":`item-component-${Ve}`,children:fe}):y.jsx(Kr.Item,{children:y.jsx("span",{className:x(ut.has(fe[N])&&"blue text-white",!ut.has(fe[N])&&"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-${Ve}`,onClick:Ot=>{Ot.preventDefault(),le(fe)},children:An(fe[S])})})},Ve))})]})})})}),document.body)]})},Hl=50,l0=({total:t,handleNext:l,handlePrev:i,handleSelectPage:s,page:c=null})=>{const[d,p]=n.useState(1),[h,b]=n.useState([]),[S,N]=n.useState([]),I=Math.ceil(t/Hl);n.useEffect(()=>{const F=[];for(let $=1;$<=I;$++)F.push($);N(F)},[I]),n.useEffect(()=>{let F=[];const $="...",U="... ",W=" ...";if(S.length<6)F=S;else if(d>=1&&d<=3)F=[1,2,3,4,$,S.length];else if(d===4)F=[...S.slice(0,5),$,S.length];else if(d>4&&d<S.length-2){const J=S.slice(d-2,d),de=S.slice(d,d+1);F=[1,U,...J,...de,W,S.length]}else if(d>S.length-3){const J=S.slice(S.length-4);F=[1,U,...J]}b(F)},[d,S]),n.useEffect(()=>{c!==null&&c!==d&&p(c)},[c,d]);const A=F=>{p(F),s(F)},O=()=>{p(d===1?d:d-1),d>1&&i(d-1)},D=()=>{d===S.length?p(d):p(d+1),d<S.length&&l(d+1)};return y.jsxs("nav",{className:"flex items-center justify-between border-t border-gray-200 px-4 sm:px-0",children:[y.jsx("div",{className:"-mt-px flex w-0 flex-1",children:y.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:O,"data-testid":"prev",children:[y.jsx(am,{className:"mr-3 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Anterior"]})}),y.jsx("div",{className:"hidden md:-mt-px md:flex",children:h.map((F,$)=>y.jsx(Bl,{className:x("inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",d===F?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),"aria-current":"page",onClick:()=>F!=="..."&&F!==" ..."&&F!=="... "&&A(F),id:`page-${$+1}`,children:F},$))}),y.jsx("div",{className:"-mt-px flex w-0 flex-1 justify-end",children:y.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:D,"data-testid":"next",children:["Siguiente",y.jsx(cm,{className:"ml-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]})})]})},s0=({setForm:t,setValuesDefault:l,className:i="",classNameContainer:s="",classNameContainerImg:c="",src:d=null,alt:p=null,width:h,height:b})=>{const S=N=>{const{files:I}=N.target,[A]=I,O=new FileReader;O.readAsDataURL(A),O.onload=function(){t(D=>({...D,photo:O.result})),l("photo",O.result)}};return y.jsxs("div",{className:x("col-span-full",s!==""&&s),children:[y.jsx("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-500",children:"Logo (Opcional)"}),y.jsxs("div",{className:x("mt-2 flex justify-center rounded-lg border-2 border-dotted border-gray-300 cursor-pointer relative",d===null&&"px-9 pt-6 pb-2.5",c!==""&&c),children:[d?y.jsx("img",{src:d,alt:p,width:h,height:b,className:x(i!==""&&i),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:b},onLoad:N=>N.currentTarget.style.filter="none","data-testid":"img"}):y.jsxs("div",{className:"text-center",children:[y.jsx(Fm,{"aria-hidden":"true",className:"mx-auto h-12 w-12 text-gray-300"}),y.jsxs("div",{className:"mt-4 flex text-sm leading-6 text-gray-600",children:[y.jsx("label",{htmlFor:"file-upload",className:"relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500",children:y.jsx("span",{children:"Upload a file"})}),y.jsx("p",{className:"pl-1",children:"or drag and drop"})]}),y.jsx("p",{className:"text-xs leading-5 text-gray-600",children:"PNG, JPG, GIF up to 10MB"})]}),y.jsx("input",{id:"file-upload",name:"file-upload",type:"file",className:"absolute w-full h-full opacity-0 cursor-pointer",onChange:S})]})]})},a0=({children:t,openDefault:l=!1,setForm:i,setValuesDefault:s,title:c,type:d,data:p,setData:h,id:b,defaultData:S,dispatch:N,isAdd:I=!0,search:A=null,isPadding:O=!0,isReadOnly:D=!1,isEdit:F=!1,deleteItem:$=null,validateAdd:U=null,loading:W=!1,internalEdit:J=!0,isDataEmpty:de=!0,typeProp:se="value",setAdd:xe=null,hasNoRecords:qe=!0,tabs:He=null,selectTab:ye=null})=>{const[Te,Me]=n.useState(!1),[Be,ct]=n.useState(!1),[,mt]=n.useState(!1),[K,dt]=n.useState(""),[ze,bt]=n.useState(1);n.useEffect(()=>{Me(l),mt(D)},[l,D]);const ce=({e:De,index:Ct})=>{const et=m(p),{name:At,value:le}=De.target;!(U!==null&&U({value:le,copyData:et,index:Ct}))&&(et[Ct][At]=le),h(et),s(b,et),i(Ne=>({...Ne,[b]:et}))},Ue=()=>{if(p.some(De=>Object.values(De).some(Ct=>Ct[se]===-1))||p.length===0)return N({type:"ALERT",payload:{title:"",message:"Todos los campos son requeridos",typeAlert:"warning",active:!0}});i(De=>({...De,data:p})),s(b,p),h([...p,S]),xe&&xe([...p,S])},ut=({index:De,item:Ct})=>{if(p.length===1&&!F)return;const et=m(p);et.splice(De,1),i(At=>({...At,data:et})),s(b,et),h(et),$&&$({index:De,item:Ct,data:et}),De===p.length-1&&F&&et.length===0&&(i(At=>({...At,data:et})),s(b,et),h([...et,S]))},Nt=()=>{ct(!Be),mt(!1)},Rt=()=>{if(p.length>1)return;if(p.length===0)return!0;const[De]=p,{rol:Ct,privileges:et,limitedPrivileges:At,...le}=De;return Object.values(le).every(Ne=>Object.values(Ne)[0]===-1)},wt=({tab:De})=>{bt(De.id),ye&&ye({tab:De})};return y.jsxs("div",{className:"divide-y divide-gray-200 rounded-lg bg-white shadow mt-7",children:[y.jsxs("div",{className:"px-4 py-3.5 sm:px-6 flex justify-between items-center cursor-pointer",onClick:()=>Me(!Te),"data-testid":`open-accordion-${b}`,children:[y.jsx("p",{className:"text-gray-500 uppercase text-xs font-bold",children:c}),y.jsxs("div",{className:"flex items-center",children:[A&&y.jsx(si,{htmlFor:"search",id:"search",name:"search",type:"text",autoComplete:"search",placeholder:"Buscar...",handleChange:De=>{A(De),dt(De.target.value)},icon:y.jsx(qm,{className:"w-6 h-6 text-indigo-300"}),className:"h-9",classNameContainerInput:"w-52 2xs:w-64 max-w-64 mr-8 hidden sm:block",value:K,onClick:De=>De.stopPropagation(),onFocus:()=>Me(!0)}),Te?y.jsx(Ym,{className:"w-5 h-5 text-default-5"}):y.jsx(Vm,{className:"w-5 h-5 text-default-5"})]})]}),y.jsx(kn,{as:n.Fragment,show:Te,enter:"transition duration-[400ms]",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-200 transition ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:y.jsxs("div",{children:[He&&y.jsx("nav",{className:"flex justify-center border-b border-gray-200","aria-label":"Tabs",children:He.map(De=>y.jsx("span",{className:x(ze===De.id?"border-indigo-500 text-gray-900":"border-gray-300 text-gray-500 hover:border-indigo-500","whitespace-nowrap border-b-2 py-2.5 px-2 text-sm font-medium cursor-pointer"),"aria-current":ze===De.id?"page":void 0,onClick:()=>wt({tab:De}),"data-testid":`tab-${De.id}`,children:De.name},De.name))}),y.jsxs("div",{className:x("sm:mt-2.5 py-3.5 relative",O&&He===null&&"px-4 sm:p-6",O&&He!==null&&"px-4 sm:px-6 sm:pb-6 sm:pt-2.5"),children:[J&&!Be&&y.jsx(Mm,{className:"w-5 h-5 text-gray-400 cursor-pointer absolute right-4",onClick:Nt,"data-testid":`edit-role-${b}`}),W&&y.jsx("div",{className:"flex justify-center mt-5",children:y.jsx(yr,{})}),de&&Rt()&&qe&&!W&&(J?!Be:!F)&&y.jsx("p",{className:"text-gray-800 text-center","data-testid":"records-empty",children:"No hay registros para mostrar"}),!W&&p.map((De,Ct)=>y.jsxs("div",{className:x("flex flex-col 3xs:flex-row mb-4",O&&"ml-0 3xs:ml-3"),children:[typeof t=="function"?t({item:De,index:Ct,handleChange:ce,isEdit:J?Be:F}):t,I&&(J?Be:F)&&y.jsx("div",{style:{backgroundColor:"#B0B8BF",width:"25px",height:"25px"},className:x("rounded-full flex justify-center items-center mt-4 3xs:mt-7 ml-2 3xs:ml-5 self-start 3xs:self-center",p.length===1&&!F&&"opacity-0"),children:y.jsx(Xm,{className:x("w-6 h-4",(p.length>1||F)&&"cursor-pointer"),style:{color:"#637381"},strokeWidth:2.5,onClick:()=>ut({index:Ct,item:De}),"data-testid":`delete-item-${Ct}-${b}`})})]},Ct)),I&&(J?Be:F)&&!W&&y.jsx("p",{className:"text-secondary-2 text-sm font-medium ml-3 cursor-pointer",onClick:Ue,"data-testid":`add-item-${b}`,style:{width:"fit-content"},children:`+ Añadir ${d}`})]})]})})]})},u0=({src:t,alt:l,width:i,height:s,className:c="",priority:d=!1,style:p={},id:h=""})=>{const[b,S]=n.useState(!1),N={filter:b?"none":"blur(10px)",transition:"filter 0.3s ease-out",objectFit:"cover",...i?{width:i}:{},...s?{height:s}:{},...p};return y.jsx("img",{src:t,alt:l,...i?{width:i}:{},...s?{height:s}:{},className:x(c!==""&&c),loading:d?"eager":"lazy",decoding:"async",style:N,onLoad:()=>S(!0),"data-testid":`image-${h}`})};r.Accordion=a0,r.Alert=jm,r.Avatar=$m,r.Bullets=_m,r.ButtonOutline=_l,r.ButtonPagination=Bl,r.ButtonSolid=xr,r.Checkbox=zm,r.ConfirmationAbandoningCreation=Jm,r.CoverPhoto=s0,r.Divider=Qm,r.Dropdown=i0,r.GoBack=e0,r.Image=u0,r.Input=si,r.InputDropdown=n0,r.MESSAGE_ABORT_CONTROLLER=P,r.MESSAGE_SIGNAL_ABORTED_WITHOUT_REASON=C,r.Modal=zl,r.Pagination=l0,r.Select=Wl,r.Spinner=t0,r.SpinnerIcon=yr,r.Switch=r0,r.Textarea=o0,r.Tooltip=li,r.classNames=x,r.copyOptions=m,r.generateAvatarInitials=E,r.isPromise=k,r.rowsPerPage=Hl,r.useCloseModal=M,r.useForm=R,r.useMediaQuery=L,r.useWindowDimensions=B,r.validateEmail=v,Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})})})(Fo,Fo.exports);var ln=Fo.exports;const Ro=({className:e="",classNameContainer:o="",children:r,message:n="",style:u={}})=>{const[f,a]=g.useState(!1),[m,v]=g.useState({top:0,left:0}),x=g.useRef(null),E=()=>{if(n==="")return;const C=x.current.getBoundingClientRect();v({top:C.bottom+window.scrollY,left:C.left+window.scrollX}),a(!0)},k=()=>{a(!1)},P=w.jsx(vn,{as:g.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:f,children:w.jsx("div",{className:ln.classNames("absolute z-40 px-4 mt-0 sm:px-0",e!==""&&e),style:{top:m.top,left:m.left,position:"absolute"},children:w.jsx("div",{className:"bg-white p-2 text-center rounded-lg shadow-lg ring-1 ring-black ring-opacity-5",onMouseEnter:E,onMouseLeave:k,"data-testid":"message",children:typeof n=="object"?"":n})})});return w.jsxs(w.Fragment,{children:[w.jsx("div",{ref:x,className:ln.classNames("inline-block",o!==""&&o),onMouseEnter:E,onMouseLeave:k,"data-testid":"container-tooltip",style:u,children:r}),typeof window<"u"&&Sr.createPortal(P,document.body)]})},Lo=({placeholder:e="",label:o="",htmlFor:r,type:n="text",name:u,handleChange:f,onClick:a=()=>{},value:m,isReadOnly:v=!1,isError:x=!1,helperText:E="",autocomplete:k="off",id:P,classNameLabel:C="",classNameContainerInput:M="",classNameContainer:R="",className:L="",icon:B=null,onKeyDown:_,onFocus:z,min:X,max:ee,maxWidth:ue=5e3})=>{const[we,Oe]=g.useState(!1),be=Zt({"ring-red-300 focus:ring-red-300 text-red-900":x||we,"focus:ring-primary-7 text-gray-500":!x&&!we}),y=he=>{if(f&&f(he),n!=="email")return;const{value:Pe}=he.target,Ze=pi(Pe);Oe(!Ze)};return w.jsxs("div",{"data-testid":`container-input-${P}`,className:R,children:[o!==""&&w.jsx("label",{htmlFor:r,className:ae("block text-sm font-medium leading-6",!C.includes("mb-")&&"mb-0.5",C!==""?C:"text-gray-700"),"data-testid":`label-${P}`,children:o}),w.jsxs("div",{className:ae("relative rounded-md",M!==""&&M),children:[w.jsx(Ro,{className:"text-sm",classNameContainer:"w-full",message:n==="password"?"":m,children:w.jsx("input",{id:P,name:u,type:n,autoComplete:k,placeholder:e,onChange:y,onClick:a,onKeyDown:_,onFocus:z,value:m,readOnly:v,"data-testid":`input-${P}`,min:X,className:ae("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",be,L!==""&&L),style:{maxWidth:`${ue}px`}})}),B!==null&&w.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-3",children:B}),x&&B===null&&w.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:w.jsx(il,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),E.length===0||!x?null:w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${P}`,children:E})]})};function Qn({className:e="w-6 h-6",color:o="#3730a3"}){return w.jsxs("svg",{className:ae("fill-current animate-spin",e),viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[w.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:o,strokeWidth:"4",fill:"none"}),w.jsx("path",{fill:o,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 pd(){return w.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:[w.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"}),w.jsx(Qn,{className:"w-8 h-8 animate-spin"})]})}const cl=({height:e="36px",style:o={},styleMenu:r={},label:n="",onChange:u,isReadOnly:f=!1,isError:a=!1,helperText:m="",name:v,id:x,className:E="",classNameLabel:k="",classNameInput:P="",options:C,value:M=-1,defaultValue:R={value:-1,label:"",iconStart:null,iconEnd:null},defaultLabel:L="label",defaultId:B="value",bgOptionSelect:_="bg-primary-7",isSearch:z=!1,loading:X=!1,isSingleOptionAndFirstLoad:ee=!0,isTest:ue=!1})=>{const we=g.useRef(!0),[Oe,be]=g.useState(""),[y,he]=g.useState(R),[Pe,Ze]=g.useState(!1);g.useEffect(()=>{if((C==null?void 0:C.length)!==1||!we.current)return;we.current=!1;const[q]=C,te=q[B],ve=q[L];he({value:te,label:ve}),ee&&u({target:{value:q,checked:!1,name:v,type:void 0,id:q[B]}})},[C,B,L,u,v,ee]),g.useEffect(()=>{if(M===-1||(C==null?void 0:C.length)===0)return;const q=C==null?void 0:C.find(te=>te[B]===M);q&&he(q)},[M,C,B]),g.useEffect(()=>{M==="clear"&&(y[B]!==R[B]||y[L]!==R[L]||ue)&&he(R)},[R,ue,y,M,B,L]);const Ye=Oe===""?C:C.filter(q=>q[L].normalize("NFD").replace(/[\u0300-\u036f]/g,"").toLowerCase().includes(Oe.toLowerCase())),Y=Zt({"ring-red-300 focus:ring-red-300 text-red-900":a&&!f,"text-gray-500":!a,"focus:ring-primary-7":!a&&!f}),Je=Zt({"text-red-400":a&&!f,"text-gray-400":!a}),Re=q=>{he(q),u({target:{value:q,checked:!1,name:v,type:void 0,id:q[B]}})};return w.jsxs(on,{as:"div",value:y,children:[w.jsx(on.Label,{className:ae("block text-sm font-medium leading-6 text-gray-500 mb-0.5",k!==""&&k),children:n}),w.jsxs("div",{className:ae("relative",E!==""&&E),children:[w.jsx(Ro,{className:"text-sm",classNameContainer:"w-full",message:y[L],children:w.jsxs(on.Button,{className:"w-full","data-testid":`listbox-button-${x}`,children:[y.iconStart&&w.jsx("span",{className:"absolute inset-y-0 left-0 flex items-center pl-2",children:y.iconStart}),w.jsx(on.Input,{className:ae("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",!a&&!f&&"ring-inset focus:ring-inset focus:ring-2 focus:ring-primary-7",f&&"focus:ring-gray-300",Y,P!==""&&P),onChange:q=>be(q.target.value.normalize("NFD").replace(/[\u0300-\u036f]/g,"")),displayValue:q=>{var te;return(te=q[L])==null?void 0:te.trim()},autoComplete:"off",readOnly:!z||f,style:{height:e,...o},"data-testid":"input-search",onClick:()=>Ze(f?!1:!Pe),onBlur:()=>Ze(!1)})]})}),y.iconEnd&&w.jsx("span",{className:"absolute inset-y-0 right-4 flex items-center pr-4",children:y.iconEnd}),!f&&w.jsx(on.Button,{className:"absolute inset-y-0 right-0 flex items-center rounded-r-md px-2 focus:outline-none",onClick:()=>Ze(f?!1:!Pe),"data-testid":"arrow-button",children:w.jsx(Po,{className:ae("h-5 w-5 ml-auto transition-transform","transform",Pe&&"rotate-180",Je)})}),!f&&w.jsx(w.Fragment,{children:X?w.jsx(on.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:w.jsx(Qn,{})}):(Ye??[]).length>0?w.jsx(on.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:r,children:Ye.map((q,te)=>w.jsx(on.Option,{value:q,className:ae(q[B]===y[B]?`${_} text-white`:"text-gray-900",`relative cursor-default select-none p-2 hover:text-white hover:${_}`),"data-testid":`select-${x}-${q[B]}`,onClick:()=>Re(q),children:w.jsxs("div",{className:"flex justify-between items-center",children:[w.jsxs("div",{className:"flex items-center",children:[q.iconStart&&w.jsx("span",{className:"mr-2","aria-hidden":"true",children:q.iconStart}),w.jsx("span",{className:"font-normal hyphens-auto break-words overflow-hidden",children:q[L]})]}),q.iconEnd&&w.jsx("span",{className:"ml-2","aria-hidden":"true",children:q.iconEnd})]})},te))}):w.jsx(on.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:w.jsx("p",{"data-testid":"empty-options",children:"Sin opciones"})})})]}),m.length>0&&a&&w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${x}`,children:m})]})},md=({placeholder:e="",label:o="",htmlFor:r,name:n,handleChange:u,onClick:f=()=>{},value:a,valueSelect:m,isReadOnly:v=!1,isError:x=!1,helperText:E="",autocomplete:k="on",id:P,classNameLabel:C="",classNameContainer:M="",className:R="",onKeyDown:L,options:B,idSelect:_,isMarginLeft:z=!0,classNameSelect:X="w-20",type:ee="text"})=>{const{width:ue}=hi(),we=Zt({"ring-red-300 focus:ring-red-300 text-red-900":x,"focus:ring-primary-7 text-gray-500":!x});return w.jsxs(w.Fragment,{children:[w.jsx("style",{children:`
|
|
96
96
|
input[type="number"]::-webkit-inner-spin-button,
|
|
97
97
|
input[type="number"]::-webkit-outer-spin-button {
|
|
98
98
|
-webkit-appearance: none;
|
|
@@ -101,7 +101,7 @@ Check the top-level render call using <`+oe+">.")}return G}}function Xl(T,G){{if
|
|
|
101
101
|
input[type="number"] {
|
|
102
102
|
-moz-appearance: textfield;
|
|
103
103
|
}
|
|
104
|
-
`}),w.jsxs("div",{"data-testid":`container-input-${P}`,className:M,children:[o!==""&&w.jsx("label",{htmlFor:r,className:ae("block text-sm font-medium leading-6",C!==""?C:"text-gray-700"),"data-testid":`label-${P}`,children:o}),w.jsxs("div",{className:"relative mt-1 rounded-md shadow-sm",children:[w.jsx("div",{className:"absolute inset-y-0 -top-0.5 flex items-center",style:{left:"2px"},children:w.jsx(cl,{name:_,onChange:Oe=>u(Oe),id:_,options:B,value:m,isReadOnly:v,className:X,height:ue<=640?"28px":"32px",classNameInput:ae(z&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},isDisabledFocus:!0})}),w.jsx("input",{id:P,name:n,type:ee,autoComplete:k,placeholder:e,readOnly:v,"data-testid":`input-${P}`,onClick:f,onKeyDown:L,onChange:Oe=>u(Oe),value:a,className:ae("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",we,R!==""&&R)}),x&&w.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:w.jsx(il,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),E.length===0||!x?null:w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${P}`,children:E})]})]})},hd=({setValuesDefault:e,status:o=!1,isReadOnly:r=!1,handleClick:n,text:u="",updateStatus:f=!1,id:a="",isHiddenText:m=!1,setForm:v,handleChange:x,textActive:E="Activo",textInactive:k="Inactivo"})=>{const[P,C]=g.useState(!1);g.useEffect(()=>{C(o),e("status",o),v(R=>({...R,status:o}))},[o,e,f,v]);const M=()=>{C(!P),e("status",!P),v(R=>({...R,status:!P})),x({target:{checked:!P,value:!P,name:"status",type:"",id:""}}),n&&n()};return w.jsxs("div",{className:"flex",children:[w.jsxs(oc,{checked:P,onChange:M,className:ae("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-
|
|
104
|
+
`}),w.jsxs("div",{"data-testid":`container-input-${P}`,className:M,children:[o!==""&&w.jsx("label",{htmlFor:r,className:ae("block text-sm font-medium leading-6",C!==""?C:"text-gray-700"),"data-testid":`label-${P}`,children:o}),w.jsxs("div",{className:"relative mt-1 rounded-md shadow-sm",children:[w.jsx("div",{className:"absolute inset-y-0 -top-0.5 flex items-center",style:{left:"2px"},children:w.jsx(cl,{name:_,onChange:Oe=>u(Oe),id:_,options:B,value:m,isReadOnly:v,className:X,height:ue<=640?"28px":"32px",classNameInput:ae(z&&"ml-3.5"),style:{paddingRight:0,boxShadow:"none"},isDisabledFocus:!0})}),w.jsx("input",{id:P,name:n,type:ee,autoComplete:k,placeholder:e,readOnly:v,"data-testid":`input-${P}`,onClick:f,onKeyDown:L,onChange:Oe=>u(Oe),value:a,className:ae("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",we,R!==""&&R)}),x&&w.jsx("div",{className:"pointer-events-none absolute inset-y-0 right-0 flex items-center pr-3",children:w.jsx(il,{className:"h-5 w-5 text-red-500","aria-hidden":"true"})})]}),E.length===0||!x?null:w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${P}`,children:E})]})]})},hd=({setValuesDefault:e,status:o=!1,isReadOnly:r=!1,handleClick:n,text:u="",updateStatus:f=!1,id:a="",isHiddenText:m=!1,setForm:v,handleChange:x,textActive:E="Activo",textInactive:k="Inactivo"})=>{const[P,C]=g.useState(!1);g.useEffect(()=>{C(o),e("status",o),v(R=>({...R,status:o}))},[o,e,f,v]);const M=()=>{C(!P),e("status",!P),v(R=>({...R,status:!P})),x({target:{checked:!P,value:!P,name:"status",type:"",id:""}}),n&&n()};return w.jsxs("div",{className:"flex",children:[w.jsxs(oc,{checked:P,onChange:M,className:ae("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",P?"bg-success-5":"bg-gray-200"),"data-testid":`switch-${a}`,disabled:r,children:[w.jsx("span",{className:"sr-only",children:"Use setting"}),w.jsx("span",{"aria-hidden":"true",className:ae("pointer-events-none inline-block h-5 w-5 transform rounded-full bg-white shadow ring-0 transition duration-200 ease-in-out",P?"translate-x-full":"translate-x-0")})]}),u!==""?w.jsx("p",{className:ae("text-sm font-medium text-gray-500 ml-2 self-end",m&&"hidden"),children:u}):w.jsx("p",{className:ae("text-sm font-medium text-gray-500 ml-2 self-end",m&&"hidden"),"data-testid":"text-switch",children:P?E:k})]})};function vd({label:e="",id:o,htmlFor:r="",classNameLabel:n="",className:u="",rows:f=4,name:a,placeholder:m="",helperText:v="",isReadOnly:x=!1,isError:E=!1,onChange:k,value:P,idInput:C,nameInput:M,placeholderInput:R="",isReadOnlyInput:L=!1,valueInput:B,infoTop:_=null,infoBottom:z=null,classNameInfoTop:X="h-4",classNameInfoBottom:ee="h-2",isInputTitle:ue=!1,hiddenBorder:we=!1}){const Oe=Zt({"ring-red-300 focus:ring-red-300 text-red-900":E,"focus:ring-primary-7 text-gray-700":!E});return w.jsxs(w.Fragment,{children:[e!==""&&w.jsx("label",{htmlFor:r,className:ae("leading-6 block text-sm",n!==""&&n),children:e}),w.jsxs("div",{className:"relative overflow-x-hidden",children:[_!==null&&w.jsx("div",{className:"absolute top-2 left-3 w-full",children:_}),w.jsxs("div",{className:ae("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",Oe),children:[_!==null&&w.jsx("div",{className:"py-2","aria-hidden":"true",children:w.jsx("div",{className:"py-px",children:w.jsx("div",{className:X})})}),ue&&w.jsx("textarea",{name:M,id:C,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:R,value:B,onChange:k,rows:2,readOnly:L}),w.jsx("textarea",{placeholder:m,rows:f,name:a,id:o,className:ae(ue||we?"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",Oe,u!==""&&u),readOnly:x,onChange:k,value:P,"data-testid":`textarea-${o}`}),z!==null&&w.jsx("div",{className:"py-2","aria-hidden":"true",children:w.jsx("div",{className:"py-px",children:w.jsx("div",{className:ee})})})]}),z!==null&&w.jsx("div",{className:"absolute bottom-2 left-3 w-full",children:z})]}),v.length>0&&E&&w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${o}`,children:v})]})}const gd=({children:e,data:o,className:r="",classNameTooltip:n="w-full",classNameMenu:u="",classNameMenuItems:f="",classNameContainerSearch:a="px-5",isSelectMultiple:m=!1,optionsSelect:v,propObject:x="name",propId:E="id",textNewItem:k="",defaultId:P=null,loading:C=!1,search:M=null,searchPlaceHolder:R="Buscar...",valueSearch:L=void 0,idsOptionSelect:B=null,isComponent:_,isSticky:z=!1,hiddenMenu:X=!1,id:ee,onClick:ue=()=>{},isRelative:we=!0,isMaxWidth:Oe=!1,isTag:be=!1,isClear:y=!1,clear:he=null,applyButton:Pe=null,applyButtonText:Ze="Aplicar",tagsParent:Ye=[],isClearTagsParent:Y=!1,isReadOnly:Je,isDisabledApplyButton:Re=!0,isOpenMenu:q=void 0,onScroll:te=null})=>{const ve=g.useRef(null),$e=g.useRef(null),[We,lt]=g.useState(new Set),[tt,St]=g.useState(new Map);g.useEffect(()=>{B!==null&<(new Set(new Set(B)))},[B]),g.useEffect(()=>{Y&&St(new Map)},[Y]),g.useEffect(()=>{if(Ye.length===0)return;const V=new Map;Ye.forEach(Ee=>V.set(Ee.id,Ee)),St(V)},[Ye]),g.useEffect(()=>{y&&(lt(new Set),St(new Map),he&&he())},[he,y]);const Lt=V=>{let Ee=new Map(tt),ke=new Set(We),Fe=null;if(P!==null&&(V[E]===P&&(Fe=crypto.randomUUID()),Fe!==null&&(V[E]=Fe),Fe!==null&&(V[x]=V[x].replace(k,"").trim())),ke.has(V[E])?ke.delete(V[E]):ke.add(V[E]),Ee.has(V[E])?Ee.delete(V[E]):Ee.set(V[E],V),!m){const Mt=Array.from(ke),Yt=Array.from(Ee);Mt.shift(),Yt.shift(),ke=ke.size===2?new Set(Mt):ke,Ee=Ee.size===2?new Map(Yt):Ee}v(V,Array.from(ke),Fe!==null),lt(ke),St(Ee)},ge=V=>{ue(V===!0?-1:ee)},st=V=>{const Ee=new Set(We),ke=new Map(tt);Ee.delete(V[E]),ke.delete(V[E]),v(V,Array.from(Ee)),lt(Ee),St(ke)},re=()=>{if(We.size===0)return;const V=new Set(We),Ee=new Map(tt);V.clear(),Ee.clear(),v(null,Array.from(V)),lt(V),St(Ee)};function Ce(V){if(typeof V!="string")return V;const Ee=V.toLowerCase();return Ee.charAt(0).toUpperCase()+Ee.slice(1)}return w.jsxs(Fr,{as:"div",className:ae("inline-block text-left",we&&"relative",u!==""&&u),onClick:()=>ge(!0),"data-testid":`menu-${ee}`,id:ee,ref:ve,children:[w.jsx("style",{children:`
|
|
105
105
|
.blue {
|
|
106
106
|
background-color: #3758F9;
|
|
107
107
|
}
|
|
@@ -118,4 +118,4 @@ Check the top-level render call using <`+oe+">.")}return G}}function Xl(T,G){{if
|
|
|
118
118
|
width: 414px;
|
|
119
119
|
}
|
|
120
120
|
}
|
|
121
|
-
`}),w.jsx(Fr.Button,{as:"div",onClick:()=>ge(X),"data-testid":`menu-button-${ee}`,ref:$e,children:e}),!Je&&w.jsx("div",{className:ae("absolute right-0 z-20",n,X&&"hidden",C&&"w-full"),children:w.jsx(vn,{as:g.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:q,children:w.jsx(Fr.Items,{className:ae("mt-1 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",C?"w-full":f===""&&"w-max",f!==""&&f),children:C?w.jsx("div",{className:"flex justify-center py-4",children:w.jsx(Qn,{})}):w.jsxs("div",{className:ae(!_&&"pb-1",r!==""&&r,Oe&&"w-custom"),"data-testid":"dropdown-menu",onScroll:te,children:[w.jsxs("div",{className:"sticky top-0 bg-white w-full",children:[M!==null&&w.jsx("div",{className:ae("py-2 w-full",a),children:w.jsx(Lo,{htmlFor:"search",id:`dropdown-search-${ee}`,name:"search",type:"text",placeholder:R,handleChange:V=>M(V,ee),icon:R!==""&&w.jsx(zc,{className:"w-4 h-4 text-indigo-300"}),className:"pl-5 pr-4 h-8",classNameContainerInput:"w-full",value:L,onKeyDown:V=>V.key===" "&&V.stopPropagation(),autocomplete:"off"})}),Pe!==null&&w.jsxs("div",{className:ae("pt-1.5 justify-end flex items-center",a),children:[w.jsx(Jn,{classNameButton:ae("bg-gray-400 hover:bg-gray-400 font-medium px-2 py-1.5 rounded-md",We.size>0?"opacity-1 cursor-pointer":"opacity-0 cursor-default"),outline:"",classNameText:"text-xs text-white text-center",id:"delete",onClick:re,children:"Descartar"}),w.jsx(Jn,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 font-medium px-2 py-1.5 rounded-md",outline:We.size===0&&Re?"":"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:We.size===0&&Re,onClick:()=>Pe({id:ee,items:Array.from(tt.values())}),children:Ze})]})]}),be&&w.jsx("div",{className:"flex flex-wrap ml-7 pt-1",children:Array.from(tt).map((V,Ee)=>w.jsx("div",{className:"mr-1",children:w.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:[V[1][x],w.jsx("button",{type:"button",className:"p-0.5 rounded-sm bg-gray-100 hover:bg-gray-300",onClick:()=>st(V[1]),"data-testid":`tag-${V[0]}`,children:w.jsx(qc,{className:"h-2.5 w-2.5 stroke-gray-700/50 group-hover:stroke-gray-700/75"})})]})},V))}),w.jsx("div",{className:"divide-y divide-gray-100",children:o.map((V,Ee)=>w.jsx("div",{className:ae(!_&&"py-1",z&&Ee===0&&"sticky top-0"),children:_?w.jsx("div",{onClick:ke=>{ke.preventDefault(),v()},"data-testid":`item-component-${Ee}`,children:V}):w.jsx(Fr.Item,{children:w.jsx("span",{className:ae(We.has(V[E])&&"blue text-white",!We.has(V[E])&&"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-${Ee}`,onClick:ke=>{ke.preventDefault(),Lt(V)},children:Ce(V[x])})})},Ee))})]})})})})]})},Ao=50,bd=({total:e,handleNext:o,handlePrev:r,handleSelectPage:n,page:u=null,pageSize:f=Ao})=>{const[a,m]=g.useState(1),[v,x]=g.useState([]),[E,k]=g.useState([]),[P,C]=g.useState(""),M=Math.ceil(e/f);g.useEffect(()=>{const z=[];for(let X=1;X<=M;X++)z.push(X);k(z)},[M]),g.useEffect(()=>{let z=[];const X="...",ee="... ",ue=" ...";if(E.length<6)z=E;else if(a>=1&&a<=3)z=[1,2,3,4,X,E.length];else if(a===4)z=[...E.slice(0,5),X,E.length];else if(a>4&&a<E.length-2){const we=E.slice(a-2,a),Oe=E.slice(a,a+1);z=[1,ee,...we,...Oe,ue,E.length]}else if(a>E.length-3){const we=E.slice(E.length-4);z=[1,ee,...we]}x(z)},[a,E]),g.useEffect(()=>{u!==null&&u!==a&&m(u)},[u,a]);const R=z=>{C(""),m(z),n(z)},L=()=>{C(""),a>1&&m(a-1),a>1&&r(a-1)},B=()=>{C(""),a<E.length&&m(a+1),a<E.length&&o(a+1)},_=z=>{const{value:X}=z.target;if(!/^\d*$/.test(X))return;const ee=Math.ceil(e/Ao);X>ee||C(X)};return g.useEffect(()=>{const z=setTimeout(()=>{const X=Number(P);!isNaN(X)&&X>=1&&X<=M&&(n(X),m(X))},500);return()=>clearTimeout(z)},[P,M,n]),w.jsxs("nav",{className:"flex items-center justify-between border-t border-gray-200 px-4 sm:px-0",children:[w.jsx("div",{className:"-mt-px flex w-0 flex-1",children:w.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:L,"data-testid":"prev",children:[w.jsx(wc,{className:"mr-3 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Anterior"]})}),w.jsxs("div",{className:"hidden md:-mt-px md:flex",children:[w.jsxs("div",{children:[w.jsx("span",{className:"text-sm text-gray-500 font-medium mr-1",children:"Ir a"}),w.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:w.jsx(ln.Input,{htmlFor:"",id:"pager",name:"pager",handleChange:_,value:P,className:"pl-1.5 pr-1 h-7"})})]}),v.map((z,X)=>w.jsx(ln.ButtonPagination,{className:ln.classNames("inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",a===z?"border-indigo-500 text-indigo-600":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),"aria-current":"page",onClick:()=>z!=="..."&&z!==" ..."&&z!=="... "&&R(z),id:`page-${X+1}`,children:z},X))]}),w.jsx("div",{className:"-mt-px flex w-0 flex-1 justify-end",children:w.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:B,"data-testid":"next",children:["Siguiente",w.jsx(Sc,{className:"ml-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]})})]})},xd=({setForm:e,setValuesDefault:o,className:r="",classNameContainer:n="",classNameContainerImg:u="",src:f=null,alt:a=null,width:m,height:v,title:x="Logo (Opcional)",fileFormatsDescription:E="PNG, JPG, GIF up to 10MB"})=>{const k=f===null?"":f.split("."),P=C=>{const{files:M}=C.target,[R]=M,L=new FileReader;L.readAsDataURL(R),L.onload=function(){R.type.startsWith("image/")?(e(_=>({..._,photo:L.result})),o("photo",L.result)):(e(_=>({..._,photo:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png"})),o("photo",L.result))}};return w.jsxs("div",{className:ae("col-span-full",n!==""&&n),children:[w.jsx("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-500",children:x}),w.jsxs("div",{className:ae("mt-2 flex justify-center rounded-lg border-2 border-dotted border-gray-300 cursor-pointer relative",u!==""&&u),children:[f?w.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(k[k.length-1])||f.startsWith("data:image/")?f:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:a,width:m,height:v,className:ae(r!==""&&r),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:v},onLoad:C=>C.currentTarget.style.filter="none","data-testid":"img"}):w.jsxs("div",{className:"text-center",children:[w.jsx(Vc,{"aria-hidden":"true",className:"mx-auto h-12 w-12 text-gray-300"}),w.jsxs("div",{className:"mt-4 flex text-sm leading-6 text-gray-600",children:[w.jsx("label",{htmlFor:"file-upload",className:"relative cursor-pointer rounded-md bg-white font-semibold text-indigo-600 focus-within:outline-none focus-within:ring-2 focus-within:ring-indigo-600 focus-within:ring-offset-2 hover:text-indigo-500",children:w.jsx("span",{children:"Subir un archivo"})}),w.jsx("p",{className:"pl-1",children:"o arrástralo y suéltalo aquí"})]}),w.jsx("p",{className:"text-xs leading-5 text-gray-600",children:E})]}),w.jsx("input",{id:"file-upload",name:"file-upload",type:"file",className:"absolute w-full h-full opacity-0 cursor-pointer",onChange:P})]})]})},yd=({children:e,openDefault:o=!1,setForm:r,setValuesDefault:n,title:u,type:f,data:a,setData:m,id:v,defaultData:x,showAlert:E,isAdd:k=!0,search:P=null,isPadding:C=!0,isReadOnly:M=!1,isEdit:R=!1,deleteItem:L=null,validateAdd:B=null,loading:_=!1,internalEdit:z=!0,isDataEmpty:X=!0,typeProp:ee="value",setAdd:ue=null,hasNoRecords:we=!0,tabs:Oe=null,selectTab:be=null,className:y="mt-7"})=>{const[Pe,Ze]=g.useState(!1),[Ye,Y]=g.useState(!1),[,Je]=g.useState(!1),[Re,q]=g.useState(""),[te,ve]=g.useState(1);g.useEffect(()=>{Ze(o),Je(M)},[o,M]);const $e=({e:ge,index:st})=>{const re=eo(a),{name:Ce,value:V}=ge.target;!(B===null?!1:B({value:V,copyData:re,index:st}))&&(re[st][Ce]=V),m(re),n(v,re),r(ke=>({...ke,[v]:re}))},We=()=>{if(a.some(st=>Object.values(st).some(V=>V[ee]===-1))||a.length===0)return E({title:"",message:"Todos los campos son requeridos",type:"warning"});r(st=>({...st,data:a})),n(v,a),m([...a,x]),ue&&ue([...a,x])},lt=({index:ge,item:st})=>{if(a.length===1&&!R)return;let re=eo(a);re.length===1&&(re=[x]),re.length>1&&re.splice(ge,1),r(Ce=>({...Ce,data:re})),n(v,re),m(re),L&&L({index:ge,item:st,data:re}),ge===a.length-1&&R&&re.length===0&&(r(Ce=>({...Ce,data:re})),n(v,re),m([...re,x]))},tt=()=>{Y(!Ye),Je(!1)},St=()=>{if(a.length>1)return;if(a.length===0)return!0;const[ge]=a;return!ge||typeof ge!="object"?!0:Object.keys(ge).filter(Ce=>{const V=ge[Ce];return V&&typeof V=="object"&&"value"in V}).every(Ce=>ge[Ce].value===-1)},Lt=({tab:ge})=>{ve(ge.id),be&&be({tab:ge})};return w.jsxs("div",{className:ae("divide-y divide-gray-200 rounded-lg bg-white shadow",y),children:[w.jsxs("div",{className:"px-4 py-3.5 sm:px-6 flex justify-between items-center cursor-pointer",onClick:()=>Ze(!Pe),"data-testid":`open-accordion-${v}`,children:[typeof u=="string"?w.jsx("p",{className:"text-gray-500 uppercase text-xs font-bold",children:u}):u,w.jsxs("div",{className:"flex items-center",children:[P&&w.jsx(Lo,{htmlFor:"search",id:"search",name:"search",type:"text",autoComplete:"search",placeholder:"Buscar...",handleChange:ge=>{P(ge),q(ge.target.value)},icon:w.jsx(sd,{className:"w-6 h-6 text-indigo-300"}),className:"h-9",classNameContainerInput:"w-52 2xs:w-64 max-w-64 mr-8 hidden sm:block",value:Re,onClick:ge=>ge.stopPropagation(),onFocus:()=>Ze(!0)}),Pe?w.jsx(id,{className:"w-5 h-5 text-default-5"}):w.jsx(al,{className:"w-5 h-5 text-default-5"})]})]}),w.jsx(vn,{as:g.Fragment,show:Pe,enter:"transition duration-[400ms]",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-200 transition ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:w.jsxs("div",{children:[Oe&&w.jsx("nav",{className:"flex justify-center border-b border-gray-200","aria-label":"Tabs",children:Oe.map(ge=>w.jsx("span",{className:ae(te===ge.id?"border-indigo-500 text-gray-900":"border-gray-300 text-gray-500 hover:border-indigo-500","whitespace-nowrap border-b-2 py-2.5 px-2 text-sm font-medium cursor-pointer"),"aria-current":te===ge.id?"page":void 0,onClick:()=>Lt({tab:ge}),"data-testid":`tab-${ge.id}`,children:ge.name},ge.name))}),w.jsxs("div",{className:ae("sm:mt-2.5 py-3.5 relative",C&&Oe===null&&"px-4 sm:p-6",C&&Oe!==null&&"px-4 sm:px-6 sm:pb-6 sm:pt-2.5"),children:[z&&!Ye&&w.jsx(Hc,{className:"w-5 h-5 text-gray-400 cursor-pointer absolute right-4",onClick:tt,"data-testid":`edit-role-${v}`}),_&&w.jsx("div",{className:"flex justify-center mt-5",children:w.jsx(Qn,{})}),X&&St()&&we&&!_&&(z?!Ye:!R)&&w.jsx("p",{className:"text-gray-800 text-center","data-testid":"records-empty",children:"No hay registros para mostrar"}),!_&&a.map((ge,st)=>w.jsxs("div",{className:ae("flex flex-col 3xs:flex-row mb-4",C&&"ml-0 3xs:ml-3"),children:[typeof e=="function"?e({item:ge,index:st,handleChange:$e,isEdit:z?Ye:R}):e,k&&(z?Ye:R)&&w.jsx("div",{style:{backgroundColor:"#B0B8BF",width:"25px",height:"25px"},className:ae("rounded-full flex justify-center items-center mt-4 3xs:mt-7 ml-2 3xs:ml-5 self-start 3xs:self-center",a.length===1&&!R&&"opacity-0"),children:w.jsx(ud,{className:ae("w-6 h-4",(a.length>1||R)&&"cursor-pointer"),style:{color:"#637381"},strokeWidth:2.5,onClick:()=>lt({index:st,item:ge}),"data-testid":`delete-item-${st}-${v}`})})]},st)),k&&(z?Ye:R)&&!_&&w.jsx("p",{className:"text-secondary-2 text-sm font-medium ml-3 cursor-pointer",onClick:We,"data-testid":`add-item-${v}`,style:{width:"fit-content"},children:`+ Añadir ${f}`})]})]})})]})},wd=({src:e,alt:o,width:r,height:n,className:u="",priority:f=!1,style:a={},id:m=""})=>{const[v,x]=g.useState(!1),E={filter:v?"none":"blur(10px)",transition:"filter 0.3s ease-out",objectFit:"cover",...r?{width:r}:{},...n?{height:n}:{},...a};return w.jsx("img",{src:e,alt:o,...r?{width:r}:{},...n?{height:n}:{},className:ae(u!==""&&u),loading:f?"eager":"lazy",decoding:"async",style:E,onLoad:()=>x(!0),"data-testid":`image-${m}`})},Ed=["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"];function Sd({value:e,onChange:o,disabled:r,id:n,label:u="",classNameLabel:f="",helperText:a="",isError:m=!1,isReadOnly:v=!1,name:x}){const[E,k]=g.useState(!1),P=g.useRef(null);g.useEffect(()=>{function M(R){E&&P.current&&!P.current.contains(R.target)&&k(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[E]);const C=Zt({"border-red-300 focus:border-red-300 text-red-900":m&&!v,"text-gray-500":!m,"focus:border-indigo-600":!m&&!v});return w.jsxs(w.Fragment,{children:[u!==""&&w.jsx("p",{className:ln.classNames("block text-sm font-medium leading-6",f!==""?f:"text-gray-700"),"data-testid":`label-${n}`,children:u}),w.jsxs("div",{style:{position:"relative",width:"100%"},className:ln.classNames("border rounded-md",C),ref:P,children:[w.jsxs("div",{className:"flex items-center gap-2 dropdown-trigger border border-default-6 rounded-md p-1.5",onClick:()=>!r&&k(!E),style:{cursor:r?"not-allowed":"pointer"},title:e||"Selecciona un icono","data-testid":"open",children:[w.jsx("div",{className:"rounded border border-default-6 p-1 h-6 w-6 bg-default-6 flex items-center justify-center",children:e&&w.jsx("i",{className:ln.classNames(e,"text-normal block")})}),w.jsx("div",{className:"truncate",style:{width:"136px"},children:e}),w.jsx(al,{className:ln.classNames("h-5 w-5 ml-auto transition-transform",{"transform rotate-180":E})})]}),E&&w.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:w.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:"repeat(auto-fill, minmax(30px, 1fr))",gap:12},children:Ed.map(M=>w.jsx("button",{type:"button",className:"icon-picker-btn",style:{width:"100%",aspectRatio:"1",borderRadius:4,border:e===M?"2px solid #007bff":"1px solid #eee",background:"#f9f9f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,color:e===M?"#007bff":"#333",outline:"none",cursor:"pointer"},onClick:()=>{o({target:{value:M,checked:!1,name:x,id:n}}),k(!1)},title:M,children:w.jsx("i",{className:M})},M))})})]}),a.length>0&&m&&w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${n}`,children:a})]})}const Dr=(e,o,r)=>{const n=r*o,u=n*(1-Math.abs(e/60%2-1)),f=r-n;let a,m,v;return e<60?[a,m,v]=[n,u,0]:e<120?[a,m,v]=[u,n,0]:e<180?[a,m,v]=[0,n,u]:e<240?[a,m,v]=[0,u,n]:e<300?[a,m,v]=[u,0,n]:[a,m,v]=[n,0,u],[Math.round((a+f)*255),Math.round((m+f)*255),Math.round((v+f)*255)]},Do=(e,o,r)=>{e/=255,o/=255,r/=255;const n=Math.max(e,o,r),u=Math.min(e,o,r),f=n-u;let a;const m=n,v=n===0?0:f/n;if(n===u)a=0;else{switch(n){case e:a=(o-r)/f+(o<r?6:0);break;case o:a=(r-e)/f+2;break;case r:a=(e-o)/f+4;break}a*=60}return[a,v,m]},er=(e,o,r)=>"#"+[e,o,r].map(n=>n.toString(16).padStart(2,"0")).join("").toUpperCase(),dl=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 Cd({value:e,onChange:o,disabled:r,label:n="",classNameLabel:u="",helperText:f="",isError:a=!1,isReadOnly:m=!1,name:v}){const x=g.useRef(!0),E=g.useRef(null),k=g.useRef(null),[P,C]=g.useState(!1),[M,R]=g.useState([182.2,.849,.494]),[L,B]=g.useState(e),_=g.useCallback(q=>{o({target:{value:q,name:v}})},[v,o]);g.useEffect(()=>{if(e&&/^#[0-9A-Fa-f]{6}$/.test(e)){const q=dl(e);R(Do(...q)),B(e.toUpperCase())}},[e]);const[z,X,ee]=M,[ue,we,Oe]=Dr(z,X,ee),be=er(ue,we,Oe);g.useEffect(()=>{B(be)},[be]),g.useEffect(()=>{!x.current||m||(x.current=!1,_(be))},[be,_,m]),g.useEffect(()=>{function q(ve){if(!E.current||!E.current._dragging)return;const $e=E.current.getBoundingClientRect();let We=(ve.touches?ve.touches[0].clientX:ve.clientX)-$e.left,lt=(ve.touches?ve.touches[0].clientY:ve.clientY)-$e.top;We=Math.max(0,Math.min($e.width,We)),lt=Math.max(0,Math.min($e.height,lt));const tt=We/$e.width,St=1-lt/$e.height;R([z,tt,St]);const[Lt,ge,st]=Dr(z,tt,St),re=er(Lt,ge,st);B(re),_(re)}function te(){E.current&&(E.current._dragging=!1),window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",te),window.removeEventListener("touchmove",q),window.removeEventListener("touchend",te)}return E.current&&E.current._dragging&&(window.addEventListener("mousemove",q),window.addEventListener("mouseup",te),window.addEventListener("touchmove",q),window.addEventListener("touchend",te)),()=>{window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",te),window.removeEventListener("touchmove",q),window.removeEventListener("touchend",te)}},[_,z]),g.useEffect(()=>{function q(te){P&&k.current&&!k.current.contains(te.target)&&C(!1)}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[P]);const y=q=>{if(!E.current)return;const te=E.current.getBoundingClientRect();let ve=(q.touches?q.touches[0].clientX:q.clientX)-te.left,$e=(q.touches?q.touches[0].clientY:q.clientY)-te.top;ve=Math.max(0,Math.min(te.width,ve)),$e=Math.max(0,Math.min(te.height,$e));const We=ve/te.width,lt=1-$e/te.height;R([z,We,lt]);const[tt,St,Lt]=Dr(z,We,lt),ge=er(tt,St,Lt);B(ge),_(ge)},he=q=>{r||(E.current&&(E.current._dragging=!0),y(q))},Pe=()=>{E.current&&(E.current._dragging=!1)},Ze=q=>{const te=Number(q.target.value);R([te,X,ee]);const[ve,$e,We]=Dr(te,X,ee),lt=er(ve,$e,We);B(lt),_(lt)},Ye=q=>{const te=q.target.value;if(B(te),/^#[0-9A-Fa-f]{6}$/.test(te)){const ve=dl(te);R(Do(...ve)),_(te.toUpperCase())}},Y=(q,te)=>{const ve=[ue,we,Oe];ve[q]=Math.max(0,Math.min(255,Number(te)||0)),R(Do(...ve));const $e=er(...ve);B($e),_($e)},Je=X*180,Re=(1-ee)*180;return w.jsxs(w.Fragment,{children:[n&&w.jsx("p",{className:Zt("block text-sm font-medium leading-6",u||"text-gray-700"),children:n}),w.jsxs("div",{style:{position:"relative",display:"inline-block"},ref:k,className:"w-full",children:[w.jsxs("div",{className:"flex items-center gap-2 mb-2 dropdown-trigger rounded-md border p-2 border-default-6 w-full",onClick:()=>!r&&C(!P),children:[w.jsx("div",{className:"rounded border border-default-6 flex-shrink-0 w-6 h-6",style:{backgroundColor:m?"":be}}),w.jsx("input",{type:"text",className:"px-2 py-1 border-b border-t-0 border-l-0 border-r-0 border-default-4 text-xs focus:border-default-2 focus:ring-0 w-full",value:m?"":L,disabled:r,onChange:Ye,readOnly:m}),w.jsx(Po,{className:Zt("h-5 w-5 ml-2 transition-transform",{"transform rotate-180":P&&!m})})]}),P&&!m&&w.jsxs("div",{className:"openSketch absolute z-20 top-14 left-0 bg-white border border-default-6 rounded-md p-4 shadow-md w-full",children:[w.jsxs("div",{className:"relative rounded mb-2 cursor-crosshair",ref:E,style:{backgroundColor:`hsl(${z}, 100%, 50%)`,height:"200px"},onMouseDown:he,onMouseMove:q=>E.current&&E.current._dragging&&y(q),onMouseUp:Pe,onMouseLeave:Pe,onTouchStart:he,onTouchMove:q=>E.current&&E.current._dragging&&y(q),onTouchEnd:Pe,children:[w.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to right, #fff, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),w.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, #000, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),w.jsx("div",{className:"absolute w-4 h-4 rounded-full border-2 border-white shadow",style:{left:`calc(${Je}px - 8px)`,top:`calc(${Re}px - 8px)`,background:be,pointerEvents:"none"}})]}),w.jsx("input",{type:"range",min:0,max:359,value:z,onChange:Ze,className:"w-full mb-2",style:{background:"linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red)"},disabled:r}),w.jsx("div",{className:"flex gap-2 mb-2",children:["R","G","B"].map((q,te)=>w.jsxs("div",{children:[w.jsx("label",{className:"text-center block",children:q}),w.jsx("input",{type:"number",min:0,max:255,className:"w-14 px-2 py-1 border border-gray-300 rounded text-sm",value:[ue,we,Oe][te],onChange:ve=>Y(te,ve.target.value),disabled:r,placeholder:q})]},te))})]})]}),f&&a&&w.jsx("p",{className:"text-red-600 text-sm text-left mt-1",children:f})]})}const jd=["#FFCEC7","#2ecc71","#3498db","#9b59b6","#34495e","#1abc9c","#e74c3c","#7f8c8d","#f1c40f","#e67e22","#000000"],Td=({className:e="",label:o="",onChange:r,name:n,id:u,value:f="#FFCEC7"})=>{const[a,m]=g.useState(!1),[v,x]=g.useState("#FFCEC7");mi({id:"menu-colors",close:()=>m(!1)}),g.useEffect(()=>{x(f)},[f]);const E=k=>{x(k),m(!1),r({target:{value:k,checked:!1,name:n,type:void 0,id:u}})};return w.jsxs("div",{className:ae("relative",e!==""&&e),children:[o&&w.jsx("p",{className:"text-sm font-medium leading-6 text-gray-500 mb-0.5",children:o}),w.jsxs("div",{className:"flex justify-center items-center bg-gray-100 px-3 rounded-md h-10 w-20 gap-4 cursor-pointer",onClick:()=>m(!a),id:"menu-colors","data-testid":"menu-colors",children:[w.jsx("div",{style:{width:"18px",height:"18px",backgroundColor:v},className:"rounded-full"}),w.jsx(Po,{className:ae("h-5 w-5 transition-transform",a&&"transform rotate-180")})]}),w.jsx(vn,{show:a,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:w.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:jd.map((k,P)=>w.jsx("div",{style:{width:"17px",height:"17px",backgroundColor:k},className:"rounded-full cursor-pointer flex justify-center items-center",onClick:()=>E(k),"data-testid":`color-${P}`,children:v===k&&w.jsx(Nc,{className:"w-3 h-3 text-white",stroke:"2"})},P))})})]})};Se.Accordion=yd,Se.Alert=Dc,Se.Avatar=Kc,Se.Bullets=Xc,Se.ButtonOutline=sl,Se.ButtonPagination=Qc,Se.ButtonSolid=Jn,Se.Checkbox=ed,Se.ConfirmationAbandoningCreation=cd,Se.CoverPhoto=xd,Se.Divider=dd,Se.Dropdown=gd,Se.GoBack=fd,Se.IconSelectPicker=Sd,Se.Image=wd,Se.Input=Lo,Se.InputDropdown=md,Se.MESSAGE_ABORT_CONTROLLER=is,Se.MESSAGE_SIGNAL_ABORTED_WITHOUT_REASON=ls,Se.Modal=ul,Se.Pagination=bd,Se.Select=cl,Se.SelectColor=Td,Se.SketchColorPicker=Cd,Se.Spinner=pd,Se.SpinnerIcon=Qn,Se.Switch=hd,Se.Textarea=vd,Se.Tooltip=Ro,Se.classNames=ae,Se.copyOptions=eo,Se.generateAvatarInitials=ns,Se.groupBy=rs,Se.isPromise=os,Se.rowsPerPage=Ao,Se.useCloseModal=mi,Se.useForm=ss,Se.useMediaQuery=as,Se.useWindowDimensions=hi,Se.validateEmail=pi,Object.defineProperty(Se,Symbol.toStringTag,{value:"Module"})});
|
|
121
|
+
`}),w.jsx(Fr.Button,{as:"div",onClick:()=>ge(X),"data-testid":`menu-button-${ee}`,ref:$e,children:e}),!Je&&w.jsx("div",{className:ae("absolute right-0 z-20",n,X&&"hidden",C&&"w-full"),children:w.jsx(vn,{as:g.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:q,children:w.jsx(Fr.Items,{className:ae("mt-1 origin-top-right rounded-md bg-white shadow-lg ring-1 ring-black ring-opacity-5 focus:outline-none",C?"w-full":f===""&&"w-max",f!==""&&f),children:C?w.jsx("div",{className:"flex justify-center py-4",children:w.jsx(Qn,{})}):w.jsxs("div",{className:ae(!_&&"pb-1",r!==""&&r,Oe&&"w-custom"),"data-testid":"dropdown-menu",onScroll:te,children:[w.jsxs("div",{className:"sticky top-0 bg-white w-full",children:[M!==null&&w.jsx("div",{className:ae("py-2 w-full",a),children:w.jsx(Lo,{htmlFor:"search",id:`dropdown-search-${ee}`,name:"search",type:"text",placeholder:R,handleChange:V=>M(V,ee),icon:R!==""&&w.jsx(zc,{className:"w-4 h-4 text-primary-4"}),className:"pl-5 pr-4 h-8",classNameContainerInput:"w-full",value:L,onKeyDown:V=>V.key===" "&&V.stopPropagation(),autocomplete:"off"})}),Pe!==null&&w.jsxs("div",{className:ae("pt-1.5 justify-end flex items-center",a),children:[w.jsx(Jn,{classNameButton:ae("bg-gray-400 hover:bg-gray-400 font-medium px-2 py-1.5 rounded-md",We.size>0?"opacity-1 cursor-pointer":"opacity-0 cursor-default"),outline:"",classNameText:"text-xs text-white text-center",id:"delete",onClick:re,children:"Descartar"}),w.jsx(Jn,{classNameButton:"bg-secondary-2 hover:bg-secondary-3 font-medium px-2 py-1.5 rounded-md",outline:We.size===0&&Re?"":"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:We.size===0&&Re,onClick:()=>Pe({id:ee,items:Array.from(tt.values())}),children:Ze})]})]}),be&&w.jsx("div",{className:"flex flex-wrap ml-7 pt-1",children:Array.from(tt).map((V,Ee)=>w.jsx("div",{className:"mr-1",children:w.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:[V[1][x],w.jsx("button",{type:"button",className:"p-0.5 rounded-sm bg-gray-100 hover:bg-gray-300",onClick:()=>st(V[1]),"data-testid":`tag-${V[0]}`,children:w.jsx(qc,{className:"h-2.5 w-2.5 stroke-gray-700/50 group-hover:stroke-gray-700/75"})})]})},V))}),w.jsx("div",{className:"divide-y divide-gray-100",children:o.map((V,Ee)=>w.jsx("div",{className:ae(!_&&"py-1",z&&Ee===0&&"sticky top-0"),children:_?w.jsx("div",{onClick:ke=>{ke.preventDefault(),v()},"data-testid":`item-component-${Ee}`,children:V}):w.jsx(Fr.Item,{children:w.jsx("span",{className:ae(We.has(V[E])&&"blue text-white",!We.has(V[E])&&"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-${Ee}`,onClick:ke=>{ke.preventDefault(),Lt(V)},children:Ce(V[x])})})},Ee))})]})})})})]})},Ao=50,bd=({total:e,handleNext:o,handlePrev:r,handleSelectPage:n,page:u=null,pageSize:f=Ao})=>{const[a,m]=g.useState(1),[v,x]=g.useState([]),[E,k]=g.useState([]),[P,C]=g.useState(""),M=Math.ceil(e/f);g.useEffect(()=>{const z=[];for(let X=1;X<=M;X++)z.push(X);k(z)},[M]),g.useEffect(()=>{let z=[];const X="...",ee="... ",ue=" ...";if(E.length<6)z=E;else if(a>=1&&a<=3)z=[1,2,3,4,X,E.length];else if(a===4)z=[...E.slice(0,5),X,E.length];else if(a>4&&a<E.length-2){const we=E.slice(a-2,a),Oe=E.slice(a,a+1);z=[1,ee,...we,...Oe,ue,E.length]}else if(a>E.length-3){const we=E.slice(E.length-4);z=[1,ee,...we]}x(z)},[a,E]),g.useEffect(()=>{u!==null&&u!==a&&m(u)},[u,a]);const R=z=>{C(""),m(z),n(z)},L=()=>{C(""),a>1&&m(a-1),a>1&&r(a-1)},B=()=>{C(""),a<E.length&&m(a+1),a<E.length&&o(a+1)},_=z=>{const{value:X}=z.target;if(!/^\d*$/.test(X))return;const ee=Math.ceil(e/Ao);X>ee||C(X)};return g.useEffect(()=>{const z=setTimeout(()=>{const X=Number(P);!isNaN(X)&&X>=1&&X<=M&&(n(X),m(X))},500);return()=>clearTimeout(z)},[P,M,n]),w.jsxs("nav",{className:"flex items-center justify-between border-t border-gray-200 px-4 sm:px-0",children:[w.jsx("div",{className:"-mt-px flex w-0 flex-1",children:w.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:L,"data-testid":"prev",children:[w.jsx(wc,{className:"mr-3 h-5 w-5 text-gray-400","aria-hidden":"true"}),"Anterior"]})}),w.jsxs("div",{className:"hidden md:-mt-px md:flex",children:[w.jsxs("div",{children:[w.jsx("span",{className:"text-sm text-gray-500 font-medium mr-1",children:"Ir a"}),w.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:w.jsx(ln.Input,{htmlFor:"",id:"pager",name:"pager",handleChange:_,value:P,className:"pl-1.5 pr-1 h-7"})})]}),v.map((z,X)=>w.jsx(ln.ButtonPagination,{className:ln.classNames("inline-flex items-center border-t-2 px-4 pt-4 text-sm font-medium",a===z?"border-primary-6 text-primary-7":"border-transparent text-gray-500 hover:border-gray-300 hover:text-gray-700"),"aria-current":"page",onClick:()=>z!=="..."&&z!==" ..."&&z!=="... "&&R(z),id:`page-${X+1}`,children:z},X))]}),w.jsx("div",{className:"-mt-px flex w-0 flex-1 justify-end",children:w.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:B,"data-testid":"next",children:["Siguiente",w.jsx(Sc,{className:"ml-3 h-5 w-5 text-gray-400","aria-hidden":"true"})]})})]})},xd=({setForm:e,setValuesDefault:o,className:r="",classNameContainer:n="",classNameContainerImg:u="",src:f=null,alt:a=null,width:m,height:v,title:x="Logo (Opcional)",fileFormatsDescription:E="PNG, JPG, GIF up to 10MB"})=>{const k=f===null?"":f.split("."),P=C=>{const{files:M}=C.target,[R]=M,L=new FileReader;L.readAsDataURL(R),L.onload=function(){R.type.startsWith("image/")?(e(_=>({..._,photo:L.result})),o("photo",L.result)):(e(_=>({..._,photo:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png"})),o("photo",L.result))}};return w.jsxs("div",{className:ae("col-span-full",n!==""&&n),children:[w.jsx("label",{htmlFor:"cover-photo",className:"block text-sm font-medium leading-6 text-gray-500",children:x}),w.jsxs("div",{className:ae("mt-2 flex justify-center rounded-lg border-2 border-dotted border-gray-300 cursor-pointer relative",u!==""&&u),children:[f?w.jsx("img",{src:/(jpg|png|jpe?g|gif|webp|svg)$/i.test(k[k.length-1])||f.startsWith("data:image/")?f:"https://cdn.pixabay.com/photo/2017/03/08/21/21/file-2127833_1280.png",alt:a,width:m,height:v,className:ae(r!==""&&r),loading:"lazy",decoding:"async",style:{filter:"blur(5px)",transition:"filter 0.3s",objectFit:"contain",height:v},onLoad:C=>C.currentTarget.style.filter="none","data-testid":"img"}):w.jsxs("div",{className:"text-center",children:[w.jsx(Vc,{"aria-hidden":"true",className:"mx-auto h-12 w-12 text-gray-300"}),w.jsxs("div",{className:"mt-4 flex text-sm leading-6 text-gray-600",children:[w.jsx("label",{htmlFor:"file-upload",className:"relative cursor-pointer rounded-md bg-white font-semibold text-primary-7 focus-within:outline-none focus-within:ring-2 focus-within:ring-primary-7 focus-within:ring-offset-2 hover:text-primary-6",children:w.jsx("span",{children:"Subir un archivo"})}),w.jsx("p",{className:"pl-1",children:"o arrástralo y suéltalo aquí"})]}),w.jsx("p",{className:"text-xs leading-5 text-gray-600",children:E})]}),w.jsx("input",{id:"file-upload",name:"file-upload",type:"file",className:"absolute w-full h-full opacity-0 cursor-pointer",onChange:P})]})]})},yd=({children:e,openDefault:o=!1,setForm:r,setValuesDefault:n,title:u,type:f,data:a,setData:m,id:v,defaultData:x,showAlert:E,isAdd:k=!0,search:P=null,isPadding:C=!0,isReadOnly:M=!1,isEdit:R=!1,deleteItem:L=null,validateAdd:B=null,loading:_=!1,internalEdit:z=!0,isDataEmpty:X=!0,typeProp:ee="value",setAdd:ue=null,hasNoRecords:we=!0,tabs:Oe=null,selectTab:be=null,className:y="mt-7"})=>{const[Pe,Ze]=g.useState(!1),[Ye,Y]=g.useState(!1),[,Je]=g.useState(!1),[Re,q]=g.useState(""),[te,ve]=g.useState(1);g.useEffect(()=>{Ze(o),Je(M)},[o,M]);const $e=({e:ge,index:st})=>{const re=eo(a),{name:Ce,value:V}=ge.target;!(B===null?!1:B({value:V,copyData:re,index:st}))&&(re[st][Ce]=V),m(re),n(v,re),r(ke=>({...ke,[v]:re}))},We=()=>{if(a.some(st=>Object.values(st).some(V=>V[ee]===-1))||a.length===0)return E({title:"",message:"Todos los campos son requeridos",type:"warning"});r(st=>({...st,data:a})),n(v,a),m([...a,x]),ue&&ue([...a,x])},lt=({index:ge,item:st})=>{if(a.length===1&&!R)return;let re=eo(a);re.length===1&&(re=[x]),re.length>1&&re.splice(ge,1),r(Ce=>({...Ce,data:re})),n(v,re),m(re),L&&L({index:ge,item:st,data:re}),ge===a.length-1&&R&&re.length===0&&(r(Ce=>({...Ce,data:re})),n(v,re),m([...re,x]))},tt=()=>{Y(!Ye),Je(!1)},St=()=>{if(a.length>1)return;if(a.length===0)return!0;const[ge]=a;return!ge||typeof ge!="object"?!0:Object.keys(ge).filter(Ce=>{const V=ge[Ce];return V&&typeof V=="object"&&"value"in V}).every(Ce=>ge[Ce].value===-1)},Lt=({tab:ge})=>{ve(ge.id),be&&be({tab:ge})};return w.jsxs("div",{className:ae("divide-y divide-gray-200 rounded-lg bg-white shadow",y),children:[w.jsxs("div",{className:"px-4 py-3.5 sm:px-6 flex justify-between items-center cursor-pointer",onClick:()=>Ze(!Pe),"data-testid":`open-accordion-${v}`,children:[typeof u=="string"?w.jsx("p",{className:"text-gray-500 uppercase text-xs font-bold",children:u}):u,w.jsxs("div",{className:"flex items-center",children:[P&&w.jsx(Lo,{htmlFor:"search",id:"search",name:"search",type:"text",autoComplete:"search",placeholder:"Buscar...",handleChange:ge=>{P(ge),q(ge.target.value)},icon:w.jsx(sd,{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:Re,onClick:ge=>ge.stopPropagation(),onFocus:()=>Ze(!0)}),Pe?w.jsx(id,{className:"w-5 h-5 text-default-4"}):w.jsx(al,{className:"w-5 h-5 text-default-4"})]})]}),w.jsx(vn,{as:g.Fragment,show:Pe,enter:"transition duration-[400ms]",enterFrom:"opacity-0",enterTo:"opacity-100",leave:"duration-200 transition ease-in-out",leaveFrom:"opacity-100",leaveTo:"opacity-0",children:w.jsxs("div",{children:[Oe&&w.jsx("nav",{className:"flex justify-center border-b border-gray-200","aria-label":"Tabs",children:Oe.map(ge=>w.jsx("span",{className:ae(te===ge.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":te===ge.id?"page":void 0,onClick:()=>Lt({tab:ge}),"data-testid":`tab-${ge.id}`,children:ge.name},ge.name))}),w.jsxs("div",{className:ae("sm:mt-2.5 py-3.5 relative",C&&Oe===null&&"px-4 sm:p-6",C&&Oe!==null&&"px-4 sm:px-6 sm:pb-6 sm:pt-2.5"),children:[z&&!Ye&&w.jsx(Hc,{className:"w-5 h-5 text-gray-400 cursor-pointer absolute right-4",onClick:tt,"data-testid":`edit-role-${v}`}),_&&w.jsx("div",{className:"flex justify-center mt-5",children:w.jsx(Qn,{})}),X&&St()&&we&&!_&&(z?!Ye:!R)&&w.jsx("p",{className:"text-gray-800 text-center","data-testid":"records-empty",children:"No hay registros para mostrar"}),!_&&a.map((ge,st)=>w.jsxs("div",{className:ae("flex flex-col 3xs:flex-row mb-4",C&&"ml-0 3xs:ml-3"),children:[typeof e=="function"?e({item:ge,index:st,handleChange:$e,isEdit:z?Ye:R}):e,k&&(z?Ye:R)&&w.jsx("div",{style:{backgroundColor:"#B0B8BF",width:"25px",height:"25px"},className:ae("rounded-full flex justify-center items-center mt-4 3xs:mt-7 ml-2 3xs:ml-5 self-start 3xs:self-center",a.length===1&&!R&&"opacity-0"),children:w.jsx(ud,{className:ae("w-6 h-4",(a.length>1||R)&&"cursor-pointer"),style:{color:"#637381"},strokeWidth:2.5,onClick:()=>lt({index:st,item:ge}),"data-testid":`delete-item-${st}-${v}`})})]},st)),k&&(z?Ye:R)&&!_&&w.jsx("p",{className:"text-secondary-2 text-sm font-medium ml-3 cursor-pointer",onClick:We,"data-testid":`add-item-${v}`,style:{width:"fit-content"},children:`+ Añadir ${f}`})]})]})})]})},wd=({src:e,alt:o,width:r,height:n,className:u="",priority:f=!1,style:a={},id:m=""})=>{const[v,x]=g.useState(!1),E={filter:v?"none":"blur(10px)",transition:"filter 0.3s ease-out",objectFit:"cover",...r?{width:r}:{},...n?{height:n}:{},...a};return w.jsx("img",{src:e,alt:o,...r?{width:r}:{},...n?{height:n}:{},className:ae(u!==""&&u),loading:f?"eager":"lazy",decoding:"async",style:E,onLoad:()=>x(!0),"data-testid":`image-${m}`})},Ed=["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"];function Sd({value:e,onChange:o,disabled:r,id:n,label:u="",classNameLabel:f="",helperText:a="",isError:m=!1,isReadOnly:v=!1,name:x}){const[E,k]=g.useState(!1),P=g.useRef(null);g.useEffect(()=>{function M(R){E&&P.current&&!P.current.contains(R.target)&&k(!1)}return document.addEventListener("mousedown",M),()=>document.removeEventListener("mousedown",M)},[E]);const C=Zt({"border-red-300 focus:border-red-300 text-red-900":m&&!v,"text-gray-500":!m,"focus:border-primary-7":!m&&!v});return w.jsxs(w.Fragment,{children:[u!==""&&w.jsx("p",{className:ln.classNames("block text-sm font-medium leading-6",f!==""?f:"text-gray-700"),"data-testid":`label-${n}`,children:u}),w.jsxs("div",{style:{position:"relative",width:"100%"},className:ln.classNames("border rounded-md",C),ref:P,children:[w.jsxs("div",{className:"flex items-center gap-2 dropdown-trigger border border-default-2 rounded-md p-1.5",onClick:()=>!r&&k(!E),style:{cursor:r?"not-allowed":"pointer"},title:e||"Selecciona un icono","data-testid":"open",children:[w.jsx("div",{className:"rounded border border-default-2 p-1 h-6 w-6 bg-default-2 flex items-center justify-center",children:e&&w.jsx("i",{className:ln.classNames(e,"text-normal block")})}),w.jsx("div",{className:"truncate",style:{width:"136px"},children:e}),w.jsx(al,{className:ln.classNames("h-5 w-5 ml-auto transition-transform",{"transform rotate-180":E})})]}),E&&w.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:w.jsx("div",{className:"grid w-full",style:{gridTemplateColumns:"repeat(auto-fill, minmax(30px, 1fr))",gap:12},children:Ed.map(M=>w.jsx("button",{type:"button",className:"icon-picker-btn",style:{width:"100%",aspectRatio:"1",borderRadius:4,border:e===M?"2px solid #007bff":"1px solid #eee",background:"#f9f9f9",display:"flex",alignItems:"center",justifyContent:"center",fontSize:20,color:e===M?"#007bff":"#333",outline:"none",cursor:"pointer"},onClick:()=>{o({target:{value:M,checked:!1,name:x,id:n}}),k(!1)},title:M,children:w.jsx("i",{className:M})},M))})})]}),a.length>0&&m&&w.jsx("p",{className:"text-red-600 text-sm text-left mt-1","data-testid":`helperText-${n}`,children:a})]})}const Dr=(e,o,r)=>{const n=r*o,u=n*(1-Math.abs(e/60%2-1)),f=r-n;let a,m,v;return e<60?[a,m,v]=[n,u,0]:e<120?[a,m,v]=[u,n,0]:e<180?[a,m,v]=[0,n,u]:e<240?[a,m,v]=[0,u,n]:e<300?[a,m,v]=[u,0,n]:[a,m,v]=[n,0,u],[Math.round((a+f)*255),Math.round((m+f)*255),Math.round((v+f)*255)]},Do=(e,o,r)=>{e/=255,o/=255,r/=255;const n=Math.max(e,o,r),u=Math.min(e,o,r),f=n-u;let a;const m=n,v=n===0?0:f/n;if(n===u)a=0;else{switch(n){case e:a=(o-r)/f+(o<r?6:0);break;case o:a=(r-e)/f+2;break;case r:a=(e-o)/f+4;break}a*=60}return[a,v,m]},er=(e,o,r)=>"#"+[e,o,r].map(n=>n.toString(16).padStart(2,"0")).join("").toUpperCase(),dl=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 Cd({value:e,onChange:o,disabled:r,label:n="",classNameLabel:u="",helperText:f="",isError:a=!1,isReadOnly:m=!1,name:v}){const x=g.useRef(!0),E=g.useRef(null),k=g.useRef(null),[P,C]=g.useState(!1),[M,R]=g.useState([182.2,.849,.494]),[L,B]=g.useState(e),_=g.useCallback(q=>{o({target:{value:q,name:v}})},[v,o]);g.useEffect(()=>{if(e&&/^#[0-9A-Fa-f]{6}$/.test(e)){const q=dl(e);R(Do(...q)),B(e.toUpperCase())}},[e]);const[z,X,ee]=M,[ue,we,Oe]=Dr(z,X,ee),be=er(ue,we,Oe);g.useEffect(()=>{B(be)},[be]),g.useEffect(()=>{!x.current||m||(x.current=!1,_(be))},[be,_,m]),g.useEffect(()=>{function q(ve){if(!E.current||!E.current._dragging)return;const $e=E.current.getBoundingClientRect();let We=(ve.touches?ve.touches[0].clientX:ve.clientX)-$e.left,lt=(ve.touches?ve.touches[0].clientY:ve.clientY)-$e.top;We=Math.max(0,Math.min($e.width,We)),lt=Math.max(0,Math.min($e.height,lt));const tt=We/$e.width,St=1-lt/$e.height;R([z,tt,St]);const[Lt,ge,st]=Dr(z,tt,St),re=er(Lt,ge,st);B(re),_(re)}function te(){E.current&&(E.current._dragging=!1),window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",te),window.removeEventListener("touchmove",q),window.removeEventListener("touchend",te)}return E.current&&E.current._dragging&&(window.addEventListener("mousemove",q),window.addEventListener("mouseup",te),window.addEventListener("touchmove",q),window.addEventListener("touchend",te)),()=>{window.removeEventListener("mousemove",q),window.removeEventListener("mouseup",te),window.removeEventListener("touchmove",q),window.removeEventListener("touchend",te)}},[_,z]),g.useEffect(()=>{function q(te){P&&k.current&&!k.current.contains(te.target)&&C(!1)}return document.addEventListener("mousedown",q),()=>document.removeEventListener("mousedown",q)},[P]);const y=q=>{if(!E.current)return;const te=E.current.getBoundingClientRect();let ve=(q.touches?q.touches[0].clientX:q.clientX)-te.left,$e=(q.touches?q.touches[0].clientY:q.clientY)-te.top;ve=Math.max(0,Math.min(te.width,ve)),$e=Math.max(0,Math.min(te.height,$e));const We=ve/te.width,lt=1-$e/te.height;R([z,We,lt]);const[tt,St,Lt]=Dr(z,We,lt),ge=er(tt,St,Lt);B(ge),_(ge)},he=q=>{r||(E.current&&(E.current._dragging=!0),y(q))},Pe=()=>{E.current&&(E.current._dragging=!1)},Ze=q=>{const te=Number(q.target.value);R([te,X,ee]);const[ve,$e,We]=Dr(te,X,ee),lt=er(ve,$e,We);B(lt),_(lt)},Ye=q=>{const te=q.target.value;if(B(te),/^#[0-9A-Fa-f]{6}$/.test(te)){const ve=dl(te);R(Do(...ve)),_(te.toUpperCase())}},Y=(q,te)=>{const ve=[ue,we,Oe];ve[q]=Math.max(0,Math.min(255,Number(te)||0)),R(Do(...ve));const $e=er(...ve);B($e),_($e)},Je=X*180,Re=(1-ee)*180;return w.jsxs(w.Fragment,{children:[n&&w.jsx("p",{className:Zt("block text-sm font-medium leading-6",u||"text-gray-700"),children:n}),w.jsxs("div",{style:{position:"relative",display:"inline-block"},ref:k,className:"w-full",children:[w.jsxs("div",{className:"flex items-center gap-2 mb-2 dropdown-trigger rounded-md border p-2 border-default-2 w-full",onClick:()=>!r&&C(!P),children:[w.jsx("div",{className:"rounded border border-default-2 flex-shrink-0 w-6 h-6",style:{backgroundColor:m?"":be}}),w.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:m?"":L,disabled:r,onChange:Ye,readOnly:m}),w.jsx(Po,{className:Zt("h-5 w-5 ml-2 transition-transform",{"transform rotate-180":P&&!m})})]}),P&&!m&&w.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:[w.jsxs("div",{className:"relative rounded mb-2 cursor-crosshair",ref:E,style:{backgroundColor:`hsl(${z}, 100%, 50%)`,height:"200px"},onMouseDown:he,onMouseMove:q=>E.current&&E.current._dragging&&y(q),onMouseUp:Pe,onMouseLeave:Pe,onTouchStart:he,onTouchMove:q=>E.current&&E.current._dragging&&y(q),onTouchEnd:Pe,children:[w.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to right, #fff, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),w.jsx("div",{style:{position:"absolute",inset:0,background:"linear-gradient(to top, #000, transparent)",borderRadius:"inherit",pointerEvents:"none"}}),w.jsx("div",{className:"absolute w-4 h-4 rounded-full border-2 border-white shadow",style:{left:`calc(${Je}px - 8px)`,top:`calc(${Re}px - 8px)`,background:be,pointerEvents:"none"}})]}),w.jsx("input",{type:"range",min:0,max:359,value:z,onChange:Ze,className:"w-full mb-2",style:{background:"linear-gradient(to right, red, yellow, lime, cyan, blue, magenta, red)"},disabled:r}),w.jsx("div",{className:"flex gap-2 mb-2",children:["R","G","B"].map((q,te)=>w.jsxs("div",{children:[w.jsx("label",{className:"text-center block",children:q}),w.jsx("input",{type:"number",min:0,max:255,className:"w-14 px-2 py-1 border border-gray-300 rounded text-sm",value:[ue,we,Oe][te],onChange:ve=>Y(te,ve.target.value),disabled:r,placeholder:q})]},te))})]})]}),f&&a&&w.jsx("p",{className:"text-red-600 text-sm text-left mt-1",children:f})]})}const jd=["#FFCEC7","#2ecc71","#3498db","#9b59b6","#34495e","#1abc9c","#e74c3c","#7f8c8d","#f1c40f","#e67e22","#000000"],Td=({className:e="",label:o="",onChange:r,name:n,id:u,value:f="#FFCEC7"})=>{const[a,m]=g.useState(!1),[v,x]=g.useState("#FFCEC7");mi({id:"menu-colors",close:()=>m(!1)}),g.useEffect(()=>{x(f)},[f]);const E=k=>{x(k),m(!1),r({target:{value:k,checked:!1,name:n,type:void 0,id:u}})};return w.jsxs("div",{className:ae("relative",e!==""&&e),children:[o&&w.jsx("p",{className:"text-sm font-medium leading-6 text-gray-500 mb-0.5",children:o}),w.jsxs("div",{className:"flex justify-center items-center bg-gray-100 px-3 rounded-md h-10 w-20 gap-4 cursor-pointer",onClick:()=>m(!a),id:"menu-colors","data-testid":"menu-colors",children:[w.jsx("div",{style:{width:"18px",height:"18px",backgroundColor:v},className:"rounded-full"}),w.jsx(Po,{className:ae("h-5 w-5 transition-transform",a&&"transform rotate-180")})]}),w.jsx(vn,{show:a,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:w.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:jd.map((k,P)=>w.jsx("div",{style:{width:"17px",height:"17px",backgroundColor:k},className:"rounded-full cursor-pointer flex justify-center items-center",onClick:()=>E(k),"data-testid":`color-${P}`,children:v===k&&w.jsx(Nc,{className:"w-3 h-3 text-white",stroke:"2"})},P))})})]})};Se.Accordion=yd,Se.Alert=Dc,Se.Avatar=Kc,Se.Bullets=Xc,Se.ButtonOutline=sl,Se.ButtonPagination=Qc,Se.ButtonSolid=Jn,Se.Checkbox=ed,Se.ConfirmationAbandoningCreation=cd,Se.CoverPhoto=xd,Se.Divider=dd,Se.Dropdown=gd,Se.GoBack=fd,Se.IconSelectPicker=Sd,Se.Image=wd,Se.Input=Lo,Se.InputDropdown=md,Se.MESSAGE_ABORT_CONTROLLER=is,Se.MESSAGE_SIGNAL_ABORTED_WITHOUT_REASON=ls,Se.Modal=ul,Se.Pagination=bd,Se.Select=cl,Se.SelectColor=Td,Se.SketchColorPicker=Cd,Se.Spinner=pd,Se.SpinnerIcon=Qn,Se.Switch=hd,Se.Textarea=vd,Se.Tooltip=Ro,Se.classNames=ae,Se.copyOptions=eo,Se.generateAvatarInitials=ns,Se.groupBy=rs,Se.isPromise=os,Se.rowsPerPage=Ao,Se.useCloseModal=mi,Se.useForm=ss,Se.useMediaQuery=as,Se.useWindowDimensions=hi,Se.validateEmail=pi,Object.defineProperty(Se,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "cemtrik-dependencies",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.202",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"scripts": {
|
|
6
6
|
"dev": "vite",
|
|
@@ -24,14 +24,10 @@
|
|
|
24
24
|
"@babel/preset-react": "^7.24.7",
|
|
25
25
|
"@commitlint/cli": "^17.6.5",
|
|
26
26
|
"@commitlint/config-conventional": "^17.6.5",
|
|
27
|
-
"@tailwindcss/forms": "^0.3.4",
|
|
28
|
-
"@tailwindcss/typography": "^0.4.1",
|
|
29
27
|
"@testing-library/jest-dom": "^5.16.5",
|
|
30
28
|
"@testing-library/react": "^14.0.0",
|
|
31
29
|
"@vitejs/plugin-react": "^4.3.1",
|
|
32
|
-
"autoprefixer": "10.4.5",
|
|
33
30
|
"babel-jest": "^29.7.0",
|
|
34
|
-
"css-loader": "^6.8.1",
|
|
35
31
|
"eslint": "^8.42.0",
|
|
36
32
|
"eslint-config-google": "^0.14.0",
|
|
37
33
|
"eslint-config-next": "^13.4.4",
|
|
@@ -49,11 +45,7 @@
|
|
|
49
45
|
"jest-transform-stub": "^2.0.0",
|
|
50
46
|
"lint-staged": "^13.2.2",
|
|
51
47
|
"npm": "^10.8.2",
|
|
52
|
-
"postcss": "^8.3.5",
|
|
53
|
-
"postcss-loader": "^6.1.1",
|
|
54
48
|
"prettier": "^2.8.8",
|
|
55
|
-
"style-loader": "^3.3.3",
|
|
56
|
-
"tailwindcss": "^2.2.19",
|
|
57
49
|
"vite": "^5.4.0"
|
|
58
50
|
},
|
|
59
51
|
"lint-staged": {
|