@segmentify/ui 0.0.45 → 0.0.47
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.
|
@@ -5,7 +5,7 @@ import { ColumnVisibility } from './column-visibility';
|
|
|
5
5
|
import { Content } from './content';
|
|
6
6
|
export type { ActionItem, ActionsProps } from './actions';
|
|
7
7
|
export type { RenderRowSubComponentProps } from './content';
|
|
8
|
-
export { type ColumnDef } from '@tanstack/react-table';
|
|
8
|
+
export { type ColumnDef, type Column } from '@tanstack/react-table';
|
|
9
9
|
export declare const DataTable: {
|
|
10
10
|
Root: typeof Root;
|
|
11
11
|
Toolbar: typeof Toolbar;
|
|
@@ -2,6 +2,7 @@ interface SearchProps {
|
|
|
2
2
|
placeholder?: string;
|
|
3
3
|
filterColumn?: string;
|
|
4
4
|
className?: string;
|
|
5
|
+
label?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare function Search({ placeholder, filterColumn, className }: SearchProps): import("react/jsx-runtime").JSX.Element;
|
|
7
|
+
export declare function Search({ placeholder, filterColumn, className, label }: SearchProps): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -74,7 +74,7 @@ export { Timeline, type IconConfig, type TimelineItem, type TimelineProps } from
|
|
|
74
74
|
export { Tooltip, TooltipTrigger, TooltipContent, TooltipProvider } from './components/atoms/tooltip';
|
|
75
75
|
export { TooltipField } from './components/molecules/tooltip-field';
|
|
76
76
|
export { QuillEditor } from './components/atoms/quill-editor';
|
|
77
|
-
export { DataTable, type ColumnDef } from './components/organisms/data-table';
|
|
77
|
+
export { DataTable, type ColumnDef, type Column } from './components/organisms/data-table';
|
|
78
78
|
export type { ActionItem, ActionsProps, RenderRowSubComponentProps } from './components/organisms/data-table';
|
|
79
79
|
export { DatePreset } from './components/organisms/date-preset/date-preset';
|
|
80
80
|
export { DatePresetProvider } from './components/organisms/date-preset/root';
|
package/dist/segmentify-ui.cjs
CHANGED
|
@@ -83,7 +83,7 @@ Avoid returning a new reference inside your input selector, e.g.
|
|
|
83
83
|
${s.right}px ${s.bottom}px,
|
|
84
84
|
${s.right}px ${s.top}px,
|
|
85
85
|
${s.left}px ${s.top}px
|
|
86
|
-
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});process.env.NODE_ENV!=="production"&&(LD.displayName="InternalBackdrop");function uJ(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const $0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&($0.displayName="ComboboxRootContext");const G0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(G0.displayName="ComboboxFloatingContext");const H0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(H0.displayName="ComboboxDerivedItemsContext");const W0=b.createContext("");process.env.NODE_ENV!=="production"&&(W0.displayName="ComboboxInputValueContext");function Gn(){const e=b.useContext($0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(22));return e}function _f(){const e=b.useContext(G0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(23));return e}function Ii(){const e=b.useContext(H0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(24));return e}function z0(){return b.useContext(W0)}const cJ=(e,t)=>Object.is(e,t);function ns(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function dJ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:ns(t,r,n))}function gd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:ns(r,t,n))}function fJ(e,t,n){return e.filter(r=>!ns(t,r,n))}function mv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function q0(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function pJ(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(q0(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function On(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return mv(e)}function $a(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?mv(e.value):mv(e)}function FD(e,t,n){function r(){return On(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=q0(t)?t.flatMap(i=>i.items):t;if(e==null||typeof e!="object"){const i=o.find(s=>s.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=o.find(s=>s&&s.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function hJ(e,t,n){return e.reduce((r,o,i)=>(i>0&&r.push(", "),r.push(h.jsx(b.Fragment,{children:FD(o,t,n)},i)),r),[])}const be={id:De(e=>e.id),query:De(e=>e.query),items:De(e=>e.items),selectedValue:De(e=>e.selectedValue),hasSelectionChips:De(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:De(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:De((e,t)=>t?pJ(e.items):!1),open:De(e=>e.open),mounted:De(e=>e.mounted),forceMounted:De(e=>e.forceMounted),inline:De(e=>e.inline),activeIndex:De(e=>e.activeIndex),selectedIndex:De(e=>e.selectedIndex),isActive:De((e,t)=>e.activeIndex===t),isSelected:De((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(o=>ns(t,o,n)):ns(t,r,n)}),transitionStatus:De(e=>e.transitionStatus),popupProps:De(e=>e.popupProps),inputProps:De(e=>e.inputProps),triggerProps:De(e=>e.triggerProps),getItemProps:De(e=>e.getItemProps),positionerElement:De(e=>e.positionerElement),listElement:De(e=>e.listElement),triggerElement:De(e=>e.triggerElement),inputElement:De(e=>e.inputElement),popupSide:De(e=>e.popupSide),openMethod:De(e=>e.openMethod),inputInsidePopup:De(e=>e.inputInsidePopup),selectionMode:De(e=>e.selectionMode),listRef:De(e=>e.listRef),labelsRef:De(e=>e.labelsRef),popupRef:De(e=>e.popupRef),emptyRef:De(e=>e.emptyRef),inputRef:De(e=>e.inputRef),keyboardActiveRef:De(e=>e.keyboardActiveRef),chipsContainerRef:De(e=>e.chipsContainerRef),clearRef:De(e=>e.clearRef),valuesRef:De(e=>e.valuesRef),allValuesRef:De(e=>e.allValuesRef),name:De(e=>e.name),disabled:De(e=>e.disabled),readOnly:De(e=>e.readOnly),required:De(e=>e.required),grid:De(e=>e.grid),isGrouped:De(e=>e.isGrouped),virtualized:De(e=>e.virtualized),onOpenChangeComplete:De(e=>e.onOpenChangeComplete),openOnInputClick:De(e=>e.openOnInputClick),itemToStringLabel:De(e=>e.itemToStringLabel),isItemEqualToValue:De(e=>e.isItemEqualToValue),modal:De(e=>e.modal),autoHighlight:De(e=>e.autoHighlight),submitOnItemClick:De(e=>e.submitOnItemClick)};let JE=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const gJ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},mJ={valid(e){return e===null?null:e?{[JE.valid]:""}:{[JE.invalid]:""}}},BD=b.createContext({invalid:void 0,name:void 0,validityData:{state:gJ,errors:[],error:"",value:"",initialValue:null},setValidityData:Lt,disabled:void 0,touched:!1,setTouched:Lt,dirty:!1,setDirty:Lt,filled:!1,setFilled:Lt,focused:!1,setFocused:Lt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=En)=>e,getInputValidationProps:(e=En)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(BD.displayName="FieldRootContext");function bu(e=!0){const t=b.useContext(BD);if(t.setValidityData===Lt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Fr(28));return t}function bJ(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const VD=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Lt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(VD.displayName="FormContext");function $D(){return b.useContext(VD)}function vJ(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:i,commit:s}=e,{formRef:a}=$D(),{invalid:l,markedDirtyRef:u,validityData:c,setValidityData:d}=bu(),f=ke(e.getValue);Ge(()=>{if(!t)return;let p=n;p===void 0&&(p=f()),c.initialValue===null&&p!==null&&d(g=>({...g,initialValue:p}))},[t,d,n,c.initialValue,f]),Ge(()=>{!t||!r||a.current.fields.set(r,{getValue:f,name:o,controlRef:i,validityData:bJ(c,l),validate(p=!0){let g=n;g===void 0&&(g=f()),u.current=!0,p?so.flushSync(()=>s(g)):s(g)}})},[s,i,t,a,f,r,l,u,o,c,n]),Ge(()=>{const p=a.current.fields;return()=>{r&&p.delete(r)}},[a,r])}const GD=b.createContext({controlId:void 0,registerControlId:Lt,labelId:void 0,setLabelId:Lt,messageIds:[],setMessageIds:Lt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(GD.displayName="LabelableContext");function U0(){return b.useContext(GD)}function HD(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=U0(),s=tD(t),a=n?o:void 0,l=cr(()=>Symbol("labelable-control")),u=b.useRef(!1),c=b.useRef(t!=null),d=ke(()=>{!u.current||i===Lt||(u.current=!1,i(l.current,void 0))});return Ge(()=>{if(i===Lt)return;let f;if(n){const p=r?.current;Ot(p)&&p.closest("label")!=null?f=t??null:f=a??s}else if(t!=null)c.current=!0,f=t;else if(c.current)f=s;else{d();return}if(f===void 0){d();return}u.current=!0,i(l.current,f)},[t,r,a,i,n,s,l,d]),b.useEffect(()=>d,[d]),o??s}function yJ(e,t){return(n,r)=>{if(n==null)return!1;const o=On(n,t);return e.contains(o,r)}}function xJ(e,t,n){return(r,o)=>{if(r==null)return!1;if(!o)return!0;const i=On(r,t),s=n!=null?On(n,t):"";return s&&e.contains(s,o)&&s.length===o.length?!0:e.contains(i,o)}}const KE=new Map;function WD(e){return Array.isArray(e)?e.map(t=>WD(t)).join(","):e==null?"":String(e)}function wJ(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${WD(e.locale)}|${JSON.stringify(t)}`,r=KE.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(s,a,l){if(!a)return!0;const u=On(s,l);for(let c=0;c<=u.length-a.length;c+=1)if(o.compare(u.slice(c,c+a.length),a)===0)return!0;return!1},startsWith(s,a,l){if(!a)return!0;const u=On(s,l);return o.compare(u.slice(0,a.length),a)===0},endsWith(s,a,l){if(!a)return!0;const u=On(s,l),c=a.length;return u.length>=c&&o.compare(u.slice(u.length-c),a)===0}};return KE.set(n,i),i}const CJ=wJ;function oc(e,t){const n=b.useRef(e),r=ke(t);Ge(()=>{n.current!==e&&r(n.current)},[e,r]),Ge(()=>{n.current=e},[e])}const zD=Symbol("none"),$i={value:zD,index:-1};function SJ(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:s,inputValue:a,selectionMode:l="none",onItemHighlighted:u,name:c,disabled:d=!1,readOnly:f=!1,required:p=!1,inputRef:g,grid:m=!1,items:v,filteredItems:y,filter:x,openOnInputClick:w=!0,autoHighlight:C=!1,keepHighlight:S=!1,highlightItemOnHover:R=!0,loopFocus:I=!0,itemToStringLabel:T,itemToStringValue:_,isItemEqualToValue:$=cJ,virtualized:A=!1,inline:M=!1,fillInputOnItemPress:O=!0,modal:B=!1,limit:j=-1,autoComplete:D="list",formAutoComplete:V,locale:G,submitOnItemClick:z=!1}=e,{clearErrors:H}=$D(),{setDirty:ne,validityData:W,shouldValidateOnChange:J,setFilled:K,name:U,disabled:oe,setTouched:X,setFocused:te,validationMode:Q,validation:se}=bu(),ae=HD({id:t}),L=CJ({locale:G}),[Z,k]=b.useState(!1),[ie,Y]=b.useState(null),le=b.useRef([]),pe=b.useRef([]),re=b.useRef(null),fe=b.useRef(null),de=b.useRef(null),ve=b.useRef(!0),we=b.useRef(!1),Se=b.useRef(null),Ye=b.useRef(null),at=b.useRef(null),Xe=b.useRef($i),Ue=b.useRef(null),rt=b.useRef([]),et=b.useRef([]),gt=oe||d,ct=U??c,ot=l==="multiple",mt=l==="single",Nt=a!==void 0||s!==void 0,Bt=v!==void 0,tt=y!==void 0;let Ze;C==="always"?Ze="always":Ze=C?"input-change":!1;const[ee,ye]=Rm({controlled:o,default:ot?r??Yu:r,name:"Combobox",state:"selectedValue"}),ge=b.useMemo(()=>x===null?()=>!0:x!==void 0?x:mt&&!Z?xJ(L,T,ee):yJ(L,T),[x,mt,ee,Z,L,T]),xe=cr(()=>Nt?s??"":mt?On(ee,T):"").current,[Ae,Ie]=Rm({controlled:a,default:xe,name:"Combobox",state:"inputValue"}),[qe,Pt]=Rm({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),lt=q0(v),it=ie??(Ae===""?"":String(Ae).trim()),_t=mt?On(ee,T):"",Et=mt&&!Z&&it!==""&&_t!==""&&_t.length===it.length&&L.contains(_t,it),sn=Et?"":it,mr=Bt&&tt&&Et,Wn=b.useMemo(()=>v?lt?v.flatMap(Ce=>Ce.items):v:Yu,[v,lt]),pn=b.useMemo(()=>{if(y&&!mr)return y;if(!v)return Yu;if(lt){const Me=v,Ke=[];let It=0;for(const st of Me){if(j>-1&&It>=j)break;const Dt=sn===""?st.items:st.items.filter(zr=>ge(zr,sn,T));if(Dt.length===0)continue;const Xn=j>-1?j-It:1/0,An=Dt.slice(0,Xn);if(An.length>0){const zr={...st,items:An};Ke.push(zr),It+=An.length}}return Ke}if(sn==="")return j>-1?Wn.slice(0,j):Wn;const Ce=[];for(const Me of Wn){if(j>-1&&Ce.length>=j)break;ge(Me,sn,T)&&Ce.push(Me)}return Ce},[y,mr,v,lt,sn,j,ge,T,Wn]),Jt=b.useMemo(()=>lt?pn.flatMap(Me=>Me.items):pn,[pn,lt]),Ve=cr(()=>new DD({id:ae,selectedValue:ee,open:qe,filter:ge,query:it,items:v,selectionMode:l,listRef:le,labelsRef:pe,popupRef:re,emptyRef:de,inputRef:fe,keyboardActiveRef:ve,chipsContainerRef:Se,clearRef:Ye,valuesRef:rt,allValuesRef:et,selectionEventRef:at,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,openOnInputClick:w,itemToStringLabel:T,isItemEqualToValue:$,modal:B,autoHighlight:Ze,submitOnItemClick:z,hasInputValue:Nt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:M,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Lt,setOpen:Lt,setInputValue:Lt,setSelectedValue:Lt,setIndices:Lt,onItemHighlighted:Lt,handleSelection:Lt,getItemProps:()=>En,forceMount:Lt,requestSubmit:Lt})).current,zn=l==="none"?Ae:ee,Sa=b.useMemo(()=>l==="none"?zn:Array.isArray(ee)?ee.map(Ce=>$a(Ce,_)):$a(ee,_),[zn,_,l,ee]),Oi=ke(u),Ni=ke(n),Go=me(Ve,be.activeIndex),nn=me(Ve,be.selectedIndex),Ho=me(Ve,be.positionerElement),Es=me(Ve,be.listElement),bo=me(Ve,be.triggerElement),Pi=me(Ve,be.inputElement),Cn=me(Ve,be.inline),Mt=me(Ve,be.inputInsidePopup),Ea=rr(bo),{mounted:Is,setMounted:Ia,transitionStatus:_i}=M0(qe),{openMethod:Rs,triggerProps:Hr,reset:As}=eJ(qe);vJ({id:ae,name:ct,commit:se.commit,value:zn,controlRef:Mt?Ea:fe,getValue:()=>Sa});const br=ke(()=>{v?pe.current=Jt.map(Ce=>On(Ce,T)):Ve.set("forceMounted",!0)}),qn=b.useRef(ee);Ge(()=>{ee!==qn.current&&br()},[br,ee]);const an=ke(Ce=>{Ve.update(Ce);const Me=Ce.type||"none";if(Ce.activeIndex!==void 0)if(Ce.activeIndex===null)Xe.current!==$i&&(Xe.current=$i,Oi(void 0,Ba(Me,void 0,{index:-1})));else{const Ke=rt.current[Ce.activeIndex];Xe.current={value:Ke,index:Ce.activeIndex},Oi(Ke,Ba(Me,void 0,{index:Ce.activeIndex}))}}),Rn=ke((Ce,Me)=>{if(we.current=Me.reason===ei,e.onInputValueChange?.(Ce,Me),!Me.isCanceled){if(Me.reason===Hs){const Ke=Me.event,It=Ke.inputType;if(Ke.type==="compositionend"||It!=null&&It!==""&&It!=="insertReplacementText"){const Dt=Ce.trim()!=="";Dt&&k(!0),Ue.current={hasQuery:Dt},Dt&&Ze&&Ve.state.activeIndex==null&&Ve.set("activeIndex",0)}}Ie(Ce)}}),vo=ke((Ce,Me)=>{if(qe!==Ce&&(Me.reason==="escape-key"&&Bt&&Jt.length===0&&!Ve.state.emptyRef.current&&Me.allowPropagation(),e.onOpenChange?.(Ce,Me),!Me.isCanceled&&(!Ce&&Z&&(mt?(Cn||Y(it),it===""&&k(!1)):ot&&(Cn||Mt?an({activeIndex:null}):Y(it),Rn("",Qe(ei,Me.event)))),Pt(Ce),!Ce&&Mt&&(Me.reason===Rf||Me.reason===O0)&&(X(!0),te(!1),Q==="onBlur")))){const Ke=l==="none"?Ae:ee;se.commit(Ke)}}),Wo=ke((Ce,Me)=>{if(i?.(Ce,Me),Me.isCanceled)return;ye(Ce),(l==="none"&&re.current&&O||mt&&!Ve.state.inputInsidePopup)&&Rn(On(Ce,T),Qe(Me.reason,Me.event)),mt&&Ce!=null&&Me.reason!==Hs&&Z&&!Cn&&Y(it)}),Ra=ke((Ce,Me)=>{let Ke=Me;if(Ke===void 0){if(Go===null)return;Ke=rt.current[Go]}const It=Nn(Ce),st=at.current??Ce;at.current=null;const Dt=Qe(s7,st),Xn=It?.closest("a")?.getAttribute("href");if(Xn){Xn.startsWith("#")&&vo(!1,Dt);return}if(ot){const An=Array.isArray(ee)?ee:[],Uo=dJ(An,Ke,Ve.state.isItemEqualToValue)?fJ(An,Ke,Ve.state.isItemEqualToValue):[...An,Ke];if(Wo(Uo,Dt),!(fe.current?fe.current.value.trim()!=="":!1))return;Ve.state.inputInsidePopup?Rn("",Qe(ei,Dt.event)):vo(!1,Dt)}else Wo(Ke,Dt),vo(!1,Dt)}),Mi=ke(()=>{if(!Ve.state.submitOnItemClick)return;const Ce=Ve.state.inputElement?.form;Ce&&typeof Ce.requestSubmit=="function"&&Ce.requestSubmit()}),Wr=ke(()=>{if(Ia(!1),Ni?.(!1),k(!1),As(),Y(null),an(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ot&&fe.current&&fe.current.value!==""&&!we.current&&Rn("",Qe(ei)),mt)if(Ve.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Rn("",Qe(ei));else{const Ce=On(ee,T);fe.current&&fe.current.value!==Ce&&Rn(Ce,Qe(Ce===""?ei:er))}}),Di=b.useMemo(()=>Cn&&Ho?{current:Ho.closest('[role="dialog"]')}:re,[Cn,Ho]);Of({enabled:!e.actionsRef,open:qe,ref:Di,onComplete(){qe||Wr()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:Wr}),[Wr]),Ge(function(){if(qe||l==="none")return;const Me=v?Wn:et.current;if(ot){const Ke=Array.isArray(ee)?ee:[],It=Ke[Ke.length-1],st=gd(Me,It,$);an({selectedIndex:st===-1?null:st})}else{const Ke=gd(Me,ee,$);an({selectedIndex:Ke===-1?null:Ke})}},[qe,ee,v,l,Wn,ot,$,an]),Ge(()=>{v&&(rt.current=Jt,le.current.length=Jt.length)},[v,Jt]),Ge(()=>{const Ce=Ue.current;if(Ce&&(Ce.hasQuery?Ze&&Ve.set("activeIndex",0):Ze==="always"&&Ve.set("activeIndex",0),Ue.current=null),!qe&&!Cn)return;const Ke=Bt||tt?Jt:rt.current,It=Ve.state.activeIndex;if(It==null){if(Ze==="always"&&Ke.length>0){Ve.set("activeIndex",0);return}Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(er,void 0,{index:-1})));return}if(It>=Ke.length){Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(er,void 0,{index:-1}))),Ve.set("activeIndex",null);return}const st=Ke[It],Dt=Xe.current.value,Xn=Dt!==zD&&ns(st,Dt,Ve.state.isItemEqualToValue);(Xe.current.index!==It||!Xn)&&(Xe.current={value:st,index:It},Ve.state.onItemHighlighted(st,Ba(er,void 0,{index:It})))},[Go,Ze,tt,Bt,Jt,Cn,qe,Ve]),Ge(()=>{if(l==="none"){K(String(Ae)!=="");return}K(ot?Array.isArray(ee)&&ee.length>0:ee!=null)},[K,l,Ae,ee,ot]),b.useEffect(()=>{Bt&&Ze&&Jt.length===0&&an({activeIndex:null})},[Bt,Ze,Jt.length,an]),oc(it,()=>{!qe||it===""||it===String(xe)||k(!0)}),oc(ee,()=>{if(l!=="none"&&(H(ct),ne(ee!==W.initialValue),J()?se.commit(ee):se.commit(ee,!0),mt&&!Nt&&!Mt)){const Ce=On(ee,T);Ae!==Ce&&Rn(Ce,Qe(er))}}),oc(Ae,()=>{l==="none"&&(H(ct),ne(Ae!==W.initialValue),J()?se.commit(Ae):se.commit(Ae,!0))}),oc(v,()=>{if(!mt||Nt||Mt||Z)return;const Ce=On(ee,T);Ae!==Ce&&Rn(Ce,Qe(er))});const Un=kD({open:Cn?!0:qe,onOpenChange:vo,elements:{reference:Mt?bo:Pi,floating:Ho}});let zo,qo;Cn||(zo=m?"grid":"listbox",qo=qe?"true":"false");const Aa=b.useMemo(()=>{const Ce=Pi?.tagName==="INPUT",Me=Ce||qe,Ke=Ce?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Me&&(Ke.role="combobox",Ke["aria-expanded"]=qo,Ke["aria-haspopup"]=zo,Ke["aria-controls"]=qe?Es?.id:void 0,Ke["aria-autocomplete"]=D),{reference:Ke,floating:{role:"presentation"}}},[Pi,qe,qo,zo,Es?.id,D]),Ta=PD(Un,{enabled:!f&&!gt&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Mt?0:50,reason:l7}),Oa=hZ(Un,{enabled:!f&&!gt&&!Cn,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Cn?!0:void 0,outsidePress(Ce){const Me=Nn(Ce);return!ft(bo,Me)&&!ft(Ye.current,Me)&&!ft(Se.current,Me)}}),Na=JZ(Un,{enabled:!f&&!gt,id:ae,listRef:le,activeIndex:Go,selectedIndex:nn,virtual:!0,loopFocus:I,allowEscape:I&&!Ze,focusItemOnOpen:Z||l==="none"&&!Ze?!1:"auto",focusItemOnHover:R,resetOnPointerLeave:!S,cols:m?2:1,orientation:m?"horizontal":void 0,disabledIndices:Yu,onNavigate(Ce,Me){!Me&&!qe||_i==="ending"||an(Me?{activeIndex:Ce,type:ve.current?"keyboard":"pointer"}:{activeIndex:Ce})}}),{getReferenceProps:yo,getFloatingProps:ki,getItemProps:ji}=UZ([Aa,Ta,Oa,Na]);uJ(()=>{Ve.update({inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,getItemProps:ji,setOpen:vo,setInputValue:Rn,setSelectedValue:Wo,setIndices:an,onItemHighlighted:Oi,handleSelection:Ra,forceMount:br,requestSubmit:Mi})}),Ge(()=>{Ve.update({id:ae,selectedValue:ee,open:qe,mounted:Is,transitionStatus:_i,items:v,inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,openMethod:Rs,getItemProps:ji,selectionMode:l,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,onOpenChangeComplete:Ni,openOnInputClick:w,itemToStringLabel:T,modal:B,autoHighlight:Ze,isItemEqualToValue:$,submitOnItemClick:z,hasInputValue:Nt,requestSubmit:Mi})},[Ve,ae,ee,qe,Is,_i,v,ki,yo,ji,Rs,Hr,l,ct,gt,f,p,se,m,lt,A,Ni,w,T,B,$,z,Nt,M,Mi,Ze]);const xo=Ml(g,se.inputRef),Dn=b.useMemo(()=>({query:it,hasItems:Bt,filteredItems:pn,flatFilteredItems:Jt}),[it,Bt,pn,Jt]),vr=b.useMemo(()=>Array.isArray(zn)?"":$a(zn,_),[zn,_]),yr=ot&&Array.isArray(ee)&&ee.length>0,Li=ot||l==="none"?void 0:ct,Yn=b.useMemo(()=>!ot||!Array.isArray(ee)||!ct?null:ee.map(Ce=>{const Me=$a(Ce,_);return h.jsx("input",{type:"hidden",name:ct,value:Me},Me)}),[ot,ee,ct,_]),Pa=h.jsxs(b.Fragment,{children:[e.children,h.jsx("input",{...se.getInputValidationProps({onFocus(){if(Mt){bo?.focus();return}(fe.current||bo)?.focus()},onChange(Ce){if(Ce.nativeEvent.defaultPrevented)return;const Me=Ce.target.value,Ke=Qe(er,Ce.nativeEvent);function It(){if(ot)return;if(l==="none"){ne(Me!==W.initialValue),Rn(Me,Ke),J()&&se.commit(Me);return}const st=rt.current.find(Dt=>$a(Dt,_).toLowerCase()===Me.toLowerCase());st!=null&&(ne(st!==W.initialValue),Wo?.(st,Ke),J()&&se.commit(st))}v?It():(br(),queueMicrotask(It))}}),id:ae&&Li==null?`${ae}-hidden-input`:void 0,name:Li,autoComplete:V,disabled:gt,required:p&&!yr,readOnly:f,value:vr,ref:xo,style:Li?tZ:L0,tabIndex:-1,"aria-hidden":!0}),Yn]});return h.jsx($0.Provider,{value:Ve,children:h.jsx(G0.Provider,{value:Un,children:h.jsx(H0.Provider,{value:Dn,children:h.jsx(W0.Provider,{value:Ae,children:Pa})})})})}const qD={...aJ,...mJ,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function EJ(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const i=parseFloat(n.width)||0,s=parseFloat(n.height)||0,a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,i,a),c=Math.max(t.height,s,l),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}const ic=2,UD=b.forwardRef(function(t,n){const{render:r,className:o,nativeButton:i=!0,disabled:s=!1,id:a,...l}=t,{state:u,disabled:c,setTouched:d,setFocused:f,validationMode:p,validation:g}=bu(),{labelId:m}=U0(),v=Gn(),{filteredItems:y}=Ii(),x=me(v,be.selectionMode),w=me(v,be.disabled),C=me(v,be.readOnly),S=me(v,be.required),R=me(v,be.mounted),I=me(v,be.popupSide),T=me(v,be.positionerElement),_=me(v,be.listElement),$=me(v,be.triggerProps),A=me(v,be.triggerElement),M=me(v,be.inputInsidePopup),O=me(v,be.id),B=me(v,be.open),j=me(v,be.selectedValue),D=me(v,be.activeIndex),V=me(v,be.selectedIndex),G=me(v,be.hasSelectedValue),z=_f(),H=z0(),ne=ts(),W=c||w||s,J=y.length===0,K=R&&T?I:null;HD({id:M?a:void 0});const U=M?a??O:a,oe=b.useRef("");function X(Y){oe.current=Y.pointerType}const te=z.useState("domReferenceElement");b.useEffect(()=>{M&&A&&A!==te&&z.set("domReferenceElement",A)},[A,te,z,M]);const{reference:Q}=KZ(z,{enabled:!B&&!C&&!w&&x==="single",listRef:v.state.labelsRef,activeIndex:D,selectedIndex:V,onMatch(Y){const le=v.state.valuesRef.current[Y];le!==void 0&&v.state.setSelectedValue(le,Qe("none"))}}),{reference:se}=PD(z,{enabled:!C&&!w,event:"mousedown"}),{buttonRef:ae,getButtonProps:L}=Af({native:i,disabled:W}),Z={...u,open:B,disabled:W,popupSide:K,listEmpty:J,placeholder:!G},k=ke(Y=>{v.set("triggerElement",Y)});return Mn("button",t,{ref:[n,ae,k],state:Z,props:[$,se,Q,{id:U,tabIndex:M?0:-1,role:M?"combobox":void 0,"aria-expanded":B?"true":"false","aria-haspopup":M?"dialog":"listbox","aria-controls":B?_?.id:void 0,"aria-required":M&&S||void 0,"aria-labelledby":m,onPointerDown:X,onPointerEnter:X,onFocus(){f(!0),!(W||C)&&ne.start(0,v.state.forceMount)},onBlur(Y){if(!ft(T,Y.relatedTarget)&&(d(!0),f(!1),p==="onBlur")){const le=x==="none"?H:j;g.commit(le)}},onMouseDown(Y){if(W||C||(M||z.set("domReferenceElement",Y.currentTarget),v.state.forceMount(),oe.current!=="touch"&&(v.state.inputRef.current?.focus(),M||Y.preventDefault()),B))return;const le=Ht(Y.currentTarget);function pe(re){if(!A)return;const fe=Nn(re),de=v.state.positionerElement,ve=v.state.listElement;if(ft(A,fe)||ft(de,fe)||ft(ve,fe)||fe===A)return;const we=EJ(A),Se=re.clientX>=we.left-ic&&re.clientX<=we.right+ic,Ye=re.clientY>=we.top-ic&&re.clientY<=we.bottom+ic;Se&&Ye||v.state.setOpen(!1,Qe("cancel-open",re))}M&&le.addEventListener("mouseup",pe,{once:!0})},onKeyDown(Y){W||C||(Y.key==="ArrowDown"||Y.key==="ArrowUp")&&(Tt(Y),v.state.setOpen(!0,Qe(dl,Y.nativeEvent)),v.state.inputRef.current?.focus())}},g?g.getValidationProps(l):l,L],stateAttributesMapping:qD})});process.env.NODE_ENV!=="production"&&(UD.displayName="ComboboxTrigger");const Y0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Y0.displayName="ComboboxChipsContext");function YD(){return b.useContext(Y0)}const X0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(X0.displayName="ComboboxPositionerContext");function Z0(e){const t=b.useContext(X0);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":Fr(21));return t}const J0=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,id:s,...a}=t,{state:l,disabled:u,setTouched:c,setFocused:d,validationMode:f,validation:p}=bu(),{labelId:g}=U0(),m=YD(),y=!!Z0(!0),x=Gn(),{filteredItems:w}=Ii(),C=z0(),S=YM(),R=me(x,be.required),I=me(x,be.disabled),T=me(x,be.readOnly),_=me(x,be.name),$=me(x,be.selectionMode),A=me(x,be.autoHighlight),M=me(x,be.inputProps),O=me(x,be.triggerProps),B=me(x,be.open),j=me(x,be.mounted),D=me(x,be.selectedValue),V=me(x,be.popupSide),G=me(x,be.positionerElement),z=me(x,be.id),H=me(x,be.inline),ne=!!A,W=j&&G?V:null,J=u||I||i,K=w.length===0,oe=tD(s??(y||H?void 0:z)),[X,te]=b.useState(null),Q=b.useRef(!1),se=b.useRef(null),ae=b.useRef(!1),L=ke(Y=>{const le=y||x.state.inline;le&&!x.state.hasInputValue&&x.state.setInputValue("",Qe(er)),x.update({inputElement:Y,inputInsidePopup:le})}),Z={...l,open:B,disabled:J,readOnly:T,popupSide:W,listEmpty:K};function k(Y){if(!m)return;let le;const{highlightedChipIndex:pe}=m;if(pe!==void 0){if(Y.key==="ArrowLeft")Y.preventDefault(),pe>0?le=pe-1:le=void 0;else if(Y.key==="ArrowRight")Y.preventDefault(),pe<D.length-1?le=pe+1:le=void 0;else if(Y.key==="Backspace"||Y.key==="Delete"){Y.preventDefault();const re=pe>=D.length-1?D.length-2:pe;le=re>=0?re:void 0,x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return le}return Y.key==="ArrowLeft"&&(Y.currentTarget.selectionStart??0)===0&&D.length>0?(Y.preventDefault(),le=Math.max(D.length-1,0)):Y.key==="Backspace"&&Y.currentTarget.value===""&&D.length>0&&(x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),Y.preventDefault()),le}return Mn("input",t,{state:Z,ref:[n,x.state.inputRef,L],props:[M,O,{type:"text",value:t.value??X??C,"aria-readonly":T||void 0,"aria-required":R||void 0,"aria-labelledby":g,disabled:J,readOnly:T,required:$==="none"?R:void 0,...$==="none"&&_&&{name:_},id:oe,onFocus(){if(d(!0),!H||!ae.current)return;ae.current=!1;const Y=se.current;Y==null||!Object.hasOwn(x.state.valuesRef.current,Y)||x.state.setIndices({activeIndex:Y})},onBlur(){c(!0),d(!1);const Y=x.state.activeIndex;if(H&&Y!==null&&A!=="always"&&(se.current=Y,ae.current=!0,x.state.setIndices({activeIndex:null})),f==="onBlur"){const le=$==="none"?C:D;p.commit(le)}},onCompositionStart(Y){ld||(Q.current=!0,te(Y.currentTarget.value))},onCompositionEnd(Y){Q.current=!1;const le=Y.currentTarget.value;te(null),x.state.setInputValue(le,Qe(Hs,Y.nativeEvent))},onChange(Y){const le=Y.nativeEvent.inputType,pe=!le||le==="insertReplacementText",re=Q.current||!pe;if(Q.current){const we=Y.currentTarget.value;te(we),we===""&&!x.state.openOnInputClick&&!x.state.inputInsidePopup&&x.state.setOpen(!1,Qe(ei,Y.nativeEvent));const Se=we.trim(),Ye=ne&&Se!=="";!T&&!J&&Se&&re&&(x.state.setOpen(!0,Qe(Hs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!Ye&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"});return}x.state.setInputValue(Y.currentTarget.value,Qe(Hs,Y.nativeEvent));const fe=Y.currentTarget.value==="",de=Qe(ei,Y.nativeEvent);fe&&!x.state.inputInsidePopup&&($==="single"&&x.state.setSelectedValue(null,de),x.state.openOnInputClick||x.state.setOpen(!1,de));const ve=Y.currentTarget.value.trim();!T&&!J&&ve&&re&&(x.state.setOpen(!0,Qe(Hs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!ne&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(Y){if(J||T||Y.ctrlKey||Y.shiftKey||Y.altKey||Y.metaKey)return;x.state.keyboardActiveRef.current=!0;const le=Y.currentTarget,pe=le.scrollWidth-le.clientWidth,re=S==="rtl";if(Y.key==="Home"){Tt(Y);const ve=PE&&re?le.value.length:0;le.setSelectionRange(ve,ve),le.scrollLeft=0;return}if(Y.key==="End"){Tt(Y);const ve=PE&&re?0:le.value.length;le.setSelectionRange(ve,ve),le.scrollLeft=re?-pe:pe;return}if(!j&&Y.key==="Escape"){const ve=$==="multiple"&&Array.isArray(D)?D.length===0:D===null,we=Qe(eD,Y.nativeEvent),Se=$==="multiple"?[]:null;x.state.setInputValue("",we),x.state.setSelectedValue(Se,we),!ve&&!x.state.inline&&!we.isPropagationAllowed&&Y.stopPropagation();return}if(m&&Y.key==="Backspace"&&le.value===""&&m.highlightedChipIndex===void 0&&Array.isArray(D)&&D.length>0){const ve=D.slice(0,-1);x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}),x.state.setSelectedValue(ve,Qe(er,Y.nativeEvent));return}const fe=m?.highlightedChipIndex!==void 0,de=k(Y);if(m?.setHighlightedChipIndex(de),de!==void 0?m?.chipsRef.current[de]?.focus():fe&&x.state.inputRef.current?.focus(),Y.which!==229&&Y.key==="Enter"&&B){const ve=x.state.activeIndex,we=Y.nativeEvent;if(ve===null){x.state.setOpen(!1,Qe(er,we));return}Tt(Y);const Se=x.state.listRef.current[ve];Se&&(x.state.selectionEventRef.current=we,Se.click(),x.state.selectionEventRef.current=null)}},onPointerMove(){x.state.keyboardActiveRef.current=!1},onPointerDown(){x.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(a):a],stateAttributesMapping:qD})});process.env.NODE_ENV!=="production"&&(J0.displayName="ComboboxInput");const IJ={..._0,...sJ},XD=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,keepMounted:a=!1,...l}=t,{disabled:u}=bu(),c=Gn(),d=me(c,be.selectionMode),f=me(c,be.disabled),p=me(c,be.readOnly),g=me(c,be.open),m=me(c,be.selectedValue),v=me(c,be.hasSelectionChips),y=z0();let x=!1;d==="none"?x=y!=="":d==="single"?x=m!=null:x=v;const w=u||f||i,{buttonRef:C,getButtonProps:S}=Af({native:s,disabled:w}),{mounted:R,transitionStatus:I,setMounted:T}=M0(x),_={disabled:w,open:g,transitionStatus:I};Of({open:x,ref:c.state.clearRef,onComplete(){x||T(!1)}});const $=Mn("button",t,{state:_,ref:[n,C,c.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(M){M.preventDefault()},onClick(M){if(w||p)return;const O=c.state.keyboardActiveRef;c.state.setInputValue("",Qe(RE,M.nativeEvent)),d!=="none"?(c.state.setSelectedValue(Array.isArray(m)?[]:null,Qe(RE,M.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:O.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:O.current?"keyboard":"pointer"}),c.state.inputRef.current?.focus()}},l,S],stateAttributesMapping:IJ});return a||R?$:null});process.env.NODE_ENV!=="production"&&(XD.displayName="ComboboxClear");const ZD=b.createContext(null);process.env.NODE_ENV!=="production"&&(ZD.displayName="GroupCollectionContext");function RJ(){return b.useContext(ZD)}function AJ(e){const{children:t}=e,{filteredItems:n}=Ii(),r=RJ(),o=r?r.items:n;return o?h.jsx(b.Fragment,{children:o.map(t)}):null}const JD=b.forwardRef(function(t,n){var r;const{render:o,className:i,children:s,...a}=t,l=Gn(),u=_f(),c=!!Z0(!0),{filteredItems:d}=Ii(),f=me(l,be.items),p=me(l,be.labelsRef),g=me(l,be.listRef),m=me(l,be.selectionMode),v=me(l,be.grid),y=me(l,be.popupProps),x=me(l,be.disabled),w=me(l,be.readOnly),C=me(l,be.virtualized),S=m==="multiple",R=d.length===0,I=ke(O=>{l.set("positionerElement",O)}),T=ke(O=>{l.set("listElement",O)}),_=b.useMemo(()=>typeof s=="function"?r||(r=h.jsx(AJ,{children:s})):s,[s]),$={empty:R},A=u.useState("floatingId"),M=Mn("div",t,{state:$,ref:[n,T,c?null:I],props:[y,{children:_,tabIndex:-1,id:A,role:v?"grid":"listbox","aria-multiselectable":S?"true":void 0,onKeyDown(O){if(!(x||w)&&O.key==="Enter"){const B=l.state.activeIndex;if(B==null)return;Tt(O);const j=O.nativeEvent,D=l.state.listRef.current[B];D&&(l.state.selectionEventRef.current=j,D.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return C?M:h.jsx(qM,{elementsRef:g,labelsRef:f?void 0:p,children:M})});process.env.NODE_ENV!=="production"&&(JD.displayName="ComboboxList");const K0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(K0.displayName="ComboboxPortalContext");function TJ(){const e=b.useContext(K0);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":Fr(20));return e}const KD=b.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,i=Gn(),s=me(i,be.mounted),a=me(i,be.forceMounted);return s||r||a?h.jsx(K0.Provider,{value:r,children:h.jsx(ND,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(KD.displayName="ComboboxPortal");const OJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:d="real"}=ro(e,t)||{};if(u==null)return{};const f=yy(c),p={x:n,y:r},g=$d(o),m=Vd(g),v=await s.getDimensions(u),y=g==="y",x=y?"top":"left",w=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[g]-p[g]-i.floating[m],R=p[g]-i.reference[g],I=d==="real"?await s.getOffsetParent?.(u):a.floating;let T=a.floating[C]||i.floating[m];(!T||!await s.isElement?.(I))&&(T=a.floating[C]||i.floating[m]);const _=S/2-R/2,$=T/2-v[m]/2-1,A=Math.min(f[x],$),M=Math.min(f[w],$),O=A,B=T-v[m]-M,j=T/2-v[m]/2+_,D=Bc(O,j,B),V=!l.arrow&&Fo(o)!=null&&j!==D&&i.reference[m]/2-(j<O?A:M)-v[m]/2<0,G=V?j<O?j-O:j-B:0;return{[g]:p[g]+G,data:{[g]:D,centerOffset:j-D-G,...V&&{alignmentOffset:G}},reset:V}}}),NJ=(e,t)=>({...OJ(e),options:[e,t]}),PJ={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await qT().fn(e)).data?.referenceHidden||i}}}},_J={sideX:"left",sideY:"top"};function QD(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function QE(e,t,n){const{rects:r,placement:o}=e;return{side:QD(t,Ln(o),n),align:Fo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function MJ(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:l=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:x,lazyFlip:w=!1,externalTree:C}=e,[S,R]=b.useState(null);!g&&S!==null&&R(null);const I=m.side||"flip",T=m.align||"flip",_=m.fallbackAxisSide||"end",$=typeof t=="function"?t:void 0,A=ke($),M=$?A:t,O=rr(t),j=YM()==="rtl",D=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":j?"left":"right","inline-start":j?"right":"left"}[r],V=i==="center"?D:`${D}-${i}`;let G=l;const z=1,H=r==="bottom"?z:0,ne=r==="top"?z:0,W=r==="right"?z:0,J=r==="left"?z:0;typeof G=="number"?G={top:G+H,right:G+J,bottom:G+ne,left:G+W}:G&&(G={top:(G.top||0)+H,right:(G.right||0)+J,bottom:(G.bottom||0)+ne,left:(G.left||0)+W});const K={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},U=b.useRef(null),oe=rr(o),X=rr(s),se=[$T(tt=>{const Ze=QE(tt,r,j),ee=typeof oe.current=="function"?oe.current(Ze):oe.current,ye=typeof X.current=="function"?X.current(Ze):X.current;return{mainAxis:ee,crossAxis:ye,alignmentAxis:ye}},[typeof o!="function"?o:0,typeof s!="function"?s:0,j,r])],ae=T==="none"&&I!=="shift",L=!ae&&(u||v||I==="shift"),Z=I==="none"?null:WT({...K,padding:{top:G.top+z,right:G.right+z,bottom:G.bottom+z,left:G.left+z},mainAxis:!v&&I==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),k=ae?null:GT(tt=>{const Ze=Ht(tt.elements.floating).documentElement;return{...K,rootBoundary:v?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:L,limiter:u||v?void 0:HT(ee=>{if(!U.current)return{};const{width:ye,height:ge}=U.current.getBoundingClientRect(),xe=sr(Ln(ee.placement)),Ae=xe==="y"?ye:ge,Ie=xe==="y"?G.left+G.right:G.top+G.bottom;return{offset:Ae/2+Ie/2}})}},[K,u,v,G,T]);I==="shift"||T==="shift"||i==="center"?se.push(k,Z):se.push(Z,k),se.push(zT({...K,apply({elements:{floating:tt},rects:{reference:Ze},availableWidth:ee,availableHeight:ye}){const ge=tt.style;ge.setProperty("--available-width",`${ee}px`),ge.setProperty("--available-height",`${ye}px`),ge.setProperty("--anchor-width",`${Ze.width}px`),ge.setProperty("--anchor-height",`${Ze.height}px`)}}),NJ(()=>({element:U.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(tt){const{elements:Ze,middlewareData:ee,placement:ye,rects:ge,y:xe}=tt,Ae=Ln(ye),Ie=sr(Ae),qe=U.current,Pt=ee.arrow?.x||0,lt=ee.arrow?.y||0,it=qe?.clientWidth||0,_t=qe?.clientHeight||0,Et=Pt+it/2,sn=lt+_t/2,mr=Math.abs(ee.shift?.y||0),Wn=ge.reference.height/2,pn=typeof o=="function"?o(QE(tt,r,j)):o,Jt=mr>pn,Ve={top:`${Et}px calc(100% + ${pn}px)`,bottom:`${Et}px ${-pn}px`,left:`calc(100% + ${pn}px) ${sn}px`,right:`${-pn}px ${sn}px`}[Ae],zn=`${Et}px ${ge.reference.y+Wn-xe}px`;return Ze.floating.style.setProperty("--transform-origin",L&&Ie==="y"&&Jt?zn:Ve),{}}},PJ,x),Ge(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const ie=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:Y,elements:le,x:pe,y:re,middlewareData:fe,update:de,placement:ve,context:we,isPositioned:Se,floatingStyles:Ye}=qZ({rootContext:p,placement:V,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...tt)=>Gc(...tt,ie),nodeId:y,externalTree:C}),{sideX:at,sideY:Xe}=fe.adaptiveOrigin||_J,Ue=Se?n:"fixed",rt=b.useMemo(()=>{const tt=x?{position:Ue,[at]:pe,[Xe]:re}:{position:Ue,...Ye};return Se||(tt.opacity=0),tt},[x,Ue,at,pe,Xe,re,Ye,Se]),et=b.useRef(null);Ge(()=>{if(!g)return;const tt=O.current,Ze=typeof tt=="function"?tt():tt,ye=(eI(Ze)?Ze.current:Ze)||null||null;ye!==et.current&&(Y.setPositionReference(ye),et.current=ye)},[g,Y,M,O]),b.useEffect(()=>{if(!g)return;const tt=O.current;typeof tt!="function"&&eI(tt)&&tt.current!==et.current&&(Y.setPositionReference(tt.current),et.current=tt.current)},[g,Y,M,O]),b.useEffect(()=>{if(f&&g&&le.domReference&&le.floating)return Gc(le.domReference,le.floating,de,ie)},[f,g,le,de,ie]);const gt=Ln(ve),ct=QD(r,gt,j),ot=Fo(ve)||"center",mt=!!fe.hide?.referenceHidden;Ge(()=>{w&&g&&Se&&R(gt)},[w,g,Se,gt]);const Nt=b.useMemo(()=>({position:"absolute",top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Bt=fe.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:rt,arrowStyles:Nt,arrowRef:U,arrowUncentered:Bt,side:ct,align:ot,physicalSide:gt,anchorHidden:mt,refs:Y,context:we,isPositioned:Se,update:de}),[rt,Nt,U,Bt,ct,ot,gt,mt,Y,we,Se,de])}function eI(e){return e!=null&&"current"in e}function ek(e){return e==="starting"?J8:En}const tk=b.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="bottom",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:v=Q8,...y}=t,x=Gn(),{filteredItems:w}=Ii(),C=_f(),S=TJ(),R=me(x,be.modal),I=me(x,be.open),T=me(x,be.mounted),_=me(x,be.openMethod),$=me(x,be.triggerElement),A=me(x,be.inputElement),M=me(x,be.inputInsidePopup),O=me(x,be.transitionStatus),B=w.length===0,D=MJ({anchor:i??(M?$:A),floatingRootContext:C,positionMethod:s,mounted:T,side:a,sideOffset:u,align:l,alignOffset:c,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:m,keepMounted:S,collisionAvoidance:v,lazyFlip:!0});K7(I&&R&&_!=="touch",$);const V=b.useMemo(()=>{const W={...D.positionerStyles};return I||(W.pointerEvents="none"),{role:"presentation",hidden:!T,style:W}},[I,T,D.positionerStyles]),G={open:I,side:D.side,align:D.align,anchorHidden:D.anchorHidden,empty:B};Ge(()=>{x.set("popupSide",D.side)},[x,D.side]);const z=b.useMemo(()=>({side:D.side,align:D.align,arrowRef:D.arrowRef,arrowUncentered:D.arrowUncentered,arrowStyles:D.arrowStyles,anchorHidden:D.anchorHidden,isPositioned:D.isPositioned}),[D.side,D.align,D.arrowRef,D.arrowUncentered,D.arrowStyles,D.anchorHidden,D.isPositioned]),H=ke(W=>{x.set("positionerElement",W)}),ne=Mn("div",t,{state:G,ref:[n,H],props:[V,ek(O),y],stateAttributesMapping:jD});return h.jsxs(X0.Provider,{value:z,children:[T&&R&&h.jsx(LD,{inert:lJ(!I),cutout:A??$}),ne]})});process.env.NODE_ENV!=="production"&&(tk.displayName="ComboboxPositioner");const DJ={...jD,..._0},nk=b.forwardRef(function(t,n){const{render:r,className:o,initialFocus:i,finalFocus:s,...a}=t,l=Gn(),u=Z0(),c=_f(),{filteredItems:d}=Ii(),f=me(l,be.mounted),p=me(l,be.open),g=me(l,be.openMethod),m=me(l,be.transitionStatus),v=me(l,be.inputInsidePopup),y=me(l,be.inputElement),x=d.length===0;Of({open:p,ref:l.state.popupRef,onComplete(){p&&l.state.onOpenChangeComplete(!0)}});const w={open:p,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:m,empty:x},C=Mn("div",t,{state:w,ref:[n,l.state.popupRef],props:[{role:v?"dialog":"presentation",tabIndex:-1,onFocus(T){const _=Nn(T.nativeEvent);g!=="touch"&&(ft(l.state.listElement,_)||_===T.currentTarget)&&l.state.inputRef.current?.focus()}},ek(m),a],stateAttributesMapping:DJ}),R=i===void 0?v?T=>T==="touch"?l.state.popupRef.current:y:!1:i;let I;return s!=null?I=s:I=v?void 0:!1,h.jsx(dZ,{context:c,disabled:!f,modal:!v,openInteractionType:g,initialFocus:R,returnFocus:I,children:C})});process.env.NODE_ENV!=="production"&&(nk.displayName="ComboboxPopup");const Q0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Q0.displayName="ComboboxItemContext");function rk(){const e=b.useContext(Q0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.":Fr(19));return e}const ok=b.createContext(!1);process.env.NODE_ENV!=="production"&&(ok.displayName="ComboboxRowContext");function kJ(){return b.useContext(ok)}const ik=b.memo(b.forwardRef(function(t,n){const{render:r,className:o,value:i=null,index:s,disabled:a=!1,nativeButton:l=!1,...u}=t,c=b.useRef(!1),d=b.useRef(null),f=oD({index:s,textRef:d,indexGuessBehavior:rD.GuessFromOrder}),p=Gn(),g=kJ(),{flatFilteredItems:m,hasItems:v}=Ii(),y=me(p,be.open),x=me(p,be.selectionMode),w=me(p,be.readOnly),C=me(p,be.virtualized),S=me(p,be.isItemEqualToValue),R=x!=="none",I=s??(C?gd(m,i,S):f.index),T=f.index!==-1,_=me(p,be.id),$=me(p,be.isActive,I),A=me(p,be.isSelected,i),M=me(p,be.getItemProps),O=b.useRef(null),B=_!=null&&T?`${_}-${I}`:void 0,j=A&&R;Ge(()=>{if(!(T&&(C||s!=null)))return;const U=p.state.listRef.current;return U[I]=O.current,()=>{delete U[I]}},[T,C,I,s,p]),Ge(()=>{if(!T||v)return;const K=p.state.valuesRef.current;return K[I]=i,x!=="none"&&p.state.allValuesRef.current.push(i),()=>{delete K[I]}},[T,v,I,i,p,x]),Ge(()=>{if(!y){c.current=!1;return}if(!T||v)return;const K=p.state.selectedValue,U=Array.isArray(K)?K[K.length-1]:K;ns(i,U,S)&&p.set("selectedIndex",I)},[T,v,y,p,I,i,S]);const D={disabled:a,selected:j,highlighted:$},V=M({active:$,selected:j});V.id=void 0,V.onFocus=void 0;const{getButtonProps:G,buttonRef:z}=Af({disabled:a,focusableWhenDisabled:!0,native:l});function H(K){function U(){p.state.handleSelection(K,i)}p.state.submitOnItemClick?(so.flushSync(U),p.state.requestSubmit()):U()}const ne={id:B,role:g?"gridcell":"option","aria-selected":R?j:void 0,tabIndex:void 0,onPointerDownCapture(K){c.current=!0,K.preventDefault()},onClick(K){a||w||H(K.nativeEvent)},onMouseUp(K){const U=c.current;c.current=!1,!(a||w||K.button!==0||U||!$)&&H(K.nativeEvent)}},W=Mn("div",t,{ref:[z,n,f.ref,O],state:D,props:[V,ne,u,G]}),J=b.useMemo(()=>({selected:j,textRef:d}),[j,d]);return h.jsx(Q0.Provider,{value:J,children:W})}));process.env.NODE_ENV!=="production"&&(ik.displayName="ComboboxItem");const sk=b.forwardRef(function(t,n){const{render:r,className:o,children:i,...s}=t,{filteredItems:a}=Ii(),l=Gn(),u=a.length===0?i:null;return Mn("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});process.env.NODE_ENV!=="production"&&(sk.displayName="ComboboxEmpty");const ak=b.forwardRef(function(t,n){const{className:r,render:o,orientation:i="horizontal",...s}=t;return Mn("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},s]})});process.env.NODE_ENV!=="production"&&(ak.displayName="Separator");function jJ(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,autoComplete:i,...s}=e;return h.jsx(SJ,{...s,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o,formAutoComplete:i})}function LJ(e){const{children:t,placeholder:n}=e,r=Gn(),o=me(r,be.itemToStringLabel),i=me(r,be.selectedValue),s=me(r,be.items),a=me(r,be.selectionMode)==="multiple",l=me(r,be.hasSelectedValue),u=!l&&n!=null&&t==null,c=me(r,be.hasNullItemLabel,u);let d=null;return typeof t=="function"?d=t(i):t!=null?d=t:!l&&n!=null&&!c?d=n:a&&Array.isArray(i)?d=hJ(i,s,o):d=FD(i,s,o),h.jsx(b.Fragment,{children:d})}const lk=b.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=rk();return r||o?h.jsx(uk,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(lk.displayName="ComboboxItemIndicator");const uk=b.memo(b.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...i}=e,{selected:s}=rk(),a=b.useRef(null),{transitionStatus:l,setMounted:u}=M0(s),d=Mn("span",e,{ref:[t,a],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:_0});return Of({open:s,ref:a,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!=="production"&&(uk.displayName="Inner");const ck=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Gn(),a=me(s,be.open),l=me(s,be.hasSelectionChips),[u,c]=b.useState(void 0);a&&u!==void 0&&c(void 0);const d=b.useRef([]),f=Mn("div",t,{ref:[n,s.state.chipsContainerRef],props:[l?{role:"toolbar"}:En,i]}),p=b.useMemo(()=>({highlightedChipIndex:u,setHighlightedChipIndex:c,chipsRef:d}),[u,c,d]);return h.jsx(Y0.Provider,{value:p,children:h.jsx(qM,{elementsRef:d,children:f})})});process.env.NODE_ENV!=="production"&&(ck.displayName="ComboboxChips");const ex=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(ex.displayName="ComboboxChipContext");function FJ(){const e=b.useContext(ex);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":Fr(17));return e}const dk=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Gn(),{setHighlightedChipIndex:a,chipsRef:l}=YD(),u=me(s,be.disabled),c=me(s,be.readOnly),d=me(s,be.selectedValue),{ref:f,index:p}=oD();function g(x){let w=p;if(x.key==="ArrowLeft")x.preventDefault(),p>0?w=p-1:w=void 0;else if(x.key==="ArrowRight")x.preventDefault(),p<d.length-1?w=p+1:w=void 0;else if(x.key==="Backspace"||x.key==="Delete"){const C=p>=d.length-1?d.length-2:p;w=C>=0?C:void 0,Tt(x),s.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),s.state.setSelectedValue(d.filter((S,R)=>R!==p),Qe(er,x.nativeEvent))}else x.key==="Enter"||x.key===" "?(Tt(x),w=void 0):x.key==="ArrowDown"||x.key==="ArrowUp"?(Tt(x),s.state.setOpen(!0,Qe(dl,x.nativeEvent)),w=void 0):x.key.length===1&&!x.ctrlKey&&!x.metaKey&&!x.altKey&&(w=void 0);return w}const v=Mn("div",t,{ref:[n,f],state:{disabled:u},props:[{tabIndex:-1,"aria-disabled":u||void 0,"aria-readonly":c||void 0,onKeyDown(x){if(u||c)return;const w=g(x);so.flushSync(()=>{a(w)}),w===void 0?s.state.inputRef.current?.focus():l.current[w]?.focus()},onMouseDown(x){c||(x.preventDefault(),!u&&s.state.inputRef.current?.focus())}},i]}),y=b.useMemo(()=>({index:p}),[p]);return h.jsx(ex.Provider,{value:y,children:v})});process.env.NODE_ENV!=="production"&&(dk.displayName="ComboboxChip");const fk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,...a}=t,l=Gn(),{index:u}=FJ(),c=me(l,be.disabled),d=me(l,be.readOnly),f=me(l,be.selectedValue),p=me(l,be.isItemEqualToValue),g=c||i,{buttonRef:m,getButtonProps:v}=Af({native:s,disabled:g||d,focusableWhenDisabled:!0}),y={disabled:g};function x(S){const R=l.state.activeIndex;if(R==null)return;const I=gd(l.state.valuesRef.current,S,p);I!==-1&&R===I&&l.state.setIndices({activeIndex:null,type:l.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(S){const R=Qe(a7,S.nativeEvent),I=f[u];return x(I),l.state.setSelectedValue(f.filter((T,_)=>_!==u),R),l.state.inputRef.current?.focus(),R}return Mn("button",t,{ref:[n,m],state:y,props:[{tabIndex:-1,onClick(S){if(g||d)return;w(S).isPropagationAllowed||S.stopPropagation()},onKeyDown(S){g||d||(S.key==="Enter"||S.key===" ")&&(w(S).isPropagationAllowed||Tt(S))}},a,v]})});process.env.NODE_ENV!=="production"&&(fk.displayName="ComboboxChipRemove");function vu({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:F("ui:file:text-foreground ui:placeholder:text-muted-foreground ui:selection:bg-primary ui:selection:text-primary-foreground ui:dark:bg-input/30 ui:border-input ui:h-10 ui:w-full ui:min-w-0 ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-1 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:file:inline-flex ui:file:h-7 ui:file:border-0 ui:file:bg-transparent ui:file:text-sm ui:file:font-medium ui:disabled:pointer-events-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm","ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:focus-visible:ring-[3px]","ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive",e),...n})}function pk({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:F("ui:border-input ui:placeholder:text-muted-foreground ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:dark:bg-input/30 ui:flex ui:field-sizing-content ui:min-h-16 ui:w-full ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-2 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm",e),...t})}function BJ({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:F("ui:group/input-group ui:border-input ui:dark:bg-input/30 ui:relative ui:flex ui:w-full ui:items-center ui:rounded-md ui:border ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none","ui:h-9 ui:min-w-0 ui:has-[>textarea]:h-auto","ui:has-[>[data-align=inline-start]]:[&>input]:pl-2","ui:has-[>[data-align=inline-end]]:[&>input]:pr-2","ui:has-[>[data-align=block-start]]:h-auto ui:has-[>[data-align=block-start]]:flex-col ui:has-[>[data-align=block-start]]:[&>input]:pb-3","ui:has-[>[data-align=block-end]]:h-auto ui:has-[>[data-align=block-end]]:flex-col ui:has-[>[data-align=block-end]]:[&>input]:pt-3","ui:has-[[data-slot=input-group-control]:focus-visible]:border-ring ui:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 ui:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","ui:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 ui:has-[[data-slot][aria-invalid=true]]:border-destructive ui:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const VJ=Si("ui:text-muted-foreground ui:flex ui:h-auto ui:cursor-text ui:items-center ui:justify-center ui:gap-2 ui:py-1.5 ui:text-sm ui:font-medium ui:select-none ui:[&>svg:not([class*=size-])]:size-4 ui:[&>kbd]:rounded-[calc(var(--radius)-5px)] ui:group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"ui:order-first ui:pl-3 ui:has-[>button]:ml-[-0.45rem] ui:has-[>kbd]:ml-[-0.35rem]","inline-end":"ui:order-last ui:pr-3 ui:has-[>button]:mr-[-0.45rem] ui:has-[>kbd]:mr-[-0.35rem]","block-start":"ui:order-first ui:w-full ui:justify-start ui:px-3 ui:pt-3 ui:[.border-b]:pb-3 ui:group-has-[>input]/input-group:pt-2.5","block-end":"ui:order-last ui:w-full ui:justify-start ui:px-3 ui:pb-3 ui:[.border-t]:pt-3 ui:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function $J({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:F(VJ({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const GJ=Si("ui:text-sm ui:shadow-none ui:flex ui:gap-2 ui:items-center",{variants:{size:{xs:"ui:h-6 ui:gap-1 ui:px-2 ui:rounded-[calc(var(--radius)-5px)] ui:[&>svg:not([class*=size-])]:size-3.5 ui:has-[>svg]:px-2",sm:"ui:h-8 ui:px-2.5 ui:gap-1.5 ui:rounded-md ui:has-[>svg]:px-2.5","icon-xs":"ui:size-6 ui:rounded-[calc(var(--radius)-5px)] ui:p-0 ui:has-[>svg]:p-0","icon-sm":"ui:size-8 ui:p-0 ui:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function hk({className:e,type:t="button",variant:n="ghost",size:r="xs",...o}){return h.jsx(on,{type:t,"data-size":r,variant:n,className:F(GJ({size:r}),e),...o})}function HJ({className:e,...t}){return h.jsx(vu,{"data-slot":"input-group-control",className:F("ui:flex-1 ui:rounded-none ui:border-0 ui:bg-transparent ui:shadow-none ui:focus-visible:ring-0 ui:dark:bg-transparent",e),...t})}const WJ=jJ;function km({...e}){return h.jsx(LJ,{"data-slot":"combobox-value",...e})}function gk({className:e,children:t,...n}){return h.jsxs(UD,{"data-slot":"combobox-trigger",className:F("ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(_e.ChevronDownIcon,{"data-slot":"combobox-trigger-icon",className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4"})]})}function zJ({className:e,...t}){return h.jsx(XD,{"data-slot":"combobox-clear",render:h.jsx(hk,{variant:"ghost",size:"icon-xs",className:"ui:rounded-md"}),className:F(e),...t,children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})}function tI({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:o=!1,...i}){return h.jsxs(BJ,{className:F("ui:w-auto",e),children:[h.jsx(J0,{render:h.jsx(HJ,{disabled:n}),...i}),h.jsxs($J,{align:"inline-end",children:[r&&h.jsx(hk,{size:"icon-xs",variant:"ghost",asChild:!0,"data-slot":"input-group-button",className:"ui:group-has-data-[slot=combobox-clear]/input-group:hidden ui:data-pressed:bg-transparent",disabled:n,children:h.jsx(gk,{className:"ui:rounded-md"})}),o&&h.jsx(zJ,{disabled:n})]}),t]})}function qJ({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:o=0,anchor:i,...s}){return h.jsx(KD,{children:h.jsx(tk,{side:t,sideOffset:n,align:r,alignOffset:o,anchor:i,className:"ui:isolate ui:z-50",children:h.jsx(nk,{"data-slot":"combobox-content","data-chips":!!i,className:F("ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:max-h-96 ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",e),...s})})})}function UJ({className:e,...t}){return h.jsx(JD,{"data-slot":"combobox-list",className:F("ui:max-h-[min(calc(--spacing(96)---spacing(9)),calc(var(--available-height)---spacing(9)))] ui:scroll-py-1 ui:overflow-y-auto ui:p-1 ui:data-empty:p-0",e),...t})}function YJ({className:e,children:t,...n}){return h.jsxs(ik,{"data-slot":"combobox-item",className:F("ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(lk,{"data-slot":"combobox-item-indicator",render:h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center"}),children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4 ui:pointer-coarse:size-5"})})]})}function XJ({className:e,...t}){return h.jsx(sk,{"data-slot":"combobox-empty",className:F("ui:text-muted-foreground ui:hidden ui:w-full ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:group-data-empty/combobox-content:flex",e),...t})}function ZJ({className:e,...t}){return h.jsx(ak,{"data-slot":"combobox-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function JJ({className:e,...t}){return h.jsx(ck,{"data-slot":"combobox-chips",className:F("ui:dark:bg-input/30 ui:border-input ui:focus-within:border-ring ui:focus-within:ring-ring/50 ui:has-aria-invalid:ring-destructive/20 ui:dark:has-aria-invalid:ring-destructive/40 ui:has-aria-invalid:border-destructive ui:dark:has-aria-invalid:border-destructive/50 ui:flex ui:min-h-9 ui:flex-wrap ui:items-center ui:gap-1.5 ui:rounded-md ui:border ui:bg-transparent ui:bg-clip-padding ui:px-2.5 ui:py-1.5 ui:text-sm ui:shadow-xs ui:transition-[color,box-shadow] ui:focus-within:ring-[3px] ui:has-aria-invalid:ring-[3px] ui:has-data-[slot=combobox-chip]:px-1.5",e),...t})}function KJ({className:e,children:t,showRemove:n=!0,...r}){return h.jsxs(dk,{"data-slot":"combobox-chip",className:F("ui:bg-muted ui:text-foreground ui:flex ui:h-[calc(--spacing(5.5))] ui:w-fit ui:items-center ui:justify-center ui:gap-1 ui:rounded-sm ui:px-1.5 ui:text-xs ui:font-medium ui:whitespace-nowrap ui:has-disabled:pointer-events-none ui:has-disabled:cursor-not-allowed ui:has-disabled:opacity-50 ui:has-data-[slot=combobox-chip-remove]:pr-0",e),...r,children:[t,n&&h.jsx(fk,{render:h.jsx(on,{variant:"ghost",size:"xs",className:"ui:hover:bg-transparent"}),className:"ui:-ml-1 ui:opacity-50 ui:hover:opacity-100","data-slot":"combobox-chip-remove",children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})]})}function QJ({className:e,...t}){return h.jsx(J0,{"data-slot":"combobox-chip-input",className:F("ui:min-w-16 ui:flex-1 ui:outline-none",e),...t})}function eK(){return b.useRef(null)}const tK=e=>e.label,nK=(e,t)=>e.value===t.value,tx=({items:e,label:t,multiple:n=!1,hasClearButton:r=!1,disabled:o=!1,placeholder:i="Select...",containerClassName:s,emptyMessage:a="No results found.",hasAllOption:l=!1,allOptionLabel:u="All",inputMode:c="input",renderPopupTrigger:d,onInputChange:f,value:p,onValueChange:g})=>{const m=eK(),v=p??[],y=N.useMemo(()=>e.filter(R=>!R.disabled),[e]),x=n&&v.length===y.length&&y.length>0,w=N.useCallback(()=>{const I=v.length===y.length&&y.length>0?[]:y;g(I)},[y,v.length,g]),C=N.useCallback(R=>{Array.isArray(R)?g(R):g(R===null?[]:[R])},[g]),S=N.useCallback(R=>{f?.(R.target.value)},[f]);return h.jsxs("article",{className:s,children:[t&&h.jsx(gr,{className:"ui:mb-2",children:t}),h.jsxs(WJ,{multiple:n,autoHighlight:!0,items:e,itemToStringValue:tK,isItemEqualToValue:nK,disabled:o,value:n?v:v[0]??null,onValueChange:C,children:[h.jsxs(_r,{children:[h.jsx(rn,{condition:c==="popup",children:h.jsx(gk,{render:d?d(h.jsx(km,{placeholder:i}),v):h.jsx(on,{variant:"outline",className:"ui:w-full ui:font-normal ui:text-left ui:overflow-hidden ui:truncate ui:line-clamp-1",children:h.jsx(km,{placeholder:i})})})}),h.jsx(rn,{condition:n&&c==="input",children:h.jsx(JJ,{ref:m,className:"ui:w-full",children:h.jsx(km,{children:R=>h.jsxs(N.Fragment,{children:[R.map(I=>h.jsx(KJ,{children:I.label},I.value)),h.jsx(QJ,{placeholder:R.length?"":i,onChange:S})]})})})}),h.jsx(rn,{condition:!n&&c==="input",children:h.jsx(tI,{className:"ui:w-full",placeholder:i,showClear:r,disabled:o,onChange:S})})]}),h.jsxs(qJ,{className:"ui:min-w-64",anchor:m&&n&&c==="input"?m:void 0,children:[c==="popup"&&h.jsx(tI,{showTrigger:!1,placeholder:"Search...",onChange:S}),h.jsx(XJ,{children:a}),l&&n&&h.jsxs("div",{className:"ui:group-data-empty/combobox-content:hidden",children:[h.jsx("div",{className:F("ui:p-1 ui:pb-0",c==="popup"?"ui:mt-1":""),children:h.jsxs("div",{role:"option","aria-selected":x,onClick:w,className:F("ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none","ui:hover:bg-accent ui:hover:text-accent-foreground"),children:[u,x&&h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center",children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4"})})]})}),h.jsx(ZJ,{})]}),h.jsx(UJ,{children:R=>h.jsx(YJ,{value:R,disabled:!!R?.disabled,children:R.label},R.value)})]})]})]})},rK="dd/MM/yyyy",oK=({date:e,format:t=rK})=>e?h.jsx(h.Fragment,{children:Ws(e,t)}):null;function nx({...e}){return h.jsx(Z3,{"data-slot":"popover",...e})}const Mf=b.forwardRef(({...e},t)=>h.jsx(mN,{"data-slot":"popover-trigger",ref:t,...e}));Mf.displayName=mN.displayName;const Df=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>h.jsx(J3,{children:h.jsx(bN,{ref:o,"data-slot":"popover-content",align:t,sideOffset:n,className:F("ui-lib-root ui:z-[102] ui:w-72 ui:rounded-md ui:border ui:bg-popover ui:p-4 ui:text-popover-foreground ui:shadow-md ui:outline-none ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",e),...r})}));Df.displayName=bN.displayName;const mk=b.forwardRef(({...e},t)=>h.jsx(gN,{"data-slot":"popover-anchor",ref:t,...e}));mk.displayName=gN.displayName;const bk=({start:e,end:t,onConfirm:n,className:r,triggerButtonClassName:o,label:i,placeholder:s,confirmLabel:a="Confirm",disabledCondition:l,dateLocale:u})=>{const[c,d]=N.useState(!1),[f,p]=N.useState(e&&t?{from:e,to:t}:void 0),g=()=>{!f?.from||!f?.to||(n({from:f.from,to:f.to}),d(!1))};return h.jsxs("div",{className:F("ui:grid ui:gap-2",r),children:[i&&h.jsx(gr,{children:i}),h.jsxs(nx,{open:c,onOpenChange:d,children:[h.jsx(Mf,{asChild:!0,children:h.jsxs(on,{id:"date",variant:"outline",className:F("ui:h-auto ui:text-muted-foreground ui:justify-start ui:text-left ui:font-normal",!f&&"ui:text-muted-foreground",o),children:[h.jsx(_e.Calendar,{className:"ui:h-4 ui:w-4"}),f?.from?f.to?h.jsxs(h.Fragment,{children:[Ws(f.from,"LLL dd, y",{locale:u})," -",Ws(f.to,"LLL dd, y",{locale:u})]}):Ws(f.from,"LLL dd, y",{locale:u}):h.jsx("span",{children:s})]})}),h.jsxs(Df,{className:"ui:w-auto ui:p-0",align:"start",children:[h.jsx(e0,{mode:"range",defaultMonth:f?.from??new Date,selected:f,onSelect:p,numberOfMonths:2,disabled:l,locale:u}),h.jsx("div",{className:F("ui:px-3 ui:pb-4 ui:pt-2","ui:flex ui:justify-start ui:md:justify-end"),children:h.jsx(on,{variant:"success",onClick:g,className:"ui:w-full ui:md:w-max",children:a})})]})]})]})};function vk({value:e,onChange:t,className:n,inputClassName:r,name:o,placeholder:i,label:s}){const[a,l]=N.useState(e),u=N.useRef(null),c=N.useRef(t);N.useEffect(()=>{c.current=t},[t]);const d=N.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.length>=3?c.current(p):c.current("")},300)},[]),f=p=>{const g=decodeURIComponent(p);l(g),d(g)};return h.jsxs("search",{className:F("ui:w-full",n),children:[s&&h.jsx(gr,{htmlFor:o,className:"ui:leading-6 ui:w-full",children:s}),h.jsx(vu,{type:"search",name:o,id:o,"data-test-id":o,placeholder:i,value:a,onChange:({target:p})=>f(p.value),className:F("ui:max-h-10",r),autoFocus:!0})]})}const iK=({banner:e,campaignName:t,isControlled:n,open:r,setOpen:o,imageClassName:i})=>h.jsxs(S0,{...n&&{open:r,onOpenChange:o},children:[!n&&h.jsx(FM,{asChild:!0,children:h.jsx("div",{className:"ui:cursor-pointer",children:h.jsx("img",{className:F("ui:w-full ui:max-w-80 ui:mx-auto ui:mt-4! ui:scale-100 ui:hover:scale-110 ui:transition-all ui:duration-300 ui:aspect-video",i),src:e,alt:t})})}),h.jsxs(E0,{className:"ui:max-w-2xl",children:[h.jsx(I0,{children:h.jsx(R0,{children:t})}),h.jsx("img",{className:F("ui:w-full ui:aspect-video",i),src:e,alt:t})]})]});function sK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const yk=N.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),yu=()=>{const e=N.useContext(yk);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};sK(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
86
|
+
)`}return h.jsx("div",{ref:n,role:"presentation","data-base-ui-inert":"",...o,style:{position:"fixed",inset:0,userSelect:"none",WebkitUserSelect:"none",clipPath:i}})});process.env.NODE_ENV!=="production"&&(LD.displayName="InternalBackdrop");function uJ(e){const t=b.useRef(!0);t.current&&(t.current=!1,e())}const $0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&($0.displayName="ComboboxRootContext");const G0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(G0.displayName="ComboboxFloatingContext");const H0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(H0.displayName="ComboboxDerivedItemsContext");const W0=b.createContext("");process.env.NODE_ENV!=="production"&&(W0.displayName="ComboboxInputValueContext");function Gn(){const e=b.useContext($0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxRootContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(22));return e}function _f(){const e=b.useContext(G0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxFloatingContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(23));return e}function Ii(){const e=b.useContext(H0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemsContext is missing. Combobox parts must be placed within <Combobox.Root>.":Fr(24));return e}function z0(){return b.useContext(W0)}const cJ=(e,t)=>Object.is(e,t);function ns(e,t,n){return e==null||t==null?Object.is(e,t):n(e,t)}function dJ(e,t,n){return!e||e.length===0?!1:e.some(r=>r===void 0?!1:ns(t,r,n))}function gd(e,t,n){return!e||e.length===0?-1:e.findIndex(r=>r===void 0?!1:ns(r,t,n))}function fJ(e,t,n){return e.filter(r=>!ns(t,r,n))}function mv(e){if(e==null)return"";if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return String(e)}}function q0(e){return e!=null&&e.length>0&&typeof e[0]=="object"&&e[0]!=null&&"items"in e[0]}function pJ(e){if(!Array.isArray(e))return e!=null&&!("null"in e);if(q0(e)){for(const t of e)for(const n of t.items)if(n&&n.value==null&&n.label!=null)return!0;return!1}for(const t of e)if(t&&t.value==null&&t.label!=null)return!0;return!1}function On(e,t){if(t&&e!=null)return t(e)??"";if(e&&typeof e=="object"){if("label"in e&&e.label!=null)return String(e.label);if("value"in e)return String(e.value)}return mv(e)}function $a(e,t){return t&&e!=null?t(e)??"":e&&typeof e=="object"&&"value"in e&&"label"in e?mv(e.value):mv(e)}function FD(e,t,n){function r(){return On(e,n)}if(n&&e!=null)return n(e);if(e&&typeof e=="object"&&"label"in e&&e.label!=null)return e.label;if(t&&!Array.isArray(t))return t[e]??r();if(Array.isArray(t)){const o=q0(t)?t.flatMap(i=>i.items):t;if(e==null||typeof e!="object"){const i=o.find(s=>s.value===e);return i&&i.label!=null?i.label:r()}if("value"in e){const i=o.find(s=>s&&s.value===e.value);if(i&&i.label!=null)return i.label}}return r()}function hJ(e,t,n){return e.reduce((r,o,i)=>(i>0&&r.push(", "),r.push(h.jsx(b.Fragment,{children:FD(o,t,n)},i)),r),[])}const be={id:De(e=>e.id),query:De(e=>e.query),items:De(e=>e.items),selectedValue:De(e=>e.selectedValue),hasSelectionChips:De(e=>{const t=e.selectedValue;return Array.isArray(t)&&t.length>0}),hasSelectedValue:De(e=>{const{selectedValue:t,selectionMode:n}=e;return t==null?!1:n==="multiple"&&Array.isArray(t)?t.length>0:!0}),hasNullItemLabel:De((e,t)=>t?pJ(e.items):!1),open:De(e=>e.open),mounted:De(e=>e.mounted),forceMounted:De(e=>e.forceMounted),inline:De(e=>e.inline),activeIndex:De(e=>e.activeIndex),selectedIndex:De(e=>e.selectedIndex),isActive:De((e,t)=>e.activeIndex===t),isSelected:De((e,t)=>{const n=e.isItemEqualToValue,r=e.selectedValue;return Array.isArray(r)?r.some(o=>ns(t,o,n)):ns(t,r,n)}),transitionStatus:De(e=>e.transitionStatus),popupProps:De(e=>e.popupProps),inputProps:De(e=>e.inputProps),triggerProps:De(e=>e.triggerProps),getItemProps:De(e=>e.getItemProps),positionerElement:De(e=>e.positionerElement),listElement:De(e=>e.listElement),triggerElement:De(e=>e.triggerElement),inputElement:De(e=>e.inputElement),popupSide:De(e=>e.popupSide),openMethod:De(e=>e.openMethod),inputInsidePopup:De(e=>e.inputInsidePopup),selectionMode:De(e=>e.selectionMode),listRef:De(e=>e.listRef),labelsRef:De(e=>e.labelsRef),popupRef:De(e=>e.popupRef),emptyRef:De(e=>e.emptyRef),inputRef:De(e=>e.inputRef),keyboardActiveRef:De(e=>e.keyboardActiveRef),chipsContainerRef:De(e=>e.chipsContainerRef),clearRef:De(e=>e.clearRef),valuesRef:De(e=>e.valuesRef),allValuesRef:De(e=>e.allValuesRef),name:De(e=>e.name),disabled:De(e=>e.disabled),readOnly:De(e=>e.readOnly),required:De(e=>e.required),grid:De(e=>e.grid),isGrouped:De(e=>e.isGrouped),virtualized:De(e=>e.virtualized),onOpenChangeComplete:De(e=>e.onOpenChangeComplete),openOnInputClick:De(e=>e.openOnInputClick),itemToStringLabel:De(e=>e.itemToStringLabel),isItemEqualToValue:De(e=>e.isItemEqualToValue),modal:De(e=>e.modal),autoHighlight:De(e=>e.autoHighlight),submitOnItemClick:De(e=>e.submitOnItemClick)};let JE=(function(e){return e.disabled="data-disabled",e.valid="data-valid",e.invalid="data-invalid",e.touched="data-touched",e.dirty="data-dirty",e.filled="data-filled",e.focused="data-focused",e})({});const gJ={badInput:!1,customError:!1,patternMismatch:!1,rangeOverflow:!1,rangeUnderflow:!1,stepMismatch:!1,tooLong:!1,tooShort:!1,typeMismatch:!1,valid:null,valueMissing:!1},mJ={valid(e){return e===null?null:e?{[JE.valid]:""}:{[JE.invalid]:""}}},BD=b.createContext({invalid:void 0,name:void 0,validityData:{state:gJ,errors:[],error:"",value:"",initialValue:null},setValidityData:Lt,disabled:void 0,touched:!1,setTouched:Lt,dirty:!1,setDirty:Lt,filled:!1,setFilled:Lt,focused:!1,setFocused:Lt,validate:()=>null,validationMode:"onSubmit",validationDebounceTime:0,shouldValidateOnChange:()=>!1,state:{disabled:!1,valid:null,touched:!1,dirty:!1,filled:!1,focused:!1},markedDirtyRef:{current:!1},validation:{getValidationProps:(e=En)=>e,getInputValidationProps:(e=En)=>e,inputRef:{current:null},commit:async()=>{}}});process.env.NODE_ENV!=="production"&&(BD.displayName="FieldRootContext");function bu(e=!0){const t=b.useContext(BD);if(t.setValidityData===Lt&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: FieldRootContext is missing. Field parts must be placed within <Field.Root>.":Fr(28));return t}function bJ(e,t){return{...e,state:{...e.state,valid:!t&&e.state.valid}}}const VD=b.createContext({formRef:{current:{fields:new Map}},errors:{},clearErrors:Lt,validationMode:"onSubmit",submitAttemptedRef:{current:!1}});process.env.NODE_ENV!=="production"&&(VD.displayName="FormContext");function $D(){return b.useContext(VD)}function vJ(e){const{enabled:t=!0,value:n,id:r,name:o,controlRef:i,commit:s}=e,{formRef:a}=$D(),{invalid:l,markedDirtyRef:u,validityData:c,setValidityData:d}=bu(),f=ke(e.getValue);Ge(()=>{if(!t)return;let p=n;p===void 0&&(p=f()),c.initialValue===null&&p!==null&&d(g=>({...g,initialValue:p}))},[t,d,n,c.initialValue,f]),Ge(()=>{!t||!r||a.current.fields.set(r,{getValue:f,name:o,controlRef:i,validityData:bJ(c,l),validate(p=!0){let g=n;g===void 0&&(g=f()),u.current=!0,p?so.flushSync(()=>s(g)):s(g)}})},[s,i,t,a,f,r,l,u,o,c,n]),Ge(()=>{const p=a.current.fields;return()=>{r&&p.delete(r)}},[a,r])}const GD=b.createContext({controlId:void 0,registerControlId:Lt,labelId:void 0,setLabelId:Lt,messageIds:[],setMessageIds:Lt,getDescriptionProps:e=>e});process.env.NODE_ENV!=="production"&&(GD.displayName="LabelableContext");function U0(){return b.useContext(GD)}function HD(e={}){const{id:t,implicit:n=!1,controlRef:r}=e,{controlId:o,registerControlId:i}=U0(),s=tD(t),a=n?o:void 0,l=cr(()=>Symbol("labelable-control")),u=b.useRef(!1),c=b.useRef(t!=null),d=ke(()=>{!u.current||i===Lt||(u.current=!1,i(l.current,void 0))});return Ge(()=>{if(i===Lt)return;let f;if(n){const p=r?.current;Ot(p)&&p.closest("label")!=null?f=t??null:f=a??s}else if(t!=null)c.current=!0,f=t;else if(c.current)f=s;else{d();return}if(f===void 0){d();return}u.current=!0,i(l.current,f)},[t,r,a,i,n,s,l,d]),b.useEffect(()=>d,[d]),o??s}function yJ(e,t){return(n,r)=>{if(n==null)return!1;const o=On(n,t);return e.contains(o,r)}}function xJ(e,t,n){return(r,o)=>{if(r==null)return!1;if(!o)return!0;const i=On(r,t),s=n!=null?On(n,t):"";return s&&e.contains(s,o)&&s.length===o.length?!0:e.contains(i,o)}}const KE=new Map;function WD(e){return Array.isArray(e)?e.map(t=>WD(t)).join(","):e==null?"":String(e)}function wJ(e={}){const t={usage:"search",sensitivity:"base",ignorePunctuation:!0,...e},n=`${WD(e.locale)}|${JSON.stringify(t)}`,r=KE.get(n);if(r)return r;const o=new Intl.Collator(e.locale,t),i={contains(s,a,l){if(!a)return!0;const u=On(s,l);for(let c=0;c<=u.length-a.length;c+=1)if(o.compare(u.slice(c,c+a.length),a)===0)return!0;return!1},startsWith(s,a,l){if(!a)return!0;const u=On(s,l);return o.compare(u.slice(0,a.length),a)===0},endsWith(s,a,l){if(!a)return!0;const u=On(s,l),c=a.length;return u.length>=c&&o.compare(u.slice(u.length-c),a)===0}};return KE.set(n,i),i}const CJ=wJ;function oc(e,t){const n=b.useRef(e),r=ke(t);Ge(()=>{n.current!==e&&r(n.current)},[e,r]),Ge(()=>{n.current=e},[e])}const zD=Symbol("none"),$i={value:zD,index:-1};function SJ(e){const{id:t,onOpenChangeComplete:n,defaultSelectedValue:r=null,selectedValue:o,onSelectedValueChange:i,defaultInputValue:s,inputValue:a,selectionMode:l="none",onItemHighlighted:u,name:c,disabled:d=!1,readOnly:f=!1,required:p=!1,inputRef:g,grid:m=!1,items:v,filteredItems:y,filter:x,openOnInputClick:w=!0,autoHighlight:C=!1,keepHighlight:S=!1,highlightItemOnHover:R=!0,loopFocus:I=!0,itemToStringLabel:T,itemToStringValue:_,isItemEqualToValue:$=cJ,virtualized:A=!1,inline:M=!1,fillInputOnItemPress:O=!0,modal:B=!1,limit:j=-1,autoComplete:D="list",formAutoComplete:V,locale:G,submitOnItemClick:z=!1}=e,{clearErrors:H}=$D(),{setDirty:ne,validityData:W,shouldValidateOnChange:J,setFilled:K,name:U,disabled:oe,setTouched:X,setFocused:te,validationMode:Q,validation:se}=bu(),ae=HD({id:t}),L=CJ({locale:G}),[Z,k]=b.useState(!1),[ie,Y]=b.useState(null),le=b.useRef([]),pe=b.useRef([]),re=b.useRef(null),fe=b.useRef(null),de=b.useRef(null),ve=b.useRef(!0),we=b.useRef(!1),Se=b.useRef(null),Ye=b.useRef(null),at=b.useRef(null),Xe=b.useRef($i),Ue=b.useRef(null),rt=b.useRef([]),et=b.useRef([]),gt=oe||d,ct=U??c,ot=l==="multiple",mt=l==="single",Nt=a!==void 0||s!==void 0,Bt=v!==void 0,tt=y!==void 0;let Ze;C==="always"?Ze="always":Ze=C?"input-change":!1;const[ee,ye]=Rm({controlled:o,default:ot?r??Yu:r,name:"Combobox",state:"selectedValue"}),ge=b.useMemo(()=>x===null?()=>!0:x!==void 0?x:mt&&!Z?xJ(L,T,ee):yJ(L,T),[x,mt,ee,Z,L,T]),xe=cr(()=>Nt?s??"":mt?On(ee,T):"").current,[Ae,Ie]=Rm({controlled:a,default:xe,name:"Combobox",state:"inputValue"}),[qe,Pt]=Rm({controlled:e.open,default:e.defaultOpen,name:"Combobox",state:"open"}),lt=q0(v),it=ie??(Ae===""?"":String(Ae).trim()),_t=mt?On(ee,T):"",Et=mt&&!Z&&it!==""&&_t!==""&&_t.length===it.length&&L.contains(_t,it),sn=Et?"":it,mr=Bt&&tt&&Et,Wn=b.useMemo(()=>v?lt?v.flatMap(Ce=>Ce.items):v:Yu,[v,lt]),pn=b.useMemo(()=>{if(y&&!mr)return y;if(!v)return Yu;if(lt){const Me=v,Ke=[];let It=0;for(const st of Me){if(j>-1&&It>=j)break;const Dt=sn===""?st.items:st.items.filter(zr=>ge(zr,sn,T));if(Dt.length===0)continue;const Xn=j>-1?j-It:1/0,An=Dt.slice(0,Xn);if(An.length>0){const zr={...st,items:An};Ke.push(zr),It+=An.length}}return Ke}if(sn==="")return j>-1?Wn.slice(0,j):Wn;const Ce=[];for(const Me of Wn){if(j>-1&&Ce.length>=j)break;ge(Me,sn,T)&&Ce.push(Me)}return Ce},[y,mr,v,lt,sn,j,ge,T,Wn]),Jt=b.useMemo(()=>lt?pn.flatMap(Me=>Me.items):pn,[pn,lt]),Ve=cr(()=>new DD({id:ae,selectedValue:ee,open:qe,filter:ge,query:it,items:v,selectionMode:l,listRef:le,labelsRef:pe,popupRef:re,emptyRef:de,inputRef:fe,keyboardActiveRef:ve,chipsContainerRef:Se,clearRef:Ye,valuesRef:rt,allValuesRef:et,selectionEventRef:at,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,openOnInputClick:w,itemToStringLabel:T,isItemEqualToValue:$,modal:B,autoHighlight:Ze,submitOnItemClick:z,hasInputValue:Nt,mounted:!1,forceMounted:!1,transitionStatus:"idle",inline:M,activeIndex:null,selectedIndex:null,popupProps:{},inputProps:{},triggerProps:{},positionerElement:null,listElement:null,triggerElement:null,inputElement:null,popupSide:null,openMethod:null,inputInsidePopup:!0,onOpenChangeComplete:n||Lt,setOpen:Lt,setInputValue:Lt,setSelectedValue:Lt,setIndices:Lt,onItemHighlighted:Lt,handleSelection:Lt,getItemProps:()=>En,forceMount:Lt,requestSubmit:Lt})).current,zn=l==="none"?Ae:ee,Sa=b.useMemo(()=>l==="none"?zn:Array.isArray(ee)?ee.map(Ce=>$a(Ce,_)):$a(ee,_),[zn,_,l,ee]),Oi=ke(u),Ni=ke(n),Go=me(Ve,be.activeIndex),nn=me(Ve,be.selectedIndex),Ho=me(Ve,be.positionerElement),Es=me(Ve,be.listElement),bo=me(Ve,be.triggerElement),Pi=me(Ve,be.inputElement),Cn=me(Ve,be.inline),Mt=me(Ve,be.inputInsidePopup),Ea=rr(bo),{mounted:Is,setMounted:Ia,transitionStatus:_i}=M0(qe),{openMethod:Rs,triggerProps:Hr,reset:As}=eJ(qe);vJ({id:ae,name:ct,commit:se.commit,value:zn,controlRef:Mt?Ea:fe,getValue:()=>Sa});const br=ke(()=>{v?pe.current=Jt.map(Ce=>On(Ce,T)):Ve.set("forceMounted",!0)}),qn=b.useRef(ee);Ge(()=>{ee!==qn.current&&br()},[br,ee]);const an=ke(Ce=>{Ve.update(Ce);const Me=Ce.type||"none";if(Ce.activeIndex!==void 0)if(Ce.activeIndex===null)Xe.current!==$i&&(Xe.current=$i,Oi(void 0,Ba(Me,void 0,{index:-1})));else{const Ke=rt.current[Ce.activeIndex];Xe.current={value:Ke,index:Ce.activeIndex},Oi(Ke,Ba(Me,void 0,{index:Ce.activeIndex}))}}),Rn=ke((Ce,Me)=>{if(we.current=Me.reason===ei,e.onInputValueChange?.(Ce,Me),!Me.isCanceled){if(Me.reason===Hs){const Ke=Me.event,It=Ke.inputType;if(Ke.type==="compositionend"||It!=null&&It!==""&&It!=="insertReplacementText"){const Dt=Ce.trim()!=="";Dt&&k(!0),Ue.current={hasQuery:Dt},Dt&&Ze&&Ve.state.activeIndex==null&&Ve.set("activeIndex",0)}}Ie(Ce)}}),vo=ke((Ce,Me)=>{if(qe!==Ce&&(Me.reason==="escape-key"&&Bt&&Jt.length===0&&!Ve.state.emptyRef.current&&Me.allowPropagation(),e.onOpenChange?.(Ce,Me),!Me.isCanceled&&(!Ce&&Z&&(mt?(Cn||Y(it),it===""&&k(!1)):ot&&(Cn||Mt?an({activeIndex:null}):Y(it),Rn("",Qe(ei,Me.event)))),Pt(Ce),!Ce&&Mt&&(Me.reason===Rf||Me.reason===O0)&&(X(!0),te(!1),Q==="onBlur")))){const Ke=l==="none"?Ae:ee;se.commit(Ke)}}),Wo=ke((Ce,Me)=>{if(i?.(Ce,Me),Me.isCanceled)return;ye(Ce),(l==="none"&&re.current&&O||mt&&!Ve.state.inputInsidePopup)&&Rn(On(Ce,T),Qe(Me.reason,Me.event)),mt&&Ce!=null&&Me.reason!==Hs&&Z&&!Cn&&Y(it)}),Ra=ke((Ce,Me)=>{let Ke=Me;if(Ke===void 0){if(Go===null)return;Ke=rt.current[Go]}const It=Nn(Ce),st=at.current??Ce;at.current=null;const Dt=Qe(s7,st),Xn=It?.closest("a")?.getAttribute("href");if(Xn){Xn.startsWith("#")&&vo(!1,Dt);return}if(ot){const An=Array.isArray(ee)?ee:[],Uo=dJ(An,Ke,Ve.state.isItemEqualToValue)?fJ(An,Ke,Ve.state.isItemEqualToValue):[...An,Ke];if(Wo(Uo,Dt),!(fe.current?fe.current.value.trim()!=="":!1))return;Ve.state.inputInsidePopup?Rn("",Qe(ei,Dt.event)):vo(!1,Dt)}else Wo(Ke,Dt),vo(!1,Dt)}),Mi=ke(()=>{if(!Ve.state.submitOnItemClick)return;const Ce=Ve.state.inputElement?.form;Ce&&typeof Ce.requestSubmit=="function"&&Ce.requestSubmit()}),Wr=ke(()=>{if(Ia(!1),Ni?.(!1),k(!1),As(),Y(null),an(l==="none"?{activeIndex:null,selectedIndex:null}:{activeIndex:null}),ot&&fe.current&&fe.current.value!==""&&!we.current&&Rn("",Qe(ei)),mt)if(Ve.state.inputInsidePopup)fe.current&&fe.current.value!==""&&Rn("",Qe(ei));else{const Ce=On(ee,T);fe.current&&fe.current.value!==Ce&&Rn(Ce,Qe(Ce===""?ei:er))}}),Di=b.useMemo(()=>Cn&&Ho?{current:Ho.closest('[role="dialog"]')}:re,[Cn,Ho]);Of({enabled:!e.actionsRef,open:qe,ref:Di,onComplete(){qe||Wr()}}),b.useImperativeHandle(e.actionsRef,()=>({unmount:Wr}),[Wr]),Ge(function(){if(qe||l==="none")return;const Me=v?Wn:et.current;if(ot){const Ke=Array.isArray(ee)?ee:[],It=Ke[Ke.length-1],st=gd(Me,It,$);an({selectedIndex:st===-1?null:st})}else{const Ke=gd(Me,ee,$);an({selectedIndex:Ke===-1?null:Ke})}},[qe,ee,v,l,Wn,ot,$,an]),Ge(()=>{v&&(rt.current=Jt,le.current.length=Jt.length)},[v,Jt]),Ge(()=>{const Ce=Ue.current;if(Ce&&(Ce.hasQuery?Ze&&Ve.set("activeIndex",0):Ze==="always"&&Ve.set("activeIndex",0),Ue.current=null),!qe&&!Cn)return;const Ke=Bt||tt?Jt:rt.current,It=Ve.state.activeIndex;if(It==null){if(Ze==="always"&&Ke.length>0){Ve.set("activeIndex",0);return}Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(er,void 0,{index:-1})));return}if(It>=Ke.length){Xe.current!==$i&&(Xe.current=$i,Ve.state.onItemHighlighted(void 0,Ba(er,void 0,{index:-1}))),Ve.set("activeIndex",null);return}const st=Ke[It],Dt=Xe.current.value,Xn=Dt!==zD&&ns(st,Dt,Ve.state.isItemEqualToValue);(Xe.current.index!==It||!Xn)&&(Xe.current={value:st,index:It},Ve.state.onItemHighlighted(st,Ba(er,void 0,{index:It})))},[Go,Ze,tt,Bt,Jt,Cn,qe,Ve]),Ge(()=>{if(l==="none"){K(String(Ae)!=="");return}K(ot?Array.isArray(ee)&&ee.length>0:ee!=null)},[K,l,Ae,ee,ot]),b.useEffect(()=>{Bt&&Ze&&Jt.length===0&&an({activeIndex:null})},[Bt,Ze,Jt.length,an]),oc(it,()=>{!qe||it===""||it===String(xe)||k(!0)}),oc(ee,()=>{if(l!=="none"&&(H(ct),ne(ee!==W.initialValue),J()?se.commit(ee):se.commit(ee,!0),mt&&!Nt&&!Mt)){const Ce=On(ee,T);Ae!==Ce&&Rn(Ce,Qe(er))}}),oc(Ae,()=>{l==="none"&&(H(ct),ne(Ae!==W.initialValue),J()?se.commit(Ae):se.commit(Ae,!0))}),oc(v,()=>{if(!mt||Nt||Mt||Z)return;const Ce=On(ee,T);Ae!==Ce&&Rn(Ce,Qe(er))});const Un=kD({open:Cn?!0:qe,onOpenChange:vo,elements:{reference:Mt?bo:Pi,floating:Ho}});let zo,qo;Cn||(zo=m?"grid":"listbox",qo=qe?"true":"false");const Aa=b.useMemo(()=>{const Ce=Pi?.tagName==="INPUT",Me=Ce||qe,Ke=Ce?{autoComplete:"off",spellCheck:"false",autoCorrect:"off",autoCapitalize:"none"}:{};return Me&&(Ke.role="combobox",Ke["aria-expanded"]=qo,Ke["aria-haspopup"]=zo,Ke["aria-controls"]=qe?Es?.id:void 0,Ke["aria-autocomplete"]=D),{reference:Ke,floating:{role:"presentation"}}},[Pi,qe,qo,zo,Es?.id,D]),Ta=PD(Un,{enabled:!f&&!gt&&w,event:"mousedown-only",toggle:!1,touchOpenDelay:Mt?0:50,reason:l7}),Oa=hZ(Un,{enabled:!f&&!gt&&!Cn,outsidePressEvent:{mouse:"sloppy",touch:"intentional"},bubbles:Cn?!0:void 0,outsidePress(Ce){const Me=Nn(Ce);return!ft(bo,Me)&&!ft(Ye.current,Me)&&!ft(Se.current,Me)}}),Na=JZ(Un,{enabled:!f&&!gt,id:ae,listRef:le,activeIndex:Go,selectedIndex:nn,virtual:!0,loopFocus:I,allowEscape:I&&!Ze,focusItemOnOpen:Z||l==="none"&&!Ze?!1:"auto",focusItemOnHover:R,resetOnPointerLeave:!S,cols:m?2:1,orientation:m?"horizontal":void 0,disabledIndices:Yu,onNavigate(Ce,Me){!Me&&!qe||_i==="ending"||an(Me?{activeIndex:Ce,type:ve.current?"keyboard":"pointer"}:{activeIndex:Ce})}}),{getReferenceProps:yo,getFloatingProps:ki,getItemProps:ji}=UZ([Aa,Ta,Oa,Na]);uJ(()=>{Ve.update({inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,getItemProps:ji,setOpen:vo,setInputValue:Rn,setSelectedValue:Wo,setIndices:an,onItemHighlighted:Oi,handleSelection:Ra,forceMount:br,requestSubmit:Mi})}),Ge(()=>{Ve.update({id:ae,selectedValue:ee,open:qe,mounted:Is,transitionStatus:_i,items:v,inline:M,popupProps:ki(),inputProps:yo(),triggerProps:Hr,openMethod:Rs,getItemProps:ji,selectionMode:l,name:ct,disabled:gt,readOnly:f,required:p,grid:m,isGrouped:lt,virtualized:A,onOpenChangeComplete:Ni,openOnInputClick:w,itemToStringLabel:T,modal:B,autoHighlight:Ze,isItemEqualToValue:$,submitOnItemClick:z,hasInputValue:Nt,requestSubmit:Mi})},[Ve,ae,ee,qe,Is,_i,v,ki,yo,ji,Rs,Hr,l,ct,gt,f,p,se,m,lt,A,Ni,w,T,B,$,z,Nt,M,Mi,Ze]);const xo=Ml(g,se.inputRef),Dn=b.useMemo(()=>({query:it,hasItems:Bt,filteredItems:pn,flatFilteredItems:Jt}),[it,Bt,pn,Jt]),vr=b.useMemo(()=>Array.isArray(zn)?"":$a(zn,_),[zn,_]),yr=ot&&Array.isArray(ee)&&ee.length>0,Li=ot||l==="none"?void 0:ct,Yn=b.useMemo(()=>!ot||!Array.isArray(ee)||!ct?null:ee.map(Ce=>{const Me=$a(Ce,_);return h.jsx("input",{type:"hidden",name:ct,value:Me},Me)}),[ot,ee,ct,_]),Pa=h.jsxs(b.Fragment,{children:[e.children,h.jsx("input",{...se.getInputValidationProps({onFocus(){if(Mt){bo?.focus();return}(fe.current||bo)?.focus()},onChange(Ce){if(Ce.nativeEvent.defaultPrevented)return;const Me=Ce.target.value,Ke=Qe(er,Ce.nativeEvent);function It(){if(ot)return;if(l==="none"){ne(Me!==W.initialValue),Rn(Me,Ke),J()&&se.commit(Me);return}const st=rt.current.find(Dt=>$a(Dt,_).toLowerCase()===Me.toLowerCase());st!=null&&(ne(st!==W.initialValue),Wo?.(st,Ke),J()&&se.commit(st))}v?It():(br(),queueMicrotask(It))}}),id:ae&&Li==null?`${ae}-hidden-input`:void 0,name:Li,autoComplete:V,disabled:gt,required:p&&!yr,readOnly:f,value:vr,ref:xo,style:Li?tZ:L0,tabIndex:-1,"aria-hidden":!0}),Yn]});return h.jsx($0.Provider,{value:Ve,children:h.jsx(G0.Provider,{value:Un,children:h.jsx(H0.Provider,{value:Dn,children:h.jsx(W0.Provider,{value:Ae,children:Pa})})})})}const qD={...aJ,...mJ,popupSide:e=>e?{"data-popup-side":e}:null,listEmpty:e=>e?{"data-list-empty":""}:null};function EJ(e){const t=e.getBoundingClientRect();if(process.env.NODE_ENV!=="production")return t;const n=window.getComputedStyle(e,"::before"),r=window.getComputedStyle(e,"::after");if(!(n.content!=="none"||r.content!=="none"))return t;const i=parseFloat(n.width)||0,s=parseFloat(n.height)||0,a=parseFloat(r.width)||0,l=parseFloat(r.height)||0,u=Math.max(t.width,i,a),c=Math.max(t.height,s,l),d=u-t.width,f=c-t.height;return{left:t.left-d/2,right:t.right+d/2,top:t.top-f/2,bottom:t.bottom+f/2}}const ic=2,UD=b.forwardRef(function(t,n){const{render:r,className:o,nativeButton:i=!0,disabled:s=!1,id:a,...l}=t,{state:u,disabled:c,setTouched:d,setFocused:f,validationMode:p,validation:g}=bu(),{labelId:m}=U0(),v=Gn(),{filteredItems:y}=Ii(),x=me(v,be.selectionMode),w=me(v,be.disabled),C=me(v,be.readOnly),S=me(v,be.required),R=me(v,be.mounted),I=me(v,be.popupSide),T=me(v,be.positionerElement),_=me(v,be.listElement),$=me(v,be.triggerProps),A=me(v,be.triggerElement),M=me(v,be.inputInsidePopup),O=me(v,be.id),B=me(v,be.open),j=me(v,be.selectedValue),D=me(v,be.activeIndex),V=me(v,be.selectedIndex),G=me(v,be.hasSelectedValue),z=_f(),H=z0(),ne=ts(),W=c||w||s,J=y.length===0,K=R&&T?I:null;HD({id:M?a:void 0});const U=M?a??O:a,oe=b.useRef("");function X(Y){oe.current=Y.pointerType}const te=z.useState("domReferenceElement");b.useEffect(()=>{M&&A&&A!==te&&z.set("domReferenceElement",A)},[A,te,z,M]);const{reference:Q}=KZ(z,{enabled:!B&&!C&&!w&&x==="single",listRef:v.state.labelsRef,activeIndex:D,selectedIndex:V,onMatch(Y){const le=v.state.valuesRef.current[Y];le!==void 0&&v.state.setSelectedValue(le,Qe("none"))}}),{reference:se}=PD(z,{enabled:!C&&!w,event:"mousedown"}),{buttonRef:ae,getButtonProps:L}=Af({native:i,disabled:W}),Z={...u,open:B,disabled:W,popupSide:K,listEmpty:J,placeholder:!G},k=ke(Y=>{v.set("triggerElement",Y)});return Mn("button",t,{ref:[n,ae,k],state:Z,props:[$,se,Q,{id:U,tabIndex:M?0:-1,role:M?"combobox":void 0,"aria-expanded":B?"true":"false","aria-haspopup":M?"dialog":"listbox","aria-controls":B?_?.id:void 0,"aria-required":M&&S||void 0,"aria-labelledby":m,onPointerDown:X,onPointerEnter:X,onFocus(){f(!0),!(W||C)&&ne.start(0,v.state.forceMount)},onBlur(Y){if(!ft(T,Y.relatedTarget)&&(d(!0),f(!1),p==="onBlur")){const le=x==="none"?H:j;g.commit(le)}},onMouseDown(Y){if(W||C||(M||z.set("domReferenceElement",Y.currentTarget),v.state.forceMount(),oe.current!=="touch"&&(v.state.inputRef.current?.focus(),M||Y.preventDefault()),B))return;const le=Ht(Y.currentTarget);function pe(re){if(!A)return;const fe=Nn(re),de=v.state.positionerElement,ve=v.state.listElement;if(ft(A,fe)||ft(de,fe)||ft(ve,fe)||fe===A)return;const we=EJ(A),Se=re.clientX>=we.left-ic&&re.clientX<=we.right+ic,Ye=re.clientY>=we.top-ic&&re.clientY<=we.bottom+ic;Se&&Ye||v.state.setOpen(!1,Qe("cancel-open",re))}M&&le.addEventListener("mouseup",pe,{once:!0})},onKeyDown(Y){W||C||(Y.key==="ArrowDown"||Y.key==="ArrowUp")&&(Tt(Y),v.state.setOpen(!0,Qe(dl,Y.nativeEvent)),v.state.inputRef.current?.focus())}},g?g.getValidationProps(l):l,L],stateAttributesMapping:qD})});process.env.NODE_ENV!=="production"&&(UD.displayName="ComboboxTrigger");const Y0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Y0.displayName="ComboboxChipsContext");function YD(){return b.useContext(Y0)}const X0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(X0.displayName="ComboboxPositionerContext");function Z0(e){const t=b.useContext(X0);if(t===void 0&&!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Popup> and <Combobox.Arrow> must be used within the <Combobox.Positioner> component":Fr(21));return t}const J0=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,id:s,...a}=t,{state:l,disabled:u,setTouched:c,setFocused:d,validationMode:f,validation:p}=bu(),{labelId:g}=U0(),m=YD(),y=!!Z0(!0),x=Gn(),{filteredItems:w}=Ii(),C=z0(),S=YM(),R=me(x,be.required),I=me(x,be.disabled),T=me(x,be.readOnly),_=me(x,be.name),$=me(x,be.selectionMode),A=me(x,be.autoHighlight),M=me(x,be.inputProps),O=me(x,be.triggerProps),B=me(x,be.open),j=me(x,be.mounted),D=me(x,be.selectedValue),V=me(x,be.popupSide),G=me(x,be.positionerElement),z=me(x,be.id),H=me(x,be.inline),ne=!!A,W=j&&G?V:null,J=u||I||i,K=w.length===0,oe=tD(s??(y||H?void 0:z)),[X,te]=b.useState(null),Q=b.useRef(!1),se=b.useRef(null),ae=b.useRef(!1),L=ke(Y=>{const le=y||x.state.inline;le&&!x.state.hasInputValue&&x.state.setInputValue("",Qe(er)),x.update({inputElement:Y,inputInsidePopup:le})}),Z={...l,open:B,disabled:J,readOnly:T,popupSide:W,listEmpty:K};function k(Y){if(!m)return;let le;const{highlightedChipIndex:pe}=m;if(pe!==void 0){if(Y.key==="ArrowLeft")Y.preventDefault(),pe>0?le=pe-1:le=void 0;else if(Y.key==="ArrowRight")Y.preventDefault(),pe<D.length-1?le=pe+1:le=void 0;else if(Y.key==="Backspace"||Y.key==="Delete"){Y.preventDefault();const re=pe>=D.length-1?D.length-2:pe;le=re>=0?re:void 0,x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"})}return le}return Y.key==="ArrowLeft"&&(Y.currentTarget.selectionStart??0)===0&&D.length>0?(Y.preventDefault(),le=Math.max(D.length-1,0)):Y.key==="Backspace"&&Y.currentTarget.value===""&&D.length>0&&(x.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),Y.preventDefault()),le}return Mn("input",t,{state:Z,ref:[n,x.state.inputRef,L],props:[M,O,{type:"text",value:t.value??X??C,"aria-readonly":T||void 0,"aria-required":R||void 0,"aria-labelledby":g,disabled:J,readOnly:T,required:$==="none"?R:void 0,...$==="none"&&_&&{name:_},id:oe,onFocus(){if(d(!0),!H||!ae.current)return;ae.current=!1;const Y=se.current;Y==null||!Object.hasOwn(x.state.valuesRef.current,Y)||x.state.setIndices({activeIndex:Y})},onBlur(){c(!0),d(!1);const Y=x.state.activeIndex;if(H&&Y!==null&&A!=="always"&&(se.current=Y,ae.current=!0,x.state.setIndices({activeIndex:null})),f==="onBlur"){const le=$==="none"?C:D;p.commit(le)}},onCompositionStart(Y){ld||(Q.current=!0,te(Y.currentTarget.value))},onCompositionEnd(Y){Q.current=!1;const le=Y.currentTarget.value;te(null),x.state.setInputValue(le,Qe(Hs,Y.nativeEvent))},onChange(Y){const le=Y.nativeEvent.inputType,pe=!le||le==="insertReplacementText",re=Q.current||!pe;if(Q.current){const we=Y.currentTarget.value;te(we),we===""&&!x.state.openOnInputClick&&!x.state.inputInsidePopup&&x.state.setOpen(!1,Qe(ei,Y.nativeEvent));const Se=we.trim(),Ye=ne&&Se!=="";!T&&!J&&Se&&re&&(x.state.setOpen(!0,Qe(Hs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!Ye&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"});return}x.state.setInputValue(Y.currentTarget.value,Qe(Hs,Y.nativeEvent));const fe=Y.currentTarget.value==="",de=Qe(ei,Y.nativeEvent);fe&&!x.state.inputInsidePopup&&($==="single"&&x.state.setSelectedValue(null,de),x.state.openOnInputClick||x.state.setOpen(!1,de));const ve=Y.currentTarget.value.trim();!T&&!J&&ve&&re&&(x.state.setOpen(!0,Qe(Hs,Y.nativeEvent)),ne||x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})),B&&x.state.activeIndex!==null&&!ne&&x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"})},onKeyDown(Y){if(J||T||Y.ctrlKey||Y.shiftKey||Y.altKey||Y.metaKey)return;x.state.keyboardActiveRef.current=!0;const le=Y.currentTarget,pe=le.scrollWidth-le.clientWidth,re=S==="rtl";if(Y.key==="Home"){Tt(Y);const ve=PE&&re?le.value.length:0;le.setSelectionRange(ve,ve),le.scrollLeft=0;return}if(Y.key==="End"){Tt(Y);const ve=PE&&re?0:le.value.length;le.setSelectionRange(ve,ve),le.scrollLeft=re?-pe:pe;return}if(!j&&Y.key==="Escape"){const ve=$==="multiple"&&Array.isArray(D)?D.length===0:D===null,we=Qe(eD,Y.nativeEvent),Se=$==="multiple"?[]:null;x.state.setInputValue("",we),x.state.setSelectedValue(Se,we),!ve&&!x.state.inline&&!we.isPropagationAllowed&&Y.stopPropagation();return}if(m&&Y.key==="Backspace"&&le.value===""&&m.highlightedChipIndex===void 0&&Array.isArray(D)&&D.length>0){const ve=D.slice(0,-1);x.state.setIndices({activeIndex:null,selectedIndex:null,type:x.state.keyboardActiveRef.current?"keyboard":"pointer"}),x.state.setSelectedValue(ve,Qe(er,Y.nativeEvent));return}const fe=m?.highlightedChipIndex!==void 0,de=k(Y);if(m?.setHighlightedChipIndex(de),de!==void 0?m?.chipsRef.current[de]?.focus():fe&&x.state.inputRef.current?.focus(),Y.which!==229&&Y.key==="Enter"&&B){const ve=x.state.activeIndex,we=Y.nativeEvent;if(ve===null){x.state.setOpen(!1,Qe(er,we));return}Tt(Y);const Se=x.state.listRef.current[ve];Se&&(x.state.selectionEventRef.current=we,Se.click(),x.state.selectionEventRef.current=null)}},onPointerMove(){x.state.keyboardActiveRef.current=!1},onPointerDown(){x.state.keyboardActiveRef.current=!1}},p?p.getValidationProps(a):a],stateAttributesMapping:qD})});process.env.NODE_ENV!=="production"&&(J0.displayName="ComboboxInput");const IJ={..._0,...sJ},XD=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,keepMounted:a=!1,...l}=t,{disabled:u}=bu(),c=Gn(),d=me(c,be.selectionMode),f=me(c,be.disabled),p=me(c,be.readOnly),g=me(c,be.open),m=me(c,be.selectedValue),v=me(c,be.hasSelectionChips),y=z0();let x=!1;d==="none"?x=y!=="":d==="single"?x=m!=null:x=v;const w=u||f||i,{buttonRef:C,getButtonProps:S}=Af({native:s,disabled:w}),{mounted:R,transitionStatus:I,setMounted:T}=M0(x),_={disabled:w,open:g,transitionStatus:I};Of({open:x,ref:c.state.clearRef,onComplete(){x||T(!1)}});const $=Mn("button",t,{state:_,ref:[n,C,c.state.clearRef],props:[{tabIndex:-1,children:"x",onMouseDown(M){M.preventDefault()},onClick(M){if(w||p)return;const O=c.state.keyboardActiveRef;c.state.setInputValue("",Qe(RE,M.nativeEvent)),d!=="none"?(c.state.setSelectedValue(Array.isArray(m)?[]:null,Qe(RE,M.nativeEvent)),c.state.setIndices({activeIndex:null,selectedIndex:null,type:O.current?"keyboard":"pointer"})):c.state.setIndices({activeIndex:null,type:O.current?"keyboard":"pointer"}),c.state.inputRef.current?.focus()}},l,S],stateAttributesMapping:IJ});return a||R?$:null});process.env.NODE_ENV!=="production"&&(XD.displayName="ComboboxClear");const ZD=b.createContext(null);process.env.NODE_ENV!=="production"&&(ZD.displayName="GroupCollectionContext");function RJ(){return b.useContext(ZD)}function AJ(e){const{children:t}=e,{filteredItems:n}=Ii(),r=RJ(),o=r?r.items:n;return o?h.jsx(b.Fragment,{children:o.map(t)}):null}const JD=b.forwardRef(function(t,n){var r;const{render:o,className:i,children:s,...a}=t,l=Gn(),u=_f(),c=!!Z0(!0),{filteredItems:d}=Ii(),f=me(l,be.items),p=me(l,be.labelsRef),g=me(l,be.listRef),m=me(l,be.selectionMode),v=me(l,be.grid),y=me(l,be.popupProps),x=me(l,be.disabled),w=me(l,be.readOnly),C=me(l,be.virtualized),S=m==="multiple",R=d.length===0,I=ke(O=>{l.set("positionerElement",O)}),T=ke(O=>{l.set("listElement",O)}),_=b.useMemo(()=>typeof s=="function"?r||(r=h.jsx(AJ,{children:s})):s,[s]),$={empty:R},A=u.useState("floatingId"),M=Mn("div",t,{state:$,ref:[n,T,c?null:I],props:[y,{children:_,tabIndex:-1,id:A,role:v?"grid":"listbox","aria-multiselectable":S?"true":void 0,onKeyDown(O){if(!(x||w)&&O.key==="Enter"){const B=l.state.activeIndex;if(B==null)return;Tt(O);const j=O.nativeEvent,D=l.state.listRef.current[B];D&&(l.state.selectionEventRef.current=j,D.click(),l.state.selectionEventRef.current=null)}},onKeyDownCapture(){l.state.keyboardActiveRef.current=!0},onPointerMoveCapture(){l.state.keyboardActiveRef.current=!1}},a]});return C?M:h.jsx(qM,{elementsRef:g,labelsRef:f?void 0:p,children:M})});process.env.NODE_ENV!=="production"&&(JD.displayName="ComboboxList");const K0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(K0.displayName="ComboboxPortalContext");function TJ(){const e=b.useContext(K0);if(e===void 0)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: <Combobox.Portal> is missing.":Fr(20));return e}const KD=b.forwardRef(function(t,n){const{keepMounted:r=!1,...o}=t,i=Gn(),s=me(i,be.mounted),a=me(i,be.forceMounted);return s||r||a?h.jsx(K0.Provider,{value:r,children:h.jsx(ND,{ref:n,...o})}):null});process.env.NODE_ENV!=="production"&&(KD.displayName="ComboboxPortal");const OJ=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:u,padding:c=0,offsetParent:d="real"}=ro(e,t)||{};if(u==null)return{};const f=yy(c),p={x:n,y:r},g=$d(o),m=Vd(g),v=await s.getDimensions(u),y=g==="y",x=y?"top":"left",w=y?"bottom":"right",C=y?"clientHeight":"clientWidth",S=i.reference[m]+i.reference[g]-p[g]-i.floating[m],R=p[g]-i.reference[g],I=d==="real"?await s.getOffsetParent?.(u):a.floating;let T=a.floating[C]||i.floating[m];(!T||!await s.isElement?.(I))&&(T=a.floating[C]||i.floating[m]);const _=S/2-R/2,$=T/2-v[m]/2-1,A=Math.min(f[x],$),M=Math.min(f[w],$),O=A,B=T-v[m]-M,j=T/2-v[m]/2+_,D=Bc(O,j,B),V=!l.arrow&&Fo(o)!=null&&j!==D&&i.reference[m]/2-(j<O?A:M)-v[m]/2<0,G=V?j<O?j-O:j-B:0;return{[g]:p[g]+G,data:{[g]:D,centerOffset:j-D-G,...V&&{alignmentOffset:G}},reset:V}}}),NJ=(e,t)=>({...OJ(e),options:[e,t]}),PJ={name:"hide",async fn(e){const{width:t,height:n,x:r,y:o}=e.rects.reference,i=t===0&&n===0&&r===0&&o===0;return{data:{referenceHidden:(await qT().fn(e)).data?.referenceHidden||i}}}},_J={sideX:"left",sideY:"top"};function QD(e,t,n){const r=e==="inline-start"||e==="inline-end";return{top:"top",right:r?n?"inline-start":"inline-end":"right",bottom:"bottom",left:r?n?"inline-end":"inline-start":"left"}[t]}function QE(e,t,n){const{rects:r,placement:o}=e;return{side:QD(t,Ln(o),n),align:Fo(o)||"center",anchor:{width:r.reference.width,height:r.reference.height},positioner:{width:r.floating.width,height:r.floating.height}}}function MJ(e){const{anchor:t,positionMethod:n="absolute",side:r="bottom",sideOffset:o=0,align:i="center",alignOffset:s=0,collisionBoundary:a,collisionPadding:l=5,sticky:u=!1,arrowPadding:c=5,disableAnchorTracking:d=!1,keepMounted:f=!1,floatingRootContext:p,mounted:g,collisionAvoidance:m,shiftCrossAxis:v=!1,nodeId:y,adaptiveOrigin:x,lazyFlip:w=!1,externalTree:C}=e,[S,R]=b.useState(null);!g&&S!==null&&R(null);const I=m.side||"flip",T=m.align||"flip",_=m.fallbackAxisSide||"end",$=typeof t=="function"?t:void 0,A=ke($),M=$?A:t,O=rr(t),j=YM()==="rtl",D=S||{top:"top",right:"right",bottom:"bottom",left:"left","inline-end":j?"left":"right","inline-start":j?"right":"left"}[r],V=i==="center"?D:`${D}-${i}`;let G=l;const z=1,H=r==="bottom"?z:0,ne=r==="top"?z:0,W=r==="right"?z:0,J=r==="left"?z:0;typeof G=="number"?G={top:G+H,right:G+J,bottom:G+ne,left:G+W}:G&&(G={top:(G.top||0)+H,right:(G.right||0)+J,bottom:(G.bottom||0)+ne,left:(G.left||0)+W});const K={boundary:a==="clipping-ancestors"?"clippingAncestors":a,padding:G},U=b.useRef(null),oe=rr(o),X=rr(s),se=[$T(tt=>{const Ze=QE(tt,r,j),ee=typeof oe.current=="function"?oe.current(Ze):oe.current,ye=typeof X.current=="function"?X.current(Ze):X.current;return{mainAxis:ee,crossAxis:ye,alignmentAxis:ye}},[typeof o!="function"?o:0,typeof s!="function"?s:0,j,r])],ae=T==="none"&&I!=="shift",L=!ae&&(u||v||I==="shift"),Z=I==="none"?null:WT({...K,padding:{top:G.top+z,right:G.right+z,bottom:G.bottom+z,left:G.left+z},mainAxis:!v&&I==="flip",crossAxis:T==="flip"?"alignment":!1,fallbackAxisSideDirection:_}),k=ae?null:GT(tt=>{const Ze=Ht(tt.elements.floating).documentElement;return{...K,rootBoundary:v?{x:0,y:0,width:Ze.clientWidth,height:Ze.clientHeight}:void 0,mainAxis:T!=="none",crossAxis:L,limiter:u||v?void 0:HT(ee=>{if(!U.current)return{};const{width:ye,height:ge}=U.current.getBoundingClientRect(),xe=sr(Ln(ee.placement)),Ae=xe==="y"?ye:ge,Ie=xe==="y"?G.left+G.right:G.top+G.bottom;return{offset:Ae/2+Ie/2}})}},[K,u,v,G,T]);I==="shift"||T==="shift"||i==="center"?se.push(k,Z):se.push(Z,k),se.push(zT({...K,apply({elements:{floating:tt},rects:{reference:Ze},availableWidth:ee,availableHeight:ye}){const ge=tt.style;ge.setProperty("--available-width",`${ee}px`),ge.setProperty("--available-height",`${ye}px`),ge.setProperty("--anchor-width",`${Ze.width}px`),ge.setProperty("--anchor-height",`${Ze.height}px`)}}),NJ(()=>({element:U.current||document.createElement("div"),padding:c,offsetParent:"floating"}),[c]),{name:"transformOrigin",fn(tt){const{elements:Ze,middlewareData:ee,placement:ye,rects:ge,y:xe}=tt,Ae=Ln(ye),Ie=sr(Ae),qe=U.current,Pt=ee.arrow?.x||0,lt=ee.arrow?.y||0,it=qe?.clientWidth||0,_t=qe?.clientHeight||0,Et=Pt+it/2,sn=lt+_t/2,mr=Math.abs(ee.shift?.y||0),Wn=ge.reference.height/2,pn=typeof o=="function"?o(QE(tt,r,j)):o,Jt=mr>pn,Ve={top:`${Et}px calc(100% + ${pn}px)`,bottom:`${Et}px ${-pn}px`,left:`calc(100% + ${pn}px) ${sn}px`,right:`${-pn}px ${sn}px`}[Ae],zn=`${Et}px ${ge.reference.y+Wn-xe}px`;return Ze.floating.style.setProperty("--transform-origin",L&&Ie==="y"&&Jt?zn:Ve),{}}},PJ,x),Ge(()=>{!g&&p&&p.update({referenceElement:null,floatingElement:null,domReferenceElement:null})},[g,p]);const ie=b.useMemo(()=>({elementResize:!d&&typeof ResizeObserver<"u",layoutShift:!d&&typeof IntersectionObserver<"u"}),[d]),{refs:Y,elements:le,x:pe,y:re,middlewareData:fe,update:de,placement:ve,context:we,isPositioned:Se,floatingStyles:Ye}=qZ({rootContext:p,placement:V,middleware:se,strategy:n,whileElementsMounted:f?void 0:(...tt)=>Gc(...tt,ie),nodeId:y,externalTree:C}),{sideX:at,sideY:Xe}=fe.adaptiveOrigin||_J,Ue=Se?n:"fixed",rt=b.useMemo(()=>{const tt=x?{position:Ue,[at]:pe,[Xe]:re}:{position:Ue,...Ye};return Se||(tt.opacity=0),tt},[x,Ue,at,pe,Xe,re,Ye,Se]),et=b.useRef(null);Ge(()=>{if(!g)return;const tt=O.current,Ze=typeof tt=="function"?tt():tt,ye=(eI(Ze)?Ze.current:Ze)||null||null;ye!==et.current&&(Y.setPositionReference(ye),et.current=ye)},[g,Y,M,O]),b.useEffect(()=>{if(!g)return;const tt=O.current;typeof tt!="function"&&eI(tt)&&tt.current!==et.current&&(Y.setPositionReference(tt.current),et.current=tt.current)},[g,Y,M,O]),b.useEffect(()=>{if(f&&g&&le.domReference&&le.floating)return Gc(le.domReference,le.floating,de,ie)},[f,g,le,de,ie]);const gt=Ln(ve),ct=QD(r,gt,j),ot=Fo(ve)||"center",mt=!!fe.hide?.referenceHidden;Ge(()=>{w&&g&&Se&&R(gt)},[w,g,Se,gt]);const Nt=b.useMemo(()=>({position:"absolute",top:fe.arrow?.y,left:fe.arrow?.x}),[fe.arrow]),Bt=fe.arrow?.centerOffset!==0;return b.useMemo(()=>({positionerStyles:rt,arrowStyles:Nt,arrowRef:U,arrowUncentered:Bt,side:ct,align:ot,physicalSide:gt,anchorHidden:mt,refs:Y,context:we,isPositioned:Se,update:de}),[rt,Nt,U,Bt,ct,ot,gt,mt,Y,we,Se,de])}function eI(e){return e!=null&&"current"in e}function ek(e){return e==="starting"?J8:En}const tk=b.forwardRef(function(t,n){const{render:r,className:o,anchor:i,positionMethod:s="absolute",side:a="bottom",align:l="center",sideOffset:u=0,alignOffset:c=0,collisionBoundary:d="clipping-ancestors",collisionPadding:f=5,arrowPadding:p=5,sticky:g=!1,disableAnchorTracking:m=!1,collisionAvoidance:v=Q8,...y}=t,x=Gn(),{filteredItems:w}=Ii(),C=_f(),S=TJ(),R=me(x,be.modal),I=me(x,be.open),T=me(x,be.mounted),_=me(x,be.openMethod),$=me(x,be.triggerElement),A=me(x,be.inputElement),M=me(x,be.inputInsidePopup),O=me(x,be.transitionStatus),B=w.length===0,D=MJ({anchor:i??(M?$:A),floatingRootContext:C,positionMethod:s,mounted:T,side:a,sideOffset:u,align:l,alignOffset:c,arrowPadding:p,collisionBoundary:d,collisionPadding:f,sticky:g,disableAnchorTracking:m,keepMounted:S,collisionAvoidance:v,lazyFlip:!0});K7(I&&R&&_!=="touch",$);const V=b.useMemo(()=>{const W={...D.positionerStyles};return I||(W.pointerEvents="none"),{role:"presentation",hidden:!T,style:W}},[I,T,D.positionerStyles]),G={open:I,side:D.side,align:D.align,anchorHidden:D.anchorHidden,empty:B};Ge(()=>{x.set("popupSide",D.side)},[x,D.side]);const z=b.useMemo(()=>({side:D.side,align:D.align,arrowRef:D.arrowRef,arrowUncentered:D.arrowUncentered,arrowStyles:D.arrowStyles,anchorHidden:D.anchorHidden,isPositioned:D.isPositioned}),[D.side,D.align,D.arrowRef,D.arrowUncentered,D.arrowStyles,D.anchorHidden,D.isPositioned]),H=ke(W=>{x.set("positionerElement",W)}),ne=Mn("div",t,{state:G,ref:[n,H],props:[V,ek(O),y],stateAttributesMapping:jD});return h.jsxs(X0.Provider,{value:z,children:[T&&R&&h.jsx(LD,{inert:lJ(!I),cutout:A??$}),ne]})});process.env.NODE_ENV!=="production"&&(tk.displayName="ComboboxPositioner");const DJ={...jD,..._0},nk=b.forwardRef(function(t,n){const{render:r,className:o,initialFocus:i,finalFocus:s,...a}=t,l=Gn(),u=Z0(),c=_f(),{filteredItems:d}=Ii(),f=me(l,be.mounted),p=me(l,be.open),g=me(l,be.openMethod),m=me(l,be.transitionStatus),v=me(l,be.inputInsidePopup),y=me(l,be.inputElement),x=d.length===0;Of({open:p,ref:l.state.popupRef,onComplete(){p&&l.state.onOpenChangeComplete(!0)}});const w={open:p,side:u.side,align:u.align,anchorHidden:u.anchorHidden,transitionStatus:m,empty:x},C=Mn("div",t,{state:w,ref:[n,l.state.popupRef],props:[{role:v?"dialog":"presentation",tabIndex:-1,onFocus(T){const _=Nn(T.nativeEvent);g!=="touch"&&(ft(l.state.listElement,_)||_===T.currentTarget)&&l.state.inputRef.current?.focus()}},ek(m),a],stateAttributesMapping:DJ}),R=i===void 0?v?T=>T==="touch"?l.state.popupRef.current:y:!1:i;let I;return s!=null?I=s:I=v?void 0:!1,h.jsx(dZ,{context:c,disabled:!f,modal:!v,openInteractionType:g,initialFocus:R,returnFocus:I,children:C})});process.env.NODE_ENV!=="production"&&(nk.displayName="ComboboxPopup");const Q0=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(Q0.displayName="ComboboxItemContext");function rk(){const e=b.useContext(Q0);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"Base UI: ComboboxItemContext is missing. ComboboxItem parts must be placed within <Combobox.Item>.":Fr(19));return e}const ok=b.createContext(!1);process.env.NODE_ENV!=="production"&&(ok.displayName="ComboboxRowContext");function kJ(){return b.useContext(ok)}const ik=b.memo(b.forwardRef(function(t,n){const{render:r,className:o,value:i=null,index:s,disabled:a=!1,nativeButton:l=!1,...u}=t,c=b.useRef(!1),d=b.useRef(null),f=oD({index:s,textRef:d,indexGuessBehavior:rD.GuessFromOrder}),p=Gn(),g=kJ(),{flatFilteredItems:m,hasItems:v}=Ii(),y=me(p,be.open),x=me(p,be.selectionMode),w=me(p,be.readOnly),C=me(p,be.virtualized),S=me(p,be.isItemEqualToValue),R=x!=="none",I=s??(C?gd(m,i,S):f.index),T=f.index!==-1,_=me(p,be.id),$=me(p,be.isActive,I),A=me(p,be.isSelected,i),M=me(p,be.getItemProps),O=b.useRef(null),B=_!=null&&T?`${_}-${I}`:void 0,j=A&&R;Ge(()=>{if(!(T&&(C||s!=null)))return;const U=p.state.listRef.current;return U[I]=O.current,()=>{delete U[I]}},[T,C,I,s,p]),Ge(()=>{if(!T||v)return;const K=p.state.valuesRef.current;return K[I]=i,x!=="none"&&p.state.allValuesRef.current.push(i),()=>{delete K[I]}},[T,v,I,i,p,x]),Ge(()=>{if(!y){c.current=!1;return}if(!T||v)return;const K=p.state.selectedValue,U=Array.isArray(K)?K[K.length-1]:K;ns(i,U,S)&&p.set("selectedIndex",I)},[T,v,y,p,I,i,S]);const D={disabled:a,selected:j,highlighted:$},V=M({active:$,selected:j});V.id=void 0,V.onFocus=void 0;const{getButtonProps:G,buttonRef:z}=Af({disabled:a,focusableWhenDisabled:!0,native:l});function H(K){function U(){p.state.handleSelection(K,i)}p.state.submitOnItemClick?(so.flushSync(U),p.state.requestSubmit()):U()}const ne={id:B,role:g?"gridcell":"option","aria-selected":R?j:void 0,tabIndex:void 0,onPointerDownCapture(K){c.current=!0,K.preventDefault()},onClick(K){a||w||H(K.nativeEvent)},onMouseUp(K){const U=c.current;c.current=!1,!(a||w||K.button!==0||U||!$)&&H(K.nativeEvent)}},W=Mn("div",t,{ref:[z,n,f.ref,O],state:D,props:[V,ne,u,G]}),J=b.useMemo(()=>({selected:j,textRef:d}),[j,d]);return h.jsx(Q0.Provider,{value:J,children:W})}));process.env.NODE_ENV!=="production"&&(ik.displayName="ComboboxItem");const sk=b.forwardRef(function(t,n){const{render:r,className:o,children:i,...s}=t,{filteredItems:a}=Ii(),l=Gn(),u=a.length===0?i:null;return Mn("div",t,{ref:[n,l.state.emptyRef],props:[{children:u,role:"status","aria-live":"polite","aria-atomic":!0},s]})});process.env.NODE_ENV!=="production"&&(sk.displayName="ComboboxEmpty");const ak=b.forwardRef(function(t,n){const{className:r,render:o,orientation:i="horizontal",...s}=t;return Mn("div",t,{state:{orientation:i},ref:n,props:[{role:"separator","aria-orientation":i},s]})});process.env.NODE_ENV!=="production"&&(ak.displayName="Separator");function jJ(e){const{multiple:t=!1,defaultValue:n,value:r,onValueChange:o,autoComplete:i,...s}=e;return h.jsx(SJ,{...s,selectionMode:t?"multiple":"single",selectedValue:r,defaultSelectedValue:n,onSelectedValueChange:o,formAutoComplete:i})}function LJ(e){const{children:t,placeholder:n}=e,r=Gn(),o=me(r,be.itemToStringLabel),i=me(r,be.selectedValue),s=me(r,be.items),a=me(r,be.selectionMode)==="multiple",l=me(r,be.hasSelectedValue),u=!l&&n!=null&&t==null,c=me(r,be.hasNullItemLabel,u);let d=null;return typeof t=="function"?d=t(i):t!=null?d=t:!l&&n!=null&&!c?d=n:a&&Array.isArray(i)?d=hJ(i,s,o):d=FD(i,s,o),h.jsx(b.Fragment,{children:d})}const lk=b.forwardRef(function(t,n){const r=t.keepMounted??!1,{selected:o}=rk();return r||o?h.jsx(uk,{...t,ref:n}):null});process.env.NODE_ENV!=="production"&&(lk.displayName="ComboboxItemIndicator");const uk=b.memo(b.forwardRef((e,t)=>{const{render:n,className:r,keepMounted:o,...i}=e,{selected:s}=rk(),a=b.useRef(null),{transitionStatus:l,setMounted:u}=M0(s),d=Mn("span",e,{ref:[t,a],state:{selected:s,transitionStatus:l},props:[{"aria-hidden":!0,children:"✔️"},i],stateAttributesMapping:_0});return Of({open:s,ref:a,onComplete(){s||u(!1)}}),d}));process.env.NODE_ENV!=="production"&&(uk.displayName="Inner");const ck=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Gn(),a=me(s,be.open),l=me(s,be.hasSelectionChips),[u,c]=b.useState(void 0);a&&u!==void 0&&c(void 0);const d=b.useRef([]),f=Mn("div",t,{ref:[n,s.state.chipsContainerRef],props:[l?{role:"toolbar"}:En,i]}),p=b.useMemo(()=>({highlightedChipIndex:u,setHighlightedChipIndex:c,chipsRef:d}),[u,c,d]);return h.jsx(Y0.Provider,{value:p,children:h.jsx(qM,{elementsRef:d,children:f})})});process.env.NODE_ENV!=="production"&&(ck.displayName="ComboboxChips");const ex=b.createContext(void 0);process.env.NODE_ENV!=="production"&&(ex.displayName="ComboboxChipContext");function FJ(){const e=b.useContext(ex);if(!e)throw new Error(process.env.NODE_ENV!=="production"?"useComboboxChipContext must be used within a ComboboxChip":Fr(17));return e}const dk=b.forwardRef(function(t,n){const{render:r,className:o,...i}=t,s=Gn(),{setHighlightedChipIndex:a,chipsRef:l}=YD(),u=me(s,be.disabled),c=me(s,be.readOnly),d=me(s,be.selectedValue),{ref:f,index:p}=oD();function g(x){let w=p;if(x.key==="ArrowLeft")x.preventDefault(),p>0?w=p-1:w=void 0;else if(x.key==="ArrowRight")x.preventDefault(),p<d.length-1?w=p+1:w=void 0;else if(x.key==="Backspace"||x.key==="Delete"){const C=p>=d.length-1?d.length-2:p;w=C>=0?C:void 0,Tt(x),s.state.setIndices({activeIndex:null,selectedIndex:null,type:"keyboard"}),s.state.setSelectedValue(d.filter((S,R)=>R!==p),Qe(er,x.nativeEvent))}else x.key==="Enter"||x.key===" "?(Tt(x),w=void 0):x.key==="ArrowDown"||x.key==="ArrowUp"?(Tt(x),s.state.setOpen(!0,Qe(dl,x.nativeEvent)),w=void 0):x.key.length===1&&!x.ctrlKey&&!x.metaKey&&!x.altKey&&(w=void 0);return w}const v=Mn("div",t,{ref:[n,f],state:{disabled:u},props:[{tabIndex:-1,"aria-disabled":u||void 0,"aria-readonly":c||void 0,onKeyDown(x){if(u||c)return;const w=g(x);so.flushSync(()=>{a(w)}),w===void 0?s.state.inputRef.current?.focus():l.current[w]?.focus()},onMouseDown(x){c||(x.preventDefault(),!u&&s.state.inputRef.current?.focus())}},i]}),y=b.useMemo(()=>({index:p}),[p]);return h.jsx(ex.Provider,{value:y,children:v})});process.env.NODE_ENV!=="production"&&(dk.displayName="ComboboxChip");const fk=b.forwardRef(function(t,n){const{render:r,className:o,disabled:i=!1,nativeButton:s=!0,...a}=t,l=Gn(),{index:u}=FJ(),c=me(l,be.disabled),d=me(l,be.readOnly),f=me(l,be.selectedValue),p=me(l,be.isItemEqualToValue),g=c||i,{buttonRef:m,getButtonProps:v}=Af({native:s,disabled:g||d,focusableWhenDisabled:!0}),y={disabled:g};function x(S){const R=l.state.activeIndex;if(R==null)return;const I=gd(l.state.valuesRef.current,S,p);I!==-1&&R===I&&l.state.setIndices({activeIndex:null,type:l.state.keyboardActiveRef.current?"keyboard":"pointer"})}function w(S){const R=Qe(a7,S.nativeEvent),I=f[u];return x(I),l.state.setSelectedValue(f.filter((T,_)=>_!==u),R),l.state.inputRef.current?.focus(),R}return Mn("button",t,{ref:[n,m],state:y,props:[{tabIndex:-1,onClick(S){if(g||d)return;w(S).isPropagationAllowed||S.stopPropagation()},onKeyDown(S){g||d||(S.key==="Enter"||S.key===" ")&&(w(S).isPropagationAllowed||Tt(S))}},a,v]})});process.env.NODE_ENV!=="production"&&(fk.displayName="ComboboxChipRemove");function vu({className:e,type:t,...n}){return h.jsx("input",{type:t,"data-slot":"input",className:F("ui:file:text-foreground ui:placeholder:text-muted-foreground ui:selection:bg-primary ui:selection:text-primary-foreground ui:dark:bg-input/30 ui:border-input ui:h-10 ui:w-full ui:min-w-0 ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-1 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:file:inline-flex ui:file:h-7 ui:file:border-0 ui:file:bg-transparent ui:file:text-sm ui:file:font-medium ui:disabled:pointer-events-none ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm","ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:focus-visible:ring-[3px]","ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive",e),...n})}function pk({className:e,...t}){return h.jsx("textarea",{"data-slot":"textarea",className:F("ui:border-input ui:placeholder:text-muted-foreground ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:aria-invalid:ring-destructive/20 ui:dark:aria-invalid:ring-destructive/40 ui:aria-invalid:border-destructive ui:dark:bg-input/30 ui:flex ui:field-sizing-content ui:min-h-16 ui:w-full ui:rounded-md ui:border ui:bg-transparent ui:px-3 ui:py-2 ui:text-base ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:md:text-sm",e),...t})}function BJ({className:e,...t}){return h.jsx("div",{"data-slot":"input-group",role:"group",className:F("ui:group/input-group ui:border-input ui:dark:bg-input/30 ui:relative ui:flex ui:w-full ui:items-center ui:rounded-md ui:border ui:shadow-xs ui:transition-[color,box-shadow] ui:outline-none","ui:h-9 ui:min-w-0 ui:has-[>textarea]:h-auto","ui:has-[>[data-align=inline-start]]:[&>input]:pl-2","ui:has-[>[data-align=inline-end]]:[&>input]:pr-2","ui:has-[>[data-align=block-start]]:h-auto ui:has-[>[data-align=block-start]]:flex-col ui:has-[>[data-align=block-start]]:[&>input]:pb-3","ui:has-[>[data-align=block-end]]:h-auto ui:has-[>[data-align=block-end]]:flex-col ui:has-[>[data-align=block-end]]:[&>input]:pt-3","ui:has-[[data-slot=input-group-control]:focus-visible]:border-ring ui:has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 ui:has-[[data-slot=input-group-control]:focus-visible]:ring-[3px]","ui:has-[[data-slot][aria-invalid=true]]:ring-destructive/20 ui:has-[[data-slot][aria-invalid=true]]:border-destructive ui:dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40",e),...t})}const VJ=Si("ui:text-muted-foreground ui:flex ui:h-auto ui:cursor-text ui:items-center ui:justify-center ui:gap-2 ui:py-1.5 ui:text-sm ui:font-medium ui:select-none ui:[&>svg:not([class*=size-])]:size-4 ui:[&>kbd]:rounded-[calc(var(--radius)-5px)] ui:group-data-[disabled=true]/input-group:opacity-50",{variants:{align:{"inline-start":"ui:order-first ui:pl-3 ui:has-[>button]:ml-[-0.45rem] ui:has-[>kbd]:ml-[-0.35rem]","inline-end":"ui:order-last ui:pr-3 ui:has-[>button]:mr-[-0.45rem] ui:has-[>kbd]:mr-[-0.35rem]","block-start":"ui:order-first ui:w-full ui:justify-start ui:px-3 ui:pt-3 ui:[.border-b]:pb-3 ui:group-has-[>input]/input-group:pt-2.5","block-end":"ui:order-last ui:w-full ui:justify-start ui:px-3 ui:pb-3 ui:[.border-t]:pt-3 ui:group-has-[>input]/input-group:pb-2.5"}},defaultVariants:{align:"inline-start"}});function $J({className:e,align:t="inline-start",...n}){return h.jsx("div",{role:"group","data-slot":"input-group-addon","data-align":t,className:F(VJ({align:t}),e),onClick:r=>{r.target.closest("button")||r.currentTarget.parentElement?.querySelector("input")?.focus()},...n})}const GJ=Si("ui:text-sm ui:shadow-none ui:flex ui:gap-2 ui:items-center",{variants:{size:{xs:"ui:h-6 ui:gap-1 ui:px-2 ui:rounded-[calc(var(--radius)-5px)] ui:[&>svg:not([class*=size-])]:size-3.5 ui:has-[>svg]:px-2",sm:"ui:h-8 ui:px-2.5 ui:gap-1.5 ui:rounded-md ui:has-[>svg]:px-2.5","icon-xs":"ui:size-6 ui:rounded-[calc(var(--radius)-5px)] ui:p-0 ui:has-[>svg]:p-0","icon-sm":"ui:size-8 ui:p-0 ui:has-[>svg]:p-0"}},defaultVariants:{size:"xs"}});function hk({className:e,type:t="button",variant:n="ghost",size:r="xs",...o}){return h.jsx(on,{type:t,"data-size":r,variant:n,className:F(GJ({size:r}),e),...o})}function HJ({className:e,...t}){return h.jsx(vu,{"data-slot":"input-group-control",className:F("ui:flex-1 ui:rounded-none ui:border-0 ui:bg-transparent ui:shadow-none ui:focus-visible:ring-0 ui:dark:bg-transparent",e),...t})}const WJ=jJ;function km({...e}){return h.jsx(LJ,{"data-slot":"combobox-value",...e})}function gk({className:e,children:t,...n}){return h.jsxs(UD,{"data-slot":"combobox-trigger",className:F("ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(_e.ChevronDownIcon,{"data-slot":"combobox-trigger-icon",className:"ui:text-muted-foreground ui:pointer-events-none ui:size-4"})]})}function zJ({className:e,...t}){return h.jsx(XD,{"data-slot":"combobox-clear",render:h.jsx(hk,{variant:"ghost",size:"icon-xs",className:"ui:rounded-md"}),className:F(e),...t,children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})}function tI({className:e,children:t,disabled:n=!1,showTrigger:r=!0,showClear:o=!1,...i}){return h.jsxs(BJ,{className:F("ui:w-auto ui:shrink-0",e),children:[h.jsx(J0,{render:h.jsx(HJ,{disabled:n}),...i}),h.jsxs($J,{align:"inline-end",children:[r&&h.jsx(hk,{size:"icon-xs",variant:"ghost",asChild:!0,"data-slot":"input-group-button",className:"ui:group-has-data-[slot=combobox-clear]/input-group:hidden ui:data-pressed:bg-transparent",disabled:n,children:h.jsx(gk,{className:"ui:rounded-md"})}),o&&h.jsx(zJ,{disabled:n})]}),t]})}function qJ({className:e,side:t="bottom",sideOffset:n=6,align:r="start",alignOffset:o=0,anchor:i,...s}){return h.jsx(KD,{children:h.jsx(tk,{side:t,sideOffset:n,align:r,alignOffset:o,anchor:i,className:"ui:isolate ui:z-50",children:h.jsx(nk,{"data-slot":"combobox-content","data-chips":!!i,className:F("ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:flex ui:min-h-0 ui:max-h-96 ui:flex-col ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",e),...s})})})}function UJ({className:e,...t}){return h.jsx(JD,{"data-slot":"combobox-list",className:F("ui:min-h-0 ui:flex-1 ui:overflow-y-auto ui:scroll-py-1 ui:p-1 ui:data-empty:p-0",e),...t})}function YJ({className:e,children:t,...n}){return h.jsxs(ik,{"data-slot":"combobox-item",className:F("ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",e),...n,children:[t,h.jsx(lk,{"data-slot":"combobox-item-indicator",render:h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center"}),children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4 ui:pointer-coarse:size-5"})})]})}function XJ({className:e,...t}){return h.jsx(sk,{"data-slot":"combobox-empty",className:F("ui:hidden ui:w-full ui:shrink-0 ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:text-muted-foreground ui:group-data-empty/combobox-content:flex",e),...t})}function ZJ({className:e,...t}){return h.jsx(ak,{"data-slot":"combobox-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function JJ({className:e,...t}){return h.jsx(ck,{"data-slot":"combobox-chips",className:F("ui:dark:bg-input/30 ui:border-input ui:focus-within:border-ring ui:focus-within:ring-ring/50 ui:has-aria-invalid:ring-destructive/20 ui:dark:has-aria-invalid:ring-destructive/40 ui:has-aria-invalid:border-destructive ui:dark:has-aria-invalid:border-destructive/50 ui:flex ui:min-h-9 ui:flex-wrap ui:items-center ui:gap-1.5 ui:rounded-md ui:border ui:bg-transparent ui:bg-clip-padding ui:px-2.5 ui:py-1.5 ui:text-sm ui:shadow-xs ui:transition-[color,box-shadow] ui:focus-within:ring-[3px] ui:has-aria-invalid:ring-[3px] ui:has-data-[slot=combobox-chip]:px-1.5",e),...t})}function KJ({className:e,children:t,showRemove:n=!0,...r}){return h.jsxs(dk,{"data-slot":"combobox-chip",className:F("ui:bg-muted ui:text-foreground ui:flex ui:h-[calc(--spacing(5.5))] ui:w-fit ui:items-center ui:justify-center ui:gap-1 ui:rounded-sm ui:px-1.5 ui:text-xs ui:font-medium ui:whitespace-nowrap ui:has-disabled:pointer-events-none ui:has-disabled:cursor-not-allowed ui:has-disabled:opacity-50 ui:has-data-[slot=combobox-chip-remove]:pr-0",e),...r,children:[t,n&&h.jsx(fk,{render:h.jsx(on,{variant:"ghost",size:"xs",className:"ui:hover:bg-transparent"}),className:"ui:-ml-1 ui:opacity-50 ui:hover:opacity-100","data-slot":"combobox-chip-remove",children:h.jsx(_e.XIcon,{className:"ui:pointer-events-none"})})]})}function QJ({className:e,...t}){return h.jsx(J0,{"data-slot":"combobox-chip-input",className:F("ui:min-w-16 ui:flex-1 ui:outline-none",e),...t})}function eK(){return b.useRef(null)}const tK=e=>e.label,nK=(e,t)=>e.value===t.value,tx=({items:e,label:t,multiple:n=!1,hasClearButton:r=!1,disabled:o=!1,placeholder:i="Select...",containerClassName:s,emptyMessage:a="No results found.",hasAllOption:l=!1,allOptionLabel:u="All",inputMode:c="input",renderPopupTrigger:d,onInputChange:f,value:p,onValueChange:g})=>{const m=eK(),v=p??[],y=N.useMemo(()=>e.filter(R=>!R.disabled),[e]),x=n&&v.length===y.length&&y.length>0,w=N.useCallback(()=>{const I=v.length===y.length&&y.length>0?[]:y;g(I)},[y,v.length,g]),C=N.useCallback(R=>{Array.isArray(R)?g(R):g(R===null?[]:[R])},[g]),S=N.useCallback(R=>{f?.(R.target.value)},[f]);return h.jsxs("article",{className:s,children:[t&&h.jsx(gr,{className:"ui:mb-2",children:t}),h.jsxs(WJ,{multiple:n,autoHighlight:!0,items:e,itemToStringValue:tK,isItemEqualToValue:nK,disabled:o,value:n?v:v[0]??null,onValueChange:C,children:[h.jsxs(_r,{children:[h.jsx(rn,{condition:c==="popup",children:h.jsx(gk,{render:d?d(h.jsx(km,{placeholder:i}),v):h.jsx(on,{variant:"outline",className:"ui:w-full ui:font-normal ui:text-left ui:overflow-hidden ui:truncate ui:line-clamp-1",children:h.jsx(km,{placeholder:i})})})}),h.jsx(rn,{condition:n&&c==="input",children:h.jsx(JJ,{ref:m,className:"ui:w-full",children:h.jsx(km,{children:R=>h.jsxs(N.Fragment,{children:[R.map(I=>h.jsx(KJ,{children:I.label},I.value)),h.jsx(QJ,{placeholder:R.length?"":i,onChange:S})]})})})}),h.jsx(rn,{condition:!n&&c==="input",children:h.jsx(tI,{className:"ui:w-full",placeholder:i,showClear:r,disabled:o,onChange:S})})]}),h.jsxs(qJ,{className:"ui:min-w-64",anchor:m&&n&&c==="input"?m:void 0,children:[c==="popup"&&h.jsx(tI,{showTrigger:!1,placeholder:"Search...",onChange:S}),h.jsx(XJ,{children:a}),l&&n&&h.jsxs("div",{className:"ui:shrink-0 ui:group-data-empty/combobox-content:hidden",children:[h.jsx("div",{className:F("ui:p-1 ui:pb-0",c==="popup"?"ui:mt-1":""),children:h.jsxs("div",{role:"option","aria-selected":x,onClick:w,className:F("ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none","ui:hover:bg-accent ui:hover:text-accent-foreground"),children:[u,x&&h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:right-2 ui:flex ui:size-4 ui:items-center ui:justify-center",children:h.jsx(_e.CheckIcon,{className:"ui:pointer-events-none ui:size-4"})})]})}),h.jsx(ZJ,{})]}),h.jsx(UJ,{children:R=>h.jsx(YJ,{value:R,disabled:!!R?.disabled,children:R.label},R.value)})]})]})]})},rK="dd/MM/yyyy",oK=({date:e,format:t=rK})=>e?h.jsx(h.Fragment,{children:Ws(e,t)}):null;function nx({...e}){return h.jsx(Z3,{"data-slot":"popover",...e})}const Mf=b.forwardRef(({...e},t)=>h.jsx(mN,{"data-slot":"popover-trigger",ref:t,...e}));Mf.displayName=mN.displayName;const Df=b.forwardRef(({className:e,align:t="center",sideOffset:n=4,...r},o)=>h.jsx(J3,{children:h.jsx(bN,{ref:o,"data-slot":"popover-content",align:t,sideOffset:n,className:F("ui-lib-root ui:z-[102] ui:w-72 ui:rounded-md ui:border ui:bg-popover ui:p-4 ui:text-popover-foreground ui:shadow-md ui:outline-none ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2",e),...r})}));Df.displayName=bN.displayName;const mk=b.forwardRef(({...e},t)=>h.jsx(gN,{"data-slot":"popover-anchor",ref:t,...e}));mk.displayName=gN.displayName;const bk=({start:e,end:t,onConfirm:n,className:r,triggerButtonClassName:o,label:i,placeholder:s,confirmLabel:a="Confirm",disabledCondition:l,dateLocale:u})=>{const[c,d]=N.useState(!1),[f,p]=N.useState(e&&t?{from:e,to:t}:void 0),g=()=>{!f?.from||!f?.to||(n({from:f.from,to:f.to}),d(!1))};return h.jsxs("div",{className:F("ui:grid ui:gap-2",r),children:[i&&h.jsx(gr,{children:i}),h.jsxs(nx,{open:c,onOpenChange:d,children:[h.jsx(Mf,{asChild:!0,children:h.jsxs(on,{id:"date",variant:"outline",className:F("ui:h-auto ui:text-muted-foreground ui:justify-start ui:text-left ui:font-normal",!f&&"ui:text-muted-foreground",o),children:[h.jsx(_e.Calendar,{className:"ui:h-4 ui:w-4"}),f?.from?f.to?h.jsxs(h.Fragment,{children:[Ws(f.from,"LLL dd, y",{locale:u})," -",Ws(f.to,"LLL dd, y",{locale:u})]}):Ws(f.from,"LLL dd, y",{locale:u}):h.jsx("span",{children:s})]})}),h.jsxs(Df,{className:"ui:w-auto ui:p-0",align:"start",children:[h.jsx(e0,{mode:"range",defaultMonth:f?.from??new Date,selected:f,onSelect:p,numberOfMonths:2,disabled:l,locale:u}),h.jsx("div",{className:F("ui:px-3 ui:pb-4 ui:pt-2","ui:flex ui:justify-start ui:md:justify-end"),children:h.jsx(on,{variant:"success",onClick:g,className:"ui:w-full ui:md:w-max",children:a})})]})]})]})};function vk({value:e,onChange:t,className:n,inputClassName:r,name:o,placeholder:i,label:s}){const[a,l]=N.useState(e),u=N.useRef(null),c=N.useRef(t);N.useEffect(()=>{c.current=t},[t]);const d=N.useCallback(p=>{u.current&&clearTimeout(u.current),u.current=setTimeout(()=>{p.length>=3?c.current(p):c.current("")},300)},[]),f=p=>{const g=decodeURIComponent(p);l(g),d(g)};return h.jsxs("search",{className:F("ui:w-full",n),children:[s&&h.jsx(gr,{htmlFor:o,className:"ui:leading-6 ui:w-full ui:mb-2",children:s}),h.jsx(vu,{type:"search",name:o,id:o,"data-test-id":o,placeholder:i,value:a,onChange:({target:p})=>f(p.value),className:F("ui:max-h-10",r),autoFocus:!0})]})}const iK=({banner:e,campaignName:t,isControlled:n,open:r,setOpen:o,imageClassName:i})=>h.jsxs(S0,{...n&&{open:r,onOpenChange:o},children:[!n&&h.jsx(FM,{asChild:!0,children:h.jsx("div",{className:"ui:cursor-pointer",children:h.jsx("img",{className:F("ui:w-full ui:max-w-80 ui:mx-auto ui:mt-4! ui:scale-100 ui:hover:scale-110 ui:transition-all ui:duration-300 ui:aspect-video",i),src:e,alt:t})})}),h.jsxs(E0,{className:"ui:max-w-2xl",children:[h.jsx(I0,{children:h.jsx(R0,{children:t})}),h.jsx("img",{className:F("ui:w-full ui:aspect-video",i),src:e,alt:t})]})]});function sK(e){if(typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],n=document.createElement("style");n.type="text/css",t.appendChild(n),n.styleSheet?n.styleSheet.cssText=e:n.appendChild(document.createTextNode(e))}const yk=N.createContext({drawerRef:{current:null},overlayRef:{current:null},onPress:()=>{},onRelease:()=>{},onDrag:()=>{},onNestedDrag:()=>{},onNestedOpenChange:()=>{},onNestedRelease:()=>{},openProp:void 0,dismissible:!1,isOpen:!1,isDragging:!1,keyboardIsOpen:{current:!1},snapPointsOffset:null,snapPoints:null,handleOnly:!1,modal:!1,shouldFade:!1,activeSnapPoint:null,onOpenChange:()=>{},setActiveSnapPoint:()=>{},closeDrawer:()=>{},direction:"bottom",shouldAnimate:{current:!0},shouldScaleBackground:!1,setBackgroundColorOnScale:!0,noBodyStyles:!1,container:null,autoFocus:!1}),yu=()=>{const e=N.useContext(yk);if(!e)throw new Error("useDrawerContext must be used within a Drawer.Root");return e};sK(`[data-vaul-drawer]{touch-action:none;will-change:transform;transition:transform .5s cubic-bezier(.32, .72, 0, 1);animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=open]{animation-name:slideFromBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=bottom][data-state=closed]{animation-name:slideToBottom}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=open]{animation-name:slideFromTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=top][data-state=closed]{animation-name:slideToTop}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=open]{animation-name:slideFromLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=left][data-state=closed]{animation-name:slideToLeft}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=open]{animation-name:slideFromRight}[data-vaul-drawer][data-vaul-snap-points=false][data-vaul-drawer-direction=right][data-state=closed]{animation-name:slideToRight}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--initial-transform,100%),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}[data-vaul-drawer][data-vaul-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--initial-transform,100%),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=top]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=bottom]{transform:translate3d(0,var(--snap-point-height,0),0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=left]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-drawer][data-vaul-delayed-snap-points=true][data-vaul-drawer-direction=right]{transform:translate3d(var(--snap-point-height,0),0,0)}[data-vaul-overlay][data-vaul-snap-points=false]{animation-duration:.5s;animation-timing-function:cubic-bezier(0.32,0.72,0,1)}[data-vaul-overlay][data-vaul-snap-points=false][data-state=open]{animation-name:fadeIn}[data-vaul-overlay][data-state=closed]{animation-name:fadeOut}[data-vaul-animate=false]{animation:none!important}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:0;transition:opacity .5s cubic-bezier(.32, .72, 0, 1)}[data-vaul-overlay][data-vaul-snap-points=true]{opacity:1}[data-vaul-drawer]:not([data-vaul-custom-container=true])::after{content:'';position:absolute;background:inherit;background-color:inherit}[data-vaul-drawer][data-vaul-drawer-direction=top]::after{top:initial;bottom:100%;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=bottom]::after{top:100%;bottom:initial;left:0;right:0;height:200%}[data-vaul-drawer][data-vaul-drawer-direction=left]::after{left:initial;right:100%;top:0;bottom:0;width:200%}[data-vaul-drawer][data-vaul-drawer-direction=right]::after{left:100%;right:initial;top:0;bottom:0;width:200%}[data-vaul-overlay][data-vaul-snap-points=true]:not([data-vaul-snap-points-overlay=true]):not(
|
|
87
87
|
[data-state=closed]
|
|
88
88
|
){opacity:0}[data-vaul-overlay][data-vaul-snap-points-overlay=true]{opacity:1}[data-vaul-handle]{display:block;position:relative;opacity:.7;background:#e2e2e4;margin-left:auto;margin-right:auto;height:5px;width:32px;border-radius:1rem;touch-action:pan-y}[data-vaul-handle]:active,[data-vaul-handle]:hover{opacity:1}[data-vaul-handle-hitarea]{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);width:max(100%,2.75rem);height:max(100%,2.75rem);touch-action:inherit}@media (hover:hover) and (pointer:fine){[data-vaul-drawer]{user-select:none}}@media (pointer:fine){[data-vaul-handle-hitarea]:{width:100%;height:100%}}@keyframes fadeIn{from{opacity:0}to{opacity:1}}@keyframes fadeOut{to{opacity:0}}@keyframes slideFromBottom{from{transform:translate3d(0,var(--initial-transform,100%),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToBottom{to{transform:translate3d(0,var(--initial-transform,100%),0)}}@keyframes slideFromTop{from{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}to{transform:translate3d(0,0,0)}}@keyframes slideToTop{to{transform:translate3d(0,calc(var(--initial-transform,100%) * -1),0)}}@keyframes slideFromLeft{from{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToLeft{to{transform:translate3d(calc(var(--initial-transform,100%) * -1),0,0)}}@keyframes slideFromRight{from{transform:translate3d(var(--initial-transform,100%),0,0)}to{transform:translate3d(0,0,0)}}@keyframes slideToRight{to{transform:translate3d(var(--initial-transform,100%),0,0)}}`);function aK(){const e=navigator.userAgent;return typeof window<"u"&&(/Firefox/.test(e)&&/Mobile/.test(e)||/FxiOS/.test(e))}function lK(){return rx(/^Mac/)}function uK(){return rx(/^iPhone/)}function nI(){return/^((?!chrome|android).)*safari/i.test(navigator.userAgent)}function cK(){return rx(/^iPad/)||lK()&&navigator.maxTouchPoints>1}function xk(){return uK()||cK()}function rx(e){return typeof window<"u"&&window.navigator!=null?e.test(window.navigator.platform):void 0}const dK=24,fK=typeof window<"u"?N.useLayoutEffect:N.useEffect;function rI(...e){return(...t)=>{for(let n of e)typeof n=="function"&&n(...t)}}const jm=typeof document<"u"&&window.visualViewport;function oI(e){let t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function wk(e){for(oI(e)&&(e=e.parentElement);e&&!oI(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}const pK=new Set(["checkbox","radio","range","color","file","image","button","submit","reset"]);let sc=0,Lm;function hK(e={}){let{isDisabled:t}=e;fK(()=>{if(!t)return sc++,sc===1&&xk()&&(Lm=gK()),()=>{sc--,sc===0&&Lm?.()}},[t])}function gK(){let e,t=0,n=d=>{e=wk(d.target),!(e===document.documentElement&&e===document.body)&&(t=d.changedTouches[0].pageY)},r=d=>{if(!e||e===document.documentElement||e===document.body){d.preventDefault();return}let f=d.changedTouches[0].pageY,p=e.scrollTop,g=e.scrollHeight-e.clientHeight;g!==0&&((p<=0&&f>t||p>=g&&f<t)&&d.preventDefault(),t=f)},o=d=>{let f=d.target;bv(f)&&f!==document.activeElement&&(d.preventDefault(),f.style.transform="translateY(-2000px)",f.focus(),requestAnimationFrame(()=>{f.style.transform=""}))},i=d=>{let f=d.target;bv(f)&&(f.style.transform="translateY(-2000px)",requestAnimationFrame(()=>{f.style.transform="",jm&&(jm.height<window.innerHeight?requestAnimationFrame(()=>{iI(f)}):jm.addEventListener("resize",()=>iI(f),{once:!0}))}))},s=()=>{window.scrollTo(0,0)},a=window.pageXOffset,l=window.pageYOffset,u=rI(mK(document.documentElement,"paddingRight",`${window.innerWidth-document.documentElement.clientWidth}px`));window.scrollTo(0,0);let c=rI(Ga(document,"touchstart",n,{passive:!1,capture:!0}),Ga(document,"touchmove",r,{passive:!1,capture:!0}),Ga(document,"touchend",o,{passive:!1,capture:!0}),Ga(document,"focus",i,!0),Ga(window,"scroll",s));return()=>{u(),c(),window.scrollTo(a,l)}}function mK(e,t,n){let r=e.style[t];return e.style[t]=n,()=>{e.style[t]=r}}function Ga(e,t,n,r){return e.addEventListener(t,n,r),()=>{e.removeEventListener(t,n,r)}}function iI(e){let t=document.scrollingElement||document.documentElement;for(;e&&e!==t;){let n=wk(e);if(n!==document.documentElement&&n!==document.body&&n!==e){let r=n.getBoundingClientRect().top,o=e.getBoundingClientRect().top,i=e.getBoundingClientRect().bottom;const s=n.getBoundingClientRect().bottom+dK;i>s&&(n.scrollTop+=o-r)}e=n.parentElement}}function bv(e){return e instanceof HTMLInputElement&&!pK.has(e.type)||e instanceof HTMLTextAreaElement||e instanceof HTMLElement&&e.isContentEditable}function bK(e,t){typeof e=="function"?e(t):e!=null&&(e.current=t)}function vK(...e){return t=>e.forEach(n=>bK(n,t))}function Ck(...e){return b.useCallback(vK(...e),e)}const Sk=new WeakMap;function en(e,t,n=!1){if(!e||!(e instanceof HTMLElement))return;let r={};Object.entries(t).forEach(([o,i])=>{if(o.startsWith("--")){e.style.setProperty(o,i);return}r[o]=e.style[o],e.style[o]=i}),!n&&Sk.set(e,r)}function yK(e,t){if(!e||!(e instanceof HTMLElement))return;let n=Sk.get(e);n&&(e.style[t]=n[t])}const Ut=e=>{switch(e){case"top":case"bottom":return!0;case"left":case"right":return!1;default:return e}};function ac(e,t){if(!e)return null;const n=window.getComputedStyle(e),r=n.transform||n.webkitTransform||n.mozTransform;let o=r.match(/^matrix3d\((.+)\)$/);return o?parseFloat(o[1].split(", ")[Ut(t)?13:12]):(o=r.match(/^matrix\((.+)\)$/),o?parseFloat(o[1].split(", ")[Ut(t)?5:4]):null)}function xK(e){return 8*(Math.log(e+1)-2)}function Fm(e,t){if(!e)return()=>{};const n=e.style.cssText;return Object.assign(e.style,t),()=>{e.style.cssText=n}}function wK(...e){return(...t)=>{for(const n of e)typeof n=="function"&&n(...t)}}const kt={DURATION:.5,EASE:[.32,.72,0,1]},Ek=.4,CK=.25,SK=100,Ik=8,Gi=16,vv=26,Bm="vaul-dragging";function Rk(e){const t=N.useRef(e);return N.useEffect(()=>{t.current=e}),N.useMemo(()=>(...n)=>t.current==null?void 0:t.current.call(t,...n),[])}function EK({defaultProp:e,onChange:t}){const n=N.useState(e),[r]=n,o=N.useRef(r),i=Rk(t);return N.useEffect(()=>{o.current!==r&&(i(r),o.current=r)},[r,o,i]),n}function Ak({prop:e,defaultProp:t,onChange:n=()=>{}}){const[r,o]=EK({defaultProp:t,onChange:n}),i=e!==void 0,s=i?e:r,a=Rk(n),l=N.useCallback(u=>{if(i){const d=typeof u=="function"?u(e):u;d!==e&&a(d)}else o(u)},[i,e,o,a]);return[s,l]}function IK({activeSnapPointProp:e,setActiveSnapPointProp:t,snapPoints:n,drawerRef:r,overlayRef:o,fadeFromIndex:i,onSnapPointChange:s,direction:a="bottom",container:l,snapToSequentialPoint:u}){const[c,d]=Ak({prop:e,defaultProp:n?.[0],onChange:t}),[f,p]=N.useState(typeof window<"u"?{innerWidth:window.innerWidth,innerHeight:window.innerHeight}:void 0);N.useEffect(()=>{function I(){p({innerWidth:window.innerWidth,innerHeight:window.innerHeight})}return window.addEventListener("resize",I),()=>window.removeEventListener("resize",I)},[]);const g=N.useMemo(()=>c===n?.[n.length-1]||null,[n,c]),m=N.useMemo(()=>{var I;return(I=n?.findIndex(T=>T===c))!=null?I:null},[n,c]),v=n&&n.length>0&&(i||i===0)&&!Number.isNaN(i)&&n[i]===c||!n,y=N.useMemo(()=>{const I=l?{width:l.getBoundingClientRect().width,height:l.getBoundingClientRect().height}:typeof window<"u"?{width:window.innerWidth,height:window.innerHeight}:{width:0,height:0};var T;return(T=n?.map(_=>{const $=typeof _=="string";let A=0;if($&&(A=parseInt(_,10)),Ut(a)){const O=$?A:f?_*I.height:0;return f?a==="bottom"?I.height-O:-I.height+O:O}const M=$?A:f?_*I.width:0;return f?a==="right"?I.width-M:-I.width+M:M}))!=null?T:[]},[n,f,l]),x=N.useMemo(()=>m!==null?y?.[m]:null,[y,m]),w=N.useCallback(I=>{var T;const _=(T=y?.findIndex($=>$===I))!=null?T:null;s(_),en(r.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Ut(a)?`translate3d(0, ${I}px, 0)`:`translate3d(${I}px, 0, 0)`}),y&&_!==y.length-1&&i!==void 0&&_!==i&&_<i?en(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"0"}):en(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),d(n?.[Math.max(_,0)])},[r.current,n,y,i,o,d]);N.useEffect(()=>{if(c||e){var I;const T=(I=n?.findIndex(_=>_===e||_===c))!=null?I:-1;y&&T!==-1&&typeof y[T]=="number"&&w(y[T])}},[c,e,n,y,w]);function C({draggedDistance:I,closeDrawer:T,velocity:_,dismissible:$}){if(i===void 0)return;const A=a==="bottom"||a==="right"?(x??0)-I:(x??0)+I,M=m===i-1,O=m===0,B=I>0;if(M&&en(o.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),!u&&_>2&&!B){$?T():w(y[0]);return}if(!u&&_>2&&B&&y&&n){w(y[n.length-1]);return}const j=y?.reduce((V,G)=>typeof V!="number"||typeof G!="number"?V:Math.abs(G-A)<Math.abs(V-A)?G:V),D=Ut(a)?window.innerHeight:window.innerWidth;if(_>Ek&&Math.abs(I)<D*.4){const V=B?1:-1;if(V>0&&g&&n){w(y[n.length-1]);return}if(O&&V<0&&$&&T(),m===null)return;w(y[m+V]);return}w(j)}function S({draggedDistance:I}){if(x===null)return;const T=a==="bottom"||a==="right"?x-I:x+I;(a==="bottom"||a==="right")&&T<y[y.length-1]||(a==="top"||a==="left")&&T>y[y.length-1]||en(r.current,{transform:Ut(a)?`translate3d(0, ${T}px, 0)`:`translate3d(${T}px, 0, 0)`})}function R(I,T){if(!n||typeof m!="number"||!y||i===void 0)return null;const _=m===i-1;if(m>=i&&T)return 0;if(_&&!T)return 1;if(!v&&!_)return null;const A=_?m+1:m-1,M=_?y[A]-y[A-1]:y[A+1]-y[A],O=I/Math.abs(M);return _?1-O:O}return{isLastSnapPoint:g,activeSnapPoint:c,shouldFade:v,getPercentageDragged:R,setActiveSnapPoint:d,activeSnapPointIndex:m,onRelease:C,onDrag:S,snapPointsOffset:y}}const RK=()=>()=>{};function AK(){const{direction:e,isOpen:t,shouldScaleBackground:n,setBackgroundColorOnScale:r,noBodyStyles:o}=yu(),i=N.useRef(null),s=N.useMemo(()=>document.body.style.backgroundColor,[]);function a(){return(window.innerWidth-vv)/window.innerWidth}N.useEffect(()=>{if(t&&n){i.current&&clearTimeout(i.current);const l=document.querySelector("[data-vaul-drawer-wrapper]")||document.querySelector("[vaul-drawer-wrapper]");if(!l)return;wK(r&&!o?Fm(document.body,{background:"black"}):RK,Fm(l,{transformOrigin:Ut(e)?"top":"left",transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`}));const u=Fm(l,{borderRadius:`${Ik}px`,overflow:"hidden",...Ut(e)?{transform:`scale(${a()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`}:{transform:`scale(${a()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`}});return()=>{u(),i.current=window.setTimeout(()=>{s?document.body.style.background=s:document.body.style.removeProperty("background")},kt.DURATION*1e3)}}},[t,n,s])}let Ha=null;function TK({isOpen:e,modal:t,nested:n,hasBeenOpened:r,preventScrollRestoration:o,noBodyStyles:i}){const[s,a]=N.useState(()=>typeof window<"u"?window.location.href:""),l=N.useRef(0),u=N.useCallback(()=>{if(nI()&&Ha===null&&e&&!i){Ha={position:document.body.style.position,top:document.body.style.top,left:document.body.style.left,height:document.body.style.height,right:"unset"};const{scrollX:d,innerHeight:f}=window;document.body.style.setProperty("position","fixed","important"),Object.assign(document.body.style,{top:`${-l.current}px`,left:`${-d}px`,right:"0px",height:"auto"}),window.setTimeout(()=>window.requestAnimationFrame(()=>{const p=f-window.innerHeight;p&&l.current>=f&&(document.body.style.top=`${-(l.current+p)}px`)}),300)}},[e]),c=N.useCallback(()=>{if(nI()&&Ha!==null&&!i){const d=-parseInt(document.body.style.top,10),f=-parseInt(document.body.style.left,10);Object.assign(document.body.style,Ha),window.requestAnimationFrame(()=>{if(o&&s!==window.location.href){a(window.location.href);return}window.scrollTo(f,d)}),Ha=null}},[s]);return N.useEffect(()=>{function d(){l.current=window.scrollY}return d(),window.addEventListener("scroll",d),()=>{window.removeEventListener("scroll",d)}},[]),N.useEffect(()=>{if(t)return()=>{typeof document>"u"||document.querySelector("[data-vaul-drawer]")||c()}},[t,c]),N.useEffect(()=>{n||!r||(e?(!window.matchMedia("(display-mode: standalone)").matches&&u(),t||window.setTimeout(()=>{c()},500)):c())},[e,r,s,t,n,u,c]),{restorePositionSetting:c}}function OK({open:e,onOpenChange:t,children:n,onDrag:r,onRelease:o,snapPoints:i,shouldScaleBackground:s=!1,setBackgroundColorOnScale:a=!0,closeThreshold:l=CK,scrollLockTimeout:u=SK,dismissible:c=!0,handleOnly:d=!1,fadeFromIndex:f=i&&i.length-1,activeSnapPoint:p,setActiveSnapPoint:g,fixed:m,modal:v=!0,onClose:y,nested:x,noBodyStyles:w=!1,direction:C="bottom",defaultOpen:S=!1,disablePreventScroll:R=!0,snapToSequentialPoint:I=!1,preventScrollRestoration:T=!1,repositionInputs:_=!0,onAnimationEnd:$,container:A,autoFocus:M=!1}){var O,B;const[j=!1,D]=Ak({defaultProp:S,prop:e,onChange:ee=>{t?.(ee),!ee&&!x&&Xe(),setTimeout(()=>{$?.(ee)},kt.DURATION*1e3),ee&&!v&&typeof window<"u"&&window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"}),ee||(document.body.style.pointerEvents="auto")}}),[V,G]=N.useState(!1),[z,H]=N.useState(!1),[ne,W]=N.useState(!1),J=N.useRef(null),K=N.useRef(null),U=N.useRef(null),oe=N.useRef(null),X=N.useRef(null),te=N.useRef(!1),Q=N.useRef(null),se=N.useRef(0),ae=N.useRef(!1),L=N.useRef(!S),Z=N.useRef(0),k=N.useRef(null),ie=N.useRef(((O=k.current)==null?void 0:O.getBoundingClientRect().height)||0),Y=N.useRef(((B=k.current)==null?void 0:B.getBoundingClientRect().width)||0),le=N.useRef(0),pe=N.useCallback(ee=>{i&&ee===we.length-1&&(K.current=new Date)},[]),{activeSnapPoint:re,activeSnapPointIndex:fe,setActiveSnapPoint:de,onRelease:ve,snapPointsOffset:we,onDrag:Se,shouldFade:Ye,getPercentageDragged:at}=IK({snapPoints:i,activeSnapPointProp:p,setActiveSnapPointProp:g,drawerRef:k,fadeFromIndex:f,overlayRef:J,onSnapPointChange:pe,direction:C,container:A,snapToSequentialPoint:I});hK({isDisabled:!j||z||!v||ne||!V||!_||!R});const{restorePositionSetting:Xe}=TK({isOpen:j,modal:v,nested:x??!1,hasBeenOpened:V,preventScrollRestoration:T,noBodyStyles:w});function Ue(){return(window.innerWidth-vv)/window.innerWidth}function rt(ee){var ye,ge;!c&&!i||k.current&&!k.current.contains(ee.target)||(ie.current=((ye=k.current)==null?void 0:ye.getBoundingClientRect().height)||0,Y.current=((ge=k.current)==null?void 0:ge.getBoundingClientRect().width)||0,H(!0),U.current=new Date,xk()&&window.addEventListener("touchend",()=>te.current=!1,{once:!0}),ee.target.setPointerCapture(ee.pointerId),se.current=Ut(C)?ee.pageY:ee.pageX)}function et(ee,ye){var ge;let xe=ee;const Ae=(ge=window.getSelection())==null?void 0:ge.toString(),Ie=k.current?ac(k.current,C):null,qe=new Date;if(xe.tagName==="SELECT"||xe.hasAttribute("data-vaul-no-drag")||xe.closest("[data-vaul-no-drag]"))return!1;if(C==="right"||C==="left")return!0;if(K.current&&qe.getTime()-K.current.getTime()<500)return!1;if(Ie!==null&&(C==="bottom"?Ie>0:Ie<0))return!0;if(Ae&&Ae.length>0)return!1;if(X.current&&qe.getTime()-X.current.getTime()<u&&Ie===0||ye)return X.current=qe,!1;for(;xe;){if(xe.scrollHeight>xe.clientHeight){if(xe.scrollTop!==0)return X.current=new Date,!1;if(xe.getAttribute("role")==="dialog")return!0}xe=xe.parentNode}return!0}function gt(ee){if(k.current&&z){const ye=C==="bottom"||C==="right"?1:-1,ge=(se.current-(Ut(C)?ee.pageY:ee.pageX))*ye,xe=ge>0,Ae=i&&!c&&!xe;if(Ae&&fe===0)return;const Ie=Math.abs(ge),qe=document.querySelector("[data-vaul-drawer-wrapper]"),Pt=C==="bottom"||C==="top"?ie.current:Y.current;let lt=Ie/Pt;const it=at(Ie,xe);if(it!==null&&(lt=it),Ae&<>=1||!te.current&&!et(ee.target,xe))return;if(k.current.classList.add(Bm),te.current=!0,en(k.current,{transition:"none"}),en(J.current,{transition:"none"}),i&&Se({draggedDistance:ge}),xe&&!i){const Et=xK(ge),sn=Math.min(Et*-1,0)*ye;en(k.current,{transform:Ut(C)?`translate3d(0, ${sn}px, 0)`:`translate3d(${sn}px, 0, 0)`});return}const _t=1-lt;if((Ye||f&&fe===f-1)&&(r?.(ee,lt),en(J.current,{opacity:`${_t}`,transition:"none"},!0)),qe&&J.current&&s){const Et=Math.min(Ue()+lt*(1-Ue()),1),sn=8-lt*8,mr=Math.max(0,14-lt*14);en(qe,{borderRadius:`${sn}px`,transform:Ut(C)?`scale(${Et}) translate3d(0, ${mr}px, 0)`:`scale(${Et}) translate3d(${mr}px, 0, 0)`,transition:"none"},!0)}if(!i){const Et=Ie*ye;en(k.current,{transform:Ut(C)?`translate3d(0, ${Et}px, 0)`:`translate3d(${Et}px, 0, 0)`})}}}N.useEffect(()=>{window.requestAnimationFrame(()=>{L.current=!0})},[]),N.useEffect(()=>{var ee;function ye(){if(!k.current||!_)return;const ge=document.activeElement;if(bv(ge)||ae.current){var xe;const Ae=((xe=window.visualViewport)==null?void 0:xe.height)||0,Ie=window.innerHeight;let qe=Ie-Ae;const Pt=k.current.getBoundingClientRect().height||0,lt=Pt>Ie*.8;le.current||(le.current=Pt);const it=k.current.getBoundingClientRect().top;if(Math.abs(Z.current-qe)>60&&(ae.current=!ae.current),i&&i.length>0&&we&&fe){const _t=we[fe]||0;qe+=_t}if(Z.current=qe,Pt>Ae||ae.current){const _t=k.current.getBoundingClientRect().height;let Et=_t;_t>Ae&&(Et=Ae-(lt?it:vv)),m?k.current.style.height=`${_t-Math.max(qe,0)}px`:k.current.style.height=`${Math.max(Et,Ae-it)}px`}else aK()||(k.current.style.height=`${le.current}px`);i&&i.length>0&&!ae.current?k.current.style.bottom="0px":k.current.style.bottom=`${Math.max(qe,0)}px`}}return(ee=window.visualViewport)==null||ee.addEventListener("resize",ye),()=>{var ge;return(ge=window.visualViewport)==null?void 0:ge.removeEventListener("resize",ye)}},[fe,i,we]);function ct(ee){mt(),y?.(),ee||D(!1),setTimeout(()=>{i&&de(i[0])},kt.DURATION*1e3)}function ot(){if(!k.current)return;const ee=document.querySelector("[data-vaul-drawer-wrapper]"),ye=ac(k.current,C);en(k.current,{transform:"translate3d(0, 0, 0)",transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`}),en(J.current,{transition:`opacity ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,opacity:"1"}),s&&ye&&ye>0&&j&&en(ee,{borderRadius:`${Ik}px`,overflow:"hidden",...Ut(C)?{transform:`scale(${Ue()}) translate3d(0, calc(env(safe-area-inset-top) + 14px), 0)`,transformOrigin:"top"}:{transform:`scale(${Ue()}) translate3d(calc(env(safe-area-inset-top) + 14px), 0, 0)`,transformOrigin:"left"},transitionProperty:"transform, border-radius",transitionDuration:`${kt.DURATION}s`,transitionTimingFunction:`cubic-bezier(${kt.EASE.join(",")})`},!0)}function mt(){!z||!k.current||(k.current.classList.remove(Bm),te.current=!1,H(!1),oe.current=new Date)}function Nt(ee){if(!z||!k.current)return;k.current.classList.remove(Bm),te.current=!1,H(!1),oe.current=new Date;const ye=ac(k.current,C);if(!ee||!et(ee.target,!1)||!ye||Number.isNaN(ye)||U.current===null)return;const ge=oe.current.getTime()-U.current.getTime(),xe=se.current-(Ut(C)?ee.pageY:ee.pageX),Ae=Math.abs(xe)/ge;if(Ae>.05&&(W(!0),setTimeout(()=>{W(!1)},200)),i){ve({draggedDistance:xe*(C==="bottom"||C==="right"?1:-1),closeDrawer:ct,velocity:Ae,dismissible:c}),o?.(ee,!0);return}if(C==="bottom"||C==="right"?xe>0:xe<0){ot(),o?.(ee,!0);return}if(Ae>Ek){ct(),o?.(ee,!1);return}var Ie;const qe=Math.min((Ie=k.current.getBoundingClientRect().height)!=null?Ie:0,window.innerHeight);var Pt;const lt=Math.min((Pt=k.current.getBoundingClientRect().width)!=null?Pt:0,window.innerWidth),it=C==="left"||C==="right";if(Math.abs(ye)>=(it?lt:qe)*l){ct(),o?.(ee,!1);return}o?.(ee,!0),ot()}N.useEffect(()=>(j&&(en(document.documentElement,{scrollBehavior:"auto"}),K.current=new Date),()=>{yK(document.documentElement,"scrollBehavior")}),[j]);function Bt(ee){const ye=ee?(window.innerWidth-Gi)/window.innerWidth:1,ge=ee?-Gi:0;Q.current&&window.clearTimeout(Q.current),en(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Ut(C)?`scale(${ye}) translate3d(0, ${ge}px, 0)`:`scale(${ye}) translate3d(${ge}px, 0, 0)`}),!ee&&k.current&&(Q.current=setTimeout(()=>{const xe=ac(k.current,C);en(k.current,{transition:"none",transform:Ut(C)?`translate3d(0, ${xe}px, 0)`:`translate3d(${xe}px, 0, 0)`})},500))}function tt(ee,ye){if(ye<0)return;const ge=(window.innerWidth-Gi)/window.innerWidth,xe=ge+ye*(1-ge),Ae=-Gi+ye*Gi;en(k.current,{transform:Ut(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`,transition:"none"})}function Ze(ee,ye){const ge=Ut(C)?window.innerHeight:window.innerWidth,xe=ye?(ge-Gi)/ge:1,Ae=ye?-Gi:0;ye&&en(k.current,{transition:`transform ${kt.DURATION}s cubic-bezier(${kt.EASE.join(",")})`,transform:Ut(C)?`scale(${xe}) translate3d(0, ${Ae}px, 0)`:`scale(${xe}) translate3d(${Ae}px, 0, 0)`})}return N.useEffect(()=>{v||window.requestAnimationFrame(()=>{document.body.style.pointerEvents="auto"})},[v]),N.createElement(Xl,{defaultOpen:S,onOpenChange:ee=>{!c&&!ee||(ee?G(!0):ct(!0),D(ee))},open:j},N.createElement(yk.Provider,{value:{activeSnapPoint:re,snapPoints:i,setActiveSnapPoint:de,drawerRef:k,overlayRef:J,onOpenChange:t,onPress:rt,onRelease:Nt,onDrag:gt,dismissible:c,shouldAnimate:L,handleOnly:d,isOpen:j,isDragging:z,shouldFade:Ye,closeDrawer:ct,onNestedDrag:tt,onNestedOpenChange:Bt,onNestedRelease:Ze,keyboardIsOpen:ae,modal:v,snapPointsOffset:we,activeSnapPointIndex:fe,direction:C,shouldScaleBackground:s,setBackgroundColorOnScale:a,noBodyStyles:w,container:A,autoFocus:M}},n))}const Tk=N.forwardRef(function({...e},t){const{overlayRef:n,snapPoints:r,onRelease:o,shouldFade:i,isOpen:s,modal:a,shouldAnimate:l}=yu(),u=Ck(t,n),c=r&&r.length>0;if(!a)return null;const d=N.useCallback(f=>o(f),[o]);return N.createElement(Jl,{onMouseUp:d,ref:u,"data-vaul-overlay":"","data-vaul-snap-points":s&&c?"true":"false","data-vaul-snap-points-overlay":s&&i?"true":"false","data-vaul-animate":l?.current?"true":"false",...e})});Tk.displayName="Drawer.Overlay";const Ok=N.forwardRef(function({onPointerDownOutside:e,style:t,onOpenAutoFocus:n,...r},o){const{drawerRef:i,onPress:s,onRelease:a,onDrag:l,keyboardIsOpen:u,snapPointsOffset:c,activeSnapPointIndex:d,modal:f,isOpen:p,direction:g,snapPoints:m,container:v,handleOnly:y,shouldAnimate:x,autoFocus:w}=yu(),[C,S]=N.useState(!1),R=Ck(o,i),I=N.useRef(null),T=N.useRef(null),_=N.useRef(!1),$=m&&m.length>0;AK();const A=(O,B,j=0)=>{if(_.current)return!0;const D=Math.abs(O.y),V=Math.abs(O.x),G=V>D,z=["bottom","right"].includes(B)?1:-1;if(B==="left"||B==="right"){if(!(O.x*z<0)&&V>=0&&V<=j)return G}else if(!(O.y*z<0)&&D>=0&&D<=j)return!G;return _.current=!0,!0};N.useEffect(()=>{$&&window.requestAnimationFrame(()=>{S(!0)})},[]);function M(O){I.current=null,_.current=!1,a(O)}return N.createElement(Kl,{"data-vaul-drawer-direction":g,"data-vaul-drawer":"","data-vaul-delayed-snap-points":C?"true":"false","data-vaul-snap-points":p&&$?"true":"false","data-vaul-custom-container":v?"true":"false","data-vaul-animate":x?.current?"true":"false",...r,ref:R,style:c&&c.length>0?{"--snap-point-height":`${c[d??0]}px`,...t}:t,onPointerDown:O=>{y||(r.onPointerDown==null||r.onPointerDown.call(r,O),I.current={x:O.pageX,y:O.pageY},s(O))},onOpenAutoFocus:O=>{n?.(O),w||O.preventDefault()},onPointerDownOutside:O=>{if(e?.(O),!f||O.defaultPrevented){O.preventDefault();return}u.current&&(u.current=!1)},onFocusOutside:O=>{if(!f){O.preventDefault();return}},onPointerMove:O=>{if(T.current=O,y||(r.onPointerMove==null||r.onPointerMove.call(r,O),!I.current))return;const B=O.pageY-I.current.y,j=O.pageX-I.current.x,D=O.pointerType==="touch"?10:2;A({x:j,y:B},g,D)?l(O):(Math.abs(j)>D||Math.abs(B)>D)&&(I.current=null)},onPointerUp:O=>{r.onPointerUp==null||r.onPointerUp.call(r,O),I.current=null,_.current=!1,a(O)},onPointerOut:O=>{r.onPointerOut==null||r.onPointerOut.call(r,O),M(T.current)},onContextMenu:O=>{r.onContextMenu==null||r.onContextMenu.call(r,O),T.current&&M(T.current)}})});Ok.displayName="Drawer.Content";const NK=250,PK=120,_K=N.forwardRef(function({preventCycle:e=!1,children:t,...n},r){const{closeDrawer:o,isDragging:i,snapPoints:s,activeSnapPoint:a,setActiveSnapPoint:l,dismissible:u,handleOnly:c,isOpen:d,onPress:f,onDrag:p}=yu(),g=N.useRef(null),m=N.useRef(!1);function v(){if(m.current){w();return}window.setTimeout(()=>{y()},PK)}function y(){if(i||e||m.current){w();return}if(w(),!s||s.length===0){u||o();return}if(a===s[s.length-1]&&u){o();return}const S=s.findIndex(I=>I===a);if(S===-1)return;const R=s[S+1];l(R)}function x(){g.current=window.setTimeout(()=>{m.current=!0},NK)}function w(){g.current&&window.clearTimeout(g.current),m.current=!1}return N.createElement("div",{onClick:v,onPointerCancel:w,onPointerDown:C=>{c&&f(C),x()},onPointerMove:C=>{c&&p(C)},ref:r,"data-vaul-drawer-visible":d?"true":"false","data-vaul-handle":"","aria-hidden":"true",...n},N.createElement("span",{"data-vaul-handle-hitarea":"","aria-hidden":"true"},t))});_K.displayName="Drawer.Handle";function MK(e){const t=yu(),{container:n=t.container,...r}=e;return N.createElement(Zl,{container:n,...r})}const Ri={Root:OK,Content:Ok,Overlay:Tk,Trigger:jd,Portal:MK,Close:ds,Title:Ld,Description:Fd};function DK({...e}){return h.jsx(Ri.Root,{"data-slot":"drawer",...e})}function kK({...e}){return h.jsx(Ri.Trigger,{"data-slot":"drawer-trigger",...e})}function Nk({...e}){return h.jsx(Ri.Portal,{"data-slot":"drawer-portal",...e})}function jK({...e}){return h.jsx(Ri.Close,{"data-slot":"drawer-close",...e})}function Pk({className:e,...t}){return h.jsx(Ri.Overlay,{"data-slot":"drawer-overlay",className:F("ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:fixed ui:inset-0 ui:z-50 ui:bg-black/50",e),...t})}function LK({className:e,children:t,...n}){return h.jsxs(Nk,{"data-slot":"drawer-portal",children:[h.jsx(Pk,{}),h.jsxs(Ri.Content,{"data-slot":"drawer-content",className:F("ui:group/drawer-content ui:bg-background ui:fixed ui:flex ui:h-auto ui:flex-col ui:rounded-t-[10px] ui:z-100 ui:mt-24","ui:data-[vaul-drawer-direction=top]:inset-x-0 ui:data-[vaul-drawer-direction=top]:top-0 ui:data-[vaul-drawer-direction=top]:mb-24 ui:data-[vaul-drawer-direction=top]:max-h-[80vh] ui:data-[vaul-drawer-direction=top]:rounded-b-lg ui:data-[vaul-drawer-direction=top]:border-b","ui:data-[vaul-drawer-direction=bottom]:inset-x-0 ui:data-[vaul-drawer-direction=bottom]:bottom-0 ui:data-[vaul-drawer-direction=bottom]:mt-24 ui:data-[vaul-drawer-direction=bottom]:max-h-[80vh] ui:data-[vaul-drawer-direction=bottom]:rounded-t-lg ui:data-[vaul-drawer-direction=bottom]:border-t","ui:data-[vaul-drawer-direction=right]:inset-y-0 ui:data-[vaul-drawer-direction=right]:right-0 ui:data-[vaul-drawer-direction=right]:w-3/4 ui:data-[vaul-drawer-direction=right]:border-l ui:data-[vaul-drawer-direction=right]:sm:max-w-sm","ui:data-[vaul-drawer-direction=left]:inset-y-0 ui:data-[vaul-drawer-direction=left]:left-0 ui:data-[vaul-drawer-direction=left]:w-3/4 ui:data-[vaul-drawer-direction=left]:border-r ui:data-[vaul-drawer-direction=left]:sm:max-w-sm",e),...n,children:[h.jsx("div",{className:"ui:bg-muted ui:mx-auto ui:mt-4 ui:hidden ui:h-2 ui:w-[100px] ui:shrink-0 ui:rounded-full ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:block"}),t]})]})}function FK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-header",className:F("ui:flex ui:flex-col ui:gap-0.5 ui:p-4 ui:group-data-[vaul-drawer-direction=bottom]/drawer-content:text-center ui:group-data-[vaul-drawer-direction=top]/drawer-content:text-center ui:md:gap-1.5 ui:md:text-left",e),...t})}function BK({className:e,...t}){return h.jsx("div",{"data-slot":"drawer-footer",className:F("ui:mt-auto ui:flex ui:flex-col ui:gap-2 ui:p-4",e),...t})}function VK({className:e,...t}){return h.jsx(Ri.Title,{"data-slot":"drawer-title",className:F("ui:text-foreground ui:font-semibold",e),...t})}function $K({className:e,...t}){return h.jsx(Ri.Description,{"data-slot":"drawer-description",className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function ox({...e}){return h.jsx(b3,{"data-slot":"dropdown-menu",...e})}function GK({...e}){return h.jsx(ZO,{"data-slot":"dropdown-menu-portal",...e})}function ix({...e}){return h.jsx(v3,{"data-slot":"dropdown-menu-trigger",...e})}function sx({className:e,sideOffset:t=4,...n}){return h.jsx(ZO,{children:h.jsx(y3,{"data-slot":"dropdown-menu-content",sideOffset:t,className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:max-h-(--radix-dropdown-menu-content-available-height) ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-x-hidden ui:overflow-y-auto ui:rounded-md ui:border ui:p-1 ui:shadow-md",e),...n})})}function HK({...e}){return h.jsx(x3,{"data-slot":"dropdown-menu-group",...e})}function _k({className:e,inset:t,variant:n="default",...r}){return h.jsx(C3,{"data-slot":"dropdown-menu-item","data-inset":t,"data-variant":n,className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[variant=destructive]:text-destructive ui:data-[variant=destructive]:focus:bg-destructive/10 ui:dark:data-[variant=destructive]:focus:bg-destructive/20 ui:data-[variant=destructive]:focus:text-destructive ui:data-[variant=destructive]:*:[svg]:!text-destructive ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r})}function yv({className:e,children:t,checked:n,...r}){return h.jsxs(S3,{"data-slot":"dropdown-menu-checkbox-item",className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),checked:n,...r,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(JO,{children:h.jsx(_e.CheckIcon,{className:"ui:size-4"})})}),t]})}function WK({...e}){return h.jsx(E3,{"data-slot":"dropdown-menu-radio-group",...e})}function zK({className:e,children:t,...n}){return h.jsxs(I3,{"data-slot":"dropdown-menu-radio-item",className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:relative ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-2 ui:pl-8 ui:text-sm ui:outline-hidden ui:select-none ui:data-[disabled]:pointer-events-none ui:data-[disabled]:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...n,children:[h.jsx("span",{className:"ui:pointer-events-none ui:absolute ui:left-2 ui:flex size-3.5 ui:items-center ui:justify-center",children:h.jsx(JO,{children:h.jsx(_e.CircleIcon,{className:"ui:size-2 ui:fill-current"})})}),t]})}function qK({className:e,inset:t,...n}){return h.jsx(w3,{"data-slot":"dropdown-menu-label","data-inset":t,className:F("ui:px-2 ui:py-1.5 ui:text-sm ui:font-medium ui:data-[inset]:pl-8",e),...n})}function UK({className:e,...t}){return h.jsx(R3,{"data-slot":"dropdown-menu-separator",className:F("ui:bg-border ui:-mx-1 ui:my-1 ui:h-px",e),...t})}function YK({className:e,...t}){return h.jsx("span",{"data-slot":"dropdown-menu-shortcut",className:F("ui:text-muted-foreground ui:ml-auto ui:text-xs ui:tracking-widest",e),...t})}function XK({...e}){return h.jsx(A3,{"data-slot":"dropdown-menu-sub",...e})}function ZK({className:e,inset:t,children:n,...r}){return h.jsxs(T3,{"data-slot":"dropdown-menu-sub-trigger","data-inset":t,className:F("ui:focus:bg-accent ui:focus:text-accent-foreground ui:data-[state=open]:bg-accent ui:data-[state=open]:text-accent-foreground ui:[&_svg:not([class*='text-'])]:text-muted-foreground ui:flex ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:px-2 ui:py-1.5 ui:text-sm ui:outline-hidden ui:select-none ui:data-[inset]:pl-8 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*='size-'])]:size-4",e),...r,children:[n,h.jsx(_e.ChevronRightIcon,{className:"ui:ml-auto ui:size-4"})]})}function JK({className:e,...t}){return h.jsx(O3,{"data-slot":"dropdown-menu-sub-content",className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:min-w-[8rem] ui:origin-(--radix-dropdown-menu-content-transform-origin) ui:overflow-hidden ui:rounded-md ui:border ui:p-1 ui:shadow-lg",e),...t})}function KK({className:e,...t}){return h.jsx("div",{"data-slot":"empty",className:F("ui:flex ui:min-w-0 ui:flex-1 ui:flex-col ui:items-center ui:justify-center ui:gap-6 ui:rounded-lg ui:border-dashed ui:p-6 ui:text-center ui:text-balance ui:md:p-12",e),...t})}function QK({className:e,...t}){return h.jsx("div",{"data-slot":"empty-header",className:F("ui:flex ui:max-w-sm ui:flex-col ui:items-center ui:gap-2 ui:text-center",e),...t})}const eQ=Si("ui:flex ui:shrink-0 ui:items-center ui:justify-center ui:mb-2 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0",{variants:{variant:{default:"ui:bg-transparent",icon:"ui:bg-muted ui:text-foreground ui:flex ui:size-10 ui:shrink-0 ui:items-center ui:justify-center ui:rounded-lg ui:[&_svg:not([class*='size-'])]:size-6"}},defaultVariants:{variant:"default"}});function tQ({className:e,variant:t="default",...n}){return h.jsx("div",{"data-slot":"empty-icon","data-variant":t,className:F(eQ({variant:t,className:e})),...n})}function nQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-title",className:F("ui:text-lg ui:font-medium ui:tracking-tight",e),...t})}function rQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-description",className:F("ui:text-muted-foreground ui:[&>a:hover]:text-primary ui:text-sm/relaxed ui:[&>a]:underline ui:[&>a]:underline-offset-4",e),...t})}function oQ({className:e,...t}){return h.jsx("div",{"data-slot":"empty-content",className:F("ui:flex ui:w-full ui:max-w-sm ui:min-w-0 ui:flex-col ui:items-center ui:gap-4 ui:text-sm ui:text-balance",e),...t})}function Mk({message:e,className:t}){return h.jsx("p",{className:F("ui:text-red-500 ui:text-xs ui:mt-2 ui:has-error",t),children:e})}const Dk=b.createContext(null),kk=b.createContext(null),kf=()=>{const e=b.useContext(Dk),t=b.useContext(kk);if(!e)throw new Error("useFormField must be used within <FormField>");if(!t)throw new Error("useFormField must be used within <FormItem>");const{id:n}=t,{name:r,error:o}=e;return{name:r,error:o,formItemId:`${n}-form-item`,formDescriptionId:`${n}-form-item-description`,formMessageId:`${n}-form-item-message`}},Br=e=>h.jsx(ur.Controller,{...e,render:t=>h.jsx(Dk.Provider,{value:{name:e.name,error:t.fieldState.error},children:e.render?.(t)})});function dr({className:e,...t}){const n=b.useId();return h.jsx(kk.Provider,{value:{id:n},children:h.jsx("div",{"data-slot":"form-item",className:F("ui:grid ui:gap-2",e),...t})})}function oo({className:e,required:t=!1,...n}){const{error:r,formItemId:o}=kf();return h.jsxs(gr,{"data-slot":"form-label","data-error":!!r,htmlFor:o,className:F("ui:text-sm",r?"ui:text-destructive":"ui:text-black-950",e),...n,children:[n.children,t&&h.jsx("span",{className:"ui:text-destructive ml-1",children:"*"})]})}function fr(e){const{error:t,formItemId:n,formDescriptionId:r,formMessageId:o}=kf();return h.jsx(Bo,{"data-slot":"form-control",id:n,"aria-invalid":!!t,"aria-describedby":t?`${r} ${o}`:r,...e})}function po({className:e,...t}){const{formDescriptionId:n}=kf();return h.jsx("p",{"data-slot":"form-description",id:n,className:F("ui:text-muted-foreground ui:text-sm",e),...t})}function Vr({className:e,showErrorPlaceholder:t,...n}){const{error:r,formMessageId:o}=kf(),i=r?String(r.message??""):n.children;return i?h.jsx("p",{"data-slot":"form-message",id:o,className:F("ui:text-destructive ui:text-sm",e),...n,children:i}):t?h.jsx("p",{className:"ui:h-4"}):null}const iQ=({name:e,control:t,formClassName:n,...r})=>{const o=ur.useFormContext(),i=t??o?.control;if(!i)throw new Error("FormCheckbox must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:i,name:e,render:({field:s})=>h.jsxs(dr,{className:n,children:[h.jsx(fr,{children:h.jsx(zM,{...s,checked:!!s.value,onCheckedChange:s.onChange,...r})}),h.jsx(Vr,{})]})})};function ax({delayDuration:e=0,...t}){return h.jsx(JH,{"data-slot":"tooltip-provider",delayDuration:e,...t})}function lx({...e}){return h.jsx(ax,{children:h.jsx(KH,{"data-slot":"tooltip",...e})})}function ux({...e}){return h.jsx(QH,{"data-slot":"tooltip-trigger",...e})}function jf({className:e,sideOffset:t=0,children:n,...r}){return h.jsx(n_,{children:h.jsxs(r_,{"data-slot":"tooltip-content",sideOffset:t,className:F("ui:bg-foreground ui:text-background ui:animate-in ui:fade-in-0 ui:zoom-in-95 ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=closed]:zoom-out-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-fit ui:origin-(--radix-tooltip-content-transform-origin) ui:rounded-md ui:px-3 ui:py-1.5 ui:text-xs ui:text-balance",e),...r,children:[n,h.jsx(e9,{className:"ui:bg-foreground ui:fill-foreground ui:z-50 ui:size-2.5 ui:translate-y-[calc(-50%-2px)] ui:rotate-45 ui:rounded-[2px]"})]})})}const jk=b.forwardRef(({children:e,...t},n)=>h.jsx(n_,{children:h.jsx(jf,{ref:n,...t,children:e})}));jk.displayName=r_.displayName;const ya=({trigger:e,content:t,asChild:n=!0,wrapTrigger:r=!0,triggerClassName:o="",contentClassName:i="ui:max-w-sm",disableContent:s=!1,isPortal:a=!1})=>s?e:h.jsxs(lx,{children:[h.jsx(ux,{asChild:n,children:r?h.jsx("div",{className:F("ui:truncate",o),children:e}):e}),a?h.jsx(jk,{className:i,children:t}):h.jsx(jf,{className:i,children:t})]}),sQ=({name:e,label:t,placeholder:n,items:r=[],description:o,multiple:i=!1,emptyMessage:s="No results found",containerClassName:a,hasClearButton:l=!1,hasAllOption:u=!1,allOptionLabel:c="All",disabled:d=!1,tooltipContent:f,control:p,inputMode:g="input"})=>{const m=ur.useFormContext(),v=p??m?.control;if(!v)throw new Error("FormCombobox must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:v,name:e,render:({field:y})=>h.jsxs(dr,{className:F("ui:flex ui:flex-col",a),children:[t&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!f}),children:[t,f&&h.jsx(ya,{triggerClassName:"ui:order-last",content:f,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(tx,{items:r,multiple:i,value:y.value,onValueChange:y.onChange,placeholder:n,emptyMessage:s,disabled:d,hasClearButton:l,hasAllOption:u,allOptionLabel:c,inputMode:g}),o&&h.jsx(po,{children:o}),h.jsx(Vr,{})]})})},aQ=({name:e,control:t,disabledCondition:n=!1,label:r,placeholder:o,description:i,containerClassName:s,triggerClassName:a,showErrorPlaceholder:l})=>{const u=ur.useFormContext(),c=t??u?.control;if(!c)throw new Error("FormDatePicker must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:c,name:e,render:({field:d})=>h.jsxs(dr,{className:F("ui:flex ui:flex-col",s),children:[h.jsx(_r,{children:h.jsx(rn,{condition:!!r,children:h.jsx(oo,{children:r})})}),h.jsxs(nx,{children:[h.jsx(Mf,{asChild:!0,children:h.jsx(fr,{children:h.jsxs(on,{variant:"outline",className:F("ui:w-[240px] ui:pl-3 ui:text-left ui:font-normal",!d.value&&"ui:text-muted-foreground",a),children:[d.value?ti(new Date(d.value),"dd/MM/yyyy"):h.jsx("span",{children:o}),h.jsx(_e.CalendarIcon,{className:"ui:ml-auto ui:h-4 ui:w-4 ui:opacity-50"})]})})}),h.jsx(Df,{className:"ui:w-auto ui:p-0",align:"start",children:h.jsx(e0,{mode:"single",selected:d.value?new Date(d.value):void 0,onSelect:f=>{f&&d.onChange(f)},disabled:n,initialFocus:!0})})]}),h.jsx(_r,{children:h.jsx(rn,{condition:!!i,children:h.jsx(po,{children:i})})}),h.jsx(Vr,{showErrorPlaceholder:l})]})})},lQ=e=>{if(e===0)return"0 Bytes";const t=1024,n=["Bytes","KB","MB","GB"],r=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,r)).toFixed(2))+" "+n[r]},uQ=e=>e.type.startsWith("image/"),cQ=({uploadedFile:e,onRemove:t})=>h.jsx("div",{className:"ui:p-3 ui:bg-muted/50 ui:border ui:border-border ui:rounded-lg",children:h.jsxs("div",{className:"ui:flex ui:items-center ui:justify-between ui:gap-3",children:[h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-3 ui:min-w-0",children:[uQ(e.file)?h.jsx("img",{src:e.url,alt:e.file.name,className:"ui:shrink-0 ui:w-10 ui:h-10 ui:object-cover ui:rounded-md"}):h.jsx("div",{className:"ui:shrink-0 ui:p-2 ui:bg-primary/10 ui:rounded-md",children:h.jsx(_e.FileText,{size:20,className:"ui:text-primary"})}),h.jsxs("div",{className:"ui:min-w-0",children:[h.jsx("p",{className:"ui:text-sm ui:font-medium ui:text-foreground ui:truncate",children:e.file.name}),h.jsx("p",{className:"ui:text-xs ui:text-muted-foreground",children:lQ(e.file.size)})]})]}),h.jsx(Do,{variant:"ghost",size:"sm",isIconOnly:!0,onClick:t,icon:h.jsx(_e.X,{size:16}),className:F("ui:shrink-0 ui:text-muted-foreground","ui:hover:text-destructive ui:hover:bg-destructive/10")})]})}),Lk=({name:e,control:t,label:n,uploadButtonLabel:r="Upload File",uploadingLabel:o="Uploading...",uploadFailedMessage:i="Upload failed",description:s,accept:a="*",disabled:l=!1,multiple:u=!1,containerClassName:c,tooltipContent:d,hasRequiredIndicator:f=!1,onUpload:p})=>{const g=ur.useFormContext(),m=t??g?.control;if(!m)throw new Error("FormFileUpload must be used within a FormProvider or receive a control prop");const v=N.useRef(null),[y,x]=N.useState(!1),w=async(S,R,I)=>{const T=S.target.files;if(T?.length){x(!0);try{if(u){const _=Array.from(T),$=[];for(const M of _){const O=p?await p(M):URL.createObjectURL(M);$.push({file:M,url:O})}const A=Array.isArray(I)?I:[];R([...A,...$])}else{const _=T[0],$=p?await p(_):URL.createObjectURL(_);R({file:_,url:$})}}catch(_){const $=_ instanceof Error?_.message:i;Jv.toast.error($)}finally{x(!1),v.current&&(v.current.value="")}}},C=(S,R,I)=>{if(u&&Array.isArray(R)&&I){const T=R.filter(_=>_!==I);S(T.length>0?T:null)}else S(null);v.current&&(v.current.value="")};return h.jsx(Br,{control:m,name:e,render:({field:S})=>{const R=S.value,I=u?Array.isArray(R)?R:[]:R&&"file"in R?[R]:[];return h.jsxs(dr,{className:F("ui:w-full",c),children:[n&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!d}),children:[n,f&&h.jsx("span",{children:"*"}),d&&h.jsx(ya,{content:d,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:text-muted-foreground ui:cursor-pointer"})})]}),h.jsx(fr,{children:h.jsxs("div",{className:"ui:space-y-3",children:[h.jsxs("div",{className:"ui:relative ui:inline-block",children:[h.jsx("input",{ref:v,type:"file",accept:a,multiple:u,onChange:T=>w(T,S.onChange,R),disabled:l||y,className:F("ui:absolute ui:inset-0 ui:w-full ui:h-full ui:opacity-0 ui:cursor-pointer","ui:disabled:cursor-not-allowed")}),h.jsx(Do,{variant:"outline",label:y?o:r,icon:y?h.jsx(_e.Loader2,{size:16,className:"ui:animate-spin"}):h.jsx(_e.Upload,{size:16}),disabled:l||y})]}),I.length>0&&h.jsx("div",{className:"ui:space-y-2",children:I.map((T,_)=>h.jsx(cQ,{uploadedFile:T,onRemove:()=>C(S.onChange,R,T)},`${T.file.name}-${T.file.size}-${_}`))})]})}),h.jsx(Vr,{}),s&&h.jsx(po,{children:s})]})}})};Lk.displayName="FormFileUpload";const cx=N.forwardRef(({name:e,label:t,labelVariant:n,type:r,value:o,onChange:i,description:s="",placeholder:a,className:l,inputClassName:u,isReadOnly:c=!1,hasRequiredIndicator:d=!1,...f},p)=>h.jsxs("article",{className:l,children:[t&&h.jsxs(gr,{variant:n,className:"ui:mb-2",children:[t,d&&h.jsx("span",{children:"*"})]}),h.jsx(vu,{ref:p,"data-test-id":e,placeholder:a,value:o,type:r,onChange:i,className:F({"ui:pointer-events-none ui:opacity-30":c},u),...f}),s&&h.jsx(If,{description:s})]})),dQ=({label:e,containerClassName:t,inputClassName:n,name:r,description:o,placeholder:i="",tooltipContent:s,hasRequiredIndicator:a=!1,control:l,...u})=>{const c=ur.useFormContext(),d=l??c?.control;if(!d)throw new Error("FormInput must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:d,name:r,render:({field:f})=>h.jsxs(dr,{className:F("ui:w-full",t),children:[h.jsxs(oo,{className:s?"ui:flex ui:items-center ui:gap-2":void 0,children:[e,a&&h.jsx("span",{children:"*"}),s&&h.jsx(ya,{content:s,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(fr,{children:h.jsx(cx,{...f,...u,placeholder:i,inputClassName:F(n)})}),o&&h.jsx(po,{children:o}),h.jsx(Vr,{})]})})},fQ=({label:e,name:t,containerClassName:n,description:r,placeholder:o,tooltipContent:i,control:s,hasRequiredIndicator:a=!1,...l})=>{const u=ur.useFormContext(),c=s??u?.control;if(!c)throw new Error("FormPassword must be used within a FormProvider or receive a control prop");const[d,f]=N.useState(!1),p=()=>{f(g=>!g)};return h.jsx(Br,{control:c,name:t,render:({field:g})=>h.jsxs(dr,{className:F("ui:w-full",n),children:[e&&h.jsxs(oo,{className:F({"ui:flex ui:items-center ui:gap-2":!!i}),children:[e,a&&h.jsx("span",{children:"*"}),i&&h.jsx(ya,{content:i,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,className:"ui:cursor-pointer ui:text-segmentify-gray-500"})})]}),h.jsx(fr,{children:h.jsxs("div",{className:"ui:relative",children:[h.jsx(cx,{...g,...l,type:d?"text":"password",placeholder:o,hasRequiredIndicator:a,inputClassName:"pr-8"}),h.jsx("button",{type:"button",onClick:p,className:"ui:absolute ui:right-3 ui:top-1/2 ui:-translate-y-1/2 ui:text-muted-foreground ui:hover:text-foreground ui:transition-colors",tabIndex:-1,children:d?h.jsx(_e.EyeOff,{size:16,className:"ui:cursor-pointer"}):h.jsx(_e.Eye,{size:16,className:"ui:cursor-pointer"})})]})}),r&&h.jsx(po,{children:r}),h.jsx(Vr,{})]})})};function Fk({className:e,...t}){return h.jsx(aG,{"data-slot":"radio-group",className:F("ui:grid ui:gap-3",e),...t})}function Bk({className:e,...t}){return h.jsx(lG,{"data-slot":"radio-group-item",className:F("ui:p-0! ui:aspect-square ui:h-4 ui:w-4 ui:rounded-full ui:border ui:border-solid ui:border-primary ui:text-primary ui:bg-transparent ui:hover:bg-transparent ui:ring-offset-background ui:focus:outline-none ui:focus-visible:ring-2 ui:focus-visible:ring-ring ui:focus-visible:ring-offset-2 ui:disabled:cursor-not-allowed ui:disabled:opacity-50 ui:transition-none",e),...t,children:h.jsx(uG,{"data-slot":"radio-group-indicator",className:"ui:relative ui:flex ui:items-center ui:justify-center",children:h.jsx(_e.CircleIcon,{className:"ui:fill-primary ui:absolute ui:top-1/2 ui:left-1/2 ui:size-2 ui:-translate-x-1/2 ui:-translate-y-1/2"})})})}const pQ=({name:e,label:t,items:n,control:r,containerClassName:o,itemClassName:i,itemLabelClassName:s,selectedClassName:a,description:l})=>{const u=ur.useFormContext(),c=r??u?.control;if(!c)throw new Error("FormRadio must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:c,name:e,render:({field:d})=>h.jsxs(dr,{className:F("ui:space-y-3",o),children:[t&&h.jsx(oo,{children:t}),h.jsx(fr,{children:h.jsx(Fk,{onValueChange:d.onChange,defaultValue:d.value,className:"ui:flex ui:flex-col ui:space-y-1",children:n.map(f=>h.jsxs(dr,{className:F("ui:flex ui:items-center ui:space-y-0",i,d.value===f.value&&a),children:[h.jsx(fr,{children:h.jsx(Bk,{value:f.value})}),h.jsx(oo,{className:F("ui:font-normal",s),children:f.label})]},f.value))})}),h.jsx(Vr,{}),l&&h.jsx(po,{children:l})]})})};function Vk({className:e,defaultValue:t,value:n,min:r=0,max:o=100,...i}){const s=b.useMemo(()=>Array.isArray(n)?n:Array.isArray(t)?t:[r,o],[n,t,r,o]);return h.jsxs(xH,{"data-slot":"slider",defaultValue:t,value:n,min:r,max:o,className:F("ui:relative ui:flex ui:w-full ui:touch-none ui:items-center ui:select-none ui:data-[disabled]:opacity-50 ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:min-h-44 ui:data-[orientation=vertical]:w-auto ui:data-[orientation=vertical]:flex-col",e),...i,children:[h.jsx(wH,{"data-slot":"slider-track",className:F("ui:bg-muted ui:relative ui:grow ui:overflow-hidden ui:rounded-full ui:data-[orientation=horizontal]:h-1.5 ui:data-[orientation=horizontal]:w-full ui:data-[orientation=vertical]:h-full ui:data-[orientation=vertical]:w-1.5"),children:h.jsx(CH,{"data-slot":"slider-range",className:F("ui:bg-primary ui:absolute ui:data-[orientation=horizontal]:h-full ui:data-[orientation=vertical]:w-full")})}),Array.from({length:s.length},(a,l)=>h.jsx(SH,{"data-slot":"slider-thumb",className:"ui:border-primary ui:ring-ring/50 ui:block ui:size-4 ui:shrink-0 ui:rounded-full ui:border ui:bg-white ui:shadow-sm ui:transition-[color,box-shadow] ui:hover:ring-4 ui:focus-visible:ring-4 ui:focus-visible:outline-hidden ui:disabled:pointer-events-none ui:disabled:opacity-50"},l))]})}const hQ=({name:e,control:t,label:n,description:r,min:o=0,max:i=100,step:s=1,leftLabel:a,rightLabel:l,showLabels:u=!0,complementaryField:c,onValueChange:d,containerClassName:f,labelClassName:p,showErrorPlaceholder:g=!1,tooltipContent:m,...v})=>{const y=ur.useFormContext(),x=t??y?.control;if(!x)throw new Error("FormSlider must be used within a FormProvider or receive a control prop");const w=N.useRef(!1),C=ur.useWatch({control:x,name:e});return h.jsx(Br,{control:x,name:e,render:({field:S})=>{const R=T=>{if(w.current)return;const _=T[0];w.current=!0,S.onChange(String(_)),c&&y?.setValue&&y.setValue(c,String(i-_),{shouldValidate:!0}),d&&d(_),setTimeout(()=>{w.current=!1},0)},I=Number(C)||o+(i-o)/2;return h.jsxs(dr,{className:F("ui:w-full",f),children:[h.jsx(_r,{children:h.jsx(rn,{condition:!!n,children:h.jsxs(oo,{className:F(p,{"ui:flex ui:items-center ui:gap-2":!!m}),children:[n,m&&h.jsx(ya,{content:m,contentClassName:"ui:max-w-96",trigger:h.jsx(_e.Info,{size:16,color:"#737373",className:"ui:cursor-pointer"})})]})})}),h.jsx(fr,{children:h.jsxs("div",{className:"ui:space-y-2",children:[h.jsx(Vk,{value:[I],onValueChange:R,min:o,max:i,step:s,className:"ui:w-full",...v}),u&&h.jsxs("div",{className:"ui:flex ui:justify-between ui:text-sm ui:text-gray-600",children:[a&&h.jsxs("span",{children:[a,": ",I,i===100?"%":""]}),l&&h.jsxs("span",{children:[l,": ",c?i-I:I,i===100?"%":""]})]})]})}),h.jsx(_r,{children:h.jsx(rn,{condition:!!r,children:h.jsx(po,{className:"ui:text-xs",children:r})})}),h.jsx(Vr,{showErrorPlaceholder:g})]})}})};function $k({className:e,...t}){return h.jsx(TH,{"data-slot":"switch",className:F("ui:peer ui:data-[state=checked]:bg-primary ui:data-[state=unchecked]:bg-input ui:focus-visible:border-ring ui:focus-visible:ring-ring/50 ui:dark:data-[state=unchecked]:bg-input/80 ui:inline-flex ui:h-[1.15rem] ui:w-8 ui:shrink-0 ui:items-center ui:rounded-full ui:border ui:border-transparent ui:shadow-xs ui:transition-all ui:outline-none ui:focus-visible:ring-[3px] ui:disabled:cursor-not-allowed ui:disabled:opacity-50",e),...t,children:h.jsx(OH,{"data-slot":"switch-thumb",className:F("ui:bg-background ui:dark:data-[state=unchecked]:bg-foreground ui:dark:data-[state=checked]:bg-primary-foreground ui:pointer-events-none ui:block ui:size-4 ui:rounded-full ui:ring-0 ui:transition-transform ui:data-[state=checked]:translate-x-[calc(100%-2px)] ui:data-[state=unchecked]:translate-x-0")})})}const Gk=({label:e,name:t,...n})=>h.jsxs("article",{className:"ui:flex ui:items-center ui:gap-2",children:[h.jsx($k,{id:t,...n}),h.jsx(gr,{htmlFor:t,children:e})]}),gQ=({name:e,label:t,description:n,control:r,...o})=>{const i=ur.useFormContext(),s=r??i?.control;if(!s)throw new Error("FormSwitch must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:s,name:e,render:({field:a})=>h.jsxs(dr,{children:[h.jsx(fr,{children:h.jsx(Gk,{...a,...o,label:t})}),h.jsx(Vr,{}),n&&h.jsx(po,{children:n})]})})},Hk=({textAreaClassName:e,value:t,onChange:n,label:r,...o})=>h.jsxs("article",{children:[r&&h.jsx(gr,{className:"ui:mb-2 ui:block",children:r}),h.jsx(pk,{className:F("ui:w-full",e),value:t,onChange:n,...o})]}),mQ=({label:e,name:t,description:n,placeholder:r,containerClassName:o,control:i,...s})=>{const a=ur.useFormContext(),l=i??a?.control;if(!l)throw new Error("FormTextarea must be used within a FormProvider or receive a control prop");return h.jsx(Br,{control:l,name:t,render:({field:u})=>h.jsxs(dr,{className:F("ui:w-full",o),children:[h.jsx(oo,{children:e}),h.jsx(fr,{children:h.jsx(Hk,{placeholder:r,...u,...s})}),n&&h.jsx(po,{children:n}),h.jsx(Vr,{})]})})};function bQ({...e}){return h.jsx(L3,{"data-slot":"hover-card",...e})}function vQ({...e}){return h.jsx(F3,{"data-slot":"hover-card-trigger",...e})}function yQ({className:e,align:t="center",sideOffset:n=4,...r}){return h.jsx(B3,{"data-slot":"hover-card-portal",children:h.jsx(V3,{"data-slot":"hover-card-content",align:t,sideOffset:n,className:F("ui:bg-popover ui:text-popover-foreground ui:data-[state=open]:animate-in ui:data-[state=closed]:animate-out ui:data-[state=closed]:fade-out-0 ui:data-[state=open]:fade-in-0 ui:data-[state=closed]:zoom-out-95 ui:data-[state=open]:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:z-50 ui:w-64 ui:origin-(--radix-hover-card-content-transform-origin) ui:rounded-md ui:border ui:p-4 ui:shadow-md ui:outline-hidden",e),...r})})}function xQ({name:e,className:t,...n}){return h.jsx("i",{className:F(`icon-${e}`,t),...n,children:h.jsxs("span",{className:"ui:for-screenreader-only",children:[e," icon"]})})}var wQ=Object.defineProperty,CQ=Object.defineProperties,SQ=Object.getOwnPropertyDescriptors,md=Object.getOwnPropertySymbols,Wk=Object.prototype.hasOwnProperty,zk=Object.prototype.propertyIsEnumerable,sI=(e,t,n)=>t in e?wQ(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,EQ=(e,t)=>{for(var n in t||(t={}))Wk.call(t,n)&&sI(e,n,t[n]);if(md)for(var n of md(t))zk.call(t,n)&&sI(e,n,t[n]);return e},IQ=(e,t)=>CQ(e,SQ(t)),RQ=(e,t)=>{var n={};for(var r in e)Wk.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&md)for(var r of md(e))t.indexOf(r)<0&&zk.call(e,r)&&(n[r]=e[r]);return n};function AQ(e){let t=setTimeout(e,0),n=setTimeout(e,10),r=setTimeout(e,50);return[t,n,r]}function TQ(e){let t=b.useRef();return b.useEffect(()=>{t.current=e}),t.current}var OQ=18,qk=40,NQ=`${qk}px`,PQ=["[data-lastpass-icon-root]","com-1password-button","[data-dashlanecreated]",'[style$="2147483647 !important;"]'].join(",");function _Q({containerRef:e,inputRef:t,pushPasswordManagerStrategy:n,isFocused:r}){let[o,i]=b.useState(!1),[s,a]=b.useState(!1),[l,u]=b.useState(!1),c=b.useMemo(()=>n==="none"?!1:(n==="increase-width"||n==="experimental-no-flickering")&&o&&s,[o,s,n]),d=b.useCallback(()=>{let f=e.current,p=t.current;if(!f||!p||l||n==="none")return;let g=f,m=g.getBoundingClientRect().left+g.offsetWidth,v=g.getBoundingClientRect().top+g.offsetHeight/2,y=m-OQ,x=v;document.querySelectorAll(PQ).length===0&&document.elementFromPoint(y,x)===f||(i(!0),u(!0))},[e,t,l,n]);return b.useEffect(()=>{let f=e.current;if(!f||n==="none")return;function p(){let m=window.innerWidth-f.getBoundingClientRect().right;a(m>=qk)}p();let g=setInterval(p,1e3);return()=>{clearInterval(g)}},[e,n]),b.useEffect(()=>{let f=r||document.activeElement===t.current;if(n==="none"||!f)return;let p=setTimeout(d,0),g=setTimeout(d,2e3),m=setTimeout(d,5e3),v=setTimeout(()=>{u(!0)},6e3);return()=>{clearTimeout(p),clearTimeout(g),clearTimeout(m),clearTimeout(v)}},[t,r,n,d]),{hasPWMBadge:o,willPushPWMBadge:c,PWM_BADGE_SPACE_WIDTH:NQ}}var MQ=b.createContext({}),Uk=b.forwardRef((e,t)=>{var n=e,{value:r,onChange:o,maxLength:i,textAlign:s="left",pattern:a,placeholder:l,inputMode:u="numeric",onComplete:c,pushPasswordManagerStrategy:d="increase-width",pasteTransformer:f,containerClassName:p,noScriptCSSFallback:g=DQ,render:m,children:v}=n,y=RQ(n,["value","onChange","maxLength","textAlign","pattern","placeholder","inputMode","onComplete","pushPasswordManagerStrategy","pasteTransformer","containerClassName","noScriptCSSFallback","render","children"]),x,w,C,S,R;let[I,T]=b.useState(typeof y.defaultValue=="string"?y.defaultValue:""),_=r??I,$=TQ(_),A=b.useCallback(k=>{o?.(k),T(k)},[o]),M=b.useMemo(()=>a?typeof a=="string"?new RegExp(a):a:null,[a]),O=b.useRef(null),B=b.useRef(null),j=b.useRef({value:_,onChange:A,isIOS:typeof window<"u"&&((w=(x=window?.CSS)==null?void 0:x.supports)==null?void 0:w.call(x,"-webkit-touch-callout","none"))}),D=b.useRef({prev:[(C=O.current)==null?void 0:C.selectionStart,(S=O.current)==null?void 0:S.selectionEnd,(R=O.current)==null?void 0:R.selectionDirection]});b.useImperativeHandle(t,()=>O.current,[]),b.useEffect(()=>{let k=O.current,ie=B.current;if(!k||!ie)return;j.current.value!==k.value&&j.current.onChange(k.value),D.current.prev=[k.selectionStart,k.selectionEnd,k.selectionDirection];function Y(){if(document.activeElement!==k){W(null),K(null);return}let re=k.selectionStart,fe=k.selectionEnd,de=k.selectionDirection,ve=k.maxLength,we=k.value,Se=D.current.prev,Ye=-1,at=-1,Xe;if(we.length!==0&&re!==null&&fe!==null){let gt=re===fe,ct=re===we.length&&we.length<ve;if(gt&&!ct){let ot=re;if(ot===0)Ye=0,at=1,Xe="forward";else if(ot===ve)Ye=ot-1,at=ot,Xe="backward";else if(ve>1&&we.length>1){let mt=0;if(Se[0]!==null&&Se[1]!==null){Xe=ot<Se[1]?"backward":"forward";let Nt=Se[0]===Se[1]&&Se[0]<ve;Xe==="backward"&&!Nt&&(mt=-1)}Ye=mt+ot,at=mt+ot+1}}Ye!==-1&&at!==-1&&Ye!==at&&O.current.setSelectionRange(Ye,at,Xe)}let Ue=Ye!==-1?Ye:re,rt=at!==-1?at:fe,et=Xe??de;W(Ue),K(rt),D.current.prev=[Ue,rt,et]}if(document.addEventListener("selectionchange",Y,{capture:!0}),Y(),document.activeElement===k&&H(!0),!document.getElementById("input-otp-style")){let re=document.createElement("style");if(re.id="input-otp-style",document.head.appendChild(re),re.sheet){let fe="background: transparent !important; color: transparent !important; border-color: transparent !important; opacity: 0 !important; box-shadow: none !important; -webkit-box-shadow: none !important; -webkit-text-fill-color: transparent !important;";Wa(re.sheet,"[data-input-otp]::selection { background: transparent !important; color: transparent !important; }"),Wa(re.sheet,`[data-input-otp]:autofill { ${fe} }`),Wa(re.sheet,`[data-input-otp]:-webkit-autofill { ${fe} }`),Wa(re.sheet,"@supports (-webkit-touch-callout: none) { [data-input-otp] { letter-spacing: -.6em !important; font-weight: 100 !important; font-stretch: ultra-condensed; font-optical-sizing: none !important; left: -1px !important; right: 1px !important; } }"),Wa(re.sheet,"[data-input-otp] + * { pointer-events: all !important; }")}}let le=()=>{ie&&ie.style.setProperty("--root-height",`${k.clientHeight}px`)};le();let pe=new ResizeObserver(le);return pe.observe(k),()=>{document.removeEventListener("selectionchange",Y,{capture:!0}),pe.disconnect()}},[]);let[V,G]=b.useState(!1),[z,H]=b.useState(!1),[ne,W]=b.useState(null),[J,K]=b.useState(null);b.useEffect(()=>{AQ(()=>{var k,ie,Y,le;(k=O.current)==null||k.dispatchEvent(new Event("input"));let pe=(ie=O.current)==null?void 0:ie.selectionStart,re=(Y=O.current)==null?void 0:Y.selectionEnd,fe=(le=O.current)==null?void 0:le.selectionDirection;pe!==null&&re!==null&&(W(pe),K(re),D.current.prev=[pe,re,fe])})},[_,z]),b.useEffect(()=>{$!==void 0&&_!==$&&$.length<i&&_.length===i&&c?.(_)},[i,c,$,_]);let U=_Q({containerRef:B,inputRef:O,pushPasswordManagerStrategy:d,isFocused:z}),oe=b.useCallback(k=>{let ie=k.currentTarget.value.slice(0,i);if(ie.length>0&&M&&!M.test(ie)){k.preventDefault();return}typeof $=="string"&&ie.length<$.length&&document.dispatchEvent(new Event("selectionchange")),A(ie)},[i,A,$,M]),X=b.useCallback(()=>{var k;if(O.current){let ie=Math.min(O.current.value.length,i-1),Y=O.current.value.length;(k=O.current)==null||k.setSelectionRange(ie,Y),W(ie),K(Y)}H(!0)},[i]),te=b.useCallback(k=>{var ie,Y;let le=O.current;if(!f&&(!j.current.isIOS||!k.clipboardData||!le))return;let pe=k.clipboardData.getData("text/plain"),re=f?f(pe):pe;k.preventDefault();let fe=(ie=O.current)==null?void 0:ie.selectionStart,de=(Y=O.current)==null?void 0:Y.selectionEnd,ve=(fe!==de?_.slice(0,fe)+re+_.slice(de):_.slice(0,fe)+re+_.slice(fe)).slice(0,i);if(ve.length>0&&M&&!M.test(ve))return;le.value=ve,A(ve);let we=Math.min(ve.length,i-1),Se=ve.length;le.setSelectionRange(we,Se),W(we),K(Se)},[i,A,M,_]),Q=b.useMemo(()=>({position:"relative",cursor:y.disabled?"default":"text",userSelect:"none",WebkitUserSelect:"none",pointerEvents:"none"}),[y.disabled]),se=b.useMemo(()=>({position:"absolute",inset:0,width:U.willPushPWMBadge?`calc(100% + ${U.PWM_BADGE_SPACE_WIDTH})`:"100%",clipPath:U.willPushPWMBadge?`inset(0 ${U.PWM_BADGE_SPACE_WIDTH} 0 0)`:void 0,height:"100%",display:"flex",textAlign:s,opacity:"1",color:"transparent",pointerEvents:"all",background:"transparent",caretColor:"transparent",border:"0 solid transparent",outline:"0 solid transparent",boxShadow:"none",lineHeight:"1",letterSpacing:"-.5em",fontSize:"var(--root-height)",fontFamily:"monospace",fontVariantNumeric:"tabular-nums"}),[U.PWM_BADGE_SPACE_WIDTH,U.willPushPWMBadge,s]),ae=b.useMemo(()=>b.createElement("input",IQ(EQ({autoComplete:y.autoComplete||"one-time-code"},y),{"data-input-otp":!0,"data-input-otp-placeholder-shown":_.length===0||void 0,"data-input-otp-mss":ne,"data-input-otp-mse":J,inputMode:u,pattern:M?.source,"aria-placeholder":l,style:se,maxLength:i,value:_,ref:O,onPaste:k=>{var ie;te(k),(ie=y.onPaste)==null||ie.call(y,k)},onChange:oe,onMouseOver:k=>{var ie;G(!0),(ie=y.onMouseOver)==null||ie.call(y,k)},onMouseLeave:k=>{var ie;G(!1),(ie=y.onMouseLeave)==null||ie.call(y,k)},onFocus:k=>{var ie;X(),(ie=y.onFocus)==null||ie.call(y,k)},onBlur:k=>{var ie;H(!1),(ie=y.onBlur)==null||ie.call(y,k)}})),[oe,X,te,u,se,i,J,ne,y,M?.source,_]),L=b.useMemo(()=>({slots:Array.from({length:i}).map((k,ie)=>{var Y;let le=z&&ne!==null&&J!==null&&(ne===J&&ie===ne||ie>=ne&&ie<J),pe=_[ie]!==void 0?_[ie]:null,re=_[0]!==void 0?null:(Y=l?.[ie])!=null?Y:null;return{char:pe,placeholderChar:re,isActive:le,hasFakeCaret:le&&pe===null}}),isFocused:z,isHovering:!y.disabled&&V}),[z,V,i,J,ne,y.disabled,_]),Z=b.useMemo(()=>m?m(L):b.createElement(MQ.Provider,{value:L},v),[v,L,m]);return b.createElement(b.Fragment,null,g!==null&&b.createElement("noscript",null,b.createElement("style",null,g)),b.createElement("div",{ref:B,"data-input-otp-container":!0,style:Q,className:p},Z,b.createElement("div",{style:{position:"absolute",inset:0,pointerEvents:"none"}},ae)))});Uk.displayName="Input";function Wa(e,t){try{e.insertRule(t)}catch{console.error("input-otp could not insert CSS rule:",t)}}var DQ=`
|
|
89
89
|
[data-input-otp] {
|
|
@@ -157,7 +157,7 @@ ${Uf(this.code(t,n))}
|
|
|
157
157
|
`,{[In.blotName]:n}),o.insert(i)),new Ne);const r=this.quill.root.ownerDocument.createElement("div");return r.classList.add(In.className),r.innerHTML=$ce(this.options.hljs,n,t),jx(this.quill.scroll,r,[(o,i)=>{const s=ll.value(o);return s?i.compose(new Ne().retain(i.length(),{[jo.blotName]:s})):i}],[(o,i)=>o.data.split(`
|
|
158
158
|
`).reduce((s,a,l)=>(l!==0&&s.insert(`
|
|
159
159
|
`,{[In.blotName]:n}),s.insert(a)),i)],new WeakMap)}}Yj.DEFAULTS={hljs:window.hljs,interval:1e3,languages:[{key:"plain",label:"Plain"},{key:"bash",label:"Bash"},{key:"cpp",label:"C++"},{key:"cs",label:"C#"},{key:"css",label:"CSS"},{key:"diff",label:"Diff"},{key:"xml",label:"HTML/XML"},{key:"java",label:"Java"},{key:"javascript",label:"JavaScript"},{key:"markdown",label:"Markdown"},{key:"php",label:"PHP"},{key:"python",label:"Python"},{key:"ruby",label:"Ruby"},{key:"sql",label:"SQL"}]};class Ar extends dn{static blotName="table";static tagName="TD";static create(t){const n=super.create();return t?n.setAttribute("data-row",t):n.setAttribute("data-row",Fx()),n}static formats(t){if(t.hasAttribute("data-row"))return t.getAttribute("data-row")}cellOffset(){return this.parent?this.parent.children.indexOf(this):-1}format(t,n){t===Ar.blotName&&n?this.domNode.setAttribute("data-row",n):super.format(t,n)}row(){return this.parent}rowOffset(){return this.row()?this.row().rowOffset():-1}table(){return this.row()&&this.row().table()}}class as extends ws{static blotName="table-row";static tagName="TR";checkMerge(){if(super.checkMerge()&&this.next.children.head!=null){const t=this.children.head.formats(),n=this.children.tail.formats(),r=this.next.children.head.formats(),o=this.next.children.tail.formats();return t.table===n.table&&t.table===r.table&&t.table===o.table}return!1}optimize(t){super.optimize(t),this.children.forEach(n=>{if(n.next==null)return;const r=n.formats(),o=n.next.formats();if(r.table!==o.table){const i=this.splitAfter(n);i&&i.optimize(),this.prev&&this.prev.optimize()}})}rowOffset(){return this.parent?this.parent.children.indexOf(this):-1}table(){return this.parent&&this.parent.parent}}class ci extends ws{static blotName="table-body";static tagName="TBODY"}class Td extends ws{static blotName="table-container";static tagName="TABLE";balanceCells(){const t=this.descendants(as),n=t.reduce((r,o)=>Math.max(o.children.length,r),0);t.forEach(r=>{new Array(n-r.children.length).fill(0).forEach(()=>{let o;r.children.head!=null&&(o=Ar.formats(r.children.head.domNode));const i=this.scroll.create(Ar.blotName,o);r.appendChild(i),i.optimize()})})}cells(t){return this.rows().map(n=>n.children.at(t))}deleteColumn(t){const[n]=this.descendant(ci);n==null||n.children.head==null||n.children.forEach(r=>{const o=r.children.at(t);o?.remove()})}insertColumn(t){const[n]=this.descendant(ci);n==null||n.children.head==null||n.children.forEach(r=>{const o=r.children.at(t),i=Ar.formats(r.children.head.domNode),s=this.scroll.create(Ar.blotName,i);r.insertBefore(s,o)})}insertRow(t){const[n]=this.descendant(ci);if(n==null||n.children.head==null)return;const r=Fx(),o=this.scroll.create(as.blotName);n.children.head.children.forEach(()=>{const s=this.scroll.create(Ar.blotName,r);o.appendChild(s)});const i=n.children.at(t);n.insertBefore(o,i)}rows(){const t=this.children.head;return t==null?[]:t.children.map(n=>n)}}Td.allowedChildren=[ci];ci.requiredContainer=Td;ci.allowedChildren=[as];as.requiredContainer=ci;as.allowedChildren=[Ar];Ar.requiredContainer=as;function Fx(){return`row-${Math.random().toString(36).slice(2,6)}`}class Gce extends mo{static register(){ce.register(Ar),ce.register(as),ce.register(ci),ce.register(Td)}constructor(){super(...arguments),this.listenBalanceCells()}balanceTables(){this.quill.scroll.descendants(Td).forEach(t=>{t.balanceCells()})}deleteColumn(){const[t,,n]=this.getTable();n!=null&&(t.deleteColumn(n.cellOffset()),this.quill.update(ce.sources.USER))}deleteRow(){const[,t]=this.getTable();t!=null&&(t.remove(),this.quill.update(ce.sources.USER))}deleteTable(){const[t]=this.getTable();if(t==null)return;const n=t.offset();t.remove(),this.quill.update(ce.sources.USER),this.quill.setSelection(n,ce.sources.SILENT)}getTable(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:this.quill.getSelection();if(t==null)return[null,null,null,-1];const[n,r]=this.quill.getLine(t.index);if(n==null||n.statics.blotName!==Ar.blotName)return[null,null,null,-1];const o=n.parent;return[o.parent.parent,o,n,r]}insertColumn(t){const n=this.quill.getSelection();if(!n)return;const[r,o,i]=this.getTable(n);if(i==null)return;const s=i.cellOffset();r.insertColumn(s+t),this.quill.update(ce.sources.USER);let a=o.rowOffset();t===0&&(a+=1),this.quill.setSelection(n.index+a,n.length,ce.sources.SILENT)}insertColumnLeft(){this.insertColumn(0)}insertColumnRight(){this.insertColumn(1)}insertRow(t){const n=this.quill.getSelection();if(!n)return;const[r,o,i]=this.getTable(n);if(i==null)return;const s=o.rowOffset();r.insertRow(s+t),this.quill.update(ce.sources.USER),t>0?this.quill.setSelection(n,ce.sources.SILENT):this.quill.setSelection(n.index+o.children.length,n.length,ce.sources.SILENT)}insertRowAbove(){this.insertRow(0)}insertRowBelow(){this.insertRow(1)}insertTable(t,n){const r=this.quill.getSelection();if(r==null)return;const o=new Array(t).fill(0).reduce(i=>{const s=new Array(n).fill(`
|
|
160
|
-
`).join("");return i.insert(s,{table:Fx()})},new Ne().retain(r.index));this.quill.updateContents(o,ce.sources.USER),this.quill.setSelection(r.index,ce.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(ce.events.SCROLL_OPTIMIZE,t=>{t.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(ce.events.TEXT_CHANGE,(r,o,i)=>{i===ce.sources.USER&&this.balanceTables()}),!0):!1)})}}const _R=$o("quill:toolbar");let Bx=class extends mo{constructor(t,n){if(super(t,n),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),Hce(r,this.options.container),t.container?.parentNode?.insertBefore(r,t.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){_R.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(r=>{const o=this.options.handlers?.[r];o&&this.addHandler(r,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(ce.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(t,n){this.handlers[t]=n}attach(t){let n=Array.from(t.classList).find(o=>o.indexOf("ql-")===0);if(!n)return;if(n=n.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[n]==null&&this.quill.scroll.query(n)==null){_R.warn("ignoring attaching to nonexistent format",n,t);return}const r=t.tagName==="SELECT"?"change":"click";t.addEventListener(r,o=>{let i;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const a=t.options[t.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else t.classList.contains("ql-active")?i=!1:i=t.value||!t.hasAttribute("value"),o.preventDefault();this.quill.focus();const[s]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,i);else if(this.quill.scroll.query(n).prototype instanceof Hn){if(i=prompt(`Enter ${n}`),!i)return;this.quill.updateContents(new Ne().retain(s.index).delete(s.length).insert({[n]:i}),ce.sources.USER)}else this.quill.format(n,i,ce.sources.USER);this.update(s)}),this.controls.push([n,t])}update(t){const n=t==null?{}:this.quill.getFormat(t);this.controls.forEach(r=>{const[o,i]=r;if(i.tagName==="SELECT"){let s=null;if(t==null)s=null;else if(n[o]==null)s=i.querySelector("option[selected]");else if(!Array.isArray(n[o])){let a=n[o];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),s=i.querySelector(`option[value="${a}"]`)}s==null?(i.value="",i.selectedIndex=-1):s.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const s=n[o],a=s===i.getAttribute("value")||s!=null&&s.toString()===i.getAttribute("value")||s==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const s=n[o]!=null;i.classList.toggle("ql-active",s),i.setAttribute("aria-pressed",s.toString())}})}};Bx.DEFAULTS={};function MR(e,t,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),n!=null?(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)):r.setAttribute("aria-label",t),e.appendChild(r)}function Hce(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(n=>{const r=document.createElement("span");r.classList.add("ql-formats"),n.forEach(o=>{if(typeof o=="string")MR(r,o);else{const i=Object.keys(o)[0],s=o[i];Array.isArray(s)?Wce(r,i,s):MR(r,i,s)}}),e.appendChild(r)})}function Wce(e,t,n){const r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach(o=>{const i=document.createElement("option");o!==!1?i.setAttribute("value",String(o)):i.setAttribute("selected","selected"),r.appendChild(i)}),e.appendChild(r)}Bx.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(e!=null)if(e.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(n=>{this.quill.scroll.query(n,Pe.INLINE)!=null&&this.quill.format(n,!1,ce.sources.USER)})}else this.quill.removeFormat(e.index,e.length,ce.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();e==="rtl"&&t==null?this.quill.format("align","right",ce.sources.USER):!e&&t==="right"&&this.quill.format("align",!1,ce.sources.USER),this.quill.format("direction",e,ce.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if(e==="+1"||e==="-1"){let o=e==="+1"?1:-1;n.direction==="rtl"&&(o*=-1),this.quill.format("indent",r+o,ce.sources.USER)}},link(e){e===!0&&(e=prompt("Enter link URL:")),this.quill.format("link",e,ce.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);e==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,ce.sources.USER):this.quill.format("list","unchecked",ce.sources.USER):this.quill.format("list",e,ce.sources.USER)}}};const zce='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',qce='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Uce='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Yce='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Xce='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Zce='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Jce='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Kce='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',DR='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Qce='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',ede='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',tde='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',nde='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',rde='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',ode='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',ide='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',sde='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',ade='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',lde='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',ude='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',cde='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',dde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',fde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',pde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',hde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',gde='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',mde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',bde='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',vde='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',yde='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',xde='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',wde='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Cde='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Wl={align:{"":zce,center:qce,right:Uce,justify:Yce},background:Xce,blockquote:Zce,bold:Jce,clean:Kce,code:DR,"code-block":DR,color:Qce,direction:{"":ede,rtl:tde},formula:nde,header:{1:rde,2:ode,3:ide,4:sde,5:ade,6:lde},italic:ude,image:cde,indent:{"+1":dde,"-1":fde},link:pde,list:{bullet:hde,check:gde,ordered:mde},script:{sub:bde,super:vde},strike:yde,table:xde,underline:wde,video:Cde},Sde='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let kR=0;function jR(e,t){e.setAttribute(t,`${e.getAttribute(t)!=="true"}`)}class Xf{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),n.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),jR(this.label,"aria-expanded"),jR(this.options,"aria-hidden")}buildItem(t){const n=document.createElement("span");n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item");const r=t.getAttribute("value");return r&&n.setAttribute("data-value",r),t.textContent&&n.setAttribute("data-label",t.textContent),n.addEventListener("click",()=>{this.selectItem(n,!0)}),n.addEventListener("keydown",o=>{switch(o.key){case"Enter":this.selectItem(n,!0),o.preventDefault();break;case"Escape":this.escape(),o.preventDefault();break}}),n}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=Sde,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${kR}`,kR+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(n=>{const r=this.buildItem(n);t.appendChild(r),n.selected===!0&&this.selectItem(r)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");t!==r&&(r?.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const n=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}class Xj extends Xf{constructor(t,n){super(t),this.label.innerHTML=n,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(t){const n=super.buildItem(t);return n.style.backgroundColor=t.getAttribute("value")||"",n}selectItem(t,n){super.selectItem(t,n);const r=this.label.querySelector(".ql-color-label"),o=t&&t.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=o:r.style.fill=o)}}class Zj extends Xf{constructor(t,n){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=n[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,n){super.selectItem(t,n);const r=t||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const Ede=e=>{const{overflowY:t}=getComputedStyle(e,null);return t!=="visible"&&t!=="clip"};class Jj{constructor(t,n){this.quill=t,this.boundsContainer=n||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Ede(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const n=t.left+t.width/2-this.root.offsetWidth/2,r=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const o=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let s=0;if(i.right>o.right&&(s=o.right-i.right,this.root.style.left=`${n+s}px`),i.left<o.left&&(s=o.left-i.left,this.root.style.left=`${n+s}px`),i.bottom>o.bottom){const a=i.bottom-i.top,l=t.bottom-t.top+a;this.root.style.top=`${r-l}px`,this.root.classList.add("ql-flip")}return s}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Ide=[!1,"center","right","justify"],Rde=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Ade=[!1,"serif","monospace"],Tde=["1","2","3",!1],Ode=["small",!1,"large","huge"];class Iu extends Ca{constructor(t,n){super(t,n);const r=o=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(o.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(o.target)||i.close()})};t.emitter.listenDOM("click",document.body,r)}addModule(t){const n=super.addModule(t);return t==="toolbar"&&this.extendToolbar(n),n}buildButtons(t,n){Array.from(t).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),n[i]!=null))if(i==="direction")r.innerHTML=n[i][""]+n[i].rtl;else if(typeof n[i]=="string")r.innerHTML=n[i];else{const s=r.value||"";s!=null&&n[i][s]&&(r.innerHTML=n[i][s])}})})}buildPickers(t,n){this.pickers=Array.from(t).map(o=>{if(o.classList.contains("ql-align")&&(o.querySelector("option")==null&&Ya(o,Ide),typeof n.align=="object"))return new Zj(o,n.align);if(o.classList.contains("ql-background")||o.classList.contains("ql-color")){const i=o.classList.contains("ql-background")?"background":"color";return o.querySelector("option")==null&&Ya(o,Rde,i==="background"?"#ffffff":"#000000"),new Xj(o,n[i])}return o.querySelector("option")==null&&(o.classList.contains("ql-font")?Ya(o,Ade):o.classList.contains("ql-header")?Ya(o,Tde):o.classList.contains("ql-size")&&Ya(o,Ode)),new Xf(o)});const r=()=>{this.pickers.forEach(o=>{o.update()})};this.quill.on(Oe.events.EDITOR_CHANGE,r)}}Iu.DEFAULTS=ui({},Ca.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");e==null&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""}),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Kj extends Jj{constructor(t,n){super(t,n),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;n!=null?this.textbox.value=n:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:n}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,Oe.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,Oe.sources.USER)),this.quill.root.scrollTop=n;break}case"video":t=Nde(t);case"formula":{if(!t)break;const n=this.quill.getSelection(!0);if(n!=null){const r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,Oe.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Oe.sources.USER),this.quill.setSelection(r+2,Oe.sources.USER)}break}}this.textbox.value="",this.hide()}}function Nde(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:e}function Ya(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(r=>{const o=document.createElement("option");r===n?o.setAttribute("selected","selected"):o.setAttribute("value",String(r)),e.appendChild(o)})}const Pde=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class _de extends Kj{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(t,n){super(t,n),this.quill.on(Oe.events.EDITOR_CHANGE,(r,o,i,s)=>{if(r===Oe.events.SELECTION_CHANGE)if(o!=null&&o.length>0&&s===Oe.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(o.index,o.length);if(a.length===1){const l=this.quill.getBounds(o);l!=null&&this.position(l)}else{const l=a[a.length-1],u=this.quill.getIndex(l),c=Math.min(l.length()-1,o.index+o.length-u),d=this.quill.getBounds(new ss(u,c));d!=null&&this.position(d)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Oe.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const n=this.quill.getBounds(t);n!=null&&this.position(n)}},1)})}cancel(){this.show()}position(t){const n=super.position(t),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",n!==0&&(r.style.marginLeft=`${-1*n-r.offsetWidth/2}px`),n}}class Qj extends Iu{constructor(t,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=Pde),super(t,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new _de(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),Wl),this.buildPickers(t.container.querySelectorAll("select"),Wl))}}Qj.DEFAULTS=ui({},Iu.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,ce.sources.USER)}}}}});const Mde=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Dde extends Kj{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,Oe.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(Oe.events.SELECTION_CHANGE,(t,n,r)=>{if(t!=null){if(t.length===0&&r===Oe.sources.USER){const[o,i]=this.quill.scroll.descendant(Ad,t.index);if(o!=null){this.linkRange=new ss(t.index-i,o.length());const s=Ad.formats(o.domNode);this.preview.textContent=s,this.preview.setAttribute("href",s),this.show();const a=this.quill.getBounds(this.linkRange);a!=null&&this.position(a);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class eL extends Iu{constructor(t,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=Mde),super(t,n),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),Wl),this.buildPickers(t.container.querySelectorAll("select"),Wl),this.tooltip=new Dde(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(n,r)=>{t.handlers.link.call(t,!r.format.link)}))}}eL.DEFAULTS=ui({},Iu.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const t=this.quill.getSelection();if(t==null||t.length===0)return;let n=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf("mailto:")!==0&&(n=`mailto:${n}`);const{tooltip:r}=this.quill.theme;r.edit("link",n)}else this.quill.format("link",!1,ce.sources.USER)}}}}});ce.register({"attributors/attribute/direction":Lj,"attributors/class/align":Dj,"attributors/class/background":Bue,"attributors/class/color":Fue,"attributors/class/direction":Fj,"attributors/class/font":$j,"attributors/class/size":Hj,"attributors/style/align":kj,"attributors/style/background":_x,"attributors/style/color":Px,"attributors/style/direction":Bj,"attributors/style/font":Gj,"attributors/style/size":Wj},!0);ce.register({"formats/align":Dj,"formats/direction":Fj,"formats/indent":Pce,"formats/background":_x,"formats/color":Px,"formats/font":$j,"formats/size":Hj,"formats/blockquote":_ce,"formats/code-block":In,"formats/header":Mce,"formats/list":Eu,"formats/bold":Lx,"formats/code":Mx,"formats/italic":Dce,"formats/link":Ad,"formats/script":kce,"formats/strike":jce,"formats/underline":Lce,"formats/formula":Fce,"formats/image":Bce,"formats/video":Vce,"modules/syntax":Yj,"modules/table":Gce,"modules/toolbar":Bx,"themes/bubble":Qj,"themes/snow":eL,"ui/icons":Wl,"ui/picker":Xf,"ui/icon-picker":Zj,"ui/color-picker":Xj,"ui/tooltip":Jj},!0);const tL=N.forwardRef(({readOnly:e,defaultValue:t,onTextChange:n,onSelectionChange:r,theme:o="snow"},i)=>{const s=N.useRef(null),a=N.useRef(t),l=N.useRef(n),u=N.useRef(r),c=N.useRef(null);return N.useLayoutEffect(()=>{l.current=n,u.current=r}),N.useEffect(()=>{i&&typeof i=="object"&&i.current&&i.current.enable(!e)},[i,e]),N.useEffect(()=>{const d=s.current;if(!d)return;const f=d.appendChild(d.ownerDocument.createElement("div")),p=new ce(f,{theme:o});return c.current=p,i&&typeof i=="object"&&(i.current=p),a.current&&p.setContents(a.current),p.on(ce.events.TEXT_CHANGE,()=>{const g=p.getSemanticHTML();l.current?.(g)}),p.on(ce.events.SELECTION_CHANGE,(g,m,v)=>{u.current?.(g,m,v)}),()=>{c.current=null,i&&typeof i=="object"&&(i.current=null),d.innerHTML=""}},[i,o]),h.jsx("div",{ref:s})});tL.displayName="QuillEditor";const nL=N.createContext(null);function Zf(){const e=N.useContext(nL);if(!e)throw new Error("DataTable components must be used within DataTable.Root");return e}function kde({table:e,children:t,isLoading:n=!1,search:r="",onSearchChange:o=()=>{},totalCount:i,className:s}){const a={table:e,isLoading:n,search:r,onSearchChange:o,totalCount:i};return h.jsx(nL.Provider,{value:a,children:h.jsx("div",{className:F("ui:w-full",s),children:t})})}function jde({children:e,className:t}){return h.jsx("div",{className:F("ui:flex ui:justify-between ui:gap-2 ui:items-center ui:p-3 ui:bg-white ui:rounded-lg ui:border ui:mb-2.5",t),children:e})}function Lde({placeholder:e="Search...",filterColumn:t,className:n}){const{table:r,search:o,onSearchChange:i}=Zf(),s=l=>{const u=String(l);t?r.getColumn(t)?.setFilterValue(u):i(u)},a=t?r.getColumn(t)?.getFilterValue()??"":o;return h.jsx(vk,{placeholder:e,value:a,onChange:s,className:F(n)})}function Fde({emptyMessage:e="No columns found.",allOptionLabel:t="All columns"}){const{table:n}=Zf(),r=n.getAllColumns().filter(a=>a.getCanHide()&&!a.getIsPinned()),o=N.useMemo(()=>r.map(a=>{let l=a.id;return typeof a.columnDef.header=="string"&&(l=a.columnDef.header),a.columnDef.meta?.label&&(l=a.columnDef.meta.label),{value:a.id,label:l}}),[r]),i=N.useMemo(()=>r.filter(a=>a.getIsVisible()).map(a=>{const l=o.find(u=>u.value===a.id);return{value:a.id,label:l?.label??a.id}}),[r,o]),s=N.useCallback(a=>{const l=a.map(u=>u.value);r.forEach(u=>{u.toggleVisibility(l.includes(u.id))})},[r]);return h.jsx(tx,{multiple:!0,inputMode:"popup",items:o,value:i,onValueChange:s,emptyMessage:e,hasAllOption:!0,allOptionLabel:t,renderPopupTrigger:()=>h.jsx(on,{variant:"outline",size:"icon-lg",children:h.jsx(_e.Columns2,{})})})}function oi(e,t){return typeof e=="function"?e(t):e}function $n(e,t){return n=>{t.setState(r=>({...r,[e]:oi(n,r[e])}))}}function Jf(e){return e instanceof Function}function Bde(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Vde(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function We(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((c,d)=>r[d]!==c)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-u)*100)/100,f=d/16,p=(g,m)=>{for(g=String(g);g.length<m;)g=" "+g;return g};console.info(`%c⏱ ${p(d,5)} /${p(c,5)} ms`,`
|
|
160
|
+
`).join("");return i.insert(s,{table:Fx()})},new Ne().retain(r.index));this.quill.updateContents(o,ce.sources.USER),this.quill.setSelection(r.index,ce.sources.SILENT),this.balanceTables()}listenBalanceCells(){this.quill.on(ce.events.SCROLL_OPTIMIZE,t=>{t.some(n=>["TD","TR","TBODY","TABLE"].includes(n.target.tagName)?(this.quill.once(ce.events.TEXT_CHANGE,(r,o,i)=>{i===ce.sources.USER&&this.balanceTables()}),!0):!1)})}}const _R=$o("quill:toolbar");let Bx=class extends mo{constructor(t,n){if(super(t,n),Array.isArray(this.options.container)){const r=document.createElement("div");r.setAttribute("role","toolbar"),Hce(r,this.options.container),t.container?.parentNode?.insertBefore(r,t.container),this.container=r}else typeof this.options.container=="string"?this.container=document.querySelector(this.options.container):this.container=this.options.container;if(!(this.container instanceof HTMLElement)){_R.error("Container required for toolbar",this.options);return}this.container.classList.add("ql-toolbar"),this.controls=[],this.handlers={},this.options.handlers&&Object.keys(this.options.handlers).forEach(r=>{const o=this.options.handlers?.[r];o&&this.addHandler(r,o)}),Array.from(this.container.querySelectorAll("button, select")).forEach(r=>{this.attach(r)}),this.quill.on(ce.events.EDITOR_CHANGE,()=>{const[r]=this.quill.selection.getRange();this.update(r)})}addHandler(t,n){this.handlers[t]=n}attach(t){let n=Array.from(t.classList).find(o=>o.indexOf("ql-")===0);if(!n)return;if(n=n.slice(3),t.tagName==="BUTTON"&&t.setAttribute("type","button"),this.handlers[n]==null&&this.quill.scroll.query(n)==null){_R.warn("ignoring attaching to nonexistent format",n,t);return}const r=t.tagName==="SELECT"?"change":"click";t.addEventListener(r,o=>{let i;if(t.tagName==="SELECT"){if(t.selectedIndex<0)return;const a=t.options[t.selectedIndex];a.hasAttribute("selected")?i=!1:i=a.value||!1}else t.classList.contains("ql-active")?i=!1:i=t.value||!t.hasAttribute("value"),o.preventDefault();this.quill.focus();const[s]=this.quill.selection.getRange();if(this.handlers[n]!=null)this.handlers[n].call(this,i);else if(this.quill.scroll.query(n).prototype instanceof Hn){if(i=prompt(`Enter ${n}`),!i)return;this.quill.updateContents(new Ne().retain(s.index).delete(s.length).insert({[n]:i}),ce.sources.USER)}else this.quill.format(n,i,ce.sources.USER);this.update(s)}),this.controls.push([n,t])}update(t){const n=t==null?{}:this.quill.getFormat(t);this.controls.forEach(r=>{const[o,i]=r;if(i.tagName==="SELECT"){let s=null;if(t==null)s=null;else if(n[o]==null)s=i.querySelector("option[selected]");else if(!Array.isArray(n[o])){let a=n[o];typeof a=="string"&&(a=a.replace(/"/g,'\\"')),s=i.querySelector(`option[value="${a}"]`)}s==null?(i.value="",i.selectedIndex=-1):s.selected=!0}else if(t==null)i.classList.remove("ql-active"),i.setAttribute("aria-pressed","false");else if(i.hasAttribute("value")){const s=n[o],a=s===i.getAttribute("value")||s!=null&&s.toString()===i.getAttribute("value")||s==null&&!i.getAttribute("value");i.classList.toggle("ql-active",a),i.setAttribute("aria-pressed",a.toString())}else{const s=n[o]!=null;i.classList.toggle("ql-active",s),i.setAttribute("aria-pressed",s.toString())}})}};Bx.DEFAULTS={};function MR(e,t,n){const r=document.createElement("button");r.setAttribute("type","button"),r.classList.add(`ql-${t}`),r.setAttribute("aria-pressed","false"),n!=null?(r.value=n,r.setAttribute("aria-label",`${t}: ${n}`)):r.setAttribute("aria-label",t),e.appendChild(r)}function Hce(e,t){Array.isArray(t[0])||(t=[t]),t.forEach(n=>{const r=document.createElement("span");r.classList.add("ql-formats"),n.forEach(o=>{if(typeof o=="string")MR(r,o);else{const i=Object.keys(o)[0],s=o[i];Array.isArray(s)?Wce(r,i,s):MR(r,i,s)}}),e.appendChild(r)})}function Wce(e,t,n){const r=document.createElement("select");r.classList.add(`ql-${t}`),n.forEach(o=>{const i=document.createElement("option");o!==!1?i.setAttribute("value",String(o)):i.setAttribute("selected","selected"),r.appendChild(i)}),e.appendChild(r)}Bx.DEFAULTS={container:null,handlers:{clean(){const e=this.quill.getSelection();if(e!=null)if(e.length===0){const t=this.quill.getFormat();Object.keys(t).forEach(n=>{this.quill.scroll.query(n,Pe.INLINE)!=null&&this.quill.format(n,!1,ce.sources.USER)})}else this.quill.removeFormat(e.index,e.length,ce.sources.USER)},direction(e){const{align:t}=this.quill.getFormat();e==="rtl"&&t==null?this.quill.format("align","right",ce.sources.USER):!e&&t==="right"&&this.quill.format("align",!1,ce.sources.USER),this.quill.format("direction",e,ce.sources.USER)},indent(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t),r=parseInt(n.indent||0,10);if(e==="+1"||e==="-1"){let o=e==="+1"?1:-1;n.direction==="rtl"&&(o*=-1),this.quill.format("indent",r+o,ce.sources.USER)}},link(e){e===!0&&(e=prompt("Enter link URL:")),this.quill.format("link",e,ce.sources.USER)},list(e){const t=this.quill.getSelection(),n=this.quill.getFormat(t);e==="check"?n.list==="checked"||n.list==="unchecked"?this.quill.format("list",!1,ce.sources.USER):this.quill.format("list","unchecked",ce.sources.USER):this.quill.format("list",e,ce.sources.USER)}}};const zce='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="13" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="9" y1="4" y2="4"/></svg>',qce='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="14" x2="4" y1="14" y2="14"/><line class="ql-stroke" x1="12" x2="6" y1="4" y2="4"/></svg>',Uce='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="5" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="9" y1="4" y2="4"/></svg>',Yce='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="15" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="15" x2="3" y1="14" y2="14"/><line class="ql-stroke" x1="15" x2="3" y1="4" y2="4"/></svg>',Xce='<svg viewbox="0 0 18 18"><g class="ql-fill ql-color-label"><polygon points="6 6.868 6 6 5 6 5 7 5.942 7 6 6.868"/><rect height="1" width="1" x="4" y="4"/><polygon points="6.817 5 6 5 6 6 6.38 6 6.817 5"/><rect height="1" width="1" x="2" y="6"/><rect height="1" width="1" x="3" y="5"/><rect height="1" width="1" x="4" y="7"/><polygon points="4 11.439 4 11 3 11 3 12 3.755 12 4 11.439"/><rect height="1" width="1" x="2" y="12"/><rect height="1" width="1" x="2" y="9"/><rect height="1" width="1" x="2" y="15"/><polygon points="4.63 10 4 10 4 11 4.192 11 4.63 10"/><rect height="1" width="1" x="3" y="8"/><path d="M10.832,4.2L11,4.582V4H10.708A1.948,1.948,0,0,1,10.832,4.2Z"/><path d="M7,4.582L7.168,4.2A1.929,1.929,0,0,1,7.292,4H7V4.582Z"/><path d="M8,13H7.683l-0.351.8a1.933,1.933,0,0,1-.124.2H8V13Z"/><rect height="1" width="1" x="12" y="2"/><rect height="1" width="1" x="11" y="3"/><path d="M9,3H8V3.282A1.985,1.985,0,0,1,9,3Z"/><rect height="1" width="1" x="2" y="3"/><rect height="1" width="1" x="6" y="2"/><rect height="1" width="1" x="3" y="2"/><rect height="1" width="1" x="5" y="3"/><rect height="1" width="1" x="9" y="2"/><rect height="1" width="1" x="15" y="14"/><polygon points="13.447 10.174 13.469 10.225 13.472 10.232 13.808 11 14 11 14 10 13.37 10 13.447 10.174"/><rect height="1" width="1" x="13" y="7"/><rect height="1" width="1" x="15" y="5"/><rect height="1" width="1" x="14" y="6"/><rect height="1" width="1" x="15" y="8"/><rect height="1" width="1" x="14" y="9"/><path d="M3.775,14H3v1H4V14.314A1.97,1.97,0,0,1,3.775,14Z"/><rect height="1" width="1" x="14" y="3"/><polygon points="12 6.868 12 6 11.62 6 12 6.868"/><rect height="1" width="1" x="15" y="2"/><rect height="1" width="1" x="12" y="5"/><rect height="1" width="1" x="13" y="4"/><polygon points="12.933 9 13 9 13 8 12.495 8 12.933 9"/><rect height="1" width="1" x="9" y="14"/><rect height="1" width="1" x="8" y="15"/><path d="M6,14.926V15H7V14.316A1.993,1.993,0,0,1,6,14.926Z"/><rect height="1" width="1" x="5" y="15"/><path d="M10.668,13.8L10.317,13H10v1h0.792A1.947,1.947,0,0,1,10.668,13.8Z"/><rect height="1" width="1" x="11" y="15"/><path d="M14.332,12.2a1.99,1.99,0,0,1,.166.8H15V12H14.245Z"/><rect height="1" width="1" x="14" y="15"/><rect height="1" width="1" x="15" y="11"/></g><polyline class="ql-stroke" points="5.5 13 9 5 12.5 13"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="11" y2="11"/></svg>',Zce='<svg viewbox="0 0 18 18"><rect class="ql-fill ql-stroke" height="3" width="3" x="4" y="5"/><rect class="ql-fill ql-stroke" height="3" width="3" x="11" y="5"/><path class="ql-even ql-fill ql-stroke" d="M7,8c0,4.031-3,5-3,5"/><path class="ql-even ql-fill ql-stroke" d="M14,8c0,4.031-3,5-3,5"/></svg>',Jce='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,4H9.5A2.5,2.5,0,0,1,12,6.5v0A2.5,2.5,0,0,1,9.5,9H5A0,0,0,0,1,5,9V4A0,0,0,0,1,5,4Z"/><path class="ql-stroke" d="M5,9h5.5A2.5,2.5,0,0,1,13,11.5v0A2.5,2.5,0,0,1,10.5,14H5a0,0,0,0,1,0,0V9A0,0,0,0,1,5,9Z"/></svg>',Kce='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="5" x2="13" y1="3" y2="3"/><line class="ql-stroke" x1="6" x2="9.35" y1="12" y2="3"/><line class="ql-stroke" x1="11" x2="15" y1="11" y2="15"/><line class="ql-stroke" x1="15" x2="11" y1="11" y2="15"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="7" x="2" y="14"/></svg>',DR='<svg viewbox="0 0 18 18"><polyline class="ql-even ql-stroke" points="5 7 3 9 5 11"/><polyline class="ql-even ql-stroke" points="13 7 15 9 13 11"/><line class="ql-stroke" x1="10" x2="8" y1="5" y2="13"/></svg>',Qce='<svg viewbox="0 0 18 18"><line class="ql-color-label ql-stroke ql-transparent" x1="3" x2="15" y1="15" y2="15"/><polyline class="ql-stroke" points="5.5 11 9 3 12.5 11"/><line class="ql-stroke" x1="11.63" x2="6.38" y1="9" y2="9"/></svg>',ede='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="3 11 5 9 3 7 3 11"/><line class="ql-stroke ql-fill" x1="15" x2="11" y1="4" y2="4"/><path class="ql-fill" d="M11,3a3,3,0,0,0,0,6h1V3H11Z"/><rect class="ql-fill" height="11" width="1" x="11" y="4"/><rect class="ql-fill" height="11" width="1" x="13" y="4"/></svg>',tde='<svg viewbox="0 0 18 18"><polygon class="ql-stroke ql-fill" points="15 12 13 10 15 8 15 12"/><line class="ql-stroke ql-fill" x1="9" x2="5" y1="4" y2="4"/><path class="ql-fill" d="M5,3A3,3,0,0,0,5,9H6V3H5Z"/><rect class="ql-fill" height="11" width="1" x="5" y="4"/><rect class="ql-fill" height="11" width="1" x="7" y="4"/></svg>',nde='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M11.759,2.482a2.561,2.561,0,0,0-3.53.607A7.656,7.656,0,0,0,6.8,6.2C6.109,9.188,5.275,14.677,4.15,14.927a1.545,1.545,0,0,0-1.3-.933A0.922,0.922,0,0,0,2,15.036S1.954,16,4.119,16s3.091-2.691,3.7-5.553c0.177-.826.36-1.726,0.554-2.6L8.775,6.2c0.381-1.421.807-2.521,1.306-2.676a1.014,1.014,0,0,0,1.02.56A0.966,0.966,0,0,0,11.759,2.482Z"/><rect class="ql-fill" height="1.6" rx="0.8" ry="0.8" width="5" x="5.15" y="6.2"/><path class="ql-fill" d="M13.663,12.027a1.662,1.662,0,0,1,.266-0.276q0.193,0.069.456,0.138a2.1,2.1,0,0,0,.535.069,1.075,1.075,0,0,0,.767-0.3,1.044,1.044,0,0,0,.314-0.8,0.84,0.84,0,0,0-.238-0.619,0.8,0.8,0,0,0-.594-0.239,1.154,1.154,0,0,0-.781.3,4.607,4.607,0,0,0-.781,1q-0.091.15-.218,0.346l-0.246.38c-0.068-.288-0.137-0.582-0.212-0.885-0.459-1.847-2.494-.984-2.941-0.8-0.482.2-.353,0.647-0.094,0.529a0.869,0.869,0,0,1,1.281.585c0.217,0.751.377,1.436,0.527,2.038a5.688,5.688,0,0,1-.362.467,2.69,2.69,0,0,1-.264.271q-0.221-.08-0.471-0.147a2.029,2.029,0,0,0-.522-0.066,1.079,1.079,0,0,0-.768.3A1.058,1.058,0,0,0,9,15.131a0.82,0.82,0,0,0,.832.852,1.134,1.134,0,0,0,.787-0.3,5.11,5.11,0,0,0,.776-0.993q0.141-.219.215-0.34c0.046-.076.122-0.194,0.223-0.346a2.786,2.786,0,0,0,.918,1.726,2.582,2.582,0,0,0,2.376-.185c0.317-.181.212-0.565,0-0.494A0.807,0.807,0,0,1,14.176,15a5.159,5.159,0,0,1-.913-2.446l0,0Q13.487,12.24,13.663,12.027Z"/></svg>',rde='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm6.06787,9.209H14.98975V7.59863a.54085.54085,0,0,0-.605-.60547h-.62744a1.01119,1.01119,0,0,0-.748.29688L11.645,8.56641a.5435.5435,0,0,0-.022.8584l.28613.30762a.53861.53861,0,0,0,.84717.0332l.09912-.08789a1.2137,1.2137,0,0,0,.2417-.35254h.02246s-.01123.30859-.01123.60547V13.209H12.041a.54085.54085,0,0,0-.605.60547v.43945a.54085.54085,0,0,0,.605.60547h4.02686a.54085.54085,0,0,0,.605-.60547v-.43945A.54085.54085,0,0,0,16.06787,13.209Z"/></svg>',ode='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.73975,13.81445v.43945a.54085.54085,0,0,1-.605.60547H11.855a.58392.58392,0,0,1-.64893-.60547V14.0127c0-2.90527,3.39941-3.42187,3.39941-4.55469a.77675.77675,0,0,0-.84717-.78125,1.17684,1.17684,0,0,0-.83594.38477c-.2749.26367-.561.374-.85791.13184l-.4292-.34082c-.30811-.24219-.38525-.51758-.1543-.81445a2.97155,2.97155,0,0,1,2.45361-1.17676,2.45393,2.45393,0,0,1,2.68408,2.40918c0,2.45312-3.1792,2.92676-3.27832,3.93848h2.79443A.54085.54085,0,0,1,16.73975,13.81445ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',ide='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.65186,12.30664a2.6742,2.6742,0,0,1-2.915,2.68457,3.96592,3.96592,0,0,1-2.25537-.6709.56007.56007,0,0,1-.13232-.83594L11.64648,13c.209-.34082.48389-.36328.82471-.1543a2.32654,2.32654,0,0,0,1.12256.33008c.71484,0,1.12207-.35156,1.12207-.78125,0-.61523-.61621-.86816-1.46338-.86816H13.2085a.65159.65159,0,0,1-.68213-.41895l-.05518-.10937a.67114.67114,0,0,1,.14307-.78125l.71533-.86914a8.55289,8.55289,0,0,1,.68213-.7373V8.58887a3.93913,3.93913,0,0,1-.748.05469H11.9873a.54085.54085,0,0,1-.605-.60547V7.59863a.54085.54085,0,0,1,.605-.60547h3.75146a.53773.53773,0,0,1,.60547.59375v.17676a1.03723,1.03723,0,0,1-.27539.748L14.74854,10.0293A2.31132,2.31132,0,0,1,16.65186,12.30664ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',sde='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Zm7.05371,7.96582v.38477c0,.39648-.165.60547-.46191.60547h-.47314v1.29785a.54085.54085,0,0,1-.605.60547h-.69336a.54085.54085,0,0,1-.605-.60547V12.95605H11.333a.5412.5412,0,0,1-.60547-.60547v-.15332a1.199,1.199,0,0,1,.22021-.748l2.56348-4.05957a.7819.7819,0,0,1,.72607-.39648h1.27637a.54085.54085,0,0,1,.605.60547v3.7627h.33008A.54055.54055,0,0,1,17.05371,11.96582ZM14.28125,8.7207h-.022a4.18969,4.18969,0,0,1-.38525.81348l-1.188,1.80469v.02246h1.5293V9.60059A7.04058,7.04058,0,0,1,14.28125,8.7207Z"/></svg>',ade='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M16.74023,12.18555a2.75131,2.75131,0,0,1-2.91553,2.80566,3.908,3.908,0,0,1-2.25537-.68164.54809.54809,0,0,1-.13184-.8252L11.73438,13c.209-.34082.48389-.36328.8252-.1543a2.23757,2.23757,0,0,0,1.1001.33008,1.01827,1.01827,0,0,0,1.1001-.96777c0-.61621-.53906-.97949-1.25439-.97949a2.15554,2.15554,0,0,0-.64893.09961,1.15209,1.15209,0,0,1-.814.01074l-.12109-.04395a.64116.64116,0,0,1-.45117-.71484l.231-3.00391a.56666.56666,0,0,1,.62744-.583H15.541a.54085.54085,0,0,1,.605.60547v.43945a.54085.54085,0,0,1-.605.60547H13.41748l-.04395.72559a1.29306,1.29306,0,0,1-.04395.30859h.022a2.39776,2.39776,0,0,1,.57227-.07715A2.53266,2.53266,0,0,1,16.74023,12.18555ZM9,3A.99974.99974,0,0,0,8,4V8H3V4A1,1,0,0,0,1,4V14a1,1,0,0,0,2,0V10H8v4a1,1,0,0,0,2,0V4A.99974.99974,0,0,0,9,3Z"/></svg>',lde='<svg viewBox="0 0 18 18"><path class="ql-fill" d="M14.51758,9.64453a1.85627,1.85627,0,0,0-1.24316.38477H13.252a1.73532,1.73532,0,0,1,1.72754-1.4082,2.66491,2.66491,0,0,1,.5498.06641c.35254.05469.57227.01074.70508-.40723l.16406-.5166a.53393.53393,0,0,0-.373-.75977,4.83723,4.83723,0,0,0-1.17773-.14258c-2.43164,0-3.7627,2.17773-3.7627,4.43359,0,2.47559,1.60645,3.69629,3.19043,3.69629A2.70585,2.70585,0,0,0,16.96,12.19727,2.43861,2.43861,0,0,0,14.51758,9.64453Zm-.23047,3.58691c-.67187,0-1.22168-.81445-1.22168-1.45215,0-.47363.30762-.583.72559-.583.96875,0,1.27734.59375,1.27734,1.12207A.82182.82182,0,0,1,14.28711,13.23145ZM10,4V14a1,1,0,0,1-2,0V10H3v4a1,1,0,0,1-2,0V4A1,1,0,0,1,3,4V8H8V4a1,1,0,0,1,2,0Z"/></svg>',ude='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="13" y1="4" y2="4"/><line class="ql-stroke" x1="5" x2="11" y1="14" y2="14"/><line class="ql-stroke" x1="8" x2="10" y1="14" y2="4"/></svg>',cde='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="10" width="12" x="3" y="4"/><circle class="ql-fill" cx="6" cy="7" r="1"/><polyline class="ql-even ql-fill" points="5 12 5 11 7 9 8 10 11 7 13 9 13 12 5 12"/></svg>',dde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-fill ql-stroke" points="3 7 3 11 5 9 3 7"/></svg>',fde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="3" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="5 7 5 11 3 9 5 7"/></svg>',pde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="11" y1="7" y2="11"/><path class="ql-even ql-stroke" d="M8.9,4.577a3.476,3.476,0,0,1,.36,4.679A3.476,3.476,0,0,1,4.577,8.9C3.185,7.5,2.035,6.4,4.217,4.217S7.5,3.185,8.9,4.577Z"/><path class="ql-even ql-stroke" d="M13.423,9.1a3.476,3.476,0,0,0-4.679-.36,3.476,3.476,0,0,0,.36,4.679c1.392,1.392,2.5,2.542,4.679.36S14.815,10.5,13.423,9.1Z"/></svg>',hde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="6" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="6" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="6" x2="15" y1="14" y2="14"/><line class="ql-stroke" x1="3" x2="3" y1="4" y2="4"/><line class="ql-stroke" x1="3" x2="3" y1="9" y2="9"/><line class="ql-stroke" x1="3" x2="3" y1="14" y2="14"/></svg>',gde='<svg class="" viewbox="0 0 18 18"><line class="ql-stroke" x1="9" x2="15" y1="4" y2="4"/><polyline class="ql-stroke" points="3 4 4 5 6 3"/><line class="ql-stroke" x1="9" x2="15" y1="14" y2="14"/><polyline class="ql-stroke" points="3 14 4 15 6 13"/><line class="ql-stroke" x1="9" x2="15" y1="9" y2="9"/><polyline class="ql-stroke" points="3 9 4 10 6 8"/></svg>',mde='<svg viewbox="0 0 18 18"><line class="ql-stroke" x1="7" x2="15" y1="4" y2="4"/><line class="ql-stroke" x1="7" x2="15" y1="9" y2="9"/><line class="ql-stroke" x1="7" x2="15" y1="14" y2="14"/><line class="ql-stroke ql-thin" x1="2.5" x2="4.5" y1="5.5" y2="5.5"/><path class="ql-fill" d="M3.5,6A0.5,0.5,0,0,1,3,5.5V3.085l-0.276.138A0.5,0.5,0,0,1,2.053,3c-0.124-.247-0.023-0.324.224-0.447l1-.5A0.5,0.5,0,0,1,4,2.5v3A0.5,0.5,0,0,1,3.5,6Z"/><path class="ql-stroke ql-thin" d="M4.5,10.5h-2c0-.234,1.85-1.076,1.85-2.234A0.959,0.959,0,0,0,2.5,8.156"/><path class="ql-stroke ql-thin" d="M2.5,14.846a0.959,0.959,0,0,0,1.85-.109A0.7,0.7,0,0,0,3.75,14a0.688,0.688,0,0,0,.6-0.736,0.959,0.959,0,0,0-1.85-.109"/></svg>',bde='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,15H13.861a3.858,3.858,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.921,1.921,0,0,0,12.021,11.7a0.50013,0.50013,0,1,0,.957.291h0a0.914,0.914,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.076-1.16971,1.86982-1.93971,2.43082A1.45639,1.45639,0,0,0,12,15.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,15Z"/><path class="ql-fill" d="M9.65,5.241a1,1,0,0,0-1.409.108L6,7.964,3.759,5.349A1,1,0,0,0,2.192,6.59178Q2.21541,6.6213,2.241,6.649L4.684,9.5,2.241,12.35A1,1,0,0,0,3.71,13.70722q0.02557-.02768.049-0.05722L6,11.036,8.241,13.65a1,1,0,1,0,1.567-1.24277Q9.78459,12.3777,9.759,12.35L7.316,9.5,9.759,6.651A1,1,0,0,0,9.65,5.241Z"/></svg>',vde='<svg viewbox="0 0 18 18"><path class="ql-fill" d="M15.5,7H13.861a4.015,4.015,0,0,0,1.914-2.975,1.8,1.8,0,0,0-1.6-1.751A1.922,1.922,0,0,0,12.021,3.7a0.5,0.5,0,1,0,.957.291,0.917,0.917,0,0,1,1.053-.725,0.81,0.81,0,0,1,.744.762c0,1.077-1.164,1.925-1.934,2.486A1.423,1.423,0,0,0,12,7.5a0.5,0.5,0,0,0,.5.5h3A0.5,0.5,0,0,0,15.5,7Z"/><path class="ql-fill" d="M9.651,5.241a1,1,0,0,0-1.41.108L6,7.964,3.759,5.349a1,1,0,1,0-1.519,1.3L4.683,9.5,2.241,12.35a1,1,0,1,0,1.519,1.3L6,11.036,8.241,13.65a1,1,0,0,0,1.519-1.3L7.317,9.5,9.759,6.651A1,1,0,0,0,9.651,5.241Z"/></svg>',yde='<svg viewbox="0 0 18 18"><line class="ql-stroke ql-thin" x1="15.5" x2="2.5" y1="8.5" y2="9.5"/><path class="ql-fill" d="M9.007,8C6.542,7.791,6,7.519,6,6.5,6,5.792,7.283,5,9,5c1.571,0,2.765.679,2.969,1.309a1,1,0,0,0,1.9-.617C13.356,4.106,11.354,3,9,3,6.2,3,4,4.538,4,6.5a3.2,3.2,0,0,0,.5,1.843Z"/><path class="ql-fill" d="M8.984,10C11.457,10.208,12,10.479,12,11.5c0,0.708-1.283,1.5-3,1.5-1.571,0-2.765-.679-2.969-1.309a1,1,0,1,0-1.9.617C4.644,13.894,6.646,15,9,15c2.8,0,5-1.538,5-3.5a3.2,3.2,0,0,0-.5-1.843Z"/></svg>',xde='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="2" width="3" x="5" y="5"/><rect class="ql-fill" height="2" width="4" x="9" y="5"/><g class="ql-fill ql-transparent"><rect height="2" width="3" x="5" y="8"/><rect height="2" width="4" x="9" y="8"/><rect height="2" width="3" x="5" y="11"/><rect height="2" width="4" x="9" y="11"/></g></svg>',wde='<svg viewbox="0 0 18 18"><path class="ql-stroke" d="M5,3V9a4.012,4.012,0,0,0,4,4H9a4.012,4.012,0,0,0,4-4V3"/><rect class="ql-fill" height="1" rx="0.5" ry="0.5" width="12" x="3" y="15"/></svg>',Cde='<svg viewbox="0 0 18 18"><rect class="ql-stroke" height="12" width="12" x="3" y="3"/><rect class="ql-fill" height="12" width="1" x="5" y="3"/><rect class="ql-fill" height="12" width="1" x="12" y="3"/><rect class="ql-fill" height="2" width="8" x="5" y="8"/><rect class="ql-fill" height="1" width="3" x="3" y="5"/><rect class="ql-fill" height="1" width="3" x="3" y="7"/><rect class="ql-fill" height="1" width="3" x="3" y="10"/><rect class="ql-fill" height="1" width="3" x="3" y="12"/><rect class="ql-fill" height="1" width="3" x="12" y="5"/><rect class="ql-fill" height="1" width="3" x="12" y="7"/><rect class="ql-fill" height="1" width="3" x="12" y="10"/><rect class="ql-fill" height="1" width="3" x="12" y="12"/></svg>',Wl={align:{"":zce,center:qce,right:Uce,justify:Yce},background:Xce,blockquote:Zce,bold:Jce,clean:Kce,code:DR,"code-block":DR,color:Qce,direction:{"":ede,rtl:tde},formula:nde,header:{1:rde,2:ode,3:ide,4:sde,5:ade,6:lde},italic:ude,image:cde,indent:{"+1":dde,"-1":fde},link:pde,list:{bullet:hde,check:gde,ordered:mde},script:{sub:bde,super:vde},strike:yde,table:xde,underline:wde,video:Cde},Sde='<svg viewbox="0 0 18 18"><polygon class="ql-stroke" points="7 11 9 13 11 11 7 11"/><polygon class="ql-stroke" points="7 7 9 5 11 7 7 7"/></svg>';let kR=0;function jR(e,t){e.setAttribute(t,`${e.getAttribute(t)!=="true"}`)}class Xf{constructor(t){this.select=t,this.container=document.createElement("span"),this.buildPicker(),this.select.style.display="none",this.select.parentNode.insertBefore(this.container,this.select),this.label.addEventListener("mousedown",()=>{this.togglePicker()}),this.label.addEventListener("keydown",n=>{switch(n.key){case"Enter":this.togglePicker();break;case"Escape":this.escape(),n.preventDefault();break}}),this.select.addEventListener("change",this.update.bind(this))}togglePicker(){this.container.classList.toggle("ql-expanded"),jR(this.label,"aria-expanded"),jR(this.options,"aria-hidden")}buildItem(t){const n=document.createElement("span");n.tabIndex="0",n.setAttribute("role","button"),n.classList.add("ql-picker-item");const r=t.getAttribute("value");return r&&n.setAttribute("data-value",r),t.textContent&&n.setAttribute("data-label",t.textContent),n.addEventListener("click",()=>{this.selectItem(n,!0)}),n.addEventListener("keydown",o=>{switch(o.key){case"Enter":this.selectItem(n,!0),o.preventDefault();break;case"Escape":this.escape(),o.preventDefault();break}}),n}buildLabel(){const t=document.createElement("span");return t.classList.add("ql-picker-label"),t.innerHTML=Sde,t.tabIndex="0",t.setAttribute("role","button"),t.setAttribute("aria-expanded","false"),this.container.appendChild(t),t}buildOptions(){const t=document.createElement("span");t.classList.add("ql-picker-options"),t.setAttribute("aria-hidden","true"),t.tabIndex="-1",t.id=`ql-picker-options-${kR}`,kR+=1,this.label.setAttribute("aria-controls",t.id),this.options=t,Array.from(this.select.options).forEach(n=>{const r=this.buildItem(n);t.appendChild(r),n.selected===!0&&this.selectItem(r)}),this.container.appendChild(t)}buildPicker(){Array.from(this.select.attributes).forEach(t=>{this.container.setAttribute(t.name,t.value)}),this.container.classList.add("ql-picker"),this.label=this.buildLabel(),this.buildOptions()}escape(){this.close(),setTimeout(()=>this.label.focus(),1)}close(){this.container.classList.remove("ql-expanded"),this.label.setAttribute("aria-expanded","false"),this.options.setAttribute("aria-hidden","true")}selectItem(t){let n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;const r=this.container.querySelector(".ql-selected");t!==r&&(r?.classList.remove("ql-selected"),t!=null&&(t.classList.add("ql-selected"),this.select.selectedIndex=Array.from(t.parentNode.children).indexOf(t),t.hasAttribute("data-value")?this.label.setAttribute("data-value",t.getAttribute("data-value")):this.label.removeAttribute("data-value"),t.hasAttribute("data-label")?this.label.setAttribute("data-label",t.getAttribute("data-label")):this.label.removeAttribute("data-label"),n&&(this.select.dispatchEvent(new Event("change")),this.close())))}update(){let t;if(this.select.selectedIndex>-1){const r=this.container.querySelector(".ql-picker-options").children[this.select.selectedIndex];t=this.select.options[this.select.selectedIndex],this.selectItem(r)}else this.selectItem(null);const n=t!=null&&t!==this.select.querySelector("option[selected]");this.label.classList.toggle("ql-active",n)}}class Xj extends Xf{constructor(t,n){super(t),this.label.innerHTML=n,this.container.classList.add("ql-color-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).slice(0,7).forEach(r=>{r.classList.add("ql-primary")})}buildItem(t){const n=super.buildItem(t);return n.style.backgroundColor=t.getAttribute("value")||"",n}selectItem(t,n){super.selectItem(t,n);const r=this.label.querySelector(".ql-color-label"),o=t&&t.getAttribute("data-value")||"";r&&(r.tagName==="line"?r.style.stroke=o:r.style.fill=o)}}class Zj extends Xf{constructor(t,n){super(t),this.container.classList.add("ql-icon-picker"),Array.from(this.container.querySelectorAll(".ql-picker-item")).forEach(r=>{r.innerHTML=n[r.getAttribute("data-value")||""]}),this.defaultItem=this.container.querySelector(".ql-selected"),this.selectItem(this.defaultItem)}selectItem(t,n){super.selectItem(t,n);const r=t||this.defaultItem;if(r!=null){if(this.label.innerHTML===r.innerHTML)return;this.label.innerHTML=r.innerHTML}}}const Ede=e=>{const{overflowY:t}=getComputedStyle(e,null);return t!=="visible"&&t!=="clip"};class Jj{constructor(t,n){this.quill=t,this.boundsContainer=n||document.body,this.root=t.addContainer("ql-tooltip"),this.root.innerHTML=this.constructor.TEMPLATE,Ede(this.quill.root)&&this.quill.root.addEventListener("scroll",()=>{this.root.style.marginTop=`${-1*this.quill.root.scrollTop}px`}),this.hide()}hide(){this.root.classList.add("ql-hidden")}position(t){const n=t.left+t.width/2-this.root.offsetWidth/2,r=t.bottom+this.quill.root.scrollTop;this.root.style.left=`${n}px`,this.root.style.top=`${r}px`,this.root.classList.remove("ql-flip");const o=this.boundsContainer.getBoundingClientRect(),i=this.root.getBoundingClientRect();let s=0;if(i.right>o.right&&(s=o.right-i.right,this.root.style.left=`${n+s}px`),i.left<o.left&&(s=o.left-i.left,this.root.style.left=`${n+s}px`),i.bottom>o.bottom){const a=i.bottom-i.top,l=t.bottom-t.top+a;this.root.style.top=`${r-l}px`,this.root.classList.add("ql-flip")}return s}show(){this.root.classList.remove("ql-editing"),this.root.classList.remove("ql-hidden")}}const Ide=[!1,"center","right","justify"],Rde=["#000000","#e60000","#ff9900","#ffff00","#008a00","#0066cc","#9933ff","#ffffff","#facccc","#ffebcc","#ffffcc","#cce8cc","#cce0f5","#ebd6ff","#bbbbbb","#f06666","#ffc266","#ffff66","#66b966","#66a3e0","#c285ff","#888888","#a10000","#b26b00","#b2b200","#006100","#0047b2","#6b24b2","#444444","#5c0000","#663d00","#666600","#003700","#002966","#3d1466"],Ade=[!1,"serif","monospace"],Tde=["1","2","3",!1],Ode=["small",!1,"large","huge"];class Iu extends Ca{constructor(t,n){super(t,n);const r=o=>{if(!document.body.contains(t.root)){document.body.removeEventListener("click",r);return}this.tooltip!=null&&!this.tooltip.root.contains(o.target)&&document.activeElement!==this.tooltip.textbox&&!this.quill.hasFocus()&&this.tooltip.hide(),this.pickers!=null&&this.pickers.forEach(i=>{i.container.contains(o.target)||i.close()})};t.emitter.listenDOM("click",document.body,r)}addModule(t){const n=super.addModule(t);return t==="toolbar"&&this.extendToolbar(n),n}buildButtons(t,n){Array.from(t).forEach(r=>{(r.getAttribute("class")||"").split(/\s+/).forEach(i=>{if(i.startsWith("ql-")&&(i=i.slice(3),n[i]!=null))if(i==="direction")r.innerHTML=n[i][""]+n[i].rtl;else if(typeof n[i]=="string")r.innerHTML=n[i];else{const s=r.value||"";s!=null&&n[i][s]&&(r.innerHTML=n[i][s])}})})}buildPickers(t,n){this.pickers=Array.from(t).map(o=>{if(o.classList.contains("ql-align")&&(o.querySelector("option")==null&&Ya(o,Ide),typeof n.align=="object"))return new Zj(o,n.align);if(o.classList.contains("ql-background")||o.classList.contains("ql-color")){const i=o.classList.contains("ql-background")?"background":"color";return o.querySelector("option")==null&&Ya(o,Rde,i==="background"?"#ffffff":"#000000"),new Xj(o,n[i])}return o.querySelector("option")==null&&(o.classList.contains("ql-font")?Ya(o,Ade):o.classList.contains("ql-header")?Ya(o,Tde):o.classList.contains("ql-size")&&Ya(o,Ode)),new Xf(o)});const r=()=>{this.pickers.forEach(o=>{o.update()})};this.quill.on(Oe.events.EDITOR_CHANGE,r)}}Iu.DEFAULTS=ui({},Ca.DEFAULTS,{modules:{toolbar:{handlers:{formula(){this.quill.theme.tooltip.edit("formula")},image(){let e=this.container.querySelector("input.ql-image[type=file]");e==null&&(e=document.createElement("input"),e.setAttribute("type","file"),e.setAttribute("accept",this.quill.uploader.options.mimetypes.join(", ")),e.classList.add("ql-image"),e.addEventListener("change",()=>{const t=this.quill.getSelection(!0);this.quill.uploader.upload(t,e.files),e.value=""}),this.container.appendChild(e)),e.click()},video(){this.quill.theme.tooltip.edit("video")}}}}});class Kj extends Jj{constructor(t,n){super(t,n),this.textbox=this.root.querySelector('input[type="text"]'),this.listen()}listen(){this.textbox.addEventListener("keydown",t=>{t.key==="Enter"?(this.save(),t.preventDefault()):t.key==="Escape"&&(this.cancel(),t.preventDefault())})}cancel(){this.hide(),this.restoreFocus()}edit(){let t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"link",n=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;if(this.root.classList.remove("ql-hidden"),this.root.classList.add("ql-editing"),this.textbox==null)return;n!=null?this.textbox.value=n:t!==this.root.getAttribute("data-mode")&&(this.textbox.value="");const r=this.quill.getBounds(this.quill.selection.savedRange);r!=null&&this.position(r),this.textbox.select(),this.textbox.setAttribute("placeholder",this.textbox.getAttribute(`data-${t}`)||""),this.root.setAttribute("data-mode",t)}restoreFocus(){this.quill.focus({preventScroll:!0})}save(){let{value:t}=this.textbox;switch(this.root.getAttribute("data-mode")){case"link":{const{scrollTop:n}=this.quill.root;this.linkRange?(this.quill.formatText(this.linkRange,"link",t,Oe.sources.USER),delete this.linkRange):(this.restoreFocus(),this.quill.format("link",t,Oe.sources.USER)),this.quill.root.scrollTop=n;break}case"video":t=Nde(t);case"formula":{if(!t)break;const n=this.quill.getSelection(!0);if(n!=null){const r=n.index+n.length;this.quill.insertEmbed(r,this.root.getAttribute("data-mode"),t,Oe.sources.USER),this.root.getAttribute("data-mode")==="formula"&&this.quill.insertText(r+1," ",Oe.sources.USER),this.quill.setSelection(r+2,Oe.sources.USER)}break}}this.textbox.value="",this.hide()}}function Nde(e){let t=e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtube\.com\/watch.*v=([a-zA-Z0-9_-]+)/)||e.match(/^(?:(https?):\/\/)?(?:(?:www|m)\.)?youtu\.be\/([a-zA-Z0-9_-]+)/);return t?`${t[1]||"https"}://www.youtube.com/embed/${t[2]}?showinfo=0`:(t=e.match(/^(?:(https?):\/\/)?(?:www\.)?vimeo\.com\/(\d+)/))?`${t[1]||"https"}://player.vimeo.com/video/${t[2]}/`:e}function Ya(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;t.forEach(r=>{const o=document.createElement("option");r===n?o.setAttribute("selected","selected"):o.setAttribute("value",String(r)),e.appendChild(o)})}const Pde=[["bold","italic","link"],[{header:1},{header:2},"blockquote"]];class _de extends Kj{static TEMPLATE=['<span class="ql-tooltip-arrow"></span>','<div class="ql-tooltip-editor">','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-close"></a>',"</div>"].join("");constructor(t,n){super(t,n),this.quill.on(Oe.events.EDITOR_CHANGE,(r,o,i,s)=>{if(r===Oe.events.SELECTION_CHANGE)if(o!=null&&o.length>0&&s===Oe.sources.USER){this.show(),this.root.style.left="0px",this.root.style.width="",this.root.style.width=`${this.root.offsetWidth}px`;const a=this.quill.getLines(o.index,o.length);if(a.length===1){const l=this.quill.getBounds(o);l!=null&&this.position(l)}else{const l=a[a.length-1],u=this.quill.getIndex(l),c=Math.min(l.length()-1,o.index+o.length-u),d=this.quill.getBounds(new ss(u,c));d!=null&&this.position(d)}}else document.activeElement!==this.textbox&&this.quill.hasFocus()&&this.hide()})}listen(){super.listen(),this.root.querySelector(".ql-close").addEventListener("click",()=>{this.root.classList.remove("ql-editing")}),this.quill.on(Oe.events.SCROLL_OPTIMIZE,()=>{setTimeout(()=>{if(this.root.classList.contains("ql-hidden"))return;const t=this.quill.getSelection();if(t!=null){const n=this.quill.getBounds(t);n!=null&&this.position(n)}},1)})}cancel(){this.show()}position(t){const n=super.position(t),r=this.root.querySelector(".ql-tooltip-arrow");return r.style.marginLeft="",n!==0&&(r.style.marginLeft=`${-1*n-r.offsetWidth/2}px`),n}}class Qj extends Iu{constructor(t,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=Pde),super(t,n),this.quill.container.classList.add("ql-bubble")}extendToolbar(t){this.tooltip=new _de(this.quill,this.options.bounds),t.container!=null&&(this.tooltip.root.appendChild(t.container),this.buildButtons(t.container.querySelectorAll("button"),Wl),this.buildPickers(t.container.querySelectorAll("select"),Wl))}}Qj.DEFAULTS=ui({},Iu.DEFAULTS,{modules:{toolbar:{handlers:{link(e){e?this.quill.theme.tooltip.edit():this.quill.format("link",!1,ce.sources.USER)}}}}});const Mde=[[{header:["1","2","3",!1]}],["bold","italic","underline","link"],[{list:"ordered"},{list:"bullet"}],["clean"]];class Dde extends Kj{static TEMPLATE=['<a class="ql-preview" rel="noopener noreferrer" target="_blank" href="about:blank"></a>','<input type="text" data-formula="e=mc^2" data-link="https://quilljs.com" data-video="Embed URL">','<a class="ql-action"></a>','<a class="ql-remove"></a>'].join("");preview=this.root.querySelector("a.ql-preview");listen(){super.listen(),this.root.querySelector("a.ql-action").addEventListener("click",t=>{this.root.classList.contains("ql-editing")?this.save():this.edit("link",this.preview.textContent),t.preventDefault()}),this.root.querySelector("a.ql-remove").addEventListener("click",t=>{if(this.linkRange!=null){const n=this.linkRange;this.restoreFocus(),this.quill.formatText(n,"link",!1,Oe.sources.USER),delete this.linkRange}t.preventDefault(),this.hide()}),this.quill.on(Oe.events.SELECTION_CHANGE,(t,n,r)=>{if(t!=null){if(t.length===0&&r===Oe.sources.USER){const[o,i]=this.quill.scroll.descendant(Ad,t.index);if(o!=null){this.linkRange=new ss(t.index-i,o.length());const s=Ad.formats(o.domNode);this.preview.textContent=s,this.preview.setAttribute("href",s),this.show();const a=this.quill.getBounds(this.linkRange);a!=null&&this.position(a);return}}else delete this.linkRange;this.hide()}})}show(){super.show(),this.root.removeAttribute("data-mode")}}class eL extends Iu{constructor(t,n){n.modules.toolbar!=null&&n.modules.toolbar.container==null&&(n.modules.toolbar.container=Mde),super(t,n),this.quill.container.classList.add("ql-snow")}extendToolbar(t){t.container!=null&&(t.container.classList.add("ql-snow"),this.buildButtons(t.container.querySelectorAll("button"),Wl),this.buildPickers(t.container.querySelectorAll("select"),Wl),this.tooltip=new Dde(this.quill,this.options.bounds),t.container.querySelector(".ql-link")&&this.quill.keyboard.addBinding({key:"k",shortKey:!0},(n,r)=>{t.handlers.link.call(t,!r.format.link)}))}}eL.DEFAULTS=ui({},Iu.DEFAULTS,{modules:{toolbar:{handlers:{link(e){if(e){const t=this.quill.getSelection();if(t==null||t.length===0)return;let n=this.quill.getText(t);/^\S+@\S+\.\S+$/.test(n)&&n.indexOf("mailto:")!==0&&(n=`mailto:${n}`);const{tooltip:r}=this.quill.theme;r.edit("link",n)}else this.quill.format("link",!1,ce.sources.USER)}}}}});ce.register({"attributors/attribute/direction":Lj,"attributors/class/align":Dj,"attributors/class/background":Bue,"attributors/class/color":Fue,"attributors/class/direction":Fj,"attributors/class/font":$j,"attributors/class/size":Hj,"attributors/style/align":kj,"attributors/style/background":_x,"attributors/style/color":Px,"attributors/style/direction":Bj,"attributors/style/font":Gj,"attributors/style/size":Wj},!0);ce.register({"formats/align":Dj,"formats/direction":Fj,"formats/indent":Pce,"formats/background":_x,"formats/color":Px,"formats/font":$j,"formats/size":Hj,"formats/blockquote":_ce,"formats/code-block":In,"formats/header":Mce,"formats/list":Eu,"formats/bold":Lx,"formats/code":Mx,"formats/italic":Dce,"formats/link":Ad,"formats/script":kce,"formats/strike":jce,"formats/underline":Lce,"formats/formula":Fce,"formats/image":Bce,"formats/video":Vce,"modules/syntax":Yj,"modules/table":Gce,"modules/toolbar":Bx,"themes/bubble":Qj,"themes/snow":eL,"ui/icons":Wl,"ui/picker":Xf,"ui/icon-picker":Zj,"ui/color-picker":Xj,"ui/tooltip":Jj},!0);const tL=N.forwardRef(({readOnly:e,defaultValue:t,onTextChange:n,onSelectionChange:r,theme:o="snow"},i)=>{const s=N.useRef(null),a=N.useRef(t),l=N.useRef(n),u=N.useRef(r),c=N.useRef(null);return N.useLayoutEffect(()=>{l.current=n,u.current=r}),N.useEffect(()=>{i&&typeof i=="object"&&i.current&&i.current.enable(!e)},[i,e]),N.useEffect(()=>{const d=s.current;if(!d)return;const f=d.appendChild(d.ownerDocument.createElement("div")),p=new ce(f,{theme:o});return c.current=p,i&&typeof i=="object"&&(i.current=p),a.current&&p.setContents(a.current),p.on(ce.events.TEXT_CHANGE,()=>{const g=p.getSemanticHTML();l.current?.(g)}),p.on(ce.events.SELECTION_CHANGE,(g,m,v)=>{u.current?.(g,m,v)}),()=>{c.current=null,i&&typeof i=="object"&&(i.current=null),d.innerHTML=""}},[i,o]),h.jsx("div",{ref:s})});tL.displayName="QuillEditor";const nL=N.createContext(null);function Zf(){const e=N.useContext(nL);if(!e)throw new Error("DataTable components must be used within DataTable.Root");return e}function kde({table:e,children:t,isLoading:n=!1,search:r="",onSearchChange:o=()=>{},totalCount:i,className:s}){const a={table:e,isLoading:n,search:r,onSearchChange:o,totalCount:i};return h.jsx(nL.Provider,{value:a,children:h.jsx("div",{className:F("ui:w-full",s),children:t})})}function jde({children:e,className:t}){return h.jsx("div",{className:F("ui:flex ui:justify-between ui:gap-2 ui:items-center ui:p-3 ui:bg-white ui:rounded-lg ui:border ui:mb-2.5",t),children:e})}function Lde({placeholder:e="Search...",filterColumn:t,className:n,label:r}){const{table:o,search:i,onSearchChange:s}=Zf(),a=u=>{const c=String(u);t?o.getColumn(t)?.setFilterValue(c):s(c)},l=t?o.getColumn(t)?.getFilterValue()??"":i;return h.jsx(vk,{placeholder:e,value:l,onChange:a,className:F(n),label:r??"",name:"debounced-search-label"})}function Fde({emptyMessage:e="No columns found.",allOptionLabel:t="All columns"}){const{table:n}=Zf(),r=n.getAllColumns().filter(a=>a.getCanHide()&&!a.getIsPinned()),o=N.useMemo(()=>r.map(a=>{let l=a.id;return typeof a.columnDef.header=="string"&&(l=a.columnDef.header),a.columnDef.meta?.label&&(l=a.columnDef.meta.label),{value:a.id,label:l}}),[r]),i=N.useMemo(()=>r.filter(a=>a.getIsVisible()).map(a=>{const l=o.find(u=>u.value===a.id);return{value:a.id,label:l?.label??a.id}}),[r,o]),s=N.useCallback(a=>{const l=a.map(u=>u.value);r.forEach(u=>{u.toggleVisibility(l.includes(u.id))})},[r]);return h.jsx(tx,{multiple:!0,inputMode:"popup",items:o,value:i,onValueChange:s,emptyMessage:e,hasAllOption:!0,allOptionLabel:t,renderPopupTrigger:()=>h.jsx(on,{variant:"outline",size:"icon-lg",children:h.jsx(_e.Columns2,{})})})}function oi(e,t){return typeof e=="function"?e(t):e}function $n(e,t){return n=>{t.setState(r=>({...r,[e]:oi(n,r[e])}))}}function Jf(e){return e instanceof Function}function Bde(e){return Array.isArray(e)&&e.every(t=>typeof t=="number")}function Vde(e,t){const n=[],r=o=>{o.forEach(i=>{n.push(i);const s=t(i);s!=null&&s.length&&r(s)})};return r(e),n}function We(e,t,n){let r=[],o;return i=>{let s;n.key&&n.debug&&(s=Date.now());const a=e(i);if(!(a.length!==r.length||a.some((c,d)=>r[d]!==c)))return o;r=a;let u;if(n.key&&n.debug&&(u=Date.now()),o=t(...a),n==null||n.onChange==null||n.onChange(o),n.key&&n.debug&&n!=null&&n.debug()){const c=Math.round((Date.now()-s)*100)/100,d=Math.round((Date.now()-u)*100)/100,f=d/16,p=(g,m)=>{for(g=String(g);g.length<m;)g=" "+g;return g};console.info(`%c⏱ ${p(d,5)} /${p(c,5)} ms`,`
|
|
161
161
|
font-size: .6rem;
|
|
162
162
|
font-weight: bold;
|
|
163
163
|
color: hsl(${Math.max(0,Math.min(120-120*f,120))}deg 100% 31%);`,n?.key)}return o}}function ze(e,t,n,r){return{debug:()=>{var o;return(o=e?.debugAll)!=null?o:e[t]},key:process.env.NODE_ENV==="development"&&n,onChange:r}}function $de(e,t,n,r){const o=()=>{var s;return(s=i.getValue())!=null?s:e.options.renderFallbackValue},i={id:`${t.id}_${n.id}`,row:t,column:n,getValue:()=>t.getValue(r),renderValue:o,getContext:We(()=>[e,n,t,i],(s,a,l,u)=>({table:s,column:a,row:l,cell:u,getValue:u.getValue,renderValue:u.renderValue}),ze(e.options,"debugCells","cell.getContext"))};return e._features.forEach(s=>{s.createCell==null||s.createCell(i,n,t,e)},{}),i}function Gde(e,t,n,r){var o,i;const a={...e._getDefaultColumnDef(),...t},l=a.accessorKey;let u=(o=(i=a.id)!=null?i:l?typeof String.prototype.replaceAll=="function"?l.replaceAll(".","_"):l.replace(/\./g,"_"):void 0)!=null?o:typeof a.header=="string"?a.header:void 0,c;if(a.accessorFn?c=a.accessorFn:l&&(l.includes(".")?c=f=>{let p=f;for(const m of l.split(".")){var g;p=(g=p)==null?void 0:g[m],process.env.NODE_ENV!=="production"&&p===void 0&&console.warn(`"${m}" in deeply nested key "${l}" returned undefined.`)}return p}:c=f=>f[a.accessorKey]),!u)throw process.env.NODE_ENV!=="production"?new Error(a.accessorFn?"Columns require an id when using an accessorFn":"Columns require an id when using a non-string header"):new Error;let d={id:`${String(u)}`,accessorFn:c,parent:r,depth:n,columnDef:a,columns:[],getFlatColumns:We(()=>[!0],()=>{var f;return[d,...(f=d.columns)==null?void 0:f.flatMap(p=>p.getFlatColumns())]},ze(e.options,"debugColumns","column.getFlatColumns")),getLeafColumns:We(()=>[e._getOrderColumnsFn()],f=>{var p;if((p=d.columns)!=null&&p.length){let g=d.columns.flatMap(m=>m.getLeafColumns());return f(g)}return[d]},ze(e.options,"debugColumns","column.getLeafColumns"))};for(const f of e._features)f.createColumn==null||f.createColumn(d,e);return d}const mn="debugHeaders";function LR(e,t,n){var r;let i={id:(r=n.id)!=null?r:t.id,column:t,index:n.index,isPlaceholder:!!n.isPlaceholder,placeholderId:n.placeholderId,depth:n.depth,subHeaders:[],colSpan:0,rowSpan:0,headerGroup:null,getLeafHeaders:()=>{const s=[],a=l=>{l.subHeaders&&l.subHeaders.length&&l.subHeaders.map(a),s.push(l)};return a(i),s},getContext:()=>({table:e,header:i,column:t})};return e._features.forEach(s=>{s.createHeader==null||s.createHeader(i,e)}),i}const Hde={createTable:e=>{e.getHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>{var i,s;const a=(i=r?.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?i:[],l=(s=o?.map(d=>n.find(f=>f.id===d)).filter(Boolean))!=null?s:[],u=n.filter(d=>!(r!=null&&r.includes(d.id))&&!(o!=null&&o.includes(d.id)));return wc(t,[...a,...u,...l],e)},ze(e.options,mn,"getHeaderGroups")),e.getCenterHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r,o)=>(n=n.filter(i=>!(r!=null&&r.includes(i.id))&&!(o!=null&&o.includes(i.id))),wc(t,n,e,"center")),ze(e.options,mn,"getCenterHeaderGroups")),e.getLeftHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.left],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return wc(t,i,e,"left")},ze(e.options,mn,"getLeftHeaderGroups")),e.getRightHeaderGroups=We(()=>[e.getAllColumns(),e.getVisibleLeafColumns(),e.getState().columnPinning.right],(t,n,r)=>{var o;const i=(o=r?.map(s=>n.find(a=>a.id===s)).filter(Boolean))!=null?o:[];return wc(t,i,e,"right")},ze(e.options,mn,"getRightHeaderGroups")),e.getFooterGroups=We(()=>[e.getHeaderGroups()],t=>[...t].reverse(),ze(e.options,mn,"getFooterGroups")),e.getLeftFooterGroups=We(()=>[e.getLeftHeaderGroups()],t=>[...t].reverse(),ze(e.options,mn,"getLeftFooterGroups")),e.getCenterFooterGroups=We(()=>[e.getCenterHeaderGroups()],t=>[...t].reverse(),ze(e.options,mn,"getCenterFooterGroups")),e.getRightFooterGroups=We(()=>[e.getRightHeaderGroups()],t=>[...t].reverse(),ze(e.options,mn,"getRightFooterGroups")),e.getFlatHeaders=We(()=>[e.getHeaderGroups()],t=>t.map(n=>n.headers).flat(),ze(e.options,mn,"getFlatHeaders")),e.getLeftFlatHeaders=We(()=>[e.getLeftHeaderGroups()],t=>t.map(n=>n.headers).flat(),ze(e.options,mn,"getLeftFlatHeaders")),e.getCenterFlatHeaders=We(()=>[e.getCenterHeaderGroups()],t=>t.map(n=>n.headers).flat(),ze(e.options,mn,"getCenterFlatHeaders")),e.getRightFlatHeaders=We(()=>[e.getRightHeaderGroups()],t=>t.map(n=>n.headers).flat(),ze(e.options,mn,"getRightFlatHeaders")),e.getCenterLeafHeaders=We(()=>[e.getCenterFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ze(e.options,mn,"getCenterLeafHeaders")),e.getLeftLeafHeaders=We(()=>[e.getLeftFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ze(e.options,mn,"getLeftLeafHeaders")),e.getRightLeafHeaders=We(()=>[e.getRightFlatHeaders()],t=>t.filter(n=>{var r;return!((r=n.subHeaders)!=null&&r.length)}),ze(e.options,mn,"getRightLeafHeaders")),e.getLeafHeaders=We(()=>[e.getLeftHeaderGroups(),e.getCenterHeaderGroups(),e.getRightHeaderGroups()],(t,n,r)=>{var o,i,s,a,l,u;return[...(o=(i=t[0])==null?void 0:i.headers)!=null?o:[],...(s=(a=n[0])==null?void 0:a.headers)!=null?s:[],...(l=(u=r[0])==null?void 0:u.headers)!=null?l:[]].map(c=>c.getLeafHeaders()).flat()},ze(e.options,mn,"getLeafHeaders"))}};function wc(e,t,n,r){var o,i;let s=0;const a=function(f,p){p===void 0&&(p=1),s=Math.max(s,p),f.filter(g=>g.getIsVisible()).forEach(g=>{var m;(m=g.columns)!=null&&m.length&&a(g.columns,p+1)},0)};a(e);let l=[];const u=(f,p)=>{const g={depth:p,id:[r,`${p}`].filter(Boolean).join("_"),headers:[]},m=[];f.forEach(v=>{const y=[...m].reverse()[0],x=v.column.depth===g.depth;let w,C=!1;if(x&&v.column.parent?w=v.column.parent:(w=v.column,C=!0),y&&y?.column===w)y.subHeaders.push(v);else{const S=LR(n,w,{id:[r,p,w.id,v?.id].filter(Boolean).join("_"),isPlaceholder:C,placeholderId:C?`${m.filter(R=>R.column===w).length}`:void 0,depth:p,index:m.length});S.subHeaders.push(v),m.push(S)}g.headers.push(v),v.headerGroup=g}),l.push(g),p>0&&u(m,p-1)},c=t.map((f,p)=>LR(n,f,{depth:s,index:p}));u(c,s-1),l.reverse();const d=f=>f.filter(g=>g.column.getIsVisible()).map(g=>{let m=0,v=0,y=[0];g.subHeaders&&g.subHeaders.length?(y=[],d(g.subHeaders).forEach(w=>{let{colSpan:C,rowSpan:S}=w;m+=C,y.push(S)})):m=1;const x=Math.min(...y);return v=v+x,g.colSpan=m,g.rowSpan=v,{colSpan:m,rowSpan:v}});return d((o=(i=l[0])==null?void 0:i.headers)!=null?o:[]),l}const Vx=(e,t,n,r,o,i,s)=>{let a={id:t,index:r,original:n,depth:o,parentId:s,_valuesCache:{},_uniqueValuesCache:{},getValue:l=>{if(a._valuesCache.hasOwnProperty(l))return a._valuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return a._valuesCache[l]=u.accessorFn(a.original,r),a._valuesCache[l]},getUniqueValues:l=>{if(a._uniqueValuesCache.hasOwnProperty(l))return a._uniqueValuesCache[l];const u=e.getColumn(l);if(u!=null&&u.accessorFn)return u.columnDef.getUniqueValues?(a._uniqueValuesCache[l]=u.columnDef.getUniqueValues(a.original,r),a._uniqueValuesCache[l]):(a._uniqueValuesCache[l]=[a.getValue(l)],a._uniqueValuesCache[l])},renderValue:l=>{var u;return(u=a.getValue(l))!=null?u:e.options.renderFallbackValue},subRows:[],getLeafRows:()=>Vde(a.subRows,l=>l.subRows),getParentRow:()=>a.parentId?e.getRow(a.parentId,!0):void 0,getParentRows:()=>{let l=[],u=a;for(;;){const c=u.getParentRow();if(!c)break;l.push(c),u=c}return l.reverse()},getAllCells:We(()=>[e.getAllLeafColumns()],l=>l.map(u=>$de(e,a,u,u.id)),ze(e.options,"debugRows","getAllCells")),_getAllCellsByColumnId:We(()=>[a.getAllCells()],l=>l.reduce((u,c)=>(u[c.column.id]=c,u),{}),ze(e.options,"debugRows","getAllCellsByColumnId"))};for(let l=0;l<e._features.length;l++){const u=e._features[l];u==null||u.createRow==null||u.createRow(a,e)}return a},Wde={createColumn:(e,t)=>{e._getFacetedRowModel=t.options.getFacetedRowModel&&t.options.getFacetedRowModel(t,e.id),e.getFacetedRowModel=()=>e._getFacetedRowModel?e._getFacetedRowModel():t.getPreFilteredRowModel(),e._getFacetedUniqueValues=t.options.getFacetedUniqueValues&&t.options.getFacetedUniqueValues(t,e.id),e.getFacetedUniqueValues=()=>e._getFacetedUniqueValues?e._getFacetedUniqueValues():new Map,e._getFacetedMinMaxValues=t.options.getFacetedMinMaxValues&&t.options.getFacetedMinMaxValues(t,e.id),e.getFacetedMinMaxValues=()=>{if(e._getFacetedMinMaxValues)return e._getFacetedMinMaxValues()}}},rL=(e,t,n)=>{var r,o;const i=n==null||(r=n.toString())==null?void 0:r.toLowerCase();return!!(!((o=e.getValue(t))==null||(o=o.toString())==null||(o=o.toLowerCase())==null)&&o.includes(i))};rL.autoRemove=e=>Pr(e);const oL=(e,t,n)=>{var r;return!!(!((r=e.getValue(t))==null||(r=r.toString())==null)&&r.includes(n))};oL.autoRemove=e=>Pr(e);const iL=(e,t,n)=>{var r;return((r=e.getValue(t))==null||(r=r.toString())==null?void 0:r.toLowerCase())===n?.toLowerCase()};iL.autoRemove=e=>Pr(e);const sL=(e,t,n)=>{var r;return(r=e.getValue(t))==null?void 0:r.includes(n)};sL.autoRemove=e=>Pr(e);const aL=(e,t,n)=>!n.some(r=>{var o;return!((o=e.getValue(t))!=null&&o.includes(r))});aL.autoRemove=e=>Pr(e)||!(e!=null&&e.length);const lL=(e,t,n)=>n.some(r=>{var o;return(o=e.getValue(t))==null?void 0:o.includes(r)});lL.autoRemove=e=>Pr(e)||!(e!=null&&e.length);const uL=(e,t,n)=>e.getValue(t)===n;uL.autoRemove=e=>Pr(e);const cL=(e,t,n)=>e.getValue(t)==n;cL.autoRemove=e=>Pr(e);const $x=(e,t,n)=>{let[r,o]=n;const i=e.getValue(t);return i>=r&&i<=o};$x.resolveFilterValue=e=>{let[t,n]=e,r=typeof t!="number"?parseFloat(t):t,o=typeof n!="number"?parseFloat(n):n,i=t===null||Number.isNaN(r)?-1/0:r,s=n===null||Number.isNaN(o)?1/0:o;if(i>s){const a=i;i=s,s=a}return[i,s]};$x.autoRemove=e=>Pr(e)||Pr(e[0])&&Pr(e[1]);const Ro={includesString:rL,includesStringSensitive:oL,equalsString:iL,arrIncludes:sL,arrIncludesAll:aL,arrIncludesSome:lL,equals:uL,weakEquals:cL,inNumberRange:$x};function Pr(e){return e==null||e===""}const zde={getDefaultColumnDef:()=>({filterFn:"auto"}),getInitialState:e=>({columnFilters:[],...e}),getDefaultOptions:e=>({onColumnFiltersChange:$n("columnFilters",e),filterFromLeafRows:!1,maxLeafRowFilterDepth:100}),createColumn:(e,t)=>{e.getAutoFilterFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);return typeof r=="string"?Ro.includesString:typeof r=="number"?Ro.inNumberRange:typeof r=="boolean"||r!==null&&typeof r=="object"?Ro.equals:Array.isArray(r)?Ro.arrIncludes:Ro.weakEquals},e.getFilterFn=()=>{var n,r;return Jf(e.columnDef.filterFn)?e.columnDef.filterFn:e.columnDef.filterFn==="auto"?e.getAutoFilterFn():(n=(r=t.options.filterFns)==null?void 0:r[e.columnDef.filterFn])!=null?n:Ro[e.columnDef.filterFn]},e.getCanFilter=()=>{var n,r,o;return((n=e.columnDef.enableColumnFilter)!=null?n:!0)&&((r=t.options.enableColumnFilters)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&!!e.accessorFn},e.getIsFiltered=()=>e.getFilterIndex()>-1,e.getFilterValue=()=>{var n;return(n=t.getState().columnFilters)==null||(n=n.find(r=>r.id===e.id))==null?void 0:n.value},e.getFilterIndex=()=>{var n,r;return(n=(r=t.getState().columnFilters)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.setFilterValue=n=>{t.setColumnFilters(r=>{const o=e.getFilterFn(),i=r?.find(c=>c.id===e.id),s=oi(n,i?i.value:void 0);if(FR(o,s,e)){var a;return(a=r?.filter(c=>c.id!==e.id))!=null?a:[]}const l={id:e.id,value:s};if(i){var u;return(u=r?.map(c=>c.id===e.id?l:c))!=null?u:[]}return r!=null&&r.length?[...r,l]:[l]})}},createRow:(e,t)=>{e.columnFilters={},e.columnFiltersMeta={}},createTable:e=>{e.setColumnFilters=t=>{const n=e.getAllLeafColumns(),r=o=>{var i;return(i=oi(t,o))==null?void 0:i.filter(s=>{const a=n.find(l=>l.id===s.id);if(a){const l=a.getFilterFn();if(FR(l,s.value,a))return!1}return!0})};e.options.onColumnFiltersChange==null||e.options.onColumnFiltersChange(r)},e.resetColumnFilters=t=>{var n,r;e.setColumnFilters(t?[]:(n=(r=e.initialState)==null?void 0:r.columnFilters)!=null?n:[])},e.getPreFilteredRowModel=()=>e.getCoreRowModel(),e.getFilteredRowModel=()=>(!e._getFilteredRowModel&&e.options.getFilteredRowModel&&(e._getFilteredRowModel=e.options.getFilteredRowModel(e)),e.options.manualFiltering||!e._getFilteredRowModel?e.getPreFilteredRowModel():e._getFilteredRowModel())}};function FR(e,t,n){return(e&&e.autoRemove?e.autoRemove(t,n):!1)||typeof t>"u"||typeof t=="string"&&!t}const qde=(e,t,n)=>n.reduce((r,o)=>{const i=o.getValue(e);return r+(typeof i=="number"?i:0)},0),Ude=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r>i||r===void 0&&i>=i)&&(r=i)}),r},Yde=(e,t,n)=>{let r;return n.forEach(o=>{const i=o.getValue(e);i!=null&&(r<i||r===void 0&&i>=i)&&(r=i)}),r},Xde=(e,t,n)=>{let r,o;return n.forEach(i=>{const s=i.getValue(e);s!=null&&(r===void 0?s>=s&&(r=o=s):(r>s&&(r=s),o<s&&(o=s)))}),[r,o]},Zde=(e,t)=>{let n=0,r=0;if(t.forEach(o=>{let i=o.getValue(e);i!=null&&(i=+i)>=i&&(++n,r+=i)}),n)return r/n},Jde=(e,t)=>{if(!t.length)return;const n=t.map(i=>i.getValue(e));if(!Bde(n))return;if(n.length===1)return n[0];const r=Math.floor(n.length/2),o=n.sort((i,s)=>i-s);return n.length%2!==0?o[r]:(o[r-1]+o[r])/2},Kde=(e,t)=>Array.from(new Set(t.map(n=>n.getValue(e))).values()),Qde=(e,t)=>new Set(t.map(n=>n.getValue(e))).size,efe=(e,t)=>t.length,cb={sum:qde,min:Ude,max:Yde,extent:Xde,mean:Zde,median:Jde,unique:Kde,uniqueCount:Qde,count:efe},tfe={getDefaultColumnDef:()=>({aggregatedCell:e=>{var t,n;return(t=(n=e.getValue())==null||n.toString==null?void 0:n.toString())!=null?t:null},aggregationFn:"auto"}),getInitialState:e=>({grouping:[],...e}),getDefaultOptions:e=>({onGroupingChange:$n("grouping",e),groupedColumnMode:"reorder"}),createColumn:(e,t)=>{e.toggleGrouping=()=>{t.setGrouping(n=>n!=null&&n.includes(e.id)?n.filter(r=>r!==e.id):[...n??[],e.id])},e.getCanGroup=()=>{var n,r;return((n=e.columnDef.enableGrouping)!=null?n:!0)&&((r=t.options.enableGrouping)!=null?r:!0)&&(!!e.accessorFn||!!e.columnDef.getGroupingValue)},e.getIsGrouped=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.includes(e.id)},e.getGroupedIndex=()=>{var n;return(n=t.getState().grouping)==null?void 0:n.indexOf(e.id)},e.getToggleGroupingHandler=()=>{const n=e.getCanGroup();return()=>{n&&e.toggleGrouping()}},e.getAutoAggregationFn=()=>{const n=t.getCoreRowModel().flatRows[0],r=n?.getValue(e.id);if(typeof r=="number")return cb.sum;if(Object.prototype.toString.call(r)==="[object Date]")return cb.extent},e.getAggregationFn=()=>{var n,r;if(!e)throw new Error;return Jf(e.columnDef.aggregationFn)?e.columnDef.aggregationFn:e.columnDef.aggregationFn==="auto"?e.getAutoAggregationFn():(n=(r=t.options.aggregationFns)==null?void 0:r[e.columnDef.aggregationFn])!=null?n:cb[e.columnDef.aggregationFn]}},createTable:e=>{e.setGrouping=t=>e.options.onGroupingChange==null?void 0:e.options.onGroupingChange(t),e.resetGrouping=t=>{var n,r;e.setGrouping(t?[]:(n=(r=e.initialState)==null?void 0:r.grouping)!=null?n:[])},e.getPreGroupedRowModel=()=>e.getFilteredRowModel(),e.getGroupedRowModel=()=>(!e._getGroupedRowModel&&e.options.getGroupedRowModel&&(e._getGroupedRowModel=e.options.getGroupedRowModel(e)),e.options.manualGrouping||!e._getGroupedRowModel?e.getPreGroupedRowModel():e._getGroupedRowModel())},createRow:(e,t)=>{e.getIsGrouped=()=>!!e.groupingColumnId,e.getGroupingValue=n=>{if(e._groupingValuesCache.hasOwnProperty(n))return e._groupingValuesCache[n];const r=t.getColumn(n);return r!=null&&r.columnDef.getGroupingValue?(e._groupingValuesCache[n]=r.columnDef.getGroupingValue(e.original),e._groupingValuesCache[n]):e.getValue(n)},e._groupingValuesCache={}},createCell:(e,t,n,r)=>{e.getIsGrouped=()=>t.getIsGrouped()&&t.id===n.groupingColumnId,e.getIsPlaceholder=()=>!e.getIsGrouped()&&t.getIsGrouped(),e.getIsAggregated=()=>{var o;return!e.getIsGrouped()&&!e.getIsPlaceholder()&&!!((o=n.subRows)!=null&&o.length)}}};function nfe(e,t,n){if(!(t!=null&&t.length)||!n)return e;const r=e.filter(i=>!t.includes(i.id));return n==="remove"?r:[...t.map(i=>e.find(s=>s.id===i)).filter(Boolean),...r]}const rfe={getInitialState:e=>({columnOrder:[],...e}),getDefaultOptions:e=>({onColumnOrderChange:$n("columnOrder",e)}),createColumn:(e,t)=>{e.getIndex=We(n=>[vl(t,n)],n=>n.findIndex(r=>r.id===e.id),ze(t.options,"debugColumns","getIndex")),e.getIsFirstColumn=n=>{var r;return((r=vl(t,n)[0])==null?void 0:r.id)===e.id},e.getIsLastColumn=n=>{var r;const o=vl(t,n);return((r=o[o.length-1])==null?void 0:r.id)===e.id}},createTable:e=>{e.setColumnOrder=t=>e.options.onColumnOrderChange==null?void 0:e.options.onColumnOrderChange(t),e.resetColumnOrder=t=>{var n;e.setColumnOrder(t?[]:(n=e.initialState.columnOrder)!=null?n:[])},e._getOrderColumnsFn=We(()=>[e.getState().columnOrder,e.getState().grouping,e.options.groupedColumnMode],(t,n,r)=>o=>{let i=[];if(!(t!=null&&t.length))i=o;else{const s=[...t],a=[...o];for(;a.length&&s.length;){const l=s.shift(),u=a.findIndex(c=>c.id===l);u>-1&&i.push(a.splice(u,1)[0])}i=[...i,...a]}return nfe(i,n,r)},ze(e.options,"debugTable","_getOrderColumnsFn"))}},db=()=>({left:[],right:[]}),ofe={getInitialState:e=>({columnPinning:db(),...e}),getDefaultOptions:e=>({onColumnPinningChange:$n("columnPinning",e)}),createColumn:(e,t)=>{e.pin=n=>{const r=e.getLeafColumns().map(o=>o.id).filter(Boolean);t.setColumnPinning(o=>{var i,s;if(n==="right"){var a,l;return{left:((a=o?.left)!=null?a:[]).filter(d=>!(r!=null&&r.includes(d))),right:[...((l=o?.right)!=null?l:[]).filter(d=>!(r!=null&&r.includes(d))),...r]}}if(n==="left"){var u,c;return{left:[...((u=o?.left)!=null?u:[]).filter(d=>!(r!=null&&r.includes(d))),...r],right:((c=o?.right)!=null?c:[]).filter(d=>!(r!=null&&r.includes(d)))}}return{left:((i=o?.left)!=null?i:[]).filter(d=>!(r!=null&&r.includes(d))),right:((s=o?.right)!=null?s:[]).filter(d=>!(r!=null&&r.includes(d)))}})},e.getCanPin=()=>e.getLeafColumns().some(r=>{var o,i,s;return((o=r.columnDef.enablePinning)!=null?o:!0)&&((i=(s=t.options.enableColumnPinning)!=null?s:t.options.enablePinning)!=null?i:!0)}),e.getIsPinned=()=>{const n=e.getLeafColumns().map(a=>a.id),{left:r,right:o}=t.getState().columnPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"left":s?"right":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();return o?(n=(r=t.getState().columnPinning)==null||(r=r[o])==null?void 0:r.indexOf(e.id))!=null?n:-1:0}},createRow:(e,t)=>{e.getCenterVisibleCells=We(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left,t.getState().columnPinning.right],(n,r,o)=>{const i=[...r??[],...o??[]];return n.filter(s=>!i.includes(s.column.id))},ze(t.options,"debugRows","getCenterVisibleCells")),e.getLeftVisibleCells=We(()=>[e._getAllVisibleCells(),t.getState().columnPinning.left],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"left"})),ze(t.options,"debugRows","getLeftVisibleCells")),e.getRightVisibleCells=We(()=>[e._getAllVisibleCells(),t.getState().columnPinning.right],(n,r)=>(r??[]).map(i=>n.find(s=>s.column.id===i)).filter(Boolean).map(i=>({...i,position:"right"})),ze(t.options,"debugRows","getRightVisibleCells"))},createTable:e=>{e.setColumnPinning=t=>e.options.onColumnPinningChange==null?void 0:e.options.onColumnPinningChange(t),e.resetColumnPinning=t=>{var n,r;return e.setColumnPinning(t?db():(n=(r=e.initialState)==null?void 0:r.columnPinning)!=null?n:db())},e.getIsSomeColumnsPinned=t=>{var n;const r=e.getState().columnPinning;if(!t){var o,i;return!!((o=r.left)!=null&&o.length||(i=r.right)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e.getLeftLeafColumns=We(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ze(e.options,"debugColumns","getLeftLeafColumns")),e.getRightLeafColumns=We(()=>[e.getAllLeafColumns(),e.getState().columnPinning.right],(t,n)=>(n??[]).map(r=>t.find(o=>o.id===r)).filter(Boolean),ze(e.options,"debugColumns","getRightLeafColumns")),e.getCenterLeafColumns=We(()=>[e.getAllLeafColumns(),e.getState().columnPinning.left,e.getState().columnPinning.right],(t,n,r)=>{const o=[...n??[],...r??[]];return t.filter(i=>!o.includes(i.id))},ze(e.options,"debugColumns","getCenterLeafColumns"))}};function ife(e){return e||(typeof document<"u"?document:null)}const Cc={size:150,minSize:20,maxSize:Number.MAX_SAFE_INTEGER},fb=()=>({startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,isResizingColumn:!1,columnSizingStart:[]}),sfe={getDefaultColumnDef:()=>Cc,getInitialState:e=>({columnSizing:{},columnSizingInfo:fb(),...e}),getDefaultOptions:e=>({columnResizeMode:"onEnd",columnResizeDirection:"ltr",onColumnSizingChange:$n("columnSizing",e),onColumnSizingInfoChange:$n("columnSizingInfo",e)}),createColumn:(e,t)=>{e.getSize=()=>{var n,r,o;const i=t.getState().columnSizing[e.id];return Math.min(Math.max((n=e.columnDef.minSize)!=null?n:Cc.minSize,(r=i??e.columnDef.size)!=null?r:Cc.size),(o=e.columnDef.maxSize)!=null?o:Cc.maxSize)},e.getStart=We(n=>[n,vl(t,n),t.getState().columnSizing],(n,r)=>r.slice(0,e.getIndex(n)).reduce((o,i)=>o+i.getSize(),0),ze(t.options,"debugColumns","getStart")),e.getAfter=We(n=>[n,vl(t,n),t.getState().columnSizing],(n,r)=>r.slice(e.getIndex(n)+1).reduce((o,i)=>o+i.getSize(),0),ze(t.options,"debugColumns","getAfter")),e.resetSize=()=>{t.setColumnSizing(n=>{let{[e.id]:r,...o}=n;return o})},e.getCanResize=()=>{var n,r;return((n=e.columnDef.enableResizing)!=null?n:!0)&&((r=t.options.enableColumnResizing)!=null?r:!0)},e.getIsResizing=()=>t.getState().columnSizingInfo.isResizingColumn===e.id},createHeader:(e,t)=>{e.getSize=()=>{let n=0;const r=o=>{if(o.subHeaders.length)o.subHeaders.forEach(r);else{var i;n+=(i=o.column.getSize())!=null?i:0}};return r(e),n},e.getStart=()=>{if(e.index>0){const n=e.headerGroup.headers[e.index-1];return n.getStart()+n.getSize()}return 0},e.getResizeHandler=n=>{const r=t.getColumn(e.column.id),o=r?.getCanResize();return i=>{if(!r||!o||(i.persist==null||i.persist(),pb(i)&&i.touches&&i.touches.length>1))return;const s=e.getSize(),a=e?e.getLeafHeaders().map(y=>[y.column.id,y.column.getSize()]):[[r.id,r.getSize()]],l=pb(i)?Math.round(i.touches[0].clientX):i.clientX,u={},c=(y,x)=>{typeof x=="number"&&(t.setColumnSizingInfo(w=>{var C,S;const R=t.options.columnResizeDirection==="rtl"?-1:1,I=(x-((C=w?.startOffset)!=null?C:0))*R,T=Math.max(I/((S=w?.startSize)!=null?S:0),-.999999);return w.columnSizingStart.forEach(_=>{let[$,A]=_;u[$]=Math.round(Math.max(A+A*T,0)*100)/100}),{...w,deltaOffset:I,deltaPercentage:T}}),(t.options.columnResizeMode==="onChange"||y==="end")&&t.setColumnSizing(w=>({...w,...u})))},d=y=>c("move",y),f=y=>{c("end",y),t.setColumnSizingInfo(x=>({...x,isResizingColumn:!1,startOffset:null,startSize:null,deltaOffset:null,deltaPercentage:null,columnSizingStart:[]}))},p=ife(n),g={moveHandler:y=>d(y.clientX),upHandler:y=>{p?.removeEventListener("mousemove",g.moveHandler),p?.removeEventListener("mouseup",g.upHandler),f(y.clientX)}},m={moveHandler:y=>(y.cancelable&&(y.preventDefault(),y.stopPropagation()),d(y.touches[0].clientX),!1),upHandler:y=>{var x;p?.removeEventListener("touchmove",m.moveHandler),p?.removeEventListener("touchend",m.upHandler),y.cancelable&&(y.preventDefault(),y.stopPropagation()),f((x=y.touches[0])==null?void 0:x.clientX)}},v=afe()?{passive:!1}:!1;pb(i)?(p?.addEventListener("touchmove",m.moveHandler,v),p?.addEventListener("touchend",m.upHandler,v)):(p?.addEventListener("mousemove",g.moveHandler,v),p?.addEventListener("mouseup",g.upHandler,v)),t.setColumnSizingInfo(y=>({...y,startOffset:l,startSize:s,deltaOffset:0,deltaPercentage:0,columnSizingStart:a,isResizingColumn:r.id}))}}},createTable:e=>{e.setColumnSizing=t=>e.options.onColumnSizingChange==null?void 0:e.options.onColumnSizingChange(t),e.setColumnSizingInfo=t=>e.options.onColumnSizingInfoChange==null?void 0:e.options.onColumnSizingInfoChange(t),e.resetColumnSizing=t=>{var n;e.setColumnSizing(t?{}:(n=e.initialState.columnSizing)!=null?n:{})},e.resetHeaderSizeInfo=t=>{var n;e.setColumnSizingInfo(t?fb():(n=e.initialState.columnSizingInfo)!=null?n:fb())},e.getTotalSize=()=>{var t,n;return(t=(n=e.getHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getLeftTotalSize=()=>{var t,n;return(t=(n=e.getLeftHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getCenterTotalSize=()=>{var t,n;return(t=(n=e.getCenterHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0},e.getRightTotalSize=()=>{var t,n;return(t=(n=e.getRightHeaderGroups()[0])==null?void 0:n.headers.reduce((r,o)=>r+o.getSize(),0))!=null?t:0}}};let Sc=null;function afe(){if(typeof Sc=="boolean")return Sc;let e=!1;try{const t={get passive(){return e=!0,!1}},n=()=>{};window.addEventListener("test",n,t),window.removeEventListener("test",n)}catch{e=!1}return Sc=e,Sc}function pb(e){return e.type==="touchstart"}const lfe={getInitialState:e=>({columnVisibility:{},...e}),getDefaultOptions:e=>({onColumnVisibilityChange:$n("columnVisibility",e)}),createColumn:(e,t)=>{e.toggleVisibility=n=>{e.getCanHide()&&t.setColumnVisibility(r=>({...r,[e.id]:n??!e.getIsVisible()}))},e.getIsVisible=()=>{var n,r;const o=e.columns;return(n=o.length?o.some(i=>i.getIsVisible()):(r=t.getState().columnVisibility)==null?void 0:r[e.id])!=null?n:!0},e.getCanHide=()=>{var n,r;return((n=e.columnDef.enableHiding)!=null?n:!0)&&((r=t.options.enableHiding)!=null?r:!0)},e.getToggleVisibilityHandler=()=>n=>{e.toggleVisibility==null||e.toggleVisibility(n.target.checked)}},createRow:(e,t)=>{e._getAllVisibleCells=We(()=>[e.getAllCells(),t.getState().columnVisibility],n=>n.filter(r=>r.column.getIsVisible()),ze(t.options,"debugRows","_getAllVisibleCells")),e.getVisibleCells=We(()=>[e.getLeftVisibleCells(),e.getCenterVisibleCells(),e.getRightVisibleCells()],(n,r,o)=>[...n,...r,...o],ze(t.options,"debugRows","getVisibleCells"))},createTable:e=>{const t=(n,r)=>We(()=>[r(),r().filter(o=>o.getIsVisible()).map(o=>o.id).join("_")],o=>o.filter(i=>i.getIsVisible==null?void 0:i.getIsVisible()),ze(e.options,"debugColumns",n));e.getVisibleFlatColumns=t("getVisibleFlatColumns",()=>e.getAllFlatColumns()),e.getVisibleLeafColumns=t("getVisibleLeafColumns",()=>e.getAllLeafColumns()),e.getLeftVisibleLeafColumns=t("getLeftVisibleLeafColumns",()=>e.getLeftLeafColumns()),e.getRightVisibleLeafColumns=t("getRightVisibleLeafColumns",()=>e.getRightLeafColumns()),e.getCenterVisibleLeafColumns=t("getCenterVisibleLeafColumns",()=>e.getCenterLeafColumns()),e.setColumnVisibility=n=>e.options.onColumnVisibilityChange==null?void 0:e.options.onColumnVisibilityChange(n),e.resetColumnVisibility=n=>{var r;e.setColumnVisibility(n?{}:(r=e.initialState.columnVisibility)!=null?r:{})},e.toggleAllColumnsVisible=n=>{var r;n=(r=n)!=null?r:!e.getIsAllColumnsVisible(),e.setColumnVisibility(e.getAllLeafColumns().reduce((o,i)=>({...o,[i.id]:n||!(i.getCanHide!=null&&i.getCanHide())}),{}))},e.getIsAllColumnsVisible=()=>!e.getAllLeafColumns().some(n=>!(n.getIsVisible!=null&&n.getIsVisible())),e.getIsSomeColumnsVisible=()=>e.getAllLeafColumns().some(n=>n.getIsVisible==null?void 0:n.getIsVisible()),e.getToggleAllColumnsVisibilityHandler=()=>n=>{var r;e.toggleAllColumnsVisible((r=n.target)==null?void 0:r.checked)}}};function vl(e,t){return t?t==="center"?e.getCenterVisibleLeafColumns():t==="left"?e.getLeftVisibleLeafColumns():e.getRightVisibleLeafColumns():e.getVisibleLeafColumns()}const ufe={createTable:e=>{e._getGlobalFacetedRowModel=e.options.getFacetedRowModel&&e.options.getFacetedRowModel(e,"__global__"),e.getGlobalFacetedRowModel=()=>e.options.manualFiltering||!e._getGlobalFacetedRowModel?e.getPreFilteredRowModel():e._getGlobalFacetedRowModel(),e._getGlobalFacetedUniqueValues=e.options.getFacetedUniqueValues&&e.options.getFacetedUniqueValues(e,"__global__"),e.getGlobalFacetedUniqueValues=()=>e._getGlobalFacetedUniqueValues?e._getGlobalFacetedUniqueValues():new Map,e._getGlobalFacetedMinMaxValues=e.options.getFacetedMinMaxValues&&e.options.getFacetedMinMaxValues(e,"__global__"),e.getGlobalFacetedMinMaxValues=()=>{if(e._getGlobalFacetedMinMaxValues)return e._getGlobalFacetedMinMaxValues()}}},cfe={getInitialState:e=>({globalFilter:void 0,...e}),getDefaultOptions:e=>({onGlobalFilterChange:$n("globalFilter",e),globalFilterFn:"auto",getColumnCanGlobalFilter:t=>{var n;const r=(n=e.getCoreRowModel().flatRows[0])==null||(n=n._getAllCellsByColumnId()[t.id])==null?void 0:n.getValue();return typeof r=="string"||typeof r=="number"}}),createColumn:(e,t)=>{e.getCanGlobalFilter=()=>{var n,r,o,i;return((n=e.columnDef.enableGlobalFilter)!=null?n:!0)&&((r=t.options.enableGlobalFilter)!=null?r:!0)&&((o=t.options.enableFilters)!=null?o:!0)&&((i=t.options.getColumnCanGlobalFilter==null?void 0:t.options.getColumnCanGlobalFilter(e))!=null?i:!0)&&!!e.accessorFn}},createTable:e=>{e.getGlobalAutoFilterFn=()=>Ro.includesString,e.getGlobalFilterFn=()=>{var t,n;const{globalFilterFn:r}=e.options;return Jf(r)?r:r==="auto"?e.getGlobalAutoFilterFn():(t=(n=e.options.filterFns)==null?void 0:n[r])!=null?t:Ro[r]},e.setGlobalFilter=t=>{e.options.onGlobalFilterChange==null||e.options.onGlobalFilterChange(t)},e.resetGlobalFilter=t=>{e.setGlobalFilter(t?void 0:e.initialState.globalFilter)}}},dfe={getInitialState:e=>({expanded:{},...e}),getDefaultOptions:e=>({onExpandedChange:$n("expanded",e),paginateExpandedRows:!0}),createTable:e=>{let t=!1,n=!1;e._autoResetExpanded=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetExpanded)!=null?r:!e.options.manualExpanding){if(n)return;n=!0,e._queue(()=>{e.resetExpanded(),n=!1})}},e.setExpanded=r=>e.options.onExpandedChange==null?void 0:e.options.onExpandedChange(r),e.toggleAllRowsExpanded=r=>{r??!e.getIsAllRowsExpanded()?e.setExpanded(!0):e.setExpanded({})},e.resetExpanded=r=>{var o,i;e.setExpanded(r?{}:(o=(i=e.initialState)==null?void 0:i.expanded)!=null?o:{})},e.getCanSomeRowsExpand=()=>e.getPrePaginationRowModel().flatRows.some(r=>r.getCanExpand()),e.getToggleAllRowsExpandedHandler=()=>r=>{r.persist==null||r.persist(),e.toggleAllRowsExpanded()},e.getIsSomeRowsExpanded=()=>{const r=e.getState().expanded;return r===!0||Object.values(r).some(Boolean)},e.getIsAllRowsExpanded=()=>{const r=e.getState().expanded;return typeof r=="boolean"?r===!0:!(!Object.keys(r).length||e.getRowModel().flatRows.some(o=>!o.getIsExpanded()))},e.getExpandedDepth=()=>{let r=0;return(e.getState().expanded===!0?Object.keys(e.getRowModel().rowsById):Object.keys(e.getState().expanded)).forEach(i=>{const s=i.split(".");r=Math.max(r,s.length)}),r},e.getPreExpandedRowModel=()=>e.getSortedRowModel(),e.getExpandedRowModel=()=>(!e._getExpandedRowModel&&e.options.getExpandedRowModel&&(e._getExpandedRowModel=e.options.getExpandedRowModel(e)),e.options.manualExpanding||!e._getExpandedRowModel?e.getPreExpandedRowModel():e._getExpandedRowModel())},createRow:(e,t)=>{e.toggleExpanded=n=>{t.setExpanded(r=>{var o;const i=r===!0?!0:!!(r!=null&&r[e.id]);let s={};if(r===!0?Object.keys(t.getRowModel().rowsById).forEach(a=>{s[a]=!0}):s=r,n=(o=n)!=null?o:!i,!i&&n)return{...s,[e.id]:!0};if(i&&!n){const{[e.id]:a,...l}=s;return l}return r})},e.getIsExpanded=()=>{var n;const r=t.getState().expanded;return!!((n=t.options.getIsRowExpanded==null?void 0:t.options.getIsRowExpanded(e))!=null?n:r===!0||r?.[e.id])},e.getCanExpand=()=>{var n,r,o;return(n=t.options.getRowCanExpand==null?void 0:t.options.getRowCanExpand(e))!=null?n:((r=t.options.enableExpanding)!=null?r:!0)&&!!((o=e.subRows)!=null&&o.length)},e.getIsAllParentsExpanded=()=>{let n=!0,r=e;for(;n&&r.parentId;)r=t.getRow(r.parentId,!0),n=r.getIsExpanded();return n},e.getToggleExpandedHandler=()=>{const n=e.getCanExpand();return()=>{n&&e.toggleExpanded()}}}},Wv=0,zv=10,hb=()=>({pageIndex:Wv,pageSize:zv}),ffe={getInitialState:e=>({...e,pagination:{...hb(),...e?.pagination}}),getDefaultOptions:e=>({onPaginationChange:$n("pagination",e)}),createTable:e=>{let t=!1,n=!1;e._autoResetPageIndex=()=>{var r,o;if(!t){e._queue(()=>{t=!0});return}if((r=(o=e.options.autoResetAll)!=null?o:e.options.autoResetPageIndex)!=null?r:!e.options.manualPagination){if(n)return;n=!0,e._queue(()=>{e.resetPageIndex(),n=!1})}},e.setPagination=r=>{const o=i=>oi(r,i);return e.options.onPaginationChange==null?void 0:e.options.onPaginationChange(o)},e.resetPagination=r=>{var o;e.setPagination(r?hb():(o=e.initialState.pagination)!=null?o:hb())},e.setPageIndex=r=>{e.setPagination(o=>{let i=oi(r,o.pageIndex);const s=typeof e.options.pageCount>"u"||e.options.pageCount===-1?Number.MAX_SAFE_INTEGER:e.options.pageCount-1;return i=Math.max(0,Math.min(i,s)),{...o,pageIndex:i}})},e.resetPageIndex=r=>{var o,i;e.setPageIndex(r?Wv:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageIndex)!=null?o:Wv)},e.resetPageSize=r=>{var o,i;e.setPageSize(r?zv:(o=(i=e.initialState)==null||(i=i.pagination)==null?void 0:i.pageSize)!=null?o:zv)},e.setPageSize=r=>{e.setPagination(o=>{const i=Math.max(1,oi(r,o.pageSize)),s=o.pageSize*o.pageIndex,a=Math.floor(s/i);return{...o,pageIndex:a,pageSize:i}})},e.setPageCount=r=>e.setPagination(o=>{var i;let s=oi(r,(i=e.options.pageCount)!=null?i:-1);return typeof s=="number"&&(s=Math.max(-1,s)),{...o,pageCount:s}}),e.getPageOptions=We(()=>[e.getPageCount()],r=>{let o=[];return r&&r>0&&(o=[...new Array(r)].fill(null).map((i,s)=>s)),o},ze(e.options,"debugTable","getPageOptions")),e.getCanPreviousPage=()=>e.getState().pagination.pageIndex>0,e.getCanNextPage=()=>{const{pageIndex:r}=e.getState().pagination,o=e.getPageCount();return o===-1?!0:o===0?!1:r<o-1},e.previousPage=()=>e.setPageIndex(r=>r-1),e.nextPage=()=>e.setPageIndex(r=>r+1),e.firstPage=()=>e.setPageIndex(0),e.lastPage=()=>e.setPageIndex(e.getPageCount()-1),e.getPrePaginationRowModel=()=>e.getExpandedRowModel(),e.getPaginationRowModel=()=>(!e._getPaginationRowModel&&e.options.getPaginationRowModel&&(e._getPaginationRowModel=e.options.getPaginationRowModel(e)),e.options.manualPagination||!e._getPaginationRowModel?e.getPrePaginationRowModel():e._getPaginationRowModel()),e.getPageCount=()=>{var r;return(r=e.options.pageCount)!=null?r:Math.ceil(e.getRowCount()/e.getState().pagination.pageSize)},e.getRowCount=()=>{var r;return(r=e.options.rowCount)!=null?r:e.getPrePaginationRowModel().rows.length}}},gb=()=>({top:[],bottom:[]}),pfe={getInitialState:e=>({rowPinning:gb(),...e}),getDefaultOptions:e=>({onRowPinningChange:$n("rowPinning",e)}),createRow:(e,t)=>{e.pin=(n,r,o)=>{const i=r?e.getLeafRows().map(l=>{let{id:u}=l;return u}):[],s=o?e.getParentRows().map(l=>{let{id:u}=l;return u}):[],a=new Set([...s,e.id,...i]);t.setRowPinning(l=>{var u,c;if(n==="bottom"){var d,f;return{top:((d=l?.top)!=null?d:[]).filter(m=>!(a!=null&&a.has(m))),bottom:[...((f=l?.bottom)!=null?f:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)]}}if(n==="top"){var p,g;return{top:[...((p=l?.top)!=null?p:[]).filter(m=>!(a!=null&&a.has(m))),...Array.from(a)],bottom:((g=l?.bottom)!=null?g:[]).filter(m=>!(a!=null&&a.has(m)))}}return{top:((u=l?.top)!=null?u:[]).filter(m=>!(a!=null&&a.has(m))),bottom:((c=l?.bottom)!=null?c:[]).filter(m=>!(a!=null&&a.has(m)))}})},e.getCanPin=()=>{var n;const{enableRowPinning:r,enablePinning:o}=t.options;return typeof r=="function"?r(e):(n=r??o)!=null?n:!0},e.getIsPinned=()=>{const n=[e.id],{top:r,bottom:o}=t.getState().rowPinning,i=n.some(a=>r?.includes(a)),s=n.some(a=>o?.includes(a));return i?"top":s?"bottom":!1},e.getPinnedIndex=()=>{var n,r;const o=e.getIsPinned();if(!o)return-1;const i=(n=o==="top"?t.getTopRows():t.getBottomRows())==null?void 0:n.map(s=>{let{id:a}=s;return a});return(r=i?.indexOf(e.id))!=null?r:-1}},createTable:e=>{e.setRowPinning=t=>e.options.onRowPinningChange==null?void 0:e.options.onRowPinningChange(t),e.resetRowPinning=t=>{var n,r;return e.setRowPinning(t?gb():(n=(r=e.initialState)==null?void 0:r.rowPinning)!=null?n:gb())},e.getIsSomeRowsPinned=t=>{var n;const r=e.getState().rowPinning;if(!t){var o,i;return!!((o=r.top)!=null&&o.length||(i=r.bottom)!=null&&i.length)}return!!((n=r[t])!=null&&n.length)},e._getPinnedRows=(t,n,r)=>{var o;return((o=e.options.keepPinnedRows)==null||o?(n??[]).map(s=>{const a=e.getRow(s,!0);return a.getIsAllParentsExpanded()?a:null}):(n??[]).map(s=>t.find(a=>a.id===s))).filter(Boolean).map(s=>({...s,position:r}))},e.getTopRows=We(()=>[e.getRowModel().rows,e.getState().rowPinning.top],(t,n)=>e._getPinnedRows(t,n,"top"),ze(e.options,"debugRows","getTopRows")),e.getBottomRows=We(()=>[e.getRowModel().rows,e.getState().rowPinning.bottom],(t,n)=>e._getPinnedRows(t,n,"bottom"),ze(e.options,"debugRows","getBottomRows")),e.getCenterRows=We(()=>[e.getRowModel().rows,e.getState().rowPinning.top,e.getState().rowPinning.bottom],(t,n,r)=>{const o=new Set([...n??[],...r??[]]);return t.filter(i=>!o.has(i.id))},ze(e.options,"debugRows","getCenterRows"))}},hfe={getInitialState:e=>({rowSelection:{},...e}),getDefaultOptions:e=>({onRowSelectionChange:$n("rowSelection",e),enableRowSelection:!0,enableMultiRowSelection:!0,enableSubRowSelection:!0}),createTable:e=>{e.setRowSelection=t=>e.options.onRowSelectionChange==null?void 0:e.options.onRowSelectionChange(t),e.resetRowSelection=t=>{var n;return e.setRowSelection(t?{}:(n=e.initialState.rowSelection)!=null?n:{})},e.toggleAllRowsSelected=t=>{e.setRowSelection(n=>{t=typeof t<"u"?t:!e.getIsAllRowsSelected();const r={...n},o=e.getPreGroupedRowModel().flatRows;return t?o.forEach(i=>{i.getCanSelect()&&(r[i.id]=!0)}):o.forEach(i=>{delete r[i.id]}),r})},e.toggleAllPageRowsSelected=t=>e.setRowSelection(n=>{const r=typeof t<"u"?t:!e.getIsAllPageRowsSelected(),o={...n};return e.getRowModel().rows.forEach(i=>{qv(o,i.id,r,!0,e)}),o}),e.getPreSelectedRowModel=()=>e.getCoreRowModel(),e.getSelectedRowModel=We(()=>[e.getState().rowSelection,e.getCoreRowModel()],(t,n)=>Object.keys(t).length?mb(e,n):{rows:[],flatRows:[],rowsById:{}},ze(e.options,"debugTable","getSelectedRowModel")),e.getFilteredSelectedRowModel=We(()=>[e.getState().rowSelection,e.getFilteredRowModel()],(t,n)=>Object.keys(t).length?mb(e,n):{rows:[],flatRows:[],rowsById:{}},ze(e.options,"debugTable","getFilteredSelectedRowModel")),e.getGroupedSelectedRowModel=We(()=>[e.getState().rowSelection,e.getSortedRowModel()],(t,n)=>Object.keys(t).length?mb(e,n):{rows:[],flatRows:[],rowsById:{}},ze(e.options,"debugTable","getGroupedSelectedRowModel")),e.getIsAllRowsSelected=()=>{const t=e.getFilteredRowModel().flatRows,{rowSelection:n}=e.getState();let r=!!(t.length&&Object.keys(n).length);return r&&t.some(o=>o.getCanSelect()&&!n[o.id])&&(r=!1),r},e.getIsAllPageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows.filter(o=>o.getCanSelect()),{rowSelection:n}=e.getState();let r=!!t.length;return r&&t.some(o=>!n[o.id])&&(r=!1),r},e.getIsSomeRowsSelected=()=>{var t;const n=Object.keys((t=e.getState().rowSelection)!=null?t:{}).length;return n>0&&n<e.getFilteredRowModel().flatRows.length},e.getIsSomePageRowsSelected=()=>{const t=e.getPaginationRowModel().flatRows;return e.getIsAllPageRowsSelected()?!1:t.filter(n=>n.getCanSelect()).some(n=>n.getIsSelected()||n.getIsSomeSelected())},e.getToggleAllRowsSelectedHandler=()=>t=>{e.toggleAllRowsSelected(t.target.checked)},e.getToggleAllPageRowsSelectedHandler=()=>t=>{e.toggleAllPageRowsSelected(t.target.checked)}},createRow:(e,t)=>{e.toggleSelected=(n,r)=>{const o=e.getIsSelected();t.setRowSelection(i=>{var s;if(n=typeof n<"u"?n:!o,e.getCanSelect()&&o===n)return i;const a={...i};return qv(a,e.id,n,(s=r?.selectChildren)!=null?s:!0,t),a})},e.getIsSelected=()=>{const{rowSelection:n}=t.getState();return Gx(e,n)},e.getIsSomeSelected=()=>{const{rowSelection:n}=t.getState();return Uv(e,n)==="some"},e.getIsAllSubRowsSelected=()=>{const{rowSelection:n}=t.getState();return Uv(e,n)==="all"},e.getCanSelect=()=>{var n;return typeof t.options.enableRowSelection=="function"?t.options.enableRowSelection(e):(n=t.options.enableRowSelection)!=null?n:!0},e.getCanSelectSubRows=()=>{var n;return typeof t.options.enableSubRowSelection=="function"?t.options.enableSubRowSelection(e):(n=t.options.enableSubRowSelection)!=null?n:!0},e.getCanMultiSelect=()=>{var n;return typeof t.options.enableMultiRowSelection=="function"?t.options.enableMultiRowSelection(e):(n=t.options.enableMultiRowSelection)!=null?n:!0},e.getToggleSelectedHandler=()=>{const n=e.getCanSelect();return r=>{var o;n&&e.toggleSelected((o=r.target)==null?void 0:o.checked)}}}},qv=(e,t,n,r,o)=>{var i;const s=o.getRow(t,!0);n?(s.getCanMultiSelect()||Object.keys(e).forEach(a=>delete e[a]),s.getCanSelect()&&(e[t]=!0)):delete e[t],r&&(i=s.subRows)!=null&&i.length&&s.getCanSelectSubRows()&&s.subRows.forEach(a=>qv(e,a.id,n,r,o))};function mb(e,t){const n=e.getState().rowSelection,r=[],o={},i=function(s,a){return s.map(l=>{var u;const c=Gx(l,n);if(c&&(r.push(l),o[l.id]=l),(u=l.subRows)!=null&&u.length&&(l={...l,subRows:i(l.subRows)}),c)return l}).filter(Boolean)};return{rows:i(t.rows),flatRows:r,rowsById:o}}function Gx(e,t){var n;return(n=t[e.id])!=null?n:!1}function Uv(e,t,n){var r;if(!((r=e.subRows)!=null&&r.length))return!1;let o=!0,i=!1;return e.subRows.forEach(s=>{if(!(i&&!o)&&(s.getCanSelect()&&(Gx(s,t)?i=!0:o=!1),s.subRows&&s.subRows.length)){const a=Uv(s,t);a==="all"?i=!0:(a==="some"&&(i=!0),o=!1)}}),o?"all":i?"some":!1}const Yv=/([0-9]+)/gm,gfe=(e,t,n)=>dL(hi(e.getValue(n)).toLowerCase(),hi(t.getValue(n)).toLowerCase()),mfe=(e,t,n)=>dL(hi(e.getValue(n)),hi(t.getValue(n))),bfe=(e,t,n)=>Hx(hi(e.getValue(n)).toLowerCase(),hi(t.getValue(n)).toLowerCase()),vfe=(e,t,n)=>Hx(hi(e.getValue(n)),hi(t.getValue(n))),yfe=(e,t,n)=>{const r=e.getValue(n),o=t.getValue(n);return r>o?1:r<o?-1:0},xfe=(e,t,n)=>Hx(e.getValue(n),t.getValue(n));function Hx(e,t){return e===t?0:e>t?1:-1}function hi(e){return typeof e=="number"?isNaN(e)||e===1/0||e===-1/0?"":String(e):typeof e=="string"?e:""}function dL(e,t){const n=e.split(Yv).filter(Boolean),r=t.split(Yv).filter(Boolean);for(;n.length&&r.length;){const o=n.shift(),i=r.shift(),s=parseInt(o,10),a=parseInt(i,10),l=[s,a].sort();if(isNaN(l[0])){if(o>i)return 1;if(i>o)return-1;continue}if(isNaN(l[1]))return isNaN(s)?-1:1;if(s>a)return 1;if(a>s)return-1}return n.length-r.length}const Xa={alphanumeric:gfe,alphanumericCaseSensitive:mfe,text:bfe,textCaseSensitive:vfe,datetime:yfe,basic:xfe},wfe={getInitialState:e=>({sorting:[],...e}),getDefaultColumnDef:()=>({sortingFn:"auto",sortUndefined:1}),getDefaultOptions:e=>({onSortingChange:$n("sorting",e),isMultiSortEvent:t=>t.shiftKey}),createColumn:(e,t)=>{e.getAutoSortingFn=()=>{const n=t.getFilteredRowModel().flatRows.slice(10);let r=!1;for(const o of n){const i=o?.getValue(e.id);if(Object.prototype.toString.call(i)==="[object Date]")return Xa.datetime;if(typeof i=="string"&&(r=!0,i.split(Yv).length>1))return Xa.alphanumeric}return r?Xa.text:Xa.basic},e.getAutoSortDir=()=>{const n=t.getFilteredRowModel().flatRows[0];return typeof n?.getValue(e.id)=="string"?"asc":"desc"},e.getSortingFn=()=>{var n,r;if(!e)throw new Error;return Jf(e.columnDef.sortingFn)?e.columnDef.sortingFn:e.columnDef.sortingFn==="auto"?e.getAutoSortingFn():(n=(r=t.options.sortingFns)==null?void 0:r[e.columnDef.sortingFn])!=null?n:Xa[e.columnDef.sortingFn]},e.toggleSorting=(n,r)=>{const o=e.getNextSortingOrder(),i=typeof n<"u"&&n!==null;t.setSorting(s=>{const a=s?.find(p=>p.id===e.id),l=s?.findIndex(p=>p.id===e.id);let u=[],c,d=i?n:o==="desc";if(s!=null&&s.length&&e.getCanMultiSort()&&r?a?c="toggle":c="add":s!=null&&s.length&&l!==s.length-1?c="replace":a?c="toggle":c="replace",c==="toggle"&&(i||o||(c="remove")),c==="add"){var f;u=[...s,{id:e.id,desc:d}],u.splice(0,u.length-((f=t.options.maxMultiSortColCount)!=null?f:Number.MAX_SAFE_INTEGER))}else c==="toggle"?u=s.map(p=>p.id===e.id?{...p,desc:d}:p):c==="remove"?u=s.filter(p=>p.id!==e.id):u=[{id:e.id,desc:d}];return u})},e.getFirstSortDir=()=>{var n,r;return((n=(r=e.columnDef.sortDescFirst)!=null?r:t.options.sortDescFirst)!=null?n:e.getAutoSortDir()==="desc")?"desc":"asc"},e.getNextSortingOrder=n=>{var r,o;const i=e.getFirstSortDir(),s=e.getIsSorted();return s?s!==i&&((r=t.options.enableSortingRemoval)==null||r)&&(!(n&&(o=t.options.enableMultiRemove)!=null)||o)?!1:s==="desc"?"asc":"desc":i},e.getCanSort=()=>{var n,r;return((n=e.columnDef.enableSorting)!=null?n:!0)&&((r=t.options.enableSorting)!=null?r:!0)&&!!e.accessorFn},e.getCanMultiSort=()=>{var n,r;return(n=(r=e.columnDef.enableMultiSort)!=null?r:t.options.enableMultiSort)!=null?n:!!e.accessorFn},e.getIsSorted=()=>{var n;const r=(n=t.getState().sorting)==null?void 0:n.find(o=>o.id===e.id);return r?r.desc?"desc":"asc":!1},e.getSortIndex=()=>{var n,r;return(n=(r=t.getState().sorting)==null?void 0:r.findIndex(o=>o.id===e.id))!=null?n:-1},e.clearSorting=()=>{t.setSorting(n=>n!=null&&n.length?n.filter(r=>r.id!==e.id):[])},e.getToggleSortingHandler=()=>{const n=e.getCanSort();return r=>{n&&(r.persist==null||r.persist(),e.toggleSorting==null||e.toggleSorting(void 0,e.getCanMultiSort()?t.options.isMultiSortEvent==null?void 0:t.options.isMultiSortEvent(r):!1))}}},createTable:e=>{e.setSorting=t=>e.options.onSortingChange==null?void 0:e.options.onSortingChange(t),e.resetSorting=t=>{var n,r;e.setSorting(t?[]:(n=(r=e.initialState)==null?void 0:r.sorting)!=null?n:[])},e.getPreSortedRowModel=()=>e.getGroupedRowModel(),e.getSortedRowModel=()=>(!e._getSortedRowModel&&e.options.getSortedRowModel&&(e._getSortedRowModel=e.options.getSortedRowModel(e)),e.options.manualSorting||!e._getSortedRowModel?e.getPreSortedRowModel():e._getSortedRowModel())}},Cfe=[Hde,lfe,rfe,ofe,Wde,zde,ufe,cfe,wfe,tfe,dfe,ffe,pfe,hfe,sfe];function Sfe(e){var t,n;process.env.NODE_ENV!=="production"&&(e.debugAll||e.debugTable)&&console.info("Creating Table Instance...");const r=[...Cfe,...(t=e._features)!=null?t:[]];let o={_features:r};const i=o._features.reduce((f,p)=>Object.assign(f,p.getDefaultOptions==null?void 0:p.getDefaultOptions(o)),{}),s=f=>o.options.mergeOptions?o.options.mergeOptions(i,f):{...i,...f};let l={...{},...(n=e.initialState)!=null?n:{}};o._features.forEach(f=>{var p;l=(p=f.getInitialState==null?void 0:f.getInitialState(l))!=null?p:l});const u=[];let c=!1;const d={_features:r,options:{...i,...e},initialState:l,_queue:f=>{u.push(f),c||(c=!0,Promise.resolve().then(()=>{for(;u.length;)u.shift()();c=!1}).catch(p=>setTimeout(()=>{throw p})))},reset:()=>{o.setState(o.initialState)},setOptions:f=>{const p=oi(f,o.options);o.options=s(p)},getState:()=>o.options.state,setState:f=>{o.options.onStateChange==null||o.options.onStateChange(f)},_getRowId:(f,p,g)=>{var m;return(m=o.options.getRowId==null?void 0:o.options.getRowId(f,p,g))!=null?m:`${g?[g.id,p].join("."):p}`},getCoreRowModel:()=>(o._getCoreRowModel||(o._getCoreRowModel=o.options.getCoreRowModel(o)),o._getCoreRowModel()),getRowModel:()=>o.getPaginationRowModel(),getRow:(f,p)=>{let g=(p?o.getPrePaginationRowModel():o.getRowModel()).rowsById[f];if(!g&&(g=o.getCoreRowModel().rowsById[f],!g))throw process.env.NODE_ENV!=="production"?new Error(`getRow could not find row with ID: ${f}`):new Error;return g},_getDefaultColumnDef:We(()=>[o.options.defaultColumn],f=>{var p;return f=(p=f)!=null?p:{},{header:g=>{const m=g.header.column.columnDef;return m.accessorKey?m.accessorKey:m.accessorFn?m.id:null},cell:g=>{var m,v;return(m=(v=g.renderValue())==null||v.toString==null?void 0:v.toString())!=null?m:null},...o._features.reduce((g,m)=>Object.assign(g,m.getDefaultColumnDef==null?void 0:m.getDefaultColumnDef()),{}),...f}},ze(e,"debugColumns","_getDefaultColumnDef")),_getColumnDefs:()=>o.options.columns,getAllColumns:We(()=>[o._getColumnDefs()],f=>{const p=function(g,m,v){return v===void 0&&(v=0),g.map(y=>{const x=Gde(o,y,v,m),w=y;return x.columns=w.columns?p(w.columns,x,v+1):[],x})};return p(f)},ze(e,"debugColumns","getAllColumns")),getAllFlatColumns:We(()=>[o.getAllColumns()],f=>f.flatMap(p=>p.getFlatColumns()),ze(e,"debugColumns","getAllFlatColumns")),_getAllFlatColumnsById:We(()=>[o.getAllFlatColumns()],f=>f.reduce((p,g)=>(p[g.id]=g,p),{}),ze(e,"debugColumns","getAllFlatColumnsById")),getAllLeafColumns:We(()=>[o.getAllColumns(),o._getOrderColumnsFn()],(f,p)=>{let g=f.flatMap(m=>m.getLeafColumns());return p(g)},ze(e,"debugColumns","getAllLeafColumns")),getColumn:f=>{const p=o._getAllFlatColumnsById()[f];return process.env.NODE_ENV!=="production"&&!p&&console.error(`[Table] Column with id '${f}' does not exist.`),p}};Object.assign(o,d);for(let f=0;f<o._features.length;f++){const p=o._features[f];p==null||p.createTable==null||p.createTable(o)}return o}function Efe(){return e=>We(()=>[e.options.data],t=>{const n={rows:[],flatRows:[],rowsById:{}},r=function(o,i,s){i===void 0&&(i=0);const a=[];for(let u=0;u<o.length;u++){const c=Vx(e,e._getRowId(o[u],u,s),o[u],u,i,void 0,s?.id);if(n.flatRows.push(c),n.rowsById[c.id]=c,a.push(c),e.options.getSubRows){var l;c.originalSubRows=e.options.getSubRows(o[u],u),(l=c.originalSubRows)!=null&&l.length&&(c.subRows=r(c.originalSubRows,i+1,c))}}return a};return n.rows=r(t),n},ze(e.options,"debugTable","getRowModel",()=>e._autoResetPageIndex()))}function Ife(){return e=>We(()=>[e.getState().expanded,e.getPreExpandedRowModel(),e.options.paginateExpandedRows],(t,n,r)=>!n.rows.length||t!==!0&&!Object.keys(t??{}).length||!r?n:fL(n),ze(e.options,"debugTable","getExpandedRowModel"))}function fL(e){const t=[],n=r=>{var o;t.push(r),(o=r.subRows)!=null&&o.length&&r.getIsExpanded()&&r.subRows.forEach(n)};return e.rows.forEach(n),{rows:t,flatRows:e.flatRows,rowsById:e.rowsById}}function Rfe(e,t,n){return n.options.filterFromLeafRows?Afe(e,t,n):Tfe(e,t,n)}function Afe(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,u){u===void 0&&(u=0);const c=[];for(let f=0;f<l.length;f++){var d;let p=l[f];const g=Vx(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);if(g.columnFilters=p.columnFilters,(d=p.subRows)!=null&&d.length&&u<s){if(g.subRows=a(p.subRows,u+1),p=g,t(p)&&!g.subRows.length){c.push(p),i[p.id]=p,o.push(p);continue}if(t(p)||g.subRows.length){c.push(p),i[p.id]=p,o.push(p);continue}}else p=g,t(p)&&(c.push(p),i[p.id]=p,o.push(p))}return c};return{rows:a(e),flatRows:o,rowsById:i}}function Tfe(e,t,n){var r;const o=[],i={},s=(r=n.options.maxLeafRowFilterDepth)!=null?r:100,a=function(l,u){u===void 0&&(u=0);const c=[];for(let f=0;f<l.length;f++){let p=l[f];if(t(p)){var d;if((d=p.subRows)!=null&&d.length&&u<s){const m=Vx(n,p.id,p.original,p.index,p.depth,void 0,p.parentId);m.subRows=a(p.subRows,u+1),p=m}c.push(p),o.push(p),i[p.id]=p}}return c};return{rows:a(e),flatRows:o,rowsById:i}}function Ofe(){return e=>We(()=>[e.getPreFilteredRowModel(),e.getState().columnFilters,e.getState().globalFilter],(t,n,r)=>{if(!t.rows.length||!(n!=null&&n.length)&&!r){for(let f=0;f<t.flatRows.length;f++)t.flatRows[f].columnFilters={},t.flatRows[f].columnFiltersMeta={};return t}const o=[],i=[];(n??[]).forEach(f=>{var p;const g=e.getColumn(f.id);if(!g)return;const m=g.getFilterFn();if(!m){process.env.NODE_ENV!=="production"&&console.warn(`Could not find a valid 'column.filterFn' for column with the ID: ${g.id}.`);return}o.push({id:f.id,filterFn:m,resolvedValue:(p=m.resolveFilterValue==null?void 0:m.resolveFilterValue(f.value))!=null?p:f.value})});const s=(n??[]).map(f=>f.id),a=e.getGlobalFilterFn(),l=e.getAllLeafColumns().filter(f=>f.getCanGlobalFilter());r&&a&&l.length&&(s.push("__global__"),l.forEach(f=>{var p;i.push({id:f.id,filterFn:a,resolvedValue:(p=a.resolveFilterValue==null?void 0:a.resolveFilterValue(r))!=null?p:r})}));let u,c;for(let f=0;f<t.flatRows.length;f++){const p=t.flatRows[f];if(p.columnFilters={},o.length)for(let g=0;g<o.length;g++){u=o[g];const m=u.id;p.columnFilters[m]=u.filterFn(p,m,u.resolvedValue,v=>{p.columnFiltersMeta[m]=v})}if(i.length){for(let g=0;g<i.length;g++){c=i[g];const m=c.id;if(c.filterFn(p,m,c.resolvedValue,v=>{p.columnFiltersMeta[m]=v})){p.columnFilters.__global__=!0;break}}p.columnFilters.__global__!==!0&&(p.columnFilters.__global__=!1)}}const d=f=>{for(let p=0;p<s.length;p++)if(f.columnFilters[s[p]]===!1)return!1;return!0};return Rfe(t.rows,d,e)},ze(e.options,"debugTable","getFilteredRowModel",()=>e._autoResetPageIndex()))}function Nfe(e){return t=>We(()=>[t.getState().pagination,t.getPrePaginationRowModel(),t.options.paginateExpandedRows?void 0:t.getState().expanded],(n,r)=>{if(!r.rows.length)return r;const{pageSize:o,pageIndex:i}=n;let{rows:s,flatRows:a,rowsById:l}=r;const u=o*i,c=u+o;s=s.slice(u,c);let d;t.options.paginateExpandedRows?d={rows:s,flatRows:a,rowsById:l}:d=fL({rows:s,flatRows:a,rowsById:l}),d.flatRows=[];const f=p=>{d.flatRows.push(p),p.subRows.length&&p.subRows.forEach(f)};return d.rows.forEach(f),d},ze(t.options,"debugTable","getPaginationRowModel"))}function Pfe(){return e=>We(()=>[e.getState().sorting,e.getPreSortedRowModel()],(t,n)=>{if(!n.rows.length||!(t!=null&&t.length))return n;const r=e.getState().sorting,o=[],i=r.filter(l=>{var u;return(u=e.getColumn(l.id))==null?void 0:u.getCanSort()}),s={};i.forEach(l=>{const u=e.getColumn(l.id);u&&(s[l.id]={sortUndefined:u.columnDef.sortUndefined,invertSorting:u.columnDef.invertSorting,sortingFn:u.getSortingFn()})});const a=l=>{const u=l.map(c=>({...c}));return u.sort((c,d)=>{for(let p=0;p<i.length;p+=1){var f;const g=i[p],m=s[g.id],v=m.sortUndefined,y=(f=g?.desc)!=null?f:!1;let x=0;if(v){const w=c.getValue(g.id),C=d.getValue(g.id),S=w===void 0,R=C===void 0;if(S||R){if(v==="first")return S?-1:1;if(v==="last")return S?1:-1;x=S&&R?0:S?v:-v}}if(x===0&&(x=m.sortingFn(c,d,g.id)),x!==0)return y&&(x*=-1),m.invertSorting&&(x*=-1),x}return c.index-d.index}),u.forEach(c=>{var d;o.push(c),(d=c.subRows)!=null&&d.length&&(c.subRows=a(c.subRows))}),u};return{rows:a(n.rows),flatRows:o,rowsById:n.rowsById}},ze(e.options,"debugTable","getSortedRowModel",()=>e._autoResetPageIndex()))}function BR(e,t){return e?_fe(e)?b.createElement(e,t):e:null}function _fe(e){return Mfe(e)||typeof e=="function"||Dfe(e)}function Mfe(e){return typeof e=="function"&&(()=>{const t=Object.getPrototypeOf(e);return t.prototype&&t.prototype.isReactComponent})()}function Dfe(e){return typeof e=="object"&&typeof e.$$typeof=="symbol"&&["react.memo","react.forward_ref"].includes(e.$$typeof.description)}function kfe(e){const t={state:{},onStateChange:()=>{},renderFallbackValue:null,...e},[n]=b.useState(()=>({current:Sfe(t)})),[r,o]=b.useState(()=>n.current.initialState);return n.current.setOptions(i=>({...i,...e,state:{...r,...e.state},onStateChange:s=>{o(s),e.onStateChange==null||e.onStateChange(s)}})),n.current}function VR(e){const t=e.getIsPinned();if(!t)return{className:"",style:{}};const n=t==="left",r=t==="right";return{className:F("ui:sticky ui:z-10 ui:bg-background",n&&"ui:left-0",r&&"ui:right-0",n&&"ui:after:absolute ui:after:right-0 ui:after:top-0 ui:after:h-full ui:after:w-px ui:after:bg-border",r&&"ui:before:absolute ui:before:left-0 ui:before:top-0 ui:before:h-full ui:before:w-px ui:before:bg-border"),style:{left:n?`${e.getStart("left")}px`:void 0,right:r?`${e.getAfter("right")}px`:void 0}}}function jfe({className:e,loadingContent:t=h.jsxs("div",{className:"ui:flex ui:items-center ui:justify-center ui:gap-2",children:[h.jsx(_e.Loader2,{className:"ui:h-4 ui:w-4 ui:animate-spin"}),h.jsx("span",{children:"Loading..."})]}),emptyContent:n="No results.",renderRowSubComponent:r}){const{table:o,isLoading:i}=Zf(),s=o.getAllColumns().length;return h.jsx("div",{className:F("ui:overflow-hidden ui:rounded-md ui:border ui:bg-white ui:rounded-b-none ui:p-3 ui:pb-0",e),children:h.jsxs(X2,{children:[h.jsx(Z2,{children:o.getHeaderGroups().map(a=>h.jsx(il,{children:a.headers.map(l=>{const{className:u,style:c}=VR(l.column);return h.jsx(K2,{className:u,style:c,children:l.isPlaceholder?null:BR(l.column.columnDef.header,l.getContext())},l.id)})},a.id))}),h.jsx(J2,{children:i?h.jsx(il,{children:h.jsx(Mc,{colSpan:s,className:"ui:h-24 ui:text-center",children:t})}):o.getRowModel().rows?.length?o.getRowModel().rows.map(a=>h.jsxs(N.Fragment,{children:[h.jsx(il,{"data-state":a.getIsSelected()&&"selected",className:F(a.depth>0&&"ui:bg-muted/50"),children:a.getVisibleCells().map(l=>{const{className:u,style:c}=VR(l.column);return h.jsx(Mc,{className:u,style:c,children:BR(l.column.columnDef.cell,l.getContext())},l.id)})}),a.getIsExpanded()&&r?.({row:a})]},a.id)):h.jsx(il,{children:h.jsx(Mc,{colSpan:s,className:"ui:h-24 ui:text-center",children:n})})})]})})}const Lfe=[{value:"10",label:"10"},{value:"20",label:"20"},{value:"50",label:"50"},{value:"100",label:"100"}],Ffe=({showSelectedCount:e=!0,showPaginationInfo:t=!0,className:n,showPerPageLabel:r="Show Per Page",selectPlaceholder:o="Select",selectedCountText:i=(a,l)=>`${a} of ${l} row(s) selected.`,paginationInfoText:s=(a,l,u)=>`${a} - ${l} of ${u}`})=>{const{table:a,totalCount:l}=Zf(),u=l??a.getFilteredRowModel().rows.length,{pageIndex:c,pageSize:d}=a.getState().pagination,f=u>0?c*d+1:0,p=Math.min((c+1)*d,u),g=m=>{a.setPageSize(Number(m)),a.setPageIndex(0)};return h.jsxs("div",{className:F("ui:flex ui:items-center ui:gap-4 ui:py-4 ui:bg-white ui:rounded-b-lg ui:px-3 ui:border-border ui:border ui:border-t-0",e?"ui:justify-end":"ui:justify-between",n),children:[e&&h.jsx("div",{className:"ui:text-muted-foreground ui:flex-1 ui:text-sm",children:i(a.getFilteredSelectedRowModel().rows.length,a.getFilteredRowModel().rows.length)}),h.jsx(n2,{options:Lfe,value:String(d),onChange:g,label:r,placeholder:o,triggerClassName:"ui:w-20",labelClassName:"ui:mb-0 ui:font-normal",containerClassName:"ui:flex ui:items-center ui:gap-2",isPortal:!0}),h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-4",children:[t&&u>0&&h.jsx("div",{className:"ui:text-muted-foreground ui:text-sm",children:s(f,p,u)}),h.jsxs("div",{className:"ui:flex ui:items-center ui:gap-1",children:[h.jsx(Do,{variant:"ghost",icon:h.jsx(_e.ChevronLeft,{}),isIconOnly:!0,size:"icon-lg",onClick:()=>a.previousPage(),disabled:!a.getCanPreviousPage()}),h.jsxs("span",{className:"ui:text-sm ui:text-center",children:[c+1," / ",a.getPageCount()]}),h.jsx(Do,{variant:"ghost",icon:h.jsx(_e.ChevronRight,{}),isIconOnly:!0,size:"icon-lg",onClick:()=>a.nextPage(),disabled:!a.getCanNextPage()})]})]})]})},Bfe=({actions:e})=>{if(e.length===0)return null;if(e.length===1){const t=e[0];return h.jsx(Do,{variant:"outline",icon:t.icon,isPrefix:!0,label:t.label,onClick:t.onClick,disabled:t.disabled})}return h.jsxs(ox,{children:[h.jsx(ix,{asChild:!0,children:h.jsx(Do,{variant:"outline",size:"icon-lg",icon:h.jsx(_e.MoreVertical,{}),isIconOnly:!0})}),h.jsx(sx,{align:"end",children:e.map(t=>h.jsxs(_k,{onClick:t.onClick,variant:t.variant,disabled:t.disabled,children:[t.icon,t.label]},t.label))})]})},Vfe={Root:kde,Toolbar:jde,Search:Lde,ColumnVisibility:Fde,Content:jfe,Pagination:Ffe,Actions:Bfe},pL=N.createContext(null);function hL(){const e=N.useContext(pL);if(!e)throw new Error("useDatePreset must be used within a DatePresetProvider");return e}const Kf={TODAY:{key:"TODAY",label:"Today",getRange:()=>({from:new Date,to:new Date})},THIS_WEEK:{key:"THIS_WEEK",label:"This Week",getRange:()=>({from:Ui(new Date,{weekStartsOn:1}),to:new Date})},LAST_7_DAYS:{key:"LAST_7_DAYS",label:"Last 7 Days",getRange:()=>({from:sw(new Date,6),to:new Date})},THIS_MONTH:{key:"THIS_MONTH",label:"This Month",getRange:()=>({from:xb(new Date),to:new Date})},LAST_MONTH:{key:"LAST_MONTH",label:"Last Month",getRange:()=>({from:xb(aw(new Date)),to:AA(aw(new Date))})},LAST_30_DAYS:{key:"LAST_30_DAYS",label:"Last 30 Days",getRange:()=>({from:sw(new Date,29),to:new Date})}},Xv="LAST_7_DAYS";function gL(e,t=Kf){for(const n of Object.values(t)){const r=n.getRange();if(yb(e.from,r.from)&&yb(e.to,r.to))return n.key}return null}function $fe({presets:e=Kf,className:t,confirmLabel:n="Apply",placeholder:r="Pick a date range",disabledCondition:o,dateLocale:i}){const{range:s,preset:a,setRange:l}=hL(),u=d=>{const f=d.getRange();l(f,d.key)},c=d=>{if(d.from&&d.to){const f={from:d.from,to:d.to},p=gL(f,e);l(f,p??null)}};return h.jsxs("div",{className:F("ui:flex ui:flex-wrap ui:gap-4 ui:w-full",t),children:[h.jsx(HM,{className:"ui:max-w-full ui:py-1!",children:h.jsx("div",{className:"ui:overflow-x-auto",children:h.jsx("div",{className:"ui:flex ui:gap-2",children:Object.values(e).map(d=>h.jsx(Do,{variant:"ghost",className:F("ui:font-normal",{"ui:bg-segmentify-200 ui:text-segmentify-600":a===d.key}),onClick:()=>u(d),label:d.label},d.key))})})}),h.jsx(bk,{start:s.from,end:s.to,className:"ui:rounded-lg ui:shadow-sm",placeholder:r,confirmLabel:n,onConfirm:c,disabledCondition:o,dateLocale:i})]})}function Gfe({children:e,initialRange:t,initialPreset:n=Xv,onRangeChange:r}){const o=t??Kf[n??Xv]?.getRange(),[i,s]=N.useState(o),[a,l]=N.useState(n),c={range:i,preset:a,setRange:(d,f=null)=>{s(d),l(f),r?.(d,f)}};return h.jsx(pL.Provider,{value:c,children:e})}function Hfe({queryKey:e,columns:t,fetcher:n,initialPageSize:r=10,initialSorting:o=[],initialColumnVisibility:i={},initialColumnPinning:s={left:[],right:[]},manualPagination:a=!1,manualSorting:l=!1,manualFiltering:u=!1,getSubRows:c,getRowCanExpand:d,queryOptions:f}){const[p,g]=N.useState(o),[m,v]=N.useState([]),[y,x]=N.useState(i),[w,C]=N.useState({}),[S,R]=N.useState(s),[I,T]=N.useState({}),[_,$]=N.useState(""),[A,M]=N.useState({pageIndex:0,pageSize:r}),O={pageNo:A.pageIndex+1,pageSize:A.pageSize,sortBy:p,reversed:p.length>0?p[0].desc:!1,columnFilters:m,search:_},{data:B,isLoading:j,isFetching:D,isRefetching:V,isSuccess:G,isError:z,error:H,refetch:ne}=mL.useQuery({queryKey:[e,O],queryFn:()=>n(O),placeholderData:X=>X,...f}),W=B?.data??[],J=B?.totalCount??W.length,K=N.useCallback(X=>{$(X),M(te=>({...te,pageIndex:0}))},[]),U=N.useCallback(X=>{v(X),M(te=>({...te,pageIndex:0}))},[]);return{table:kfe({data:W,columns:t,pageCount:a?Math.ceil(J/A.pageSize):void 0,state:{sorting:p,columnFilters:m,columnVisibility:y,rowSelection:w,columnPinning:S,expanded:I,pagination:A,globalFilter:_},onSortingChange:g,onColumnFiltersChange:U,onColumnVisibilityChange:x,onRowSelectionChange:C,onColumnPinningChange:R,onExpandedChange:T,onPaginationChange:M,onGlobalFilterChange:K,getSubRows:c,getRowCanExpand:d,getCoreRowModel:Efe(),getPaginationRowModel:Nfe(),getSortedRowModel:l?void 0:Pfe(),getFilteredRowModel:u?void 0:Ofe(),getExpandedRowModel:Ife(),manualPagination:a,manualSorting:l,manualFiltering:u}),data:W,isLoading:j,isFetching:D,isRefetching:V,isSuccess:G,isError:z,error:H,totalCount:J,refetch:ne,search:_,setSearch:K,sortBy:p,pagination:A,columnFilters:m,columnVisibility:y,rowSelection:w,columnPinning:S,expanded:I}}Object.defineProperty(exports,"toast",{enumerable:!0,get:()=>Jv.toast});exports.Accordion=nV;exports.AccordionContent=iV;exports.AccordionItem=rV;exports.AccordionTrigger=oV;exports.AlertDialog=c9;exports.AlertDialogAction=v9;exports.AlertDialogCancel=y9;exports.AlertDialogContent=f9;exports.AlertDialogDescription=m9;exports.AlertDialogFooter=h9;exports.AlertDialogHeader=p9;exports.AlertDialogMedia=b9;exports.AlertDialogOverlay=a_;exports.AlertDialogPortal=s_;exports.AlertDialogTitle=g9;exports.AlertDialogTrigger=d9;exports.AspectRatio=S9;exports.Avatar=_9;exports.AvatarFallback=D9;exports.AvatarImage=M9;exports.Badge=Uy;exports.BaseButton=Do;exports.Breadcrumb=j9;exports.BreadcrumbEllipsis=G9;exports.BreadcrumbItem=F9;exports.BreadcrumbLink=B9;exports.BreadcrumbList=L9;exports.BreadcrumbPage=V9;exports.BreadcrumbSeparator=$9;exports.Button=on;exports.Calendar=e0;exports.CalendarDayButton=D_;exports.CampaignTitle=vz;exports.Card=yz;exports.CardAction=Sz;exports.CardContent=Ez;exports.CardDescription=Cz;exports.CardFooter=Iz;exports.CardHeader=xz;exports.CardTitle=wz;exports.Carousel=sq;exports.CarouselContent=aq;exports.CarouselItem=lq;exports.CarouselNext=cq;exports.CarouselPrevious=uq;exports.Case=rn;exports.ChartContainer=VX;exports.ChartLegend=HX;exports.ChartLegendContent=WX;exports.ChartStyle=TM;exports.ChartTooltip=$X;exports.ChartTooltipContent=GX;exports.Checkbox=OM;exports.CheckboxField=zM;exports.Collapsible=zX;exports.CollapsibleContent=UX;exports.CollapsibleTrigger=qX;exports.ComboboxField=tx;exports.Command=GM;exports.CommandDialog=x8;exports.CommandEmpty=S8;exports.CommandGroup=E8;exports.CommandInput=w8;exports.CommandItem=R8;exports.CommandList=C8;exports.CommandSeparator=I8;exports.CommandShortcut=A8;exports.ComponentSwitch=_r;exports.ContentWrapper=HM;exports.CreatableActionIcons=T8;exports.DATE_PRESETS=Kf;exports.DEFAULT_PRESET_KEY=Xv;exports.DataTable=Vfe;exports.DatePreset=$fe;exports.DatePresetProvider=Gfe;exports.DateRangePicker=bk;exports.DebouncedInput=vk;exports.Default=Ki;exports.DetailedImageModal=iK;exports.Dialog=S0;exports.DialogClose=v8;exports.DialogContent=E0;exports.DialogDescription=$M;exports.DialogFooter=y8;exports.DialogHeader=I0;exports.DialogOverlay=VM;exports.DialogPortal=BM;exports.DialogTitle=R0;exports.DialogTrigger=FM;exports.Drawer=DK;exports.DrawerClose=jK;exports.DrawerContent=LK;exports.DrawerDescription=$K;exports.DrawerFooter=BK;exports.DrawerHeader=FK;exports.DrawerOverlay=Pk;exports.DrawerPortal=Nk;exports.DrawerTitle=VK;exports.DrawerTrigger=kK;exports.DropdownMenu=ox;exports.DropdownMenuCheckboxItem=yv;exports.DropdownMenuContent=sx;exports.DropdownMenuGroup=HK;exports.DropdownMenuItem=_k;exports.DropdownMenuLabel=qK;exports.DropdownMenuPortal=GK;exports.DropdownMenuRadioGroup=WK;exports.DropdownMenuRadioItem=zK;exports.DropdownMenuSeparator=UK;exports.DropdownMenuShortcut=YK;exports.DropdownMenuSub=XK;exports.DropdownMenuSubContent=JK;exports.DropdownMenuSubTrigger=ZK;exports.DropdownMenuTrigger=ix;exports.Empty=KK;exports.EmptyContent=oQ;exports.EmptyDescription=rQ;exports.EmptyHeader=QK;exports.EmptyMedia=tQ;exports.EmptyTitle=nQ;exports.ErrorMessage=Mk;exports.FieldDescription=If;exports.FormCheckbox=iQ;exports.FormCombobox=sQ;exports.FormControl=fr;exports.FormDatePicker=aQ;exports.FormDescription=po;exports.FormField=Br;exports.FormFileUpload=Lk;exports.FormInput=dQ;exports.FormItem=dr;exports.FormLabel=oo;exports.FormMessage=Vr;exports.FormPassword=fQ;exports.FormRadio=pQ;exports.FormSlider=hQ;exports.FormSwitch=gQ;exports.FormTextarea=mQ;exports.FormattedDate=oK;exports.HoverCard=bQ;exports.HoverCardContent=yQ;exports.HoverCardTrigger=vQ;exports.Icon=xQ;exports.Input=vu;exports.InputField=cx;exports.InputOTP=kQ;exports.Kbd=jQ;exports.KbdGroup=LQ;exports.Label=gr;exports.MultiSelectDropdown=FQ;exports.NativeSelect=BQ;exports.NativeSelectOptGroup=$Q;exports.NativeSelectOption=VQ;exports.Pagination=GQ;exports.PaginationContent=HQ;exports.PaginationEllipsis=UQ;exports.PaginationItem=WQ;exports.PaginationLink=dx;exports.PaginationNext=qQ;exports.PaginationPrevious=zQ;exports.Popover=nx;exports.PopoverAnchor=mk;exports.PopoverContent=Df;exports.PopoverTrigger=Mf;exports.QuillEditor=tL;exports.RadioGroup=Fk;exports.RadioGroupItem=Bk;exports.ScrollArea=YQ;exports.ScrollBar=Yk;exports.Select=Xk;exports.SelectContent=Kk;exports.SelectField=n2;exports.SelectGroup=XQ;exports.SelectItem=Qk;exports.SelectLabel=ZQ;exports.SelectMultiField=jre;exports.SelectScrollDownButton=t2;exports.SelectScrollUpButton=e2;exports.SelectSeparator=JQ;exports.SelectTrigger=Jk;exports.SelectValue=Zk;exports.Separator=o2;exports.Sheet=H2;exports.SheetClose=Fre;exports.SheetContent=W2;exports.SheetDescription=U2;exports.SheetFooter=$re;exports.SheetHeader=z2;exports.SheetTitle=q2;exports.SheetTrigger=Lre;exports.Sidebar=Zre;exports.SidebarContent=ooe;exports.SidebarFooter=noe;exports.SidebarGroup=ioe;exports.SidebarGroupAction=aoe;exports.SidebarGroupContent=loe;exports.SidebarGroupLabel=soe;exports.SidebarHeader=toe;exports.SidebarInput=eoe;exports.SidebarInset=Qre;exports.SidebarMenu=uoe;exports.SidebarMenuAction=poe;exports.SidebarMenuBadge=hoe;exports.SidebarMenuButton=foe;exports.SidebarMenuItem=coe;exports.SidebarMenuSkeleton=goe;exports.SidebarMenuSub=moe;exports.SidebarMenuSubButton=voe;exports.SidebarMenuSubItem=boe;exports.SidebarProvider=Xre;exports.SidebarRail=Kre;exports.SidebarSeparator=roe;exports.SidebarTrigger=Jre;exports.Skeleton=Rv;exports.Slider=Vk;exports.Spinner=Eoe;exports.Switch=$k;exports.SwitchField=Gk;exports.Table=X2;exports.TableBody=J2;exports.TableCaption=Noe;exports.TableCell=Mc;exports.TableFooter=Ooe;exports.TableHead=K2;exports.TableHeader=Z2;exports.TableRow=il;exports.Tabs=Ioe;exports.TabsContent=Toe;exports.TabsList=Roe;exports.TabsTrigger=Aoe;exports.TextAreaField=Hk;exports.Textarea=pk;exports.Timeline=_oe;exports.Toaster=Soe;exports.Tooltip=lx;exports.TooltipContent=jf;exports.TooltipField=ya;exports.TooltipProvider=ax;exports.TooltipTrigger=ux;exports.cn=F;exports.findMatchingPreset=gL;exports.formatDate=Ws;exports.useDataTable=Hfe;exports.useDatePreset=hL;
|
package/dist/segmentify-ui.js
CHANGED
|
@@ -26864,7 +26864,7 @@ function QE({
|
|
|
26864
26864
|
showClear: o = !1,
|
|
26865
26865
|
...i
|
|
26866
26866
|
}) {
|
|
26867
|
-
return /* @__PURE__ */ ne(nJ, { className: F("ui:w-auto", e), children: [
|
|
26867
|
+
return /* @__PURE__ */ ne(nJ, { className: F("ui:w-auto ui:shrink-0", e), children: [
|
|
26868
26868
|
/* @__PURE__ */ v(ew, { render: /* @__PURE__ */ v(sJ, { disabled: n }), ...i }),
|
|
26869
26869
|
/* @__PURE__ */ ne(oJ, { align: "inline-end", children: [
|
|
26870
26870
|
r && /* @__PURE__ */ v(
|
|
@@ -26908,7 +26908,7 @@ function uJ({
|
|
|
26908
26908
|
"data-slot": "combobox-content",
|
|
26909
26909
|
"data-chips": !!i,
|
|
26910
26910
|
className: F(
|
|
26911
|
-
"ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:max-h-96 ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",
|
|
26911
|
+
"ui:bg-popover ui:text-popover-foreground ui:data-open:animate-in ui:data-closed:animate-out ui:data-closed:fade-out-0 ui:data-open:fade-in-0 ui:data-closed:zoom-out-95 ui:data-open:zoom-in-95 ui:data-[side=bottom]:slide-in-from-top-2 ui:data-[side=left]:slide-in-from-right-2 ui:data-[side=right]:slide-in-from-left-2 ui:data-[side=top]:slide-in-from-bottom-2 ui:ring-foreground/10 ui:*:data-[slot=input-group]:bg-input/30 ui:*:data-[slot=input-group]:border-input/30 ui:group/combobox-content ui:relative ui:flex ui:min-h-0 ui:max-h-96 ui:flex-col ui:w-(--anchor-width) ui:max-w-(--available-width) ui:min-w-[calc(var(--anchor-width)+--spacing(7))] ui:origin-(--transform-origin) ui:overflow-hidden ui:rounded-md ui:shadow-md ui:ring-1 ui:duration-100 ui:data-[chips=true]:min-w-(--anchor-width) ui:*:data-[slot=input-group]:m-1 ui:*:data-[slot=input-group]:mb-0 ui:*:data-[slot=input-group]:h-8 ui:*:data-[slot=input-group]:shadow-none",
|
|
26912
26912
|
e
|
|
26913
26913
|
),
|
|
26914
26914
|
...s
|
|
@@ -26922,10 +26922,7 @@ function cJ({ className: e, ...t }) {
|
|
|
26922
26922
|
XD,
|
|
26923
26923
|
{
|
|
26924
26924
|
"data-slot": "combobox-list",
|
|
26925
|
-
className: F(
|
|
26926
|
-
"ui:max-h-[min(calc(--spacing(96)---spacing(9)),calc(var(--available-height)---spacing(9)))] ui:scroll-py-1 ui:overflow-y-auto ui:p-1 ui:data-empty:p-0",
|
|
26927
|
-
e
|
|
26928
|
-
),
|
|
26925
|
+
className: F("ui:min-h-0 ui:flex-1 ui:overflow-y-auto ui:scroll-py-1 ui:p-1 ui:data-empty:p-0", e),
|
|
26929
26926
|
...t
|
|
26930
26927
|
}
|
|
26931
26928
|
);
|
|
@@ -26936,7 +26933,7 @@ function dJ({ className: e, children: t, ...n }) {
|
|
|
26936
26933
|
{
|
|
26937
26934
|
"data-slot": "combobox-item",
|
|
26938
26935
|
className: F(
|
|
26939
|
-
"ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-
|
|
26936
|
+
"ui:data-highlighted:bg-accent ui:data-highlighted:text-accent-foreground ui:relative ui:flex ui:w-full ui:cursor-default ui:items-center ui:gap-2 ui:rounded-sm ui:py-1.5 ui:pr-8 ui:pl-2 ui:text-sm ui:outline-hidden ui:select-none ui:data-disabled:pointer-events-none ui:data-disabled:opacity-50 ui:[&_svg]:pointer-events-none ui:[&_svg]:shrink-0 ui:[&_svg:not([class*=size-])]:size-4",
|
|
26940
26937
|
e
|
|
26941
26938
|
),
|
|
26942
26939
|
...n,
|
|
@@ -26960,7 +26957,7 @@ function fJ({ className: e, ...t }) {
|
|
|
26960
26957
|
{
|
|
26961
26958
|
"data-slot": "combobox-empty",
|
|
26962
26959
|
className: F(
|
|
26963
|
-
"ui:
|
|
26960
|
+
"ui:hidden ui:w-full ui:shrink-0 ui:justify-center ui:py-2 ui:text-center ui:text-sm ui:text-muted-foreground ui:group-data-empty/combobox-content:flex",
|
|
26964
26961
|
e
|
|
26965
26962
|
),
|
|
26966
26963
|
...t
|
|
@@ -27118,7 +27115,7 @@ const vJ = (e) => e.label, yJ = (e, t) => e.value === t.value, pk = ({
|
|
|
27118
27115
|
children: [
|
|
27119
27116
|
c === "popup" && /* @__PURE__ */ v(QE, { showTrigger: !1, placeholder: "Search...", onChange: S }),
|
|
27120
27117
|
/* @__PURE__ */ v(fJ, { children: a }),
|
|
27121
|
-
l && n && /* @__PURE__ */ ne("div", { className: "ui:group-data-empty/combobox-content:hidden", children: [
|
|
27118
|
+
l && n && /* @__PURE__ */ ne("div", { className: "ui:shrink-0 ui:group-data-empty/combobox-content:hidden", children: [
|
|
27122
27119
|
/* @__PURE__ */ v("div", { className: F("ui:p-1 ui:pb-0", c === "popup" ? "ui:mt-1" : ""), children: /* @__PURE__ */ ne(
|
|
27123
27120
|
"div",
|
|
27124
27121
|
{
|
|
@@ -27241,7 +27238,7 @@ function SJ({ value: e, onChange: t, className: n, inputClassName: r, name: o, p
|
|
|
27241
27238
|
l(h), d(h);
|
|
27242
27239
|
};
|
|
27243
27240
|
return /* @__PURE__ */ ne("search", { className: F("ui:w-full", n), children: [
|
|
27244
|
-
s && /* @__PURE__ */ v(Gr, { htmlFor: o, className: "ui:leading-6 ui:w-full", children: s }),
|
|
27241
|
+
s && /* @__PURE__ */ v(Gr, { htmlFor: o, className: "ui:leading-6 ui:w-full ui:mb-2", children: s }),
|
|
27245
27242
|
/* @__PURE__ */ v(
|
|
27246
27243
|
jf,
|
|
27247
27244
|
{
|
|
@@ -42588,18 +42585,20 @@ function Xue({ children: e, className: t }) {
|
|
|
42588
42585
|
}
|
|
42589
42586
|
);
|
|
42590
42587
|
}
|
|
42591
|
-
function Zue({ placeholder: e = "Search...", filterColumn: t, className: n }) {
|
|
42592
|
-
const { table:
|
|
42593
|
-
const
|
|
42594
|
-
t ?
|
|
42595
|
-
},
|
|
42588
|
+
function Zue({ placeholder: e = "Search...", filterColumn: t, className: n, label: r }) {
|
|
42589
|
+
const { table: o, search: i, onSearchChange: s } = ap(), a = (u) => {
|
|
42590
|
+
const c = String(u);
|
|
42591
|
+
t ? o.getColumn(t)?.setFilterValue(c) : s(c);
|
|
42592
|
+
}, l = t ? o.getColumn(t)?.getFilterValue() ?? "" : i;
|
|
42596
42593
|
return /* @__PURE__ */ v(
|
|
42597
42594
|
SJ,
|
|
42598
42595
|
{
|
|
42599
42596
|
placeholder: e,
|
|
42600
|
-
value:
|
|
42601
|
-
onChange:
|
|
42602
|
-
className: F(n)
|
|
42597
|
+
value: l,
|
|
42598
|
+
onChange: a,
|
|
42599
|
+
className: F(n),
|
|
42600
|
+
label: r ?? "",
|
|
42601
|
+
name: "debounced-search-label"
|
|
42603
42602
|
}
|
|
42604
42603
|
);
|
|
42605
42604
|
}
|
package/dist/ui.css
CHANGED
|
@@ -575,9 +575,6 @@
|
|
|
575
575
|
.ui\:max-h-\[300px\] {
|
|
576
576
|
max-height: 300px;
|
|
577
577
|
}
|
|
578
|
-
.ui\:max-h-\[min\(calc\(--spacing\(96\)---spacing\(9\)\)\,calc\(var\(--available-height\)---spacing\(9\)\)\)\] {
|
|
579
|
-
max-height: min(calc(calc(var(--ui-spacing) * 96) - calc(var(--ui-spacing) * 9)), calc(var(--available-height) - calc(var(--ui-spacing) * 9)));
|
|
580
|
-
}
|
|
581
578
|
.ui\:min-h-0 {
|
|
582
579
|
min-height: calc(var(--ui-spacing) * 0);
|
|
583
580
|
}
|