@simpoobusiness/sdk 2.0.47 → 2.0.49

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.
@@ -220,7 +220,7 @@ to {
220
220
  animation: ${ME} 2.5s cubic-bezier(0.35, 0.04, 0.63, 0.95) infinite;
221
221
  `,EE.svg`
222
222
  transform-origin: 50% 65%;
223
- `;var LE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});D.forwardRef((e,t)=>m.jsx(ba.span,{...e,ref:t,style:{...LE,...e.style}})).displayName="VisuallyHidden";var zE=[" ","Enter","ArrowUp","ArrowDown"],$E=[" ","Enter"],HE="Select",[VE,BE,UE]=xa(HE),[WE]=sa(HE,[UE,Bs]),qE=Bs(),[YE,GE]=WE(HE),[KE,QE]=WE(HE),XE=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:i,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:d,disabled:f,required:p,form:h}=e,g=qE(t),[y,v]=D.useState(null),[b,w]=D.useState(null),[x,S]=D.useState(!1),C=Ca(u),[k,_]=da({prop:r,defaultProp:o??!1,onChange:a,caller:HE}),[E,j]=da({prop:i,defaultProp:s,onChange:l,caller:HE}),O=D.useRef(null),N=!y||(h||!!y.closest("form")),[R,P]=D.useState(new Set),T=Array.from(R).map(e=>e.props.value).join(";");return m.jsx(al,{...g,children:m.jsxs(YE,{required:p,scope:t,trigger:y,onTriggerChange:v,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Ka(),value:E,onValueChange:j,open:k,onOpenChange:_,dir:C,triggerPointerDownPosRef:O,disabled:f,children:[m.jsx(VE.Provider,{scope:t,children:m.jsx(KE,{scope:e.__scopeSelect,onNativeOptionAdd:D.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:D.useCallback(e=>{P(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:n})}),N?m.jsxs(Fj,{"aria-hidden":!0,required:p,tabIndex:-1,name:c,autoComplete:d,value:E,onChange:e=>j(e.target.value),disabled:f,form:h,children:[void 0===E?m.jsx("option",{value:""}):null,Array.from(R)]},T):null]})})};XE.displayName=HE;var ZE="SelectTrigger",JE=D.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=qE(n),i=GE(ZE,n),s=i.disabled||r,l=ia(t,i.onTriggerChange),u=BE(n),c=D.useRef("touch"),[d,f,p]=zj(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===i.value),r=$j(t,e,n);void 0!==r&&i.onValueChange(r.value)}),h=e=>{s||(i.onOpenChange(!0),p()),e&&(i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return m.jsx(il,{asChild:!0,...a,children:m.jsx(ba.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Lj(i.value)?"":void 0,...o,ref:l,onClick:ra(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==c.current&&h(e)}),onPointerDown:ra(o.onPointerDown,e=>{c.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:ra(o.onKeyDown,e=>{const t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),t&&" "===e.key||zE.includes(e.key)&&(h(),e.preventDefault())})})})});JE.displayName=ZE;var ej="SelectValue",tj=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...s}=e,l=GE(ej,n),{onValueNodeHasChildrenChange:u}=l,c=void 0!==a,d=ia(t,l.onValueNodeChange);return ua(()=>{u(c)},[u,c]),m.jsx(ba.span,{...s,ref:d,style:{pointerEvents:"none"},children:Lj(l.value)?m.jsx(m.Fragment,{children:i}):a})});tj.displayName=ej;var nj=D.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.jsx(ba.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});nj.displayName="SelectIcon";var rj=e=>m.jsx(ul,{asChild:!0,...e});rj.displayName="SelectPortal";var oj="SelectContent",aj=D.forwardRef((e,t)=>{const n=GE(oj,e.__scopeSelect),[r,o]=D.useState();if(ua(()=>{o(new DocumentFragment)},[]),!n.open){const t=r;return t?fa.createPortal(m.jsx(sj,{scope:e.__scopeSelect,children:m.jsx(VE.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),t):null}return m.jsx(cj,{...e,ref:t})});aj.displayName=oj;var ij=10,[sj,lj]=WE(oj),uj=ha("SelectContent.RemoveScroll"),cj=D.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:y,...v}=e,b=GE(oj,n),[w,x]=D.useState(null),[S,C]=D.useState(null),k=ia(t,e=>x(e)),[_,E]=D.useState(null),[j,O]=D.useState(null),N=BE(n),[R,P]=D.useState(!1),T=D.useRef(!1);D.useEffect(()=>{if(w)return Al(w)},[w]),Ia();const M=D.useCallback(e=>{const[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==o)return}},[N,S]),I=D.useCallback(()=>M([_,w]),[M,_,w]);D.useEffect(()=>{R&&I()},[R,I]);const{onOpenChange:A,triggerPointerDownPosRef:F}=b;D.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||A(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,A,F]),D.useEffect(()=>{const e=()=>A(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[A]);const[L,z]=zj(e=>{const t=N().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=$j(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),$=D.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==b.value&&b.value===t||r)&&(E(e),r&&(T.current=!0))},[b.value]),H=D.useCallback(()=>w?.focus(),[w]),V=D.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==b.value&&b.value===t||r)&&O(e)},[b.value]),B="popper"===r?fj:dj,U=B===fj?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:y}:{};return m.jsx(sj,{scope:n,content:w,viewport:S,onViewportChange:C,itemRefCallback:$,selectedItem:_,onItemLeave:H,itemTextRefCallback:V,focusSelectedItem:I,selectedItemText:j,position:r,isPositioned:R,searchRef:L,children:m.jsx(ku,{as:uj,allowPinchZoom:!0,children:m.jsx($a,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ra(o,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:m.jsx(Ra,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:m.jsx(B,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...v,...U,onPlaced:()=>P(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ra(v.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});cj.displayName="SelectContentImpl";var dj=D.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=GE(oj,n),i=lj(oj,n),[s,l]=D.useState(null),[u,c]=D.useState(null),d=ia(t,e=>c(e)),f=BE(n),p=D.useRef(!1),h=D.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=i,w=D.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&u&&g&&y&&v){const e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),o=v.getBoundingClientRect();if("rtl"!==a.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,l=e.width+i,u=Math.max(l,t.width),c=window.innerWidth-ij,d=FE(a,[ij,Math.max(ij,c-u)]);s.style.minWidth=l+"px",s.style.left=d+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,l=e.width+i,u=Math.max(l,t.width),c=window.innerWidth-ij,d=FE(a,[ij,Math.max(ij,c-u)]);s.style.minWidth=l+"px",s.style.right=d+"px"}const i=f(),l=window.innerHeight-2*ij,c=g.scrollHeight,d=window.getComputedStyle(u),h=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),b=parseInt(d.borderBottomWidth,10),w=h+m+c+parseInt(d.paddingBottom,10)+b,x=Math.min(5*y.offsetHeight,w),S=window.getComputedStyle(g),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),_=e.top+e.height/2-ij,E=l-_,j=y.offsetHeight/2,O=h+m+(y.offsetTop+j),N=w-O;if(O<=_){const e=i.length>0&&y===i[i.length-1].ref.current;s.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=O+Math.max(E,j+(e?k:0)+t+b);s.style.height=n+"px"}else{const e=i.length>0&&y===i[0].ref.current;s.style.top="0px";const t=Math.max(_,h+g.offsetTop+(e?C:0)+j)+N;s.style.height=t+"px",g.scrollTop=O-_+g.offsetTop}s.style.margin=`${ij}px 0`,s.style.minHeight=x+"px",s.style.maxHeight=l+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,u,g,y,v,a.dir,r]);ua(()=>w(),[w]);const[x,S]=D.useState();ua(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const C=D.useCallback(e=>{e&&!0===h.current&&(w(),b?.(),h.current=!1)},[w,b]);return m.jsx(pj,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:m.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:m.jsx(ba.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});dj.displayName="SelectItemAlignedPosition";var fj=D.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ij,...a}=e,i=qE(n);return m.jsx(sl,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});fj.displayName="SelectPopperPosition";var[pj,hj]=WE(oj,{}),mj="SelectViewport",gj=D.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=lj(mj,n),i=hj(mj,n),s=ia(t,a.onViewportChange),l=D.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m.jsx(VE.Slot,{scope:n,children:m.jsx(ba.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ra(o.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=i;if(r?.current&&n){const e=Math.abs(l.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*ij,o=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(o,a);if(i<r){const o=i+e,a=Math.min(r,o),s=o-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}l.current=t.scrollTop})})})]})});gj.displayName=mj;var yj="SelectGroup",[vj,bj]=WE(yj);D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ka();return m.jsx(vj,{scope:n,id:o,children:m.jsx(ba.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=yj;var wj="SelectLabel",xj=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=bj(wj,n);return m.jsx(ba.div,{id:o.id,...r,ref:t})});xj.displayName=wj;var Sj="SelectItem",[Cj,kj]=WE(Sj),_j=D.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...i}=e,s=GE(Sj,n),l=lj(Sj,n),u=s.value===r,[c,d]=D.useState(a??""),[f,p]=D.useState(!1),h=ia(t,e=>l.itemRefCallback?.(e,r,o)),g=Ka(),y=D.useRef("touch"),v=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(""===r)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(Cj,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:D.useCallback(e=>{d(t=>t||(e?.textContent??"").trim())},[]),children:m.jsx(VE.ItemSlot,{scope:n,value:r,disabled:o,textValue:c,children:m.jsx(ba.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:h,onFocus:ra(i.onFocus,()=>p(!0)),onBlur:ra(i.onBlur,()=>p(!1)),onClick:ra(i.onClick,()=>{"mouse"!==y.current&&v()}),onPointerUp:ra(i.onPointerUp,()=>{"mouse"===y.current&&v()}),onPointerDown:ra(i.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:ra(i.onPointerMove,e=>{y.current=e.pointerType,o?l.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ra(i.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:ra(i.onKeyDown,e=>{""!==l.searchRef?.current&&" "===e.key||($E.includes(e.key)&&v()," "===e.key&&e.preventDefault())})})})})});_j.displayName=Sj;var Ej="SelectItemText",jj=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,i=GE(Ej,n),s=lj(Ej,n),l=kj(Ej,n),u=QE(Ej,n),[c,d]=D.useState(null),f=ia(t,e=>d(e),l.onItemTextChange,e=>s.itemTextRefCallback?.(e,l.value,l.disabled)),p=c?.textContent,h=D.useMemo(()=>m.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return ua(()=>(g(h),()=>y(h)),[g,y,h]),m.jsxs(m.Fragment,{children:[m.jsx(ba.span,{id:l.textId,...a,ref:f}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?fa.createPortal(a.children,i.valueNode):null]})});jj.displayName=Ej;var Oj="SelectItemIndicator",Nj=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return kj(Oj,n).isSelected?m.jsx(ba.span,{"aria-hidden":!0,...r,ref:t}):null});Nj.displayName=Oj;var Rj="SelectScrollUpButton",Pj=D.forwardRef((e,t)=>{const n=lj(Rj,e.__scopeSelect),r=hj(Rj,e.__scopeSelect),[o,a]=D.useState(!1),i=ia(t,r.onScrollButtonChange);return ua(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;a(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?m.jsx(Mj,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Pj.displayName=Rj;var Tj="SelectScrollDownButton",Dj=D.forwardRef((e,t)=>{const n=lj(Tj,e.__scopeSelect),r=hj(Tj,e.__scopeSelect),[o,a]=D.useState(!1),i=ia(t,r.onScrollButtonChange);return ua(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?m.jsx(Mj,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Dj.displayName=Tj;var Mj=D.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=lj("SelectScrollButton",n),i=D.useRef(null),s=BE(n),l=D.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return D.useEffect(()=>()=>l(),[l]),ua(()=>{const e=s().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[s]),m.jsx(ba.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ra(o.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(r,50))}),onPointerMove:ra(o.onPointerMove,()=>{a.onItemLeave?.(),null===i.current&&(i.current=window.setInterval(r,50))}),onPointerLeave:ra(o.onPointerLeave,()=>{l()})})}),Ij=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(ba.div,{"aria-hidden":!0,...r,ref:t})});Ij.displayName="SelectSeparator";var Aj="SelectArrow";D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=qE(n),a=GE(Aj,n),i=lj(Aj,n);return a.open&&"popper"===i.position?m.jsx(ll,{...o,...r,ref:t}):null}).displayName=Aj;var Fj=D.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=D.useRef(null),a=ia(r,o),i=function(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(t);return D.useEffect(()=>{const e=o.current;if(!e)return;const n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,"value").set;if(i!==t&&r){const n=new Event("change",{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[i,t]),m.jsx(ba.select,{...n,style:{...LE,...n.style},ref:a,defaultValue:t})});function Lj(e){return""===e||void 0===e}function zj(e){const t=ka(e),n=D.useRef(""),r=D.useRef(0),o=D.useCallback(e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),a=D.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function $j(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,a=n?e.indexOf(n):-1;let i=(s=e,l=Math.max(a,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===o.length&&(i=i.filter(e=>e!==n));const u=i.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}Fj.displayName="SelectBubbleInput";var Hj=JE,Vj=nj,Bj=rj,Uj=aj,Wj=gj,qj=xj,Yj=_j,Gj=jj,Kj=Nj,Qj=Pj,Xj=Dj,Zj=Ij;const Jj=XE,eO=tj,tO=D.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Hj,{ref:r,className:Ko("flex h-10 w-full items-center hover:border-[#BFD7FE] justify-between rounded-md border focus:border-primary border-neutral-200 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-neutral-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",e),...n,children:[t,m.jsx(Vj,{asChild:!0,children:m.jsx(Rd,{className:"h-4 w-4 opacity-50"})})]}));tO.displayName=Hj.displayName;const nO=D.forwardRef(({className:e,...t},n)=>m.jsx(Qj,{ref:n,className:Ko("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Td,{className:"h-4 w-4"})}));nO.displayName=Qj.displayName;const rO=D.forwardRef(({className:e,...t},n)=>m.jsx(Xj,{ref:n,className:Ko("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Rd,{className:"h-4 w-4"})}));rO.displayName=Xj.displayName;const oO=D.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>m.jsx(Bj,{children:m.jsxs(Uj,{ref:o,className:Ko("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white text-neutral-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[m.jsx(nO,{}),m.jsx(Wj,{className:Ko("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),m.jsx(rO,{})]})}));oO.displayName=Uj.displayName;D.forwardRef(({className:e,...t},n)=>m.jsx(qj,{ref:n,className:Ko("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=qj.displayName;const aO=D.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Yj,{ref:r,className:Ko("relative flex w-full select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-primary/20 cursor-pointer focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(Kj,{children:m.jsx(Nd,{className:"h-4 w-4"})})}),m.jsx(Gj,{children:t})]}));aO.displayName=Yj.displayName;function iO({label:e,addonLabel:t,type:n,placeholder:r,selectPlaceholder:o,error:a,success:i,value:s,defaultValue:l,name:u,id:c,formik:d,onChange:f,inputRef:p,onBlur:h,required:g,disabled:y,loading:v,showError:b,selectOptions:w,disableSearch:x,searchSelectPlaceholder:S,showSelectSearch:C,onSelectValueChange:k,selectValue:_,showOutline:E=!0,cols:j,rows:O,labelClass:N,addonLabelClass:R,optional:P,info:T,addonInfo:M,icon:I,actionIcon:A,actionLabel:F,actionLabelInfo:L,actionLabelAction:z,className:$,textAreaOnChange:H,addOn:V,infoAlignment:B,addonInfoAlignment:U,inputContainerClass:W,showNegative:q,showPositive:Y,...G}){const[K,Q]=D.useState(n),[X,Z]=D.useState(!1),[J,ee]=D.useState(""),te=((e,t)=>{const n=e?.filter(e=>"string"==typeof e.label?e.label?.toLowerCase().includes(t.toLowerCase()):e.value?.toLowerCase().includes(t.toLowerCase())||e?.searchId?.toLowerCase().includes(t.toLowerCase()));return t?n:e})(w??[],J);return m.jsx(m.Fragment,{children:v?m.jsx(na,{className:"w-full h-12"}):m.jsx("div",{className:"w-full",children:m.jsxs("div",{className:`flex flex-col ${e&&"gap-2.5"} relative `,children:[m.jsxs("div",{className:"flex justify-between gap-2 flex-wrap",children:[t&&m.jsxs("label",{className:Ko("text-black flex items-center gap-1 first-letter:uppercase text-sm font-medium",R),children:[t," ",g?m.jsx("span",{className:"text-[#E12D39]",children:t&&"*"}):P?m.jsx("span",{className:"text-[#B5B5B5] font-normal",children:"(optional)"}):null,M&&m.jsx(kv,{fieldName:t,align:U,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:M})})]}),e&&m.jsxs("label",{className:Ko("text-black flex items-center gap-1 first-letter:uppercase text-sm font-medium",N),children:[e," ",g?m.jsx("span",{className:"text-[#E12D39]",children:e&&"*"}):P?m.jsx("span",{className:"text-[#B5B5B5] font-normal",children:"(optional)"}):null,T&&m.jsx(kv,{fieldName:e,align:B,children:m.jsx("p",{className:"font-normal first-letter:uppercase w-full whitespace-pre-wrap",children:T})})]}),F&&m.jsxs("button",{onClick:z,className:"text-primary flex items-center gap-1 first-letter:uppercase text-sm font-bold",children:[A,F,L&&m.jsx(kv,{fieldName:e,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:L})})]})]}),m.jsxs("div",{className:Ko(`border overflow-hidden rounded-md text-sm border-[#E1E3EA] hover:border-primary_light font-normal text-grey-950 flex gap-2 items-center bg-white px-3 ${"text-area"!==n&&"h-10"} ${(a||b)&&"!border-danger"} ${i&&"!border-success"} ${X&&E&&"!border-primary"}\n ${I&&"px-2"}\n ${V&&"px-0"}\n `,y?"cursor-not-allowed bg-gray-200":null,w?"px-0":null,W),children:[V&&m.jsx("span",{className:"bg-gray-200 text-[13px] font-semibold text-gray-700 h-full min-w-9.5 flex items-center justify-center shrink-0 rounded-l-md px-2 ",children:V}),I,w&&m.jsxs(Jj,{onValueChange:k,defaultValue:_,value:_,children:[m.jsx(tO,{disabled:x,className:" min-w-max w-max h-full border-0 border-r rounded-none hover:border-neutral-200 focus:border-neutral-200 bg-[#F9F9F9] hover:border-b-neutral-200 disabled:opacity-100 ",children:m.jsx(eO,{className:" text-sm text-[#5E6278] placeholder:font-medium outline-none",placeholder:o})}),m.jsxs(oO,{className:"bg-white w-full relative",children:[C&&m.jsx("input",{value:J,onChange:e=>{ee(e.target.value.toString())},placeholder:S??"Search...",className:"h-10 border mb-2 text-sm px-4 outline-none w-full border-neutral-200 rounded bg-white sticky top-0 z-20"}),te?.map((e,t)=>m.jsx(aO,{className:"text-sm",value:e.value,children:e.label},e.value))]})]}),"text-area"===n?m.jsx("textarea",{cols:j,rows:O,onFocus:()=>Z(!0),onBlur:e=>{Z(!1)},placeholder:r,className:Ko(`placeholder:text-[#7E8299] hover:border-primary_light py-2 h-full placeholder:font-medium outline-none w-full rounded ${y?"bg-[#EEEFF2] cursor-not-allowed":null} ${X&&E&&"!border-primary"} transition-all ease-in-out`,$),...G,value:s,name:u,onChange:H}):m.jsx("input",{onInput:e=>{const t=e.target;"number"===n&&(t.value=t.value.replace(/[^0-9.]/g,""),t.value=t.value.replace(/^\.|(\..*)\./g,"$1"),t.value.length>1&&t.value.startsWith("0")&&"."!==t.value[1]&&(t.value=t.value.replace(/^0+/,"")),""!==t.value&&"0"!==t.value||(t.value="0"))},type:"number"===K?"text":K,placeholder:r,className:Ko("placeholder:text-[#7E8299] h-full placeholder:font-medium outline-none w-full rounded disabled:cursor-not-allowed",w&&"number"===n?"pr-2":null,I||V?"pr-0":null,w&&"number"===n&&t&&"text-right pr-2",$,Y&&"0"!==s?.toString().trim()?"text-green-600 font-semibold":"",q&&s?.toString().trim().startsWith("-")?"text-red-600 font-semibold":""),onFocus:()=>Z(!0),onBlur:e=>{d&&h&&d&&h(e),Z(!1)},value:s||"",defaultValue:l,onChange:f,id:c,name:u,required:g,disabled:y,ref:p,...G}),"password"===n&&m.jsx("span",{className:"cursor-pointer",onClick:()=>{Q(e=>"password"===e?"text":"password")},children:"password"===K?Jy.eyeslash:Jy.eye})]}),a&&m.jsx("p",{className:"text-danger text-xs font-normal",children:a})]})})})}function sO({value:e,label:t,placeholder:n,uuid:r,name:o,displayValue:a,valueType:i,item_unit:s}){const{mutate:l,isPending:u}=ex();J();const[c,d]=D.useState(!1),[f,p]=D.useState({item_uuid:r,[o]:e});En();const[h,g]=D.useState("");return m.jsxs($C,{open:c,onOpenChange:d,children:[m.jsx(HC,{className:"flex items-center",children:m.jsx("button",{className:"hover:text-primary duration-150 underline disabled:no-underline disabled:hover:text-inherit",children:h?"selling_price"===o?rv(+h):ov(+h)+s:a})}),m.jsxs(VC,{align:"center",className:"shadow-[0_1px_2px_0px_#E4E5E73D,_0_12px_24px_0_#868C981F] space-y-2 bg-white rounded-xl p-3 w-[280px] relative before:absolute before:w-3 before:h-1.5 before:bg-white before:left-1/2 before:-translate-x-1/2 before:rotate-45 data-[side=bottom]:before:top-0 data-[side=top]:before:bottom-0",children:[m.jsx(iO,{type:i,value:f[o],label:t,placeholder:n,onChange:e=>{p(t=>({...t,[o]:e.target.value}))}}),m.jsxs("div",{className:"flex justify-end gap-2.5",children:[m.jsx(AC,{children:m.jsx(IE,{label:"Dismiss",className:"bg-gray-300 text-dark text-sm hover:bg-gray-300/90 font-medium",disabled:u})}),m.jsx(IE,{label:"Update",className:"text-sm font-medium",onClick:()=>{l({url:"/items/update_basic",payload:f},{onSuccess:()=>{g(f[o]),d(!1)},onError:()=>{g("")}})},loading:u})]})]})]})}D.forwardRef(({className:e,...t},n)=>m.jsx(Zj,{ref:n,className:Ko("-mx-1 my-1 h-px bg-neutral-100 dark:bg-neutral-800",e),...t})).displayName=Zj.displayName;const lO=[{accessorKey:"item_description",header:()=>m.jsxs("p",{children:[" ","Item description/ ",m.jsx("br",{})," Product code"," "]}),cell:({row:e})=>{const t=e.original;return m.jsxs("div",{className:"flex items-center gap-5",children:[m.jsx("div",{className:"w-[50px] h-[50px] rounded-2xl relative bg-gray-100",children:m.jsx("img",{src:t.item_image,alt:"item image",className:"rounded-2xl object-cover w-full h-full",draggable:!1})}),m.jsxs("div",{className:"space-y-1 max-w-[265px]",children:[m.jsx(cO,{title:t.item_description,item_uuid:t.uuid,item_type_id:t.item_type_id,data:t.fullData}),m.jsxs("p",{className:"text-dark text-xs font-normal flex items-center gap-1",children:[m.jsx("span",{className:"uppercase whitespace-nowrap",children:t.itemcode}),t.sku||t.barcode.length>0?m.jsx(kv,{align:"center",fieldName:"All item codes",trigger:m.jsxs("button",{className:"rounded bg-primary_light px-[5px] flex items-center text-primary font-semibold text-[11px] h-[18px]",children:["+",(t.barcode?.length||0)+(t.sku?1:0)]}),children:m.jsxs("div",{className:"space-y-2",children:[t.sku?m.jsxs("div",{className:"",children:[m.jsx("p",{children:" SKU:"}),m.jsx("ul",{className:"list-disc pl-4",children:m.jsx("li",{children:t.sku})})]}):null,t.barcode.length>0?m.jsxs("div",{children:[m.jsx("p",{children:"Barcodes:"}),m.jsx("ul",{className:"list-disc pl-4 ",children:t.barcode.map((e,t)=>m.jsx("li",{children:e.barcode},t))})]}):null,m.jsxs("div",{className:"",children:[m.jsx("p",{children:" Itemcode:"}),m.jsx("ul",{className:"list-disc pl-4",children:m.jsx("li",{children:t.itemcode})})]})]})}):null,t.expired?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"|"}),"Expired",m.jsx("span",{className:"rounded bg-danger_light px-[5px] flex items-center text-danger font-semibold text-[11px] h-[18px]",children:t.expired})]}):null,t.expiring?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"|"}),"Expiring",m.jsx("span",{className:"rounded bg-warning-light px-[5px] flex items-center text-warning font-semibold text-[11px] h-[18px]",children:t.expiring})]}):null]})]})]})}},{accessorKey:"quantity",header:()=>m.jsx("p",{children:"quantity"}),cell:({row:e})=>{const t=e.original;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:Ko("flex items-center",t.quantity<=0?"text-danger":Number(t.reorder_level)==t.quantity?"text-orange":null),children:m.jsx(sO,{label:"Edit item quantity",placeholder:"Enter quantity",uuid:t.uuid,name:"item_quantity",displayValue:ov(t.quantity)+t.unit,value:t.quantity,valueType:"number",item_unit:t.unit})}),t.all_quantity===t.quantity?null:m.jsx("p",{className:"text-gray-700",children:Intl.NumberFormat().format(t.all_quantity??0)+t.unit})]})}},{accessorKey:"type",cell:({row:e})=>{const t=e.original;return m.jsx("p",{className:"capitalize",children:t.type})}},{accessorKey:"selling_price",header:"Selling Price (₦)",cell:({row:e})=>{const t=e.original;return m.jsx(sO,{label:"Edit selling price (₦)",placeholder:"Enter selling price",uuid:t.uuid,name:"selling_price",displayValue:rv(t.selling_price??0),value:t.selling_price??0,valueType:"number"})}},{accessorKey:"categories",header:"categories/Tags",cell:({row:e})=>{const t=e.original;return m.jsxs(m.Fragment,{children:[" ",m.jsxs("div",{className:"flex items-center gap-2 capitalize",children:[t.categories&&t.categories?.length>0?t.categories?.[0]?.name:"...",t.categories.length>1?m.jsx(kv,{align:"center",fieldName:"Categories",trigger:m.jsxs("button",{className:"rounded bg-primary_light px-[5px] flex items-center text-primary font-semibold text-[11px] h-[18px]",children:["+",t.categories.length-1]}),children:m.jsx("ul",{className:"list-disc pl-4",children:t.categories.map((e,t)=>m.jsx("li",{children:e.name},t))})}):null]}),m.jsxs("div",{className:"text-gray-700 flex items-center gap-2 capitalize",children:[t.tags?.[0],t.tags?.length>1?m.jsx(kv,{align:"center",fieldName:"Tags",trigger:m.jsxs("button",{className:"rounded bg-primary_light px-[5px] flex items-center text-primary font-semibold text-[11px] h-[18px] border-primary",children:["+",t.tags.length-1]}),children:m.jsx("ul",{className:"list-disc pl-4",children:t.tags.map((e,t)=>m.jsx("li",{children:e},t))})}):null]})]})}},{accessorKey:"status",cell:({row:e})=>{const t=e.getValue("status");return m.jsx(_v,{status:t})}},{id:"actions",header:"actions",cell:({row:e})=>{const t=e.original;return m.jsx(uO,{item_uuid:t.uuid,item_type_id:t.item_type_id,data:t.fullData})}}],uO=({item_uuid:e,item_type_id:t,data:n})=>{const[r,o]=D.useState(null),a=()=>{o(null)},[i,s]=D.useState(!1),[l,u]=D.useState(!1),[c,d]=D.useState(!1),[f,p]=D.useState(!1),[h,g]=D.useState(!1),[y,v]=D.useState(!1),[b,w]=D.useState(!1),x=[{label:"view",icon:Jy.eye_outline,action:()=>s(!0)},{label:"delete",icon:Jy.trash,action:()=>p(!0)}];return m.jsxs(m.Fragment,{children:[m.jsxs(Fd,{children:[m.jsx(Ld,{asChild:!0,children:m.jsxs("button",{className:"bg-gray-100 rounded-md h-[30px] w-[90px] flex items-center justify-between p-2.5 font-semibold text-[10px] text-gray-500 hover:border duration-200",children:["Action"," ",m.jsx("svg",{width:"11",height:"6",viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M5.50855 5.49304C5.42081 5.49355 5.33383 5.47673 5.25261 5.44356C5.17138 5.41038 5.09751 5.3615 5.03521 5.29971L1.03521 1.29971C0.972726 1.23773 0.92313 1.164 0.889284 1.08276C0.855438 1.00152 0.838013 0.914383 0.838013 0.826375C0.838013 0.738367 0.855438 0.65123 0.889284 0.56999C0.92313 0.488751 0.972726 0.415017 1.03521 0.353041C1.16012 0.228874 1.32909 0.15918 1.50521 0.15918C1.68134 0.15918 1.8503 0.228874 1.97521 0.353041L5.50855 3.88637L9.03521 0.353041C9.16012 0.228874 9.32909 0.15918 9.50521 0.15918C9.68134 0.15918 9.8503 0.228874 9.97521 0.353041C10.0377 0.415017 10.0873 0.488751 10.1211 0.56999C10.155 0.65123 10.1724 0.738367 10.1724 0.826375C10.1724 0.914383 10.155 1.00152 10.1211 1.08276C10.0873 1.164 10.0377 1.23773 9.97521 1.29971L5.97521 5.29971C5.85104 5.42287 5.68344 5.4923 5.50855 5.49304Z",fill:"#202125"})})]})}),m.jsx(zd,{align:"end",className:"flex flex-col gap-2.5 rounded-xl border-gray-200",children:x.map((e,t)=>m.jsxs($d,{className:`capitalize focus:bg-primary_light rounded-md focus:text-primary font-semibold text-gray-700 text-sm cursor-pointer px-[15px] flex items-center gap-[5px] ${t===x.length-1&&"text-danger focus:text-danger"}`,onMouseOver:()=>(e=>{o(e)})(t),onMouseOut:a,onClick:e.action,children:[M.cloneElement(e.icon,{fill:r===t?"#1868DB":"#5E6278"})," ",e.label]},t))})]}),m.jsx(QC,{isOpen:i,onClose:()=>s(!1),itemUUID:e}),m.jsx(AE,{isOpen:f,onClose:()=>p(!1),uuids:[e],single:!0})]})},cO=({title:e,item_uuid:t,item_type_id:n,data:r})=>{const[o,a]=D.useState(!1),[i,s]=D.useState(!1),[l,u]=D.useState(!1);return m.jsxs(m.Fragment,{children:[m.jsx("button",{className:Ko("text-primary font-bold text-sm first-letter:uppercase truncate max-w-[265px] cursor-pointer",r.expired?"text-danger":""),title:e,onClick:()=>a(!0),children:e}),m.jsx(QC,{isOpen:o,onClose:()=>a(!1),itemUUID:t})]})};var dO,fO={};function pO(){if(dO)return fO;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}dO=1,Object.defineProperty(fO,"__esModule",{value:!0}),fO.Collapse=void 0;var t,n=(t=f())&&t.__esModule?t:{default:t};function r(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function a(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,o=s(t);if(n){var a=s(this).constructor;r=Reflect.construct(o,arguments,a)}else r=o.apply(this,arguments);return function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return i(t)}(this,r)}}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,e);var t=a(s);function s(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),l(i(n=t.call(this,e)),"timeout",void 0),l(i(n),"container",void 0),l(i(n),"content",void 0),l(i(n),"onResize",function(){if(clearTimeout(n.timeout),n.container&&n.content){var e=n.props,t=e.isOpened,r=e.checkTimeout,o=Math.floor(n.container.clientHeight),a=Math.floor(n.content.clientHeight),i=t&&Math.abs(a-o)<=1,s=!t&&Math.abs(o)<=1;i||s?n.onRest({isFullyOpened:i,isFullyClosed:s,isOpened:t,containerHeight:o,contentHeight:a}):(n.onWork({isFullyOpened:i,isFullyClosed:s,isOpened:t,containerHeight:o,contentHeight:a}),n.timeout=setTimeout(function(){return n.onResize()},r))}}),l(i(n),"onRest",function(e){var t=e.isFullyOpened,r=e.isFullyClosed,o=e.isOpened,a=e.containerHeight,i=e.contentHeight;if(n.container&&n.content){var s=o&&n.container.style.height==="".concat(i,"px"),l=!o&&"0px"===n.container.style.height;if(s||l){n.container.style.overflow=o?"initial":"hidden",n.container.style.height=o?"auto":"0px";var u=n.props.onRest;u&&u({isFullyOpened:t,isFullyClosed:r,isOpened:o,containerHeight:a,contentHeight:i})}}}),l(i(n),"onWork",function(e){var t=e.isFullyOpened,r=e.isFullyClosed,o=e.isOpened,a=e.containerHeight,i=e.contentHeight;if(n.container&&n.content){var s=o&&n.container.style.height==="".concat(i,"px"),l=!o&&"0px"===n.container.style.height;if(!s&&!l){n.container.style.overflow="hidden",n.container.style.height=o?"".concat(i,"px"):"0px";var u=n.props.onWork;u&&u({isFullyOpened:t,isFullyClosed:r,isOpened:o,containerHeight:a,contentHeight:i})}}}),l(i(n),"onRefContainer",function(e){n.container=e}),l(i(n),"onRefContent",function(e){n.content=e}),e.initialStyle?n.initialStyle=e.initialStyle:n.initialStyle=e.isOpened?{height:"auto",overflow:"initial"}:{height:"0px",overflow:"hidden"},n}return r(s,[{key:"componentDidMount",value:function(){this.onResize()}},{key:"shouldComponentUpdate",value:function(e){var t=this.props,n=t.theme,r=t.isOpened;return t.children!==e.children||r!==e.isOpened||Object.keys(n).some(function(t){return n[t]!==e.theme[t]})}},{key:"getSnapshotBeforeUpdate",value:function(){if(!this.container||!this.content)return null;if("auto"===this.container.style.height){var e=this.content.clientHeight;this.container.style.height="".concat(e,"px")}return null}},{key:"componentDidUpdate",value:function(){this.onResize()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeout)}},{key:"render",value:function(){var e=this.props,t=e.theme,r=e.children,o=e.isOpened;return n.default.createElement("div",{ref:this.onRefContainer,className:t.collapse,style:this.initialStyle,"aria-hidden":!o},n.default.createElement("div",{ref:this.onRefContent,className:t.content},r))}}]),s}(n.default.Component);return fO.Collapse=u,l(u,"defaultProps",{theme:{collapse:"ReactCollapse--collapse",content:"ReactCollapse--content"},initialStyle:void 0,onRest:void 0,onWork:void 0,checkTimeout:50}),fO}var hO,mO,gO,yO={};function vO(){if(hO)return yO;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}hO=1,Object.defineProperty(yO,"__esModule",{value:!0}),yO.UnmountClosed=void 0;var t,n=(t=f())&&t.__esModule?t:{default:t},r=pO(),o=["isOpened"],a=["isOpened"];function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,o=m(t);if(n){var a=m(this).constructor;r=Reflect.construct(o,arguments,a)}else r=o.apply(this,arguments);return function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}(this,r)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(s,e);var t=p(s);function s(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),g(h(n=t.call(this,e)),"onWork",function(e){var t=e.isOpened,r=u(e,o);n.setState({isResting:!1,isOpened:t});var a=n.props.onWork;a&&a(l({isOpened:t},r))}),g(h(n),"onRest",function(e){var t=e.isOpened,r=u(e,a);n.setState({isResting:!0,isOpened:t,isInitialRender:!1});var o=n.props.onRest;o&&o(l({isOpened:t},r))}),g(h(n),"getInitialStyle",function(){var e=n.state,t=e.isOpened;return e.isInitialRender&&t?{height:"auto",overflow:"initial"}:{height:"0px",overflow:"hidden"}}),n.state={isResting:!0,isOpened:e.isOpened,isInitialRender:!0},n}return c(s,[{key:"componentDidUpdate",value:function(e){var t=this.props.isOpened;e.isOpened!==t&&this.setState({isResting:!1,isOpened:t,isInitialRender:!1})}},{key:"render",value:function(){var e=this.state,t=e.isResting,o=e.isOpened;return t&&!o?null:n.default.createElement(r.Collapse,i({},this.props,{initialStyle:this.getInitialStyle(),onWork:this.onWork,onRest:this.onRest}))}}]),s}(n.default.PureComponent);return yO.UnmountClosed=y,g(y,"defaultProps",{onWork:void 0,onRest:void 0}),yO}var bO=function(){if(gO)return mO;gO=1;var e=pO().Collapse,t=vO().UnmountClosed;return mO=t,t.Collapse=e,t.UnmountClosed=t,mO}();function wO({loading:e,data:t,meta:n}){const r=t?.otherscount?.map(e=>{const n=e.name;return{type:n,value:t?.result_array?.[n]?.total_selling_price??0}}),o=[{type:t?.result_array?.Retail?.pricegroup??t?.default,value:t?.result_array?.Retail?.total_selling_price??0},...r||[]],a=t?.otherscount?.map(e=>{const n=e.name;return{type:n,value:t?.result_array?.[n]?.total_profit??0}}),i=[{type:t?.result_array?.Retail?.pricegroup??t?.default,value:t?.result_array?.Retail?.total_profit??0},...a||[]],[s,l]=D.useState({type:o?.[0].type,value:o?.[0].value}),[u,c]=D.useState({type:i?.[0].type,value:i?.[0].value});M.useEffect(()=>{l({type:o?.[0].type,value:o?.[0].value}),c({type:i?.[0].type,value:i?.[0].value})},[e]);const d=[{label:"Total No. of Unique Item",count:Intl.NumberFormat().format(n?.total??0),desc:`With ${t?.unit_count??0} unit(s)`,icon:m.jsx("div",{className:"shrink-0 rounded-lg \r\n \r\n bg-[#EFF5FF] w-12 h-12 flex items-center justify-center border border-[#EDEEF1]",children:Jy.cube})},{label:"Total Cost Price",count:rv(t?.result_array?.Retail?.total_cost??0),desc:"Takes into Account FIFO & LIFO ",icon:m.jsx("div",{className:"shrink-0 rounded-lg bg-[#F9DFDD] w-12 h-12 flex items-center justify-center border border-[#EDEEF1]",children:M.cloneElement(Jy.price_tag,{fill:"#ED7400"})})},{label:"Total Selling Price",count:rv(s.value),desc:m.jsxs("p",{className:"flex gap-2 items-center flex-wrap",children:["Showing ",s.type," price"," ",m.jsxs(Fd,{children:[m.jsx(Ld,{asChild:!0,children:m.jsxs("button",{className:"rounded-lg h-8 flex items-center justify-between p-3 font-semibold text-xs text-gray-600 outline-none border border-gray-300 gap-2.5 capitalize bg-[#F9F9F9]",children:["change",m.jsx("span",{className:"rotate-90",children:Jy.arrow})]})}),m.jsx(zd,{align:"start",className:"flex flex-col gap-2.5 rounded-xl border-gray-200 py-2.5 w-[210px]",children:o.map((e,t)=>m.jsx($d,{className:Ko("capitalize focus:bg-primary_light rounded-md focus:text-primary font-semibold text-sm cursor-pointer px-[15px] flex items-center gap-[5px] \n \n ",e.type===s.type?"bg-primary_light text-primary":null),onClick:()=>l(t=>({...t,value:e.value,type:e.type})),children:e.type},t))})]})]}),icon:m.jsx("div",{className:"shrink-0 rounded-lg bg-[#D8CDF4] w-12 h-12 flex items-center justify-center border border-[#EDEEF1]",children:M.cloneElement(Jy.price_tag,{fill:"#9747FF"})})},{label:"Profit to be made",count:rv(u.value),desc:m.jsxs("p",{className:"flex gap-2 items-center flex-wrap",children:["Showing ",u.type," price"," ",m.jsxs(Fd,{children:[m.jsx(Ld,{asChild:!0,children:m.jsxs("button",{className:"rounded-lg h-8 flex items-center justify-between p-3 font-semibold text-xs text-gray-600 outline-none border border-gray-300 gap-2.5 capitalize bg-[#F9F9F9]",children:["change",m.jsx("span",{className:"rotate-90",children:Jy.arrow})]})}),m.jsx(zd,{align:"start",className:"flex flex-col gap-2.5 rounded-xl border-gray-200 py-2.5 w-[210px]",children:i.map((e,t)=>m.jsx($d,{className:Ko("capitalize focus:bg-primary_light rounded-md focus:text-primary font-semibold text-sm cursor-pointer px-[15px] flex items-center gap-[5px] \n \n ",e.type===u.type?"bg-primary_light text-primary":null),onClick:()=>c(t=>({...t,value:e.value,type:e.type})),children:e.type},t))})]})]}),icon:m.jsx("div",{className:"shrink-0 rounded-lg bg-[#C6E3D2] w-12 h-12 flex items-center justify-center border border-[#EDEEF1]",children:M.cloneElement(Jy.price_tag,{fill:"#378C5A"})})}],[f,p]=D.useState(!1);return m.jsxs(tS,{className:"bg-[#F6F8FA] p-2.5 flex flex-col",children:[m.jsxs("div",{className:"flex justify-between",children:[m.jsx("h1",{className:"capitalize text-dark font-semibold text-lg",children:"Items overview"}),m.jsxs("button",{className:"rounded-lg h-8 flex items-center justify-between p-3 font-semibold text-xs text-gray-600 outline-none border border-gray-300 gap-2.5 capitalize bg-white",onClick:()=>p(!f),children:[f?"Close":"Open"," ",m.jsx("span",{className:"rotate-90",children:Jy.arrow})]})]}),m.jsx(bO.Collapse,{isOpened:f,children:m.jsx("div",{className:"flex flex-wrap gap-2.5 mt-3",children:d.map((t,n)=>m.jsxs("div",{className:Ko("border rounded-xl border-[#E4E7EC] p-4 flex flex-col relative bg-right-bottom bg-no-repeat flex-auto",0===n?"bg-[#E4EEFA] bg-[url('/assets/images/ecstacy1.svg')]":1===n?"bg-[#FAEAE9] bg-[url('/assets/images/ecstacy2.svg')]":2===n?"bg-[#EEE9FA] bg-[url('/assets/images/ecstacy3.svg')]":3===n?"bg-[#EBF5EF] bg-[url('/assets/images/ecstacy4.svg')]":null),children:[m.jsxs("div",{className:"flex justify-between gap-1",children:[m.jsx("h1",{className:"text-dark text-sm font-medium",children:t.label}),m.jsx("div",{className:"shrink-0",children:t.icon})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[e?m.jsx(na,{className:"w-28 h-6 rounded"}):m.jsx("h1",{className:Ko("text-dark font-bold text-[29px] truncate",n===d.length-1&&u.value<0?"text-danger":null),title:t.count,children:t.count}),m.jsx("div",{className:"text-gray-700 text-sm font-medium ",children:t.desc})]})]},n))})})]})}function xO({placeholder:e,className:t,inputClass:n,...r}){return m.jsxs("div",{className:Ko("h-12 border border-gray-300 rounded-md w-[320px] flex",t),children:[m.jsx("span",{className:"bg-gray-200 w-9.5 flex items-center justify-center shrink-0 rounded-l-md ",children:Jy.magnifier}),m.jsx("input",{type:"search",placeholder:e,className:"w-full px-3 text-dark text-sm font-medium bg-transparent outline-none rounded-r-md",...r})]})}function SO(e,t){return e===t}function CO(e,t,n){var r=SO,o=D.useRef(e),a=D.useState({})[1],i=function(e,t,n,r){var o=this,a=D.useRef(null),i=D.useRef(0),s=D.useRef(0),l=D.useRef(null),u=D.useRef([]),c=D.useRef(),d=D.useRef(),f=D.useRef(e),p=D.useRef(!0);f.current=e;var h="undefined"!=typeof window,m=!t&&0!==t&&h;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,v="maxWait"in n,b="debounceOnServer"in n&&!!n.debounceOnServer,w=v?Math.max(+n.maxWait||0,t):null;D.useEffect(function(){return p.current=!0,function(){p.current=!1}},[]);var x=D.useMemo(function(){var e=function(e){var t=u.current,n=c.current;return u.current=c.current=null,i.current=e,s.current=s.current||e,d.current=f.current.apply(n,t)},n=function(e,t){m&&cancelAnimationFrame(l.current),l.current=m?requestAnimationFrame(e):setTimeout(e,t)},x=function(e){if(!p.current)return!1;var n=e-a.current;return!a.current||n>=t||n<0||v&&e-i.current>=w},S=function(t){return l.current=null,y&&u.current?e(t):(u.current=c.current=null,d.current)},C=function e(){var r=Date.now();if(g&&s.current===i.current&&k(),x(r))return S(r);if(p.current){var o=t-(r-a.current),l=v?Math.min(o,w-(r-i.current)):o;n(e,l)}},k=function(){r&&r({})},_=function(){if(h||b){var r=Date.now(),s=x(r);if(u.current=[].slice.call(arguments),c.current=o,a.current=r,s){if(!l.current&&p.current)return i.current=a.current,n(C,t),g?e(a.current):d.current;if(v)return n(C,t),e(a.current)}return l.current||n(C,t),d.current}};return _.cancel=function(){var e=l.current;e&&(m?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=c.current=l.current=null,e&&r&&r({})},_.isPending=function(){return!!l.current},_.flush=function(){return l.current?S(Date.now()):d.current},_},[g,v,t,w,y,m,h,b,r]);return x}(D.useCallback(function(e){o.current=e,a({})},[a]),t,n,a),s=D.useRef(e);return r(s.current,e)||(i(e),s.current=e),[o.current,i]}function kO({placeholder:e,searchPlaceholder:t,options:n=[],showMultiSelectValues:r=!0,values:o,onChange:a,className:i,showCheckMark:s=!0,label:l,labelClass:u,required:c,info:d,optional:f,actionLabel:p,actionLabelAction:h,actionLabelInfo:g,removeSelectedValue:y,removeTag:v,loading:b,showCount:w,error:x}){const[S,C]=D.useState(!1),[k,_]=D.useState(0),E=D.useRef(null);D.useEffect(()=>{const e=()=>{E.current&&_(E?.current?.offsetWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[E]);const j=e=>{const t=o?.includes(e)?o?.filter(t=>t!==e):[...o||[],e];a&&a(t)};D.useEffect(()=>{y&&j(y)},[y]);const[O,N]=D.useState(null),R=e=>{N(t=>t===e?null:e)},P=e=>{for(let t of n){if(t.value===e)return t.label;if(t.subOptions){const n=t.subOptions.find(t=>t.value===e);if(n)return n.label}}return null};return m.jsx("div",{ref:E,children:b?m.jsx(na,{className:"w-full h-[48px]"}):m.jsxs("div",{className:Ko("flex flex-col gap-2.5",i),children:[m.jsxs("div",{className:"flex justify-between gap-2 flex-wrap",children:[l&&m.jsxs("label",{className:Ko("text-black flex items-center gap-1 first-letter:uppercase text-sm font-medium",u),children:[l," ",c?m.jsx("span",{className:"text-[#E12D39]",children:l&&"*"}):f?m.jsx("span",{className:"text-[#B5B5B5] font-normal",children:"(optional)"}):null,d&&m.jsx(kv,{fieldName:l,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:d})})]}),p&&m.jsxs("button",{onClick:h,className:"text-primary flex items-center gap-1 first-letter:uppercase text-sm font-medium",children:[p,g&&m.jsx(kv,{fieldName:l,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:g})})]})]}),m.jsxs($C,{modal:!0,open:S,onOpenChange:C,children:[m.jsx(HC,{asChild:!0,children:m.jsxs(UC,{variant:"outline",role:"combobox","aria-expanded":S,className:Ko(`w-full h-[48px] justify-between border focus:border-primary border-neutral-200 bg-white hover:bg-white hover:border-[#BFD7FE] ${x&&"!border-danger"}`,r?"h-auto py-3":null,i),children:[m.jsx("div",{className:"flex gap-2 text-[#5E6278] justify-start first-letter:uppercase flex-wrap",children:o?.length&&r?o.map((e,t)=>m.jsxs("div",{onClick:()=>{v||j(e),R(e)},className:"px-2 py-1 text-black flex items-center justify-between rounded gap-2 border bg-slate-200 text-xs font-medium",children:[m.jsx("span",{className:"flex justify-start text-start flex-wrap gap-2 whitespace-normal",children:P(e)}),m.jsx("span",{className:"",children:m.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M5.44001 4.49978L7.83334 2.12644C7.96064 1.99737 8.03146 1.82301 8.03021 1.64173C8.02896 1.46044 7.95575 1.28708 7.82667 1.15978C7.6976 1.03247 7.52324 0.961657 7.34196 0.962907C7.16067 0.964157 6.98731 1.03737 6.86001 1.16644L4.50001 3.55978L2.14001 1.21311C2.0151 1.08894 1.84613 1.01925 1.67001 1.01925C1.49388 1.01925 1.32492 1.08894 1.20001 1.21311C1.13752 1.27509 1.08793 1.34882 1.05408 1.43006C1.02023 1.5113 1.00281 1.59844 1.00281 1.68644C1.00281 1.77445 1.02023 1.86159 1.05408 1.94283C1.08793 2.02407 1.13752 2.0978 1.20001 2.15978L3.56001 4.49978L1.16667 6.87311C1.03937 7.00218 0.968554 7.17654 0.969804 7.35782C0.971054 7.53911 1.04427 7.71247 1.17334 7.83978C1.30241 7.96708 1.47677 8.0379 1.65805 8.03665C1.83934 8.0354 2.0127 7.96218 2.14001 7.83311L4.50001 5.43978L6.86001 7.78644C6.98492 7.91061 7.15388 7.98031 7.33001 7.98031C7.50613 7.98031 7.6751 7.91061 7.80001 7.78644C7.86249 7.72447 7.91209 7.65073 7.94594 7.56949C7.97978 7.48826 7.99721 7.40112 7.99721 7.31311C7.99721 7.2251 7.97978 7.13797 7.94594 7.05673C7.91209 6.97549 7.86249 6.90175 7.80001 6.83978L5.44001 4.49978Z",fill:"black"})})})]},t)):!r&&w&&o.length>0?`${o.length} ${l} selected`:e??"Select..."}),m.jsx(Dd,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),m.jsx(VC,{align:"start",style:{width:k},className:"w-[480px] p-0 bg-white rounded-xl border-gray-200",children:m.jsxs(cC,{children:[m.jsx(dC,{className:"placeholder:text-xs",placeholder:t??"Search..."}),m.jsx(pC,{children:"No result found."}),m.jsx(hC,{children:m.jsx(fC,{className:"",children:n?.map((e,t)=>m.jsxs("div",{children:[m.jsxs(mC,{value:"string"==typeof e.label?e.label:e.searchId,className:`first-letter:uppercase mb-1 focus:bg-primary_light w-full rounded-md focus:text-primary hover:text-primary font-semibold text-gray-700 text-sm cursor-pointer ${o?.includes(e.value)&&"bg-primary_light text-primary"}`,onSelect:()=>{j(e.value),e?.subOptions&&e?.subOptions?.length>0&&R(e.value)},children:[s&&m.jsx(Nd,{className:Ko("mr-2 h-4 w-4",o?.includes(e.value)?"opacity-100":"opacity-0")}),m.jsxs("p",{className:"flex justify-between w-full",children:[e.label,e?.subOptions&&e?.subOptions?.length>0&&m.jsx(Rd,{className:"ml-2 h-5 w-5 font-bold shrink-0 opacity-50"})]})]}),O===e.value&&e?.subOptions&&e?.subOptions?.map((e,t)=>m.jsxs(mC,{value:"string"==typeof e.label?e.label:e.searchId,className:`first-letter:uppercase mb-1 focus:bg-primary_light w-full rounded-md focus:text-primary hover:text-primary font-semibold text-gray-700 text-sm cursor-pointer pl-6 ${o?.includes(e.value)&&"bg-primary_light text-primary"}`,onSelect:()=>{j(e.value)},children:[s&&m.jsx(Nd,{className:Ko("mr-2 h-4 w-4",o?.includes(e.value)?"opacity-100":"opacity-0")}),e.label]},t))]},t))})})]})})]}),x&&m.jsx("p",{className:"text-danger text-xs font-normal",children:x})]})})}var _O="ScrollArea",[EO]=sa(_O),[jO,OO]=EO(_O),NO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:a=600,...i}=e,[s,l]=D.useState(null),[u,c]=D.useState(null),[d,f]=D.useState(null),[p,h]=D.useState(null),[g,y]=D.useState(null),[v,b]=D.useState(0),[w,x]=D.useState(0),[S,C]=D.useState(!1),[k,_]=D.useState(!1),E=ia(t,e=>l(e)),j=Ca(o);return m.jsx(jO,{scope:n,type:r,dir:j,scrollHideDelay:a,scrollArea:s,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:h,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:k,onScrollbarYEnabledChange:_,onCornerWidthChange:b,onCornerHeightChange:x,children:m.jsx(ba.div,{dir:j,...i,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});NO.displayName=_O;var RO="ScrollAreaViewport",PO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...a}=e,i=OO(RO,n),s=ia(t,D.useRef(null),i.onViewportChange);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),m.jsx(ba.div,{"data-radix-scroll-area-viewport":"",...a,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});PO.displayName=RO;var TO="ScrollAreaScrollbar",DO=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OO(TO,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:i}=o,s="horizontal"===e.orientation;return D.useEffect(()=>(s?a(!0):i(!0),()=>{s?a(!1):i(!1)}),[s,a,i]),"hover"===o.type?m.jsx(MO,{...r,ref:t,forceMount:n}):"scroll"===o.type?m.jsx(IO,{...r,ref:t,forceMount:n}):"auto"===o.type?m.jsx(AO,{...r,ref:t,forceMount:n}):"always"===o.type?m.jsx(FO,{...r,ref:t}):null});DO.displayName=TO;var MO=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OO(TO,e.__scopeScrollArea),[a,i]=D.useState(!1);return D.useEffect(()=>{const e=o.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),i(!0)},r=()=>{t=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(cl,{present:n||a,children:m.jsx(AO,{"data-state":a?"visible":"hidden",...r,ref:t})})}),IO=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OO(TO,e.__scopeScrollArea),a="horizontal"===e.orientation,i=nN(()=>l("SCROLL_END"),100),[s,l]=function(e,t){return D.useReducer((e,n)=>t[e][n]??e,e)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return D.useEffect(()=>{if("idle"===s){const e=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,o.scrollHideDelay,l]),D.useEffect(()=>{const e=o.viewport,t=a?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(l("SCROLL"),i()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[o.viewport,a,l,i]),m.jsx(cl,{present:n||"hidden"!==s,children:m.jsx(FO,{"data-state":"hidden"===s?"hidden":"visible",...r,ref:t,onPointerEnter:ra(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ra(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),AO=D.forwardRef((e,t)=>{const n=OO(TO,e.__scopeScrollArea),{forceMount:r,...o}=e,[a,i]=D.useState(!1),s="horizontal"===e.orientation,l=nN(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;i(s?e:t)}},10);return rN(n.viewport,l),rN(n.content,l),m.jsx(cl,{present:r||a,children:m.jsx(FO,{"data-state":a?"visible":"hidden",...o,ref:t})})}),FO=D.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=OO(TO,e.__scopeScrollArea),a=D.useRef(null),i=D.useRef(0),[s,l]=D.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=QO(s.viewport,s.content),c={...r,sizes:s,onSizesChange:l,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>a.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function d(e,t){return function(e,t,n,r="ltr"){const o=XO(n),a=o/2,i=t||a,s=o-i,l=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-s,c=n.content-n.viewport,d="ltr"===r?[0,c]:[-1*c,0];return JO([l,u],d)(e)}(e,i.current,s,t)}return"horizontal"===n?m.jsx(LO,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const e=ZO(o.viewport.scrollLeft,s,o.dir);a.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollLeft=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollLeft=d(e,o.dir))}}):"vertical"===n?m.jsx(zO,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const e=ZO(o.viewport.scrollTop,s);a.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollTop=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollTop=d(e))}}):null}),LO=D.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=OO(TO,e.__scopeScrollArea),[i,s]=D.useState(),l=D.useRef(null),u=ia(t,l,a.onScrollbarXChange);return D.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),m.jsx(VO,{"data-orientation":"horizontal",...o,ref:u,sizes:n,style:{bottom:0,left:"rtl"===a.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===a.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":XO(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){const r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),eN(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:KO(i.paddingLeft),paddingEnd:KO(i.paddingRight)}})}})}),zO=D.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=OO(TO,e.__scopeScrollArea),[i,s]=D.useState(),l=D.useRef(null),u=ia(t,l,a.onScrollbarYChange);return D.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),m.jsx(VO,{"data-orientation":"vertical",...o,ref:u,sizes:n,style:{top:0,right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":XO(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){const r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),eN(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:KO(i.paddingTop),paddingEnd:KO(i.paddingBottom)}})}})}),[$O,HO]=EO(TO),VO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:a,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:c,onResize:d,...f}=e,p=OO(TO,n),[h,g]=D.useState(null),y=ia(t,e=>g(e)),v=D.useRef(null),b=D.useRef(""),w=p.viewport,x=r.content-r.viewport,S=ka(c),C=ka(l),k=nN(d,10);function _(e){if(v.current){const t=e.clientX-v.current.left,n=e.clientY-v.current.top;u({x:t,y:n})}}return D.useEffect(()=>{const e=e=>{const t=e.target,n=h?.contains(t);n&&S(e,x)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,h,x,S]),D.useEffect(C,[r,C]),rN(h,k),rN(p.content,k),m.jsx($O,{scope:n,scrollbar:h,hasThumb:o,onThumbChange:ka(a),onThumbPointerUp:ka(i),onThumbPositionChange:C,onThumbPointerDown:ka(s),children:m.jsx(ba.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:ra(e.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),v.current=h.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),_(e)}}),onPointerMove:ra(e.onPointerMove,_),onPointerUp:ra(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),BO="ScrollAreaThumb",UO=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=HO(BO,e.__scopeScrollArea);return m.jsx(cl,{present:n||o.hasThumb,children:m.jsx(WO,{ref:t,...r})})}),WO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,a=OO(BO,n),i=HO(BO,n),{onThumbPositionChange:s}=i,l=ia(t,e=>i.onThumbChange(e)),u=D.useRef(void 0),c=nN(()=>{u.current&&(u.current(),u.current=void 0)},100);return D.useEffect(()=>{const e=a.viewport;if(e){const t=()=>{if(c(),!u.current){const t=tN(e,s);u.current=t,s()}};return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[a.viewport,c,s]),m.jsx(ba.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ra(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;i.onThumbPointerDown({x:n,y:r})}),onPointerUp:ra(e.onPointerUp,i.onThumbPointerUp)})});UO.displayName=BO;var qO="ScrollAreaCorner",YO=D.forwardRef((e,t)=>{const n=OO(qO,e.__scopeScrollArea),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?m.jsx(GO,{...e,ref:t}):null});YO.displayName=qO;var GO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=OO(qO,n),[a,i]=D.useState(0),[s,l]=D.useState(0),u=Boolean(a&&s);return rN(o.scrollbarX,()=>{const e=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(e),l(e)}),rN(o.scrollbarY,()=>{const e=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(e),i(e)}),u?m.jsx(ba.div,{...r,ref:t,style:{width:a,height:s,position:"absolute",right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:0,...e.style}}):null});function KO(e){return e?parseInt(e,10):0}function QO(e,t){const n=e/t;return isNaN(n)?0:n}function XO(e){const t=QO(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ZO(e,t,n="ltr"){const r=XO(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-r,l=FE(e,"ltr"===n?[0,i]:[-1*i,0]);return JO([0,i],[0,s])(l)}function JO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function eN(e,t){return e>0&&e<t}var tN=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=n.left!==a.left,s=n.top!==a.top;(i||s)&&t(),n=a,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function nN(e,t){const n=ka(e),r=D.useRef(0);return D.useEffect(()=>()=>window.clearTimeout(r.current),[]),D.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function rN(e,t){const n=ka(t);ua(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var oN=NO,aN=PO,iN=YO;const sN=D.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(oN,{ref:r,className:Ko("relative overflow-hidden",e),...n,children:[m.jsx(aN,{className:"h-full w-full rounded-[inherit]",children:t}),m.jsx(lN,{}),m.jsx(iN,{})]}));sN.displayName=oN.displayName;const lN=D.forwardRef(({className:e,orientation:t="vertical",...n},r)=>m.jsx(DO,{ref:r,orientation:t,className:Ko("flex touch-none select-none transition-colors","vertical"===t&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:m.jsx(UO,{className:"relative flex-1 rounded-full bg-neutral-200 dark:bg-neutral-800"})}));function uN({placeholder:e,searchPlaceholder:t,options:n=[],showMultiSelectValues:r=!0,values:o,onChange:a,className:i,showCheckMark:s=!0,label:l,labelClass:u,required:c,info:d,optional:f,actionLabel:p,actionLabelAction:h,actionLabelInfo:g,removeSelectedValue:y,removeTag:v,loading:b,showCount:w,error:x,showError:S,onChangeSearch:C,searching:k,contentStyle:_,disabled:E,searchValue:j}){const[O,N]=D.useState(!1),[R,P]=D.useState(0),T=D.useRef(null);D.useEffect(()=>{const e=()=>{T.current&&P(T?.current?.offsetWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const M=o?.filter(e=>""!==e),I=e=>{const t=M?.includes(e)?M?.filter(t=>t!==e):[...M||[],e];a&&a(t)};return D.useEffect(()=>{y&&I(y)},[y]),m.jsx(m.Fragment,{children:b?m.jsx(na,{className:"w-full h-[48px]"}):m.jsxs("div",{className:Ko("flex flex-col gap-2.5",i),children:[m.jsxs("div",{className:"flex justify-between gap-2 flex-wrap",children:[l&&m.jsxs("label",{className:Ko("text-black flex items-center gap-1 first-letter:uppercase text-sm font-medium",u),children:[l," ",c?m.jsx("span",{className:"text-[#E12D39]",children:l&&"*"}):f?m.jsx("span",{className:"text-[#B5B5B5] font-normal",children:"(optional)"}):null,d&&m.jsx(kv,{fieldName:l,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:d})})]}),p&&m.jsxs("button",{onClick:h,className:"text-primary flex items-center gap-1 first-letter:uppercase text-sm font-medium",children:[p,g&&m.jsx(kv,{fieldName:p,children:m.jsx("p",{className:"font-normal first-letter:uppercase text-left",children:g})})]})]}),m.jsxs($C,{modal:!0,open:O,onOpenChange:N,children:[m.jsx(HC,{disabled:E,asChild:!0,children:m.jsxs(UC,{ref:T,variant:"outline",role:"combobox","aria-expanded":O,className:Ko(`w-full h-[48px] justify-between border focus:border-primary border-neutral-200 bg-white hover:bg-white hover:border-[#BFD7FE] ${(x||S)&&"!border-danger"}`,r?"h-auto py-3":null,i),children:[m.jsx("div",{className:"flex gap-2 text-[#5E6278] justify-start first-letter:uppercase flex-wrap",children:M?.length>0&&r?M?.map((e,t)=>m.jsxs("div",{onClick:()=>{!v&&I(e)},className:"px-2 py-1 text-black flex items-center justify-between rounded gap-2 border bg-slate-200 text-xs font-medium",children:[n?.[0].searchId?n?.find(t=>t.value===e)?.searchId:n?.find(t=>t.value===e)?.label,m.jsx("span",{className:"",children:m.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M5.44001 4.49978L7.83334 2.12644C7.96064 1.99737 8.03146 1.82301 8.03021 1.64173C8.02896 1.46044 7.95575 1.28708 7.82667 1.15978C7.6976 1.03247 7.52324 0.961657 7.34196 0.962907C7.16067 0.964157 6.98731 1.03737 6.86001 1.16644L4.50001 3.55978L2.14001 1.21311C2.0151 1.08894 1.84613 1.01925 1.67001 1.01925C1.49388 1.01925 1.32492 1.08894 1.20001 1.21311C1.13752 1.27509 1.08793 1.34882 1.05408 1.43006C1.02023 1.5113 1.00281 1.59844 1.00281 1.68644C1.00281 1.77445 1.02023 1.86159 1.05408 1.94283C1.08793 2.02407 1.13752 2.0978 1.20001 2.15978L3.56001 4.49978L1.16667 6.87311C1.03937 7.00218 0.968554 7.17654 0.969804 7.35782C0.971054 7.53911 1.04427 7.71247 1.17334 7.83978C1.30241 7.96708 1.47677 8.0379 1.65805 8.03665C1.83934 8.0354 2.0127 7.96218 2.14001 7.83311L4.50001 5.43978L6.86001 7.78644C6.98492 7.91061 7.15388 7.98031 7.33001 7.98031C7.50613 7.98031 7.6751 7.91061 7.80001 7.78644C7.86249 7.72447 7.91209 7.65073 7.94594 7.56949C7.97978 7.48826 7.99721 7.40112 7.99721 7.31311C7.99721 7.2251 7.97978 7.13797 7.94594 7.05673C7.91209 6.97549 7.86249 6.90175 7.80001 6.83978L5.44001 4.49978Z",fill:"black"})})})]},t)):!r&&w&&o.length>0?`${M.length} ${l} selected`:e??"Select..."}),m.jsx(Dd,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),m.jsx(VC,{align:"start",style:{width:R},className:Ko("w-[480px] p-0 bg-white rounded-xl border-gray-200",_),children:m.jsx(sN,{children:m.jsxs(cC,{children:[m.jsx(dC,{onChangeCapture:C,className:"placeholder:text-xs",placeholder:t??"Search..."}),k?m.jsx("div",{className:"flex flex-col gap-2 p-2",children:[1,2,3].map((e,t)=>m.jsx(na,{className:"h-9 rounded-md"},t))}):m.jsx(pC,{children:j?"No result found.":e}),m.jsx(hC,{children:m.jsx(fC,{className:"",children:n?.map(e=>m.jsxs(mC,{value:"string"==typeof e.label?e.label:e.searchId,className:`first-letter:uppercase mb-1 focus:bg-primary_light w-full rounded-md focus:text-primary hover:text-primary font-semibold text-gray-700 text-sm cursor-pointer ${o?.includes(e.value)&&"bg-primary_light text-primary"}`,onSelect:()=>{I(e.value)},children:[s&&m.jsx(Nd,{className:Ko("mr-2 h-4 w-4",o?.includes(e.value)?"opacity-100":"opacity-0")}),e.label]},e.value))})})]})})})]})]})})}lN.displayName=DO.displayName;const cN=D.createContext({dragDropManager:void 0});function dN(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var fN="function"==typeof Symbol&&Symbol.observable||"@@observable",pN=function(){return Math.random().toString(36).substring(7).split("").join(".")},hN={INIT:"@@redux/INIT"+pN(),REPLACE:"@@redux/REPLACE"+pN()};function mN(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(dN(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(dN(1));return n(mN)(e,t)}if("function"!=typeof e)throw new Error(dN(2));var o=e,a=t,i=[],s=i,l=!1;function u(){s===i&&(s=i.slice())}function c(){if(l)throw new Error(dN(3));return a}function d(e){if("function"!=typeof e)throw new Error(dN(4));if(l)throw new Error(dN(5));var t=!0;return u(),s.push(e),function(){if(t){if(l)throw new Error(dN(6));t=!1,u();var n=s.indexOf(e);s.splice(n,1),i=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(dN(7));if(void 0===e.type)throw new Error(dN(8));if(l)throw new Error(dN(9));try{l=!0,a=o(a,e)}finally{l=!1}for(var t=i=s,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:hN.INIT}),(r={dispatch:f,subscribe:d,getState:c,replaceReducer:function(e){if("function"!=typeof e)throw new Error(dN(10));o=e,f({type:hN.REPLACE})}})[fN]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(dN(11));function n(){e.next&&e.next(c())}return n(),{unsubscribe:t(n)}}})[fN]=function(){return this},e},r}function gN(e,t,...n){if("undefined"!=typeof process&&"production"===process.env.NODE_ENV&&void 0===t)throw new Error("invariant requires an error message argument");if(!e){let e;if(void 0===t)e=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let r=0;e=new Error(t.replace(/%s/g,function(){return n[r++]})),e.name="Invariant Violation"}throw e.framesToPop=1,e}}function yN(e){return"object"==typeof e}const vN="dnd-core/INIT_COORDS",bN="dnd-core/BEGIN_DRAG",wN="dnd-core/PUBLISH_DRAG_SOURCE",xN="dnd-core/HOVER",SN="dnd-core/DROP",CN="dnd-core/END_DRAG";function kN(e,t){return{type:vN,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const _N={type:vN,payload:{clientOffset:null,sourceClientOffset:null}};function EN(e){return function(t=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:o,getSourceClientOffset:a}=n,i=e.getMonitor(),s=e.getRegistry();e.dispatch(kN(o)),function(e,t,n){gN(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(e){gN(n.getSource(e),"Expected sourceIds to be registered.")})}(t,i,s);const l=function(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,i);if(null==l)return void e.dispatch(_N);let u=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){gN("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),u=a(l)}e.dispatch(kN(o,u));const c=s.getSource(l).beginDrag(i,l);if(null==c)return;!function(e){gN(yN(e),"Item must be an object.")}(c),s.pinSource(l);const d=s.getSourceType(l);return{type:bN,payload:{itemType:d,item:c,sourceId:l,clientOffset:o||null,sourceClientOffset:u||null,isSourcePublic:!!r}}}}function jN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ON(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){jN(e,t,n[t])})}return e}function NN(e){return function(t={}){const n=e.getMonitor(),r=e.getRegistry();!function(e){gN(e.isDragging(),"Cannot call drop while not dragging."),gN(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);const o=function(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);o.forEach((o,a)=>{const i=function(e,t,n,r){const o=n.getTarget(e);let a=o?o.drop(r,e):void 0;(function(e){gN(void 0===e||yN(e),"Drop result must either be an object or undefined.")})(a),void 0===a&&(a=0===t?{}:r.getDropResult());return a}(o,a,r,n),s={type:SN,payload:{dropResult:ON({},t,i)}};e.dispatch(s)})}}function RN(e){return function(){const t=e.getMonitor(),n=e.getRegistry();!function(e){gN(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const r=t.getSourceId();if(null!=r){n.getSource(r,!0).endDrag(t,r),n.unpinSource()}return{type:CN}}}function PN(e,t){return null===t?null===e:Array.isArray(e)?e.some(e=>e===t):e===t}function TN(e){return function(t,{clientOffset:n}={}){!function(e){gN(Array.isArray(e),"Expected targetIds to be an array.")}(t);const r=t.slice(0),o=e.getMonitor(),a=e.getRegistry();return function(e,t,n){for(let r=e.length-1;r>=0;r--){const o=e[r];PN(t.getTargetType(o),n)||e.splice(r,1)}}(r,a,o.getItemType()),function(e,t,n){gN(t.isDragging(),"Cannot call hover while not dragging."),gN(!t.didDrop(),"Cannot call hover after drop.");for(let t=0;t<e.length;t++){const r=e[t];gN(e.lastIndexOf(r)===t,"Expected targetIds to be unique in the passed array.");gN(n.getTarget(r),"Expected targetIds to be registered.")}}(r,o,a),function(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}(r,o,a),{type:xN,payload:{targetIds:r,clientOffset:n||null}}}}function DN(e){return function(){if(e.getMonitor().isDragging())return{type:wN}}}class MN{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:t}=this.store;const n=function(e){return{beginDrag:EN(e),publishDragSource:DN(e),hover:TN(e),drop:NN(e),endDrag:RN(e)}}(this);return Object.keys(n).reduce((r,o)=>{const a=n[o];var i;return r[o]=(i=a,(...n)=>{const r=i.apply(e,n);void 0!==r&&t(r)}),r},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function IN(e,t){return{x:e.x-t.x,y:e.y-t.y}}const AN=[],FN=[];AN.__IS_NONE__=!0,FN.__IS_ALL__=!0;class LN{subscribeToStateChange(e,t={}){const{handlerIds:n}=t;gN("function"==typeof e,"listener must be a function."),gN(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let r=this.store.getState().stateId;return this.store.subscribe(()=>{const t=this.store.getState(),o=t.stateId;try{const a=o===r||o===r+1&&!function(e,t){return e!==AN&&(e===FN||void 0===t||(n=e,t.filter(e=>n.indexOf(e)>-1)).length>0);var n}(t.dirtyHandlerIds,n);a||e()}finally{r=o}})}subscribeToOffsetChange(e){gN("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{const n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return gN(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);if(gN(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;return PN(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);if(gN(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;return this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:n}=t;if(!this.isDragging())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();if(o&&!PN(r,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const i=a.indexOf(e);return n?i===a.length-1:i>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return t&&n&&r?IN(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,r),n):null}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:n}=e;return t&&n?IN(t,n):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}const zN="undefined"!=typeof global?global:self,$N=zN.MutationObserver||zN.WebKitMutationObserver;function HN(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const VN="function"==typeof $N?function(e){let t=1;const n=new $N(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:HN;class BN{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const UN=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=VN(this.flush),this.requestErrorThrow=HN(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},WN=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new BN(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(UN.registerPendingError);const qN="dnd-core/ADD_SOURCE",YN="dnd-core/ADD_TARGET",GN="dnd-core/REMOVE_SOURCE",KN="dnd-core/REMOVE_TARGET";function QN(e,t){t&&Array.isArray(e)?e.forEach(e=>QN(e,!1)):gN("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var XN;!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(XN||(XN={}));let ZN=0;function JN(e){const t=(ZN++).toString();switch(e){case XN.SOURCE:return`S${t}`;case XN.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function eR(e){switch(e[0]){case"S":return XN.SOURCE;case"T":return XN.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function tR(e,t){const n=e.entries();let r=!1;do{const{done:e,value:[,o]}=n.next();if(o===t)return!0;r=!!e}while(!r);return!1}class nR{addSource(e,t){QN(e),function(e){gN("function"==typeof e.canDrag,"Expected canDrag to be a function."),gN("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),gN("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const n=this.addHandler(XN.SOURCE,e,t);return this.store.dispatch(function(e){return{type:qN,payload:{sourceId:e}}}(n)),n}addTarget(e,t){QN(e,!0),function(e){gN("function"==typeof e.canDrop,"Expected canDrop to be a function."),gN("function"==typeof e.hover,"Expected hover to be a function."),gN("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const n=this.addHandler(XN.TARGET,e,t);return this.store.dispatch(function(e){return{type:YN,payload:{targetId:e}}}(n)),n}containsHandler(e){return tR(this.dragSources,e)||tR(this.dropTargets,e)}getSource(e,t=!1){gN(this.isSourceId(e),"Expected a valid source ID.");return t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return gN(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return gN(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return gN(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return eR(e)===XN.SOURCE}isTargetId(e){return eR(e)===XN.TARGET}removeSource(e){var t;gN(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:GN,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},UN.enqueueTask(WN.create(t))}removeTarget(e){gN(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:KN,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);gN(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){gN(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){const r=JN(e);return this.types.set(r,t),e===XN.SOURCE?this.dragSources.set(r,n):e===XN.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const rR=(e,t)=>e===t;function oR(e=AN,t){switch(t.type){case xN:break;case qN:case YN:case KN:case GN:return AN;default:return FN}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,o=function(e,t){const n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);const o=[];return n.forEach((e,t)=>{1===e&&o.push(t)}),o}(n,r),a=o.length>0||!function(e,t,n=rR){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(n,r);if(!a)return AN;const i=r[r.length-1],s=n[n.length-1];return i!==s&&(i&&o.push(i),s&&o.push(s)),o}function aR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const iR={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function sR(e=iR,t){const{payload:n}=t;switch(t.type){case vN:case bN:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case xN:return r=e.clientOffset,o=n.clientOffset,!r&&!o||r&&o&&r.x===o.x&&r.y===o.y?e:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){aR(e,t,n[t])})}return e}({},e,{clientOffset:n.clientOffset});case CN:case SN:return iR;default:return e}var r,o}function lR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){lR(e,t,n[t])})}return e}const cR={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function dR(e=cR,t){const{payload:n}=t;switch(t.type){case bN:return uR({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case wN:return uR({},e,{isSourcePublic:!0});case xN:return uR({},e,{targetIds:n.targetIds});case KN:return-1===e.targetIds.indexOf(n.targetId)?e:uR({},e,{targetIds:(r=e.targetIds,o=n.targetId,r.filter(e=>e!==o))});case SN:return uR({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case CN:return uR({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var r,o}function fR(e=0,t){switch(t.type){case qN:case YN:return e+1;case GN:case KN:return e-1;default:return e}}function pR(e=0){return e+1}function hR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){hR(e,t,n[t])})}return e}function gR(e={},t){return{dirtyHandlerIds:oR(e.dirtyHandlerIds,{type:t.type,payload:mR({},t.payload,{prevTargetIds:(n=e,r="dragOperation.targetIds",o=[],r.split(".").reduce((e,t)=>e&&e[t]?e[t]:o||null,n))})}),dragOffset:sR(e.dragOffset,t),refCount:fR(e.refCount,t),dragOperation:dR(e.dragOperation,t),stateId:pR(e.stateId)};var n,r,o}function yR(e,t=void 0,n={},r=!1){const o=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return mN(gR,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(r),a=new LN(o,new nR(o)),i=new MN(o,a),s=e(i,t,n);return i.receiveBackend(s),i}function vR(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}let bR=0;const wR=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var xR,SR,CR=D.memo(function(e){var{children:t}=e,n=vR(e,["children"]);const[r,o]=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}const t=function(e,t=kR(),n,r){const o=t;o[wR]||(o[wR]={dragDropManager:yR(e,t,n,r)});return o[wR]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(n);return D.useEffect(()=>{if(o){const e=kR();return++bR,()=>{0===--bR&&(e[wR]=null)}}},[]),m.jsx(cN.Provider,{value:r,children:t})});function kR(){return"undefined"!=typeof global?global:window}var _R=(SR||(SR=1,xR=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,a;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,a[o]))return!1;for(o=r;0!==o--;){var i=a[o];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}),xR),ER=n(_R);const jR="undefined"!=typeof window?D.useLayoutEffect:D.useEffect;function OR(e,t,n){const[r,o]=function(e,t,n){const[r,o]=D.useState(()=>t(e)),a=D.useCallback(()=>{const a=t(e);ER(r,a)||(o(a),n&&n())},[r,e,n]);return jR(a),[r,a]}(e,t,n);return jR(function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(o,{handlerIds:[t]})},[e,o]),r}function NR(e,t,n){return OR(t,e||(()=>({})),()=>n.reconnect())}function RR(e,t){const n=[...t||[]];return null==t&&"function"!=typeof e&&n.push(e),D.useMemo(()=>"function"==typeof e?e():e,n)}function PR(e){return D.useMemo(()=>e.hooks.dragSource(),[e])}function TR(e){return D.useMemo(()=>e.hooks.dragPreview(),[e])}let DR=!1,MR=!1;class IR{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){gN(!DR,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return DR=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{DR=!1}}isDragging(){if(!this.sourceId)return!1;gN(!MR,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return MR=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{MR=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let AR=!1;class FR{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;gN(!AR,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return AR=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{AR=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function LR(e,t,n,r){let o;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let n=0;n<a.length;n++){const r=a[n];if(!s(r))return!1;const i=e[r],l=t[r];if(o=void 0,!1===o||void 0===o&&i!==l)return!1}return!0}function zR(e){return null!==e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function $R(e){return(t=null,n=null)=>{if(!D.isValidElement(t)){const r=t;return e(r,n),r}const r=t;!function(e){if("string"==typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}(r);const o=n?t=>e(t,n):e;return function(e,t){const n=e.ref;return gN("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?D.cloneElement(e,{ref:e=>{VR(n,e),VR(t,e)}}):D.cloneElement(e,{ref:t})}(r,o)}}function HR(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const e=$R(r);t[n]=()=>e}}),t}function VR(e,t){"function"==typeof e?e(t):e.current=t}class BR{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(t?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!LR(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!LR(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=HR({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,zR(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,zR(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class UR{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!LR(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=HR({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,zR(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function WR(){const{dragDropManager:e}=D.useContext(cN);return gN(null!=e,"Expected drag drop context"),e}class qR{beginDrag(){const e=this.spec,t=this.monitor;let n=null;return n="object"==typeof e.item?e.item:"function"==typeof e.item?e.item(t):{},null!=n?n:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const n=this.spec,r=this.monitor,{isDragging:o}=n;return o?o(r):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}}function YR(e,t,n){const r=WR(),o=function(e,t,n){const r=D.useMemo(()=>new qR(e,t,n),[t,n]);return D.useEffect(()=>{r.spec=e},[e]),r}(e,t,n),a=function(e){return D.useMemo(()=>{const t=e.type;return gN(null!=t,"spec.type must be defined"),t},[e])}(e);jR(function(){if(null!=a){const[e,i]=function(e,t,n){const r=n.getRegistry(),o=r.addSource(e,t);return[o,()=>r.removeSource(o)]}(a,o,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),i}},[r,t,n,o,a])}function GR(e,t){const n=RR(e,t);gN(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=function(){const e=WR();return D.useMemo(()=>new IR(e),[e])}(),o=function(e,t){const n=WR(),r=D.useMemo(()=>new BR(n.getBackend()),[n]);return jR(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),jR(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}(n.options,n.previewOptions);return YR(n,r,o),[NR(n.collect,r,o),PR(o),TR(o)]}function KR(e){return D.useMemo(()=>e.hooks.dropTarget(),[e])}class QR{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function XR(e,t,n){const r=WR(),o=function(e,t){const n=D.useMemo(()=>new QR(e,t),[t]);return D.useEffect(()=>{n.spec=e},[e]),n}(e,t),a=function(e){const{accept:t}=e;return D.useMemo(()=>(gN(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}(e);jR(function(){const[e,i]=function(e,t,n){const r=n.getRegistry(),o=r.addTarget(e,t);return[o,()=>r.removeTarget(o)]}(a,o,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),i},[r,t,o,n,a.map(e=>e.toString()).join("|")])}function ZR(e,t){const n=RR(e,t),r=function(){const e=WR();return D.useMemo(()=>new FR(e),[e])}(),o=function(e){const t=WR(),n=D.useMemo(()=>new UR(t.getBackend()),[t]);return jR(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}(n.options);return XR(n,r,o),[NR(n.collect,r,o),KR(o)]}function JR(e){let t=null;return()=>(null==t&&(t=e()),t)}class eP{enter(e){const t=this.entered.length;return this.entered=function(e,t){const n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);const o=[];return n.forEach(e=>o.push(e)),o}(this.entered.filter(t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var n,r;return this.entered=(n=this.entered.filter(this.isNodeInDocument),r=e,n.filter(e=>e!==r)),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class tP{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get:()=>(console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null)})})}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach(n=>{const r=this.config.exposeProperties[n];null!=r&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const nP="__NATIVE_FILE__",rP="__NATIVE_URL__",oP="__NATIVE_TEXT__",aP="__NATIVE_HTML__";var iP=Object.freeze({__proto__:null,FILE:nP,HTML:aP,TEXT:oP,URL:rP});function sP(e,t,n){const r=t.reduce((t,n)=>t||e.getData(n),"");return null!=r?r:n}const lP={[nP]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[aP]:{exposeProperties:{html:(e,t)=>sP(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[rP]:{exposeProperties:{urls:(e,t)=>sP(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[oP]:{exposeProperties:{text:(e,t)=>sP(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function uP(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(lP).filter(e=>{const n=lP[e];return!!(null==n?void 0:n.matchesTypes)&&n.matchesTypes.some(e=>t.indexOf(e)>-1)})[0]||null}const cP=JR(()=>/firefox/i.test(navigator.userAgent)),dP=JR(()=>Boolean(window.safari));class fP{interpolate(e){const{xs:t,ys:n,c1s:r,c2s:o,c3s:a}=this;let i=t.length-1;if(e===t[i])return n[i];let s,l=0,u=a.length-1;for(;l<=u;){s=Math.floor(.5*(l+u));const r=t[s];if(r<e)l=s+1;else{if(!(r>e))return n[s];u=s-1}}i=Math.max(0,u);const c=e-t[i],d=c*c;return n[i]+r[i]*c+o[i]*d+a[i]*c*d}constructor(e,t){const{length:n}=e,r=[];for(let e=0;e<n;e++)r.push(e);r.sort((t,n)=>e[t]<e[n]?-1:1);const o=[],a=[];let i,s;for(let r=0;r<n-1;r++)i=e[r+1]-e[r],s=t[r+1]-t[r],o.push(i),a.push(s/i);const l=[a[0]];for(let e=0;e<o.length-1;e++){const t=a[e],n=a[e+1];if(t*n<=0)l.push(0);else{i=o[e];const r=o[e+1],a=i+r;l.push(3*a/((a+r)/t+(a+i)/n))}}l.push(a[a.length-1]);const u=[],c=[];let d;for(let e=0;e<l.length-1;e++){d=a[e];const t=l[e],n=1/o[e],r=t+l[e+1]-d-d;u.push((d-t-r)*n),c.push(r*n*n)}this.xs=e,this.ys=t,this.c1s=l,this.c2s=u,this.c3s=c}}function pP(e){const t=1===e.nodeType?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function hP(e){return{x:e.clientX,y:e.clientY}}function mP(e,t,n,r,o){const a=function(e){var t;return"IMG"===e.nodeName&&(cP()||!(null===(t=document.documentElement)||void 0===t?void 0:t.contains(e)))}(t),i=pP(a?e:t),s={x:n.x-i.x,y:n.y-i.y},{offsetWidth:l,offsetHeight:u}=e,{anchorX:c,anchorY:d}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=function(e,t,n,r){let o=e?t.width:n,a=e?t.height:r;return dP()&&e&&(a/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:a}}(a,t,l,u),{offsetX:h,offsetY:m}=o,g=0===m||m;return{x:0===h||h?h:new fP([0,.5,1],[s.x,s.x/l*f,s.x+f-l]).interpolate(c),y:g?m:(()=>{let e=new fP([0,.5,1],[s.y,s.y/u*p,s.y+p-u]).interpolate(d);return dP()&&a&&(e+=(window.devicePixelRatio-1)*p),e})()}}class gP{get window(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}get document(){var e;return(null===(e=this.globalContext)||void 0===e?void 0:e.document)?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}}function yP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){yP(e,t,n[t])})}return e}class bP{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;var t;void 0!==e&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(t=this.window)||void 0===t||t.cancelAnimationFrame(this.asyncEndDragFrameId)))}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);const r=t=>this.handleDragStart(t,e),o=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",r),t.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",r),t.removeEventListener("selectstart",o),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),o=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",n),t.addEventListener("dragover",r),t.addEventListener("drop",o),()=>{t.removeEventListener("dragenter",n),t.removeEventListener("dragover",r),t.removeEventListener("drop",o)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return vP({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return vP({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(iP).some(t=>iP[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const n=lP[e];if(!n)throw new Error(`native type ${e} has no configuration`);const r=new tP(n);return r.loadDataTransfer(t),r}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;this.mouseMoveTimeoutTimer=setTimeout(()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){var e;if(this.currentDragSourceNode=null,this.rootElement)null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0);return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&pP(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{null===this.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{null!==this.hoverRafId&&"undefined"!=typeof cancelAnimationFrame&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const n=hP(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});const{dataTransfer:r}=e,o=uP(r);if(this.monitor.isDragging()){if(r&&"function"==typeof r.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),o=this.sourcePreviewNodes.get(e)||t;if(o){const{anchorX:e,anchorY:a,offsetX:i,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),l=mP(t,o,n,{anchorX:e,anchorY:a},{offsetX:i,offsetY:s});r.setDragImage(o,l.x,l.y)}}try{null==r||r.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(o)this.beginDragNativeItem(o);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{var t;(this.dragEnterTargetIds=[],this.isDraggingNativeItem())&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer));if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:n}=e,r=uP(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:hP(e)});t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=e=>{var t;(this.dragOverTargetIds=[],this.isDraggingNativeItem())&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=hP(e),this.scheduleHover(t);(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault();this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{var t;(this.dropTargetIds=[],this.isDraggingNativeItem())?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):uP(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:hP(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{const t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new gP(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new eP(this.isNodeInDocument)}}const wP=function(e,t,n){return new bP(e,t,n)};var xP,SP,CP=Object.create,kP=Object.defineProperty,_P=Object.getOwnPropertyDescriptor,EP=Object.getOwnPropertyNames,jP=Object.getPrototypeOf,OP=Object.prototype.hasOwnProperty,NP=(e,t,n)=>(n=null!=e?CP(jP(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of EP(t))OP.call(e,o)||o===n||kP(e,o,{get:()=>t[o],enumerable:!(r=_P(t,o))||r.enumerable});return e})(kP(n,"default",{value:e,enumerable:!0}),e)),RP=(xP={"node_modules/classnames/index.js"(e,t){!function(){var e={}.hasOwnProperty;function n(){for(var t=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var a=typeof o;if("string"===a||"number"===a)t.push(o);else if(Array.isArray(o)){if(o.length){var i=n.apply(null,o);i&&t.push(i)}}else if("object"===a){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){t.push(o.toString());continue}for(var s in o)e.call(o,s)&&o[s]&&t.push(s)}}}return t.join(" ")}void 0!==t&&t.exports?(n.default=n,t.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()}},function(){return SP||(0,xP[EP(xP)[0]])((SP={exports:{}}).exports,SP),SP.exports}),PP=NP(RP()),TP="object"==typeof global&&global&&global.Object===Object&&global,DP="object"==typeof self&&self&&self.Object===Object&&self,MP=TP||DP||Function("return this")(),IP=MP.Symbol,AP=Object.prototype,FP=AP.hasOwnProperty,LP=AP.toString,zP=IP?IP.toStringTag:void 0;var $P=function(e){var t=FP.call(e,zP),n=e[zP];try{e[zP]=void 0;var r=!0}catch(e){}var o=LP.call(e);return r&&(t?e[zP]=n:delete e[zP]),o},HP=Object.prototype.toString;var VP=function(e){return HP.call(e)},BP=IP?IP.toStringTag:void 0;var UP=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":BP&&BP in Object(e)?$P(e):VP(e)};var WP=function(e){return null!=e&&"object"==typeof e};var qP=function(e){return"symbol"==typeof e||WP(e)&&"[object Symbol]"==UP(e)};var YP=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},GP=Array.isArray,KP=IP?IP.prototype:void 0,QP=KP?KP.toString:void 0;var XP=function e(t){if("string"==typeof t)return t;if(GP(t))return YP(t,e)+"";if(qP(t))return QP?QP.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var ZP=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var JP,eT=function(e){if(!ZP(e))return!1;var t=UP(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},tT=MP["__core-js_shared__"],nT=(JP=/[^.]+$/.exec(tT&&tT.keys&&tT.keys.IE_PROTO||""))?"Symbol(src)_1."+JP:"";var rT=function(e){return!!nT&&nT in e},oT=Function.prototype.toString;var aT=function(e){if(null!=e){try{return oT.call(e)}catch(e){}try{return e+""}catch(e){}}return""},iT=/^\[object .+?Constructor\]$/,sT=Function.prototype,lT=Object.prototype,uT=sT.toString,cT=lT.hasOwnProperty,dT=RegExp("^"+uT.call(cT).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var fT=function(e){return!(!ZP(e)||rT(e))&&(eT(e)?dT:iT).test(aT(e))};var pT=function(e,t){return null==e?void 0:e[t]};var hT=function(e,t){var n=pT(e,t);return fT(n)?n:void 0},mT=hT(MP,"WeakMap");var gT=function(){};var yT=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1};var vT=function(e){return e!=e};var bT=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1};var wT=function(e,t,n){return t==t?bT(e,t,n):yT(e,vT,n)};var xT=function(e,t){return!!(null==e?0:e.length)&&wT(e,t,0)>-1},ST=/^(?:0|[1-9]\d*)$/;var CT=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ST.test(e))&&e>-1&&e%1==0&&e<t};var kT=function(e,t){return e===t||e!=e&&t!=t};var _T=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ET=function(e){return null!=e&&_T(e.length)&&!eT(e)},jT=Object.prototype;var OT=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||jT)};var NT=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var RT=function(e){return WP(e)&&"[object Arguments]"==UP(e)},PT=Object.prototype,TT=PT.hasOwnProperty,DT=PT.propertyIsEnumerable,MT=RT(function(){return arguments}())?RT:function(e){return WP(e)&&TT.call(e,"callee")&&!DT.call(e,"callee")},IT=MT;var AT=function(){return!1},FT="object"==typeof e&&e&&!e.nodeType&&e,LT=FT&&"object"==typeof module&&module&&!module.nodeType&&module,zT=LT&&LT.exports===FT?MP.Buffer:void 0,$T=(zT?zT.isBuffer:void 0)||AT,HT={};HT["[object Float32Array]"]=HT["[object Float64Array]"]=HT["[object Int8Array]"]=HT["[object Int16Array]"]=HT["[object Int32Array]"]=HT["[object Uint8Array]"]=HT["[object Uint8ClampedArray]"]=HT["[object Uint16Array]"]=HT["[object Uint32Array]"]=!0,HT["[object Arguments]"]=HT["[object Array]"]=HT["[object ArrayBuffer]"]=HT["[object Boolean]"]=HT["[object DataView]"]=HT["[object Date]"]=HT["[object Error]"]=HT["[object Function]"]=HT["[object Map]"]=HT["[object Number]"]=HT["[object Object]"]=HT["[object RegExp]"]=HT["[object Set]"]=HT["[object String]"]=HT["[object WeakMap]"]=!1;var VT=function(e){return WP(e)&&_T(e.length)&&!!HT[UP(e)]};var BT=function(e){return function(t){return e(t)}},UT="object"==typeof e&&e&&!e.nodeType&&e,WT=UT&&"object"==typeof module&&module&&!module.nodeType&&module,qT=WT&&WT.exports===UT&&TP.process,YT=function(){try{var e=WT&&WT.require&&WT.require("util").types;return e||qT&&qT.binding&&qT.binding("util")}catch(e){}}(),GT=YT&&YT.isTypedArray,KT=GT?BT(GT):VT,QT=Object.prototype.hasOwnProperty;var XT=function(e,t){var n=GP(e),r=!n&&IT(e),o=!n&&!r&&$T(e),a=!n&&!r&&!o&&KT(e),i=n||r||o||a,s=i?NT(e.length,String):[],l=s.length;for(var u in e)!t&&!QT.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||CT(u,l))||s.push(u);return s};var ZT=function(e,t){return function(n){return e(t(n))}},JT=ZT(Object.keys,Object),eD=Object.prototype.hasOwnProperty;var tD=function(e){if(!OT(e))return JT(e);var t=[];for(var n in Object(e))eD.call(e,n)&&"constructor"!=n&&t.push(n);return t};var nD=function(e){return ET(e)?XT(e):tD(e)},rD=hT(Object,"create");var oD=function(){this.__data__=rD?rD(null):{},this.size=0};var aD=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},iD=Object.prototype.hasOwnProperty;var sD=function(e){var t=this.__data__;if(rD){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return iD.call(t,e)?t[e]:void 0},lD=Object.prototype.hasOwnProperty;var uD=function(e){var t=this.__data__;return rD?void 0!==t[e]:lD.call(t,e)};var cD=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rD&&void 0===t?"__lodash_hash_undefined__":t,this};function dD(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dD.prototype.clear=oD,dD.prototype.delete=aD,dD.prototype.get=sD,dD.prototype.has=uD,dD.prototype.set=cD;var fD=dD;var pD=function(){this.__data__=[],this.size=0};var hD=function(e,t){for(var n=e.length;n--;)if(kT(e[n][0],t))return n;return-1},mD=Array.prototype.splice;var gD=function(e){var t=this.__data__,n=hD(t,e);return!(n<0)&&(n==t.length-1?t.pop():mD.call(t,n,1),--this.size,!0)};var yD=function(e){var t=this.__data__,n=hD(t,e);return n<0?void 0:t[n][1]};var vD=function(e){return hD(this.__data__,e)>-1};var bD=function(e,t){var n=this.__data__,r=hD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function wD(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wD.prototype.clear=pD,wD.prototype.delete=gD,wD.prototype.get=yD,wD.prototype.has=vD,wD.prototype.set=bD;var xD=wD,SD=hT(MP,"Map");var CD=function(){this.size=0,this.__data__={hash:new fD,map:new(SD||xD),string:new fD}};var kD=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var _D=function(e,t){var n=e.__data__;return kD(t)?n["string"==typeof t?"string":"hash"]:n.map};var ED=function(e){var t=_D(this,e).delete(e);return this.size-=t?1:0,t};var jD=function(e){return _D(this,e).get(e)};var OD=function(e){return _D(this,e).has(e)};var ND=function(e,t){var n=_D(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function RD(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}RD.prototype.clear=CD,RD.prototype.delete=ED,RD.prototype.get=jD,RD.prototype.has=OD,RD.prototype.set=ND;var PD=RD;var TD=function(e){return null==e?"":XP(e)};var DD=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e};var MD=function(e){return function(t){return null==e?void 0:e[t]}};var ID=function(){this.__data__=new xD,this.size=0};var AD=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var FD=function(e){return this.__data__.get(e)};var LD=function(e){return this.__data__.has(e)};var zD=function(e,t){var n=this.__data__;if(n instanceof xD){var r=n.__data__;if(!SD||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new PD(r)}return n.set(e,t),this.size=n.size,this};function $D(e){var t=this.__data__=new xD(e);this.size=t.size}$D.prototype.clear=ID,$D.prototype.delete=AD,$D.prototype.get=FD,$D.prototype.has=LD,$D.prototype.set=zD;var HD=$D;var VD=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a};var BD=function(){return[]},UD=Object.prototype.propertyIsEnumerable,WD=Object.getOwnPropertySymbols,qD=WD?function(e){return null==e?[]:(e=Object(e),VD(WD(e),function(t){return UD.call(e,t)}))}:BD;var YD=function(e,t,n){var r=t(e);return GP(e)?r:DD(r,n(e))};var GD=function(e){return YD(e,nD,qD)},KD=hT(MP,"DataView"),QD=hT(MP,"Promise"),XD=hT(MP,"Set"),ZD="[object Map]",JD="[object Promise]",eM="[object Set]",tM="[object WeakMap]",nM="[object DataView]",rM=aT(KD),oM=aT(SD),aM=aT(QD),iM=aT(XD),sM=aT(mT),lM=UP;(KD&&lM(new KD(new ArrayBuffer(1)))!=nM||SD&&lM(new SD)!=ZD||QD&&lM(QD.resolve())!=JD||XD&&lM(new XD)!=eM||mT&&lM(new mT)!=tM)&&(lM=function(e){var t=UP(e),n="[object Object]"==t?e.constructor:void 0,r=n?aT(n):"";if(r)switch(r){case rM:return nM;case oM:return ZD;case aM:return JD;case iM:return eM;case sM:return tM}return t});var uM=lM,cM=MP.Uint8Array;var dM=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var fM=function(e){return this.__data__.has(e)};function pM(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new PD;++t<n;)this.add(e[t])}pM.prototype.add=pM.prototype.push=dM,pM.prototype.has=fM;var hM=pM;var mM=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var gM=function(e,t){return e.has(t)};var yM=function(e,t,n,r,o,a){var i=1&n,s=e.length,l=t.length;if(s!=l&&!(i&&l>s))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&n?new hM:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var h=e[d],m=t[d];if(r)var g=i?r(m,h,d,t,e,a):r(h,m,d,e,t,a);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!mM(t,function(e,t){if(!gM(p,t)&&(h===e||o(h,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(h!==m&&!o(h,m,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f};var vM=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n};var bM=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},wM=IP?IP.prototype:void 0,xM=wM?wM.valueOf:void 0;var SM=function(e,t,n,r,o,a,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new cM(e),new cM(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return kT(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=vM;case"[object Set]":var l=1&r;if(s||(s=bM),e.size!=t.size&&!l)return!1;var u=i.get(e);if(u)return u==t;r|=2,i.set(e,t);var c=yM(s(e),s(t),r,o,a,i);return i.delete(e),c;case"[object Symbol]":if(xM)return xM.call(e)==xM.call(t)}return!1},CM=Object.prototype.hasOwnProperty;var kM=function(e,t,n,r,o,a){var i=1&n,s=GD(e),l=s.length;if(l!=GD(t).length&&!i)return!1;for(var u=l;u--;){var c=s[u];if(!(i?c in t:CM.call(t,c)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var h=i;++u<l;){var m=e[c=s[u]],g=t[c];if(r)var y=i?r(g,m,c,t,e,a):r(m,g,c,e,t,a);if(!(void 0===y?m===g||o(m,g,n,r,a):y)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(p=!1)}return a.delete(e),a.delete(t),p},_M="[object Arguments]",EM="[object Array]",jM="[object Object]",OM=Object.prototype.hasOwnProperty;var NM=function(e,t,n,r,o,a){var i=GP(e),s=GP(t),l=i?EM:uM(e),u=s?EM:uM(t),c=(l=l==_M?jM:l)==jM,d=(u=u==_M?jM:u)==jM,f=l==u;if(f&&$T(e)){if(!$T(t))return!1;i=!0,c=!1}if(f&&!c)return a||(a=new HD),i||KT(e)?yM(e,t,n,r,o,a):SM(e,t,l,n,r,o,a);if(!(1&n)){var p=c&&OM.call(e,"__wrapped__"),h=d&&OM.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,g=h?t.value():t;return a||(a=new HD),o(m,g,n,r,a)}}return!!f&&(a||(a=new HD),kM(e,t,n,r,o,a))};var RM=function e(t,n,r,o,a){return t===n||(null==t||null==n||!WP(t)&&!WP(n)?t!=t&&n!=n:NM(t,n,r,o,e,a))};var PM=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1},TM=MD({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),DM=/[&<>"']/g,MM=RegExp(DM.source);var IM=function(e){return(e=TD(e))&&MM.test(e)?e.replace(DM,TM):e},AM=/[\\^$.*+?()[\]{}|]/g,FM=RegExp(AM.source);var LM=function(e){return(e=TD(e))&&FM.test(e)?e.replace(AM,"\\$&"):e};var zM=function(e,t){return RM(e,t)},$M=XD&&1/bM(new XD([,-0]))[1]==1/0?function(e){return new XD(e)}:gT,HM=$M;var VM=function(e,t,n){var r=-1,o=xT,a=e.length,i=!0,s=[],l=s;if(n)i=!1,o=PM;else if(a>=200){var u=t?null:HM(e);if(u)return bM(u);i=!1,o=gM,l=new hM}else l=t?[]:s;e:for(;++r<a;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,i&&d==d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else o(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s};var BM=function(e){return e&&e.length?VM(e):[]},UM={ENTER:[10,13],TAB:9,BACKSPACE:8,UP_ARROW:38,DOWN_ARROW:40,SPACE:32},WM={ENTER:"Enter",TAB:"Tab",COMMA:",",SPACE:" ",SEMICOLON:";"},qM="Press enter to add new tag",YM="text",GM={tags:"ReactTags__tags",tagInput:"ReactTags__tagInput",tagInputField:"ReactTags__tagInputField",selected:"ReactTags__selected",tag:"ReactTags__tag",remove:"ReactTags__remove",suggestions:"ReactTags__suggestions",activeSuggestion:"ReactTags__activeSuggestion",editTagInput:"ReactTags__editTagInput",editTagInputField:"ReactTags__editTagInputField",clearAll:"ReactTags__clearAll"},KM="inline",QM="top",XM="bottom",ZM="Tag limit reached!";function JM(e){const{moveTag:t,readOnly:n,allowDragDrop:r}=e;return void 0!==t&&!n&&r}var eI=e=>{const{readOnly:t,removeComponent:n,onRemove:r,className:o,tag:a,index:i}=e,s=e=>{if(UM.ENTER.includes(e.keyCode)||e.keyCode===UM.SPACE)return e.preventDefault(),void e.stopPropagation();e.keyCode===UM.BACKSPACE&&r(e)};if(t)return m.jsx("span",{});const l=`Tag at index ${i} with value ${a.id} focussed. Press backspace to remove`;if(n){const e=n;return m.jsx(e,{"data-testid":"remove",onRemove:r,onKeyDown:s,className:o,"aria-label":l,tag:a,index:i})}return m.jsx("button",{"data-testid":"remove",onClick:r,onKeyDown:s,className:o,type:"button","aria-label":l,children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"12",width:"12",fill:"#fff",children:m.jsx("path",{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"})})})},tI="tag",nI=e=>{const t=D.useRef(null),{readOnly:n=!1,tag:r,classNames:o,index:a,moveTag:i,allowDragDrop:s=!0,labelField:l="text",tags:u}=e,[{isDragging:c},d]=GR(()=>({type:tI,collect:e=>({isDragging:!!e.isDragging()}),item:e,canDrag:()=>JM({moveTag:i,readOnly:n,allowDragDrop:s})}),[u]),[,f]=ZR(()=>({accept:tI,drop:t=>{const n=t.index,r=a;n!==r&&e?.moveTag?.(n,r)},canDrop:e=>function(e){const{readOnly:t,allowDragDrop:n}=e;return!t&&n}(e)}),[u]);d(f(t));const p=e.tag[l],{className:h=""}=r,g=c?0:1;return m.jsxs("span",{ref:t,className:(0,PP.default)("tag-wrapper",o.tag,h),style:{opacity:g,cursor:JM({moveTag:i,readOnly:n,allowDragDrop:s})?"move":"auto"},"data-testid":"tag",onClick:e.onTagClicked,onTouchStart:e.onTagClicked,children:[p,m.jsx(eI,{tag:e.tag,className:o.remove,removeComponent:e.removeComponent,onRemove:e.onDelete,readOnly:n,index:a})]})},rI=e=>m.jsx("button",{"aria-label":e["aria-label"],className:e.classNames.clearAll,onClick:e.onClick,children:"Clear all"}),oI=(e,t,n,r)=>"function"==typeof r?r(e):e.length>=t&&n,aI=D.memo(e=>{const t=D.createRef(),{labelField:n,minQueryLength:r,isFocused:o,classNames:a,selectedIndex:i,query:s}=e;D.useEffect(()=>{if(!t.current)return;const e=t.current.querySelector(`.${a.activeSuggestion}`);e&&((e,t)=>{const n=t.offsetHeight,r=e.offsetHeight,o=e.offsetTop-t.scrollTop;o+r>=n?t.scrollTop+=o-n+r:o<0&&(t.scrollTop+=o)})(e,t.current)},[i]);const l=(e,t)=>{const r=t.trim().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),{[n]:o}=e;return{__html:o.replace(RegExp(r,"gi"),e=>`<mark>${IM(e)}</mark>`)}},u=(t,n)=>"function"==typeof e.renderSuggestion?e.renderSuggestion(t,n):m.jsx("span",{dangerouslySetInnerHTML:l(t,n)}),c=e.suggestions.map((t,n)=>m.jsx("li",{onMouseDown:e.handleClick.bind(null,n),onTouchStart:e.handleClick.bind(null,n),onMouseOver:e.handleHover.bind(null,n),className:n===e.selectedIndex?e.classNames.activeSuggestion:"",children:u(t,e.query)},n));return 0!==c.length&&oI(s,r||2,o,e.shouldRenderSuggestions)?m.jsx("div",{ref:t,className:a.suggestions,"data-testid":"suggestions",children:m.jsxs("ul",{children:[" ",c," "]})}):null},(e,t)=>{const{query:n,minQueryLength:r=2,isFocused:o,suggestions:a}=t;return!(e.isFocused!==o||!zM(e.suggestions,a)||oI(n,r,o,t.shouldRenderSuggestions)!==oI(e.query,e.minQueryLength??2,e.isFocused,e.shouldRenderSuggestions)||e.selectedIndex!==t.selectedIndex)}),iI=aI,sI=NP(RP()),lI=e=>{const{autofocus:t,autoFocus:n,readOnly:r,labelField:o,allowDeleteFromEmptyInput:a,allowAdditionFromPaste:i,allowDragDrop:s,minQueryLength:l,shouldRenderSuggestions:u,removeComponent:c,autocomplete:d,inline:f,maxTags:p,allowUnique:h,editable:g,placeholder:y,delimiters:v,separators:b,tags:w,inputFieldPosition:x,inputProps:S,classNames:C,maxLength:k,inputValue:_,clearAll:E,ariaAttrs:j}=e,[O,N]=D.useState(e.suggestions),[R,P]=D.useState(""),[T,M]=D.useState(!1),[I,A]=D.useState(-1),[F,L]=D.useState(!1),[z,$]=D.useState(""),[H,V]=D.useState(-1),[B,U]=D.useState(""),W=D.createRef(),q=D.useRef(null),Y=D.useRef(null);D.useEffect(()=>{v.length&&console.warn("[Deprecation] The delimiters prop is deprecated and will be removed in v7.x.x, please use separators instead. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/960")},[]),D.useEffect(()=>{void 0!==f&&console.warn("[Deprecation] The inline attribute is deprecated and will be removed in v7.x.x, please use inputFieldPosition instead.")},[f]),D.useEffect(()=>{void 0!==t&&console.warn("[Deprecated] autofocus prop will be removed in 7.x so please migrate to autoFocus prop."),(t||n&&!1!==t)&&!r&&Q()},[n,n,r]),D.useEffect(()=>{ee()},[R,e.suggestions]);const G=t=>{let n=e.suggestions.slice();if(h){const e=w.map(e=>e.id.trim().toLowerCase());n=n.filter(t=>!e.includes(t.id.toLowerCase()))}if(e.handleFilterSuggestions)return e.handleFilterSuggestions(t,n);const r=n.filter(e=>0===K(t,e)),o=n.filter(e=>K(t,e)>0);return r.concat(o)},K=(e,t)=>t[o].toLowerCase().indexOf(e.toLowerCase()),Q=()=>{P(""),q.current&&(q.current.value="",q.current.focus())},X=(t,n)=>{n.preventDefault(),n.stopPropagation();const r=w.slice();0!==r.length&&(U(""),e?.handleDelete?.(t,n),Z(t,r))},Z=(e,t)=>{if(!W?.current)return;const n=W.current.querySelectorAll(".ReactTags__remove");let r="";0===e&&t.length>1?(r=`Tag at index ${e} with value ${t[e].id} deleted. Tag at index 0 with value ${t[1].id} focussed. Press backspace to remove`,n[0].focus()):e>0?(r=`Tag at index ${e} with value ${t[e].id} deleted. Tag at index ${e-1} with value ${t[e-1].id} focussed. Press backspace to remove`,n[e-1].focus()):(r=`Tag at index ${e} with value ${t[e].id} deleted. Input focussed. Press enter to add a new tag`,q.current?.focus()),$(r)},J=t=>{e.handleInputChange&&e.handleInputChange(t.target.value,t);const n=t.target.value.trim();P(n)},ee=()=>{const e=G(R);N(e),A(I>=e.length?e.length-1:I)},te=t=>{const n=t.target.value;e.handleInputFocus&&e.handleInputFocus(n,t),M(!0)},ne=t=>{const n=t.target.value;e.handleInputBlur&&(e.handleInputBlur(n,t),q.current&&(q.current.value="")),M(!1),V(-1)},re=e=>{if(!e.nativeEvent.isComposing){if("Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),A(-1),L(!1),N([]),V(-1)),(-1!==b.indexOf(e.key)||-1!==v.indexOf(e.keyCode))&&!e.shiftKey){e.keyCode===UM.TAB&&""===R||e.preventDefault();const t=F&&-1!==I?O[I]:{id:R.trim(),[o]:R.trim(),className:""};Object.keys(t)&&ie(t)}"Backspace"!==e.key||""!==R||!a&&x!==KM||X(w.length-1,e),e.keyCode===UM.UP_ARROW&&(e.preventDefault(),A(I<=0?O.length-1:I-1),L(!0)),e.keyCode===UM.DOWN_ARROW&&(e.preventDefault(),L(!0),0===O.length?A(-1):A((I+1)%O.length))}},oe=()=>p&&w.length>=p,ae=t=>{if(!i)return;if(oe())return U(ZM),void Q();U(""),t.preventDefault();const n=t.clipboardData||window.clipboardData,r=n.getData("text"),{maxLength:a=r.length}=e,s=Math.min(a,r.length),l=n.getData("text").substr(0,s);let u=v;b.length&&(u=[],b.forEach(e=>{const t=function(e){switch(e){case WM.ENTER:return[10,13];case WM.TAB:return 9;case WM.COMMA:return 188;case WM.SPACE:return 32;case WM.SEMICOLON:return 186;default:return 0}}(e);Array.isArray(t)?u=[...u,...t]:u.push(t)}));const c=function(e){const t=e.map(e=>{const t=e-48*Math.floor(e/48);return String.fromCharCode(96<=e?t:e)}).join(""),n=LM(t);return new RegExp(`[${n}]+`)}(u),d=l.split(c).map(e=>e.trim());BM(d).forEach(e=>ie({id:e.trim(),[o]:e.trim(),className:""}))},ie=t=>{if(!t.id||!t[o])return;if(-1===H){if(oe())return U(ZM),void Q();U("")}const n=w.map(e=>e.id.toLowerCase());if(!(h&&n.indexOf(t.id.trim().toLowerCase())>=0)){if(d){const e=G(t[o]);console.warn("[Deprecation] The autocomplete prop will be removed in 7.x to simplify the integration and make it more intutive. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/949"),(1===d&&1===e.length||!0===d&&e.length)&&(t=e[0])}-1!==H&&e.onTagUpdate?e.onTagUpdate(H,t):e?.handleAddition?.(t),P(""),L(!1),A(-1),V(-1),Q()}},se=(t,n)=>{const r=w[t];e?.handleDrag?.(r,t,n)},le=(()=>{const t={...GM,...e.classNames};return w.map((n,a)=>m.jsx(D.Fragment,{children:H===a?m.jsx("div",{className:t.editTagInput,children:m.jsx("input",{ref:e=>{Y.current=e},onFocus:te,value:R,onChange:J,onKeyDown:re,onBlur:ne,className:t.editTagInputField,onPaste:ae,"data-testid":"tag-edit"})}):m.jsx(nI,{index:a,tag:n,tags:w,labelField:o,onDelete:e=>X(a,e),moveTag:s?se:void 0,removeComponent:c,onTagClicked:t=>((t,n,a)=>{r||(g&&(V(t),P(n[o]),Y.current?.focus()),e.handleTagClick?.(t,a))})(a,n,t),readOnly:r,classNames:t,allowDragDrop:s})},a))})(),ue={...GM,...C},{name:ce,id:de}=e,fe=!1===f?XM:x,pe=r?null:m.jsxs("div",{className:ue.tagInput,children:[m.jsx("input",{...S,ref:e=>{q.current=e},className:ue.tagInputField,type:"text",placeholder:y,"aria-label":y,onFocus:te,onBlur:ne,onChange:J,onKeyDown:re,onPaste:ae,name:ce,id:de,maxLength:k,value:_,"data-automation":"input","data-testid":"input"}),m.jsx(iI,{query:R.trim(),suggestions:O,labelField:o,selectedIndex:I,handleClick:e=>{ie(O[e])},handleHover:e=>{A(e),L(!0)},minQueryLength:l,shouldRenderSuggestions:u,isFocused:T,classNames:ue,renderSuggestion:e.renderSuggestion}),E&&w.length>0&&m.jsx(rI,{"aria-label":j?.clearAllLabel,classNames:ue,onClick:()=>{e.onClearAll&&e.onClearAll(),U(""),Q()}}),B&&m.jsxs("div",{"data-testid":"error",className:"ReactTags__error",children:[m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"24",width:"24",fill:"#e03131",children:m.jsx("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),B]})]});return m.jsxs("div",{className:(0,sI.default)(ue.tags,"react-tags-wrapper"),ref:W,children:[m.jsx("p",{role:"alert",className:"sr-only",style:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",margin:"-1px",padding:0,width:"1px",height:"1px",border:0},children:z}),fe===QM&&pe,m.jsxs("div",{className:ue.selected,children:[le,fe===KM&&pe]}),fe===XM&&pe]})},uI=e=>{const{placeholder:t=qM,labelField:n=YM,suggestions:r=[],delimiters:o=[],separators:a=(e.delimiters?.length?[]:[WM.ENTER,WM.TAB]),autofocus:i,autoFocus:s=!0,inline:l,inputFieldPosition:u="inline",allowDeleteFromEmptyInput:c=!1,allowAdditionFromPaste:d=!0,autocomplete:f=!1,readOnly:p=!1,allowUnique:h=!0,allowDragDrop:g=!0,tags:y=[],inputProps:v={},editable:b=!1,clearAll:w=!1,ariaAttrs:x={clearAllLabel:"clear all tags"},handleDelete:S,handleAddition:C,onTagUpdate:k,handleDrag:_,handleFilterSuggestions:E,handleTagClick:j,handleInputChange:O,handleInputFocus:N,handleInputBlur:R,minQueryLength:P,shouldRenderSuggestions:T,removeComponent:D,onClearAll:M,classNames:I,name:A,id:F,maxLength:L,inputValue:z,maxTags:$,renderSuggestion:H}=e;return m.jsx(lI,{placeholder:t,labelField:n,suggestions:r,delimiters:o,separators:a,autofocus:i,autoFocus:s,inline:l,inputFieldPosition:u,allowDeleteFromEmptyInput:c,allowAdditionFromPaste:d,autocomplete:f,readOnly:p,allowUnique:h,allowDragDrop:g,tags:y,inputProps:v,editable:b,clearAll:w,ariaAttrs:x,handleDelete:S,handleAddition:C,onTagUpdate:k,handleDrag:_,handleFilterSuggestions:E,handleTagClick:j,handleInputChange:O,handleInputFocus:N,handleInputBlur:R,minQueryLength:P,shouldRenderSuggestions:T,removeComponent:D,onClearAll:M,classNames:I,name:A,id:F,maxLength:L,inputValue:z,maxTags:$,renderSuggestion:H})},cI=({...e})=>m.jsx(CR,{backend:wP,children:m.jsx(uI,{...e})});
223
+ `;var LE=Object.freeze({position:"absolute",border:0,width:1,height:1,padding:0,margin:-1,overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",wordWrap:"normal"});D.forwardRef((e,t)=>m.jsx(ba.span,{...e,ref:t,style:{...LE,...e.style}})).displayName="VisuallyHidden";var zE=[" ","Enter","ArrowUp","ArrowDown"],$E=[" ","Enter"],HE="Select",[VE,BE,UE]=xa(HE),[WE]=sa(HE,[UE,Bs]),qE=Bs(),[YE,GE]=WE(HE),[KE,QE]=WE(HE),XE=e=>{const{__scopeSelect:t,children:n,open:r,defaultOpen:o,onOpenChange:a,value:i,defaultValue:s,onValueChange:l,dir:u,name:c,autoComplete:d,disabled:f,required:p,form:h}=e,g=qE(t),[y,v]=D.useState(null),[b,w]=D.useState(null),[x,S]=D.useState(!1),C=Ca(u),[k,_]=da({prop:r,defaultProp:o??!1,onChange:a,caller:HE}),[E,j]=da({prop:i,defaultProp:s,onChange:l,caller:HE}),O=D.useRef(null),N=!y||(h||!!y.closest("form")),[R,P]=D.useState(new Set),T=Array.from(R).map(e=>e.props.value).join(";");return m.jsx(al,{...g,children:m.jsxs(YE,{required:p,scope:t,trigger:y,onTriggerChange:v,valueNode:b,onValueNodeChange:w,valueNodeHasChildren:x,onValueNodeHasChildrenChange:S,contentId:Ka(),value:E,onValueChange:j,open:k,onOpenChange:_,dir:C,triggerPointerDownPosRef:O,disabled:f,children:[m.jsx(VE.Provider,{scope:t,children:m.jsx(KE,{scope:e.__scopeSelect,onNativeOptionAdd:D.useCallback(e=>{P(t=>new Set(t).add(e))},[]),onNativeOptionRemove:D.useCallback(e=>{P(t=>{const n=new Set(t);return n.delete(e),n})},[]),children:n})}),N?m.jsxs(Fj,{"aria-hidden":!0,required:p,tabIndex:-1,name:c,autoComplete:d,value:E,onChange:e=>j(e.target.value),disabled:f,form:h,children:[void 0===E?m.jsx("option",{value:""}):null,Array.from(R)]},T):null]})})};XE.displayName=HE;var ZE="SelectTrigger",JE=D.forwardRef((e,t)=>{const{__scopeSelect:n,disabled:r=!1,...o}=e,a=qE(n),i=GE(ZE,n),s=i.disabled||r,l=ia(t,i.onTriggerChange),u=BE(n),c=D.useRef("touch"),[d,f,p]=zj(e=>{const t=u().filter(e=>!e.disabled),n=t.find(e=>e.value===i.value),r=$j(t,e,n);void 0!==r&&i.onValueChange(r.value)}),h=e=>{s||(i.onOpenChange(!0),p()),e&&(i.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return m.jsx(il,{asChild:!0,...a,children:m.jsx(ba.button,{type:"button",role:"combobox","aria-controls":i.contentId,"aria-expanded":i.open,"aria-required":i.required,"aria-autocomplete":"none",dir:i.dir,"data-state":i.open?"open":"closed",disabled:s,"data-disabled":s?"":void 0,"data-placeholder":Lj(i.value)?"":void 0,...o,ref:l,onClick:ra(o.onClick,e=>{e.currentTarget.focus(),"mouse"!==c.current&&h(e)}),onPointerDown:ra(o.onPointerDown,e=>{c.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(h(e),e.preventDefault())}),onKeyDown:ra(o.onKeyDown,e=>{const t=""!==d.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||f(e.key),t&&" "===e.key||zE.includes(e.key)&&(h(),e.preventDefault())})})})});JE.displayName=ZE;var ej="SelectValue",tj=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,children:a,placeholder:i="",...s}=e,l=GE(ej,n),{onValueNodeHasChildrenChange:u}=l,c=void 0!==a,d=ia(t,l.onValueNodeChange);return ua(()=>{u(c)},[u,c]),m.jsx(ba.span,{...s,ref:d,style:{pointerEvents:"none"},children:Lj(l.value)?m.jsx(m.Fragment,{children:i}):a})});tj.displayName=ej;var nj=D.forwardRef((e,t)=>{const{__scopeSelect:n,children:r,...o}=e;return m.jsx(ba.span,{"aria-hidden":!0,...o,ref:t,children:r||"▼"})});nj.displayName="SelectIcon";var rj=e=>m.jsx(ul,{asChild:!0,...e});rj.displayName="SelectPortal";var oj="SelectContent",aj=D.forwardRef((e,t)=>{const n=GE(oj,e.__scopeSelect),[r,o]=D.useState();if(ua(()=>{o(new DocumentFragment)},[]),!n.open){const t=r;return t?fa.createPortal(m.jsx(sj,{scope:e.__scopeSelect,children:m.jsx(VE.Slot,{scope:e.__scopeSelect,children:m.jsx("div",{children:e.children})})}),t):null}return m.jsx(cj,{...e,ref:t})});aj.displayName=oj;var ij=10,[sj,lj]=WE(oj),uj=ha("SelectContent.RemoveScroll"),cj=D.forwardRef((e,t)=>{const{__scopeSelect:n,position:r="item-aligned",onCloseAutoFocus:o,onEscapeKeyDown:a,onPointerDownOutside:i,side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:y,...v}=e,b=GE(oj,n),[w,x]=D.useState(null),[S,C]=D.useState(null),k=ia(t,e=>x(e)),[_,E]=D.useState(null),[j,O]=D.useState(null),N=BE(n),[R,P]=D.useState(!1),T=D.useRef(!1);D.useEffect(()=>{if(w)return Al(w)},[w]),Ia();const M=D.useCallback(e=>{const[t,...n]=N().map(e=>e.ref.current),[r]=n.slice(-1),o=document.activeElement;for(const n of e){if(n===o)return;if(n?.scrollIntoView({block:"nearest"}),n===t&&S&&(S.scrollTop=0),n===r&&S&&(S.scrollTop=S.scrollHeight),n?.focus(),document.activeElement!==o)return}},[N,S]),I=D.useCallback(()=>M([_,w]),[M,_,w]);D.useEffect(()=>{R&&I()},[R,I]);const{onOpenChange:A,triggerPointerDownPosRef:F}=b;D.useEffect(()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(F.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(F.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||A(!1),document.removeEventListener("pointermove",t),F.current=null};return null!==F.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}},[w,A,F]),D.useEffect(()=>{const e=()=>A(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}},[A]);const[L,z]=zj(e=>{const t=N().filter(e=>!e.disabled),n=t.find(e=>e.ref.current===document.activeElement),r=$j(t,e,n);r&&setTimeout(()=>r.ref.current.focus())}),$=D.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==b.value&&b.value===t||r)&&(E(e),r&&(T.current=!0))},[b.value]),H=D.useCallback(()=>w?.focus(),[w]),V=D.useCallback((e,t,n)=>{const r=!T.current&&!n;(void 0!==b.value&&b.value===t||r)&&O(e)},[b.value]),B="popper"===r?fj:dj,U=B===fj?{side:s,sideOffset:l,align:u,alignOffset:c,arrowPadding:d,collisionBoundary:f,collisionPadding:p,sticky:h,hideWhenDetached:g,avoidCollisions:y}:{};return m.jsx(sj,{scope:n,content:w,viewport:S,onViewportChange:C,itemRefCallback:$,selectedItem:_,onItemLeave:H,itemTextRefCallback:V,focusSelectedItem:I,selectedItemText:j,position:r,isPositioned:R,searchRef:L,children:m.jsx(ku,{as:uj,allowPinchZoom:!0,children:m.jsx($a,{asChild:!0,trapped:b.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:ra(o,e=>{b.trigger?.focus({preventScroll:!0}),e.preventDefault()}),children:m.jsx(Ra,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:i,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>b.onOpenChange(!1),children:m.jsx(B,{role:"listbox",id:b.contentId,"data-state":b.open?"open":"closed",dir:b.dir,onContextMenu:e=>e.preventDefault(),...v,...U,onPlaced:()=>P(!0),ref:k,style:{display:"flex",flexDirection:"column",outline:"none",...v.style},onKeyDown:ra(v.onKeyDown,e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||z(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=N().filter(e=>!e.disabled).map(e=>e.ref.current);if(["ArrowUp","End"].includes(e.key)&&(t=t.slice().reverse()),["ArrowUp","ArrowDown"].includes(e.key)){const n=e.target,r=t.indexOf(n);t=t.slice(r+1)}setTimeout(()=>M(t)),e.preventDefault()}})})})})})})});cj.displayName="SelectContentImpl";var dj=D.forwardRef((e,t)=>{const{__scopeSelect:n,onPlaced:r,...o}=e,a=GE(oj,n),i=lj(oj,n),[s,l]=D.useState(null),[u,c]=D.useState(null),d=ia(t,e=>c(e)),f=BE(n),p=D.useRef(!1),h=D.useRef(!0),{viewport:g,selectedItem:y,selectedItemText:v,focusSelectedItem:b}=i,w=D.useCallback(()=>{if(a.trigger&&a.valueNode&&s&&u&&g&&y&&v){const e=a.trigger.getBoundingClientRect(),t=u.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),o=v.getBoundingClientRect();if("rtl"!==a.dir){const r=o.left-t.left,a=n.left-r,i=e.left-a,l=e.width+i,u=Math.max(l,t.width),c=window.innerWidth-ij,d=FE(a,[ij,Math.max(ij,c-u)]);s.style.minWidth=l+"px",s.style.left=d+"px"}else{const r=t.right-o.right,a=window.innerWidth-n.right-r,i=window.innerWidth-e.right-a,l=e.width+i,u=Math.max(l,t.width),c=window.innerWidth-ij,d=FE(a,[ij,Math.max(ij,c-u)]);s.style.minWidth=l+"px",s.style.right=d+"px"}const i=f(),l=window.innerHeight-2*ij,c=g.scrollHeight,d=window.getComputedStyle(u),h=parseInt(d.borderTopWidth,10),m=parseInt(d.paddingTop,10),b=parseInt(d.borderBottomWidth,10),w=h+m+c+parseInt(d.paddingBottom,10)+b,x=Math.min(5*y.offsetHeight,w),S=window.getComputedStyle(g),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),_=e.top+e.height/2-ij,E=l-_,j=y.offsetHeight/2,O=h+m+(y.offsetTop+j),N=w-O;if(O<=_){const e=i.length>0&&y===i[i.length-1].ref.current;s.style.bottom="0px";const t=u.clientHeight-g.offsetTop-g.offsetHeight,n=O+Math.max(E,j+(e?k:0)+t+b);s.style.height=n+"px"}else{const e=i.length>0&&y===i[0].ref.current;s.style.top="0px";const t=Math.max(_,h+g.offsetTop+(e?C:0)+j)+N;s.style.height=t+"px",g.scrollTop=O-_+g.offsetTop}s.style.margin=`${ij}px 0`,s.style.minHeight=x+"px",s.style.maxHeight=l+"px",r?.(),requestAnimationFrame(()=>p.current=!0)}},[f,a.trigger,a.valueNode,s,u,g,y,v,a.dir,r]);ua(()=>w(),[w]);const[x,S]=D.useState();ua(()=>{u&&S(window.getComputedStyle(u).zIndex)},[u]);const C=D.useCallback(e=>{e&&!0===h.current&&(w(),b?.(),h.current=!1)},[w,b]);return m.jsx(pj,{scope:n,contentWrapper:s,shouldExpandOnScrollRef:p,onScrollButtonChange:C,children:m.jsx("div",{ref:l,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:x},children:m.jsx(ba.div,{...o,ref:d,style:{boxSizing:"border-box",maxHeight:"100%",...o.style}})})})});dj.displayName="SelectItemAlignedPosition";var fj=D.forwardRef((e,t)=>{const{__scopeSelect:n,align:r="start",collisionPadding:o=ij,...a}=e,i=qE(n);return m.jsx(sl,{...i,...a,ref:t,align:r,collisionPadding:o,style:{boxSizing:"border-box",...a.style,"--radix-select-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-select-content-available-width":"var(--radix-popper-available-width)","--radix-select-content-available-height":"var(--radix-popper-available-height)","--radix-select-trigger-width":"var(--radix-popper-anchor-width)","--radix-select-trigger-height":"var(--radix-popper-anchor-height)"}})});fj.displayName="SelectPopperPosition";var[pj,hj]=WE(oj,{}),mj="SelectViewport",gj=D.forwardRef((e,t)=>{const{__scopeSelect:n,nonce:r,...o}=e,a=lj(mj,n),i=hj(mj,n),s=ia(t,a.onViewportChange),l=D.useRef(0);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-select-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-select-viewport]::-webkit-scrollbar{display:none}"},nonce:r}),m.jsx(VE.Slot,{scope:n,children:m.jsx(ba.div,{"data-radix-select-viewport":"",role:"presentation",...o,ref:s,style:{position:"relative",flex:1,overflow:"hidden auto",...o.style},onScroll:ra(o.onScroll,e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=i;if(r?.current&&n){const e=Math.abs(l.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*ij,o=parseFloat(n.style.minHeight),a=parseFloat(n.style.height),i=Math.max(o,a);if(i<r){const o=i+e,a=Math.min(r,o),s=o-a;n.style.height=a+"px","0px"===n.style.bottom&&(t.scrollTop=s>0?s:0,n.style.justifyContent="flex-end")}}}l.current=t.scrollTop})})})]})});gj.displayName=mj;var yj="SelectGroup",[vj,bj]=WE(yj);D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=Ka();return m.jsx(vj,{scope:n,id:o,children:m.jsx(ba.div,{role:"group","aria-labelledby":o,...r,ref:t})})}).displayName=yj;var wj="SelectLabel",xj=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=bj(wj,n);return m.jsx(ba.div,{id:o.id,...r,ref:t})});xj.displayName=wj;var Sj="SelectItem",[Cj,kj]=WE(Sj),_j=D.forwardRef((e,t)=>{const{__scopeSelect:n,value:r,disabled:o=!1,textValue:a,...i}=e,s=GE(Sj,n),l=lj(Sj,n),u=s.value===r,[c,d]=D.useState(a??""),[f,p]=D.useState(!1),h=ia(t,e=>l.itemRefCallback?.(e,r,o)),g=Ka(),y=D.useRef("touch"),v=()=>{o||(s.onValueChange(r),s.onOpenChange(!1))};if(""===r)throw new Error("A <Select.Item /> must have a value prop that is not an empty string. This is because the Select value can be set to an empty string to clear the selection and show the placeholder.");return m.jsx(Cj,{scope:n,value:r,disabled:o,textId:g,isSelected:u,onItemTextChange:D.useCallback(e=>{d(t=>t||(e?.textContent??"").trim())},[]),children:m.jsx(VE.ItemSlot,{scope:n,value:r,disabled:o,textValue:c,children:m.jsx(ba.div,{role:"option","aria-labelledby":g,"data-highlighted":f?"":void 0,"aria-selected":u&&f,"data-state":u?"checked":"unchecked","aria-disabled":o||void 0,"data-disabled":o?"":void 0,tabIndex:o?void 0:-1,...i,ref:h,onFocus:ra(i.onFocus,()=>p(!0)),onBlur:ra(i.onBlur,()=>p(!1)),onClick:ra(i.onClick,()=>{"mouse"!==y.current&&v()}),onPointerUp:ra(i.onPointerUp,()=>{"mouse"===y.current&&v()}),onPointerDown:ra(i.onPointerDown,e=>{y.current=e.pointerType}),onPointerMove:ra(i.onPointerMove,e=>{y.current=e.pointerType,o?l.onItemLeave?.():"mouse"===y.current&&e.currentTarget.focus({preventScroll:!0})}),onPointerLeave:ra(i.onPointerLeave,e=>{e.currentTarget===document.activeElement&&l.onItemLeave?.()}),onKeyDown:ra(i.onKeyDown,e=>{""!==l.searchRef?.current&&" "===e.key||($E.includes(e.key)&&v()," "===e.key&&e.preventDefault())})})})})});_j.displayName=Sj;var Ej="SelectItemText",jj=D.forwardRef((e,t)=>{const{__scopeSelect:n,className:r,style:o,...a}=e,i=GE(Ej,n),s=lj(Ej,n),l=kj(Ej,n),u=QE(Ej,n),[c,d]=D.useState(null),f=ia(t,e=>d(e),l.onItemTextChange,e=>s.itemTextRefCallback?.(e,l.value,l.disabled)),p=c?.textContent,h=D.useMemo(()=>m.jsx("option",{value:l.value,disabled:l.disabled,children:p},l.value),[l.disabled,l.value,p]),{onNativeOptionAdd:g,onNativeOptionRemove:y}=u;return ua(()=>(g(h),()=>y(h)),[g,y,h]),m.jsxs(m.Fragment,{children:[m.jsx(ba.span,{id:l.textId,...a,ref:f}),l.isSelected&&i.valueNode&&!i.valueNodeHasChildren?fa.createPortal(a.children,i.valueNode):null]})});jj.displayName=Ej;var Oj="SelectItemIndicator",Nj=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return kj(Oj,n).isSelected?m.jsx(ba.span,{"aria-hidden":!0,...r,ref:t}):null});Nj.displayName=Oj;var Rj="SelectScrollUpButton",Pj=D.forwardRef((e,t)=>{const n=lj(Rj,e.__scopeSelect),r=hj(Rj,e.__scopeSelect),[o,a]=D.useState(!1),i=ia(t,r.onScrollButtonChange);return ua(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollTop>0;a(e)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?m.jsx(Mj,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null});Pj.displayName=Rj;var Tj="SelectScrollDownButton",Dj=D.forwardRef((e,t)=>{const n=lj(Tj,e.__scopeSelect),r=hj(Tj,e.__scopeSelect),[o,a]=D.useState(!1),i=ia(t,r.onScrollButtonChange);return ua(()=>{if(n.viewport&&n.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=n.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}},[n.viewport,n.isPositioned]),o?m.jsx(Mj,{...e,ref:i,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=n;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null});Dj.displayName=Tj;var Mj=D.forwardRef((e,t)=>{const{__scopeSelect:n,onAutoScroll:r,...o}=e,a=lj("SelectScrollButton",n),i=D.useRef(null),s=BE(n),l=D.useCallback(()=>{null!==i.current&&(window.clearInterval(i.current),i.current=null)},[]);return D.useEffect(()=>()=>l(),[l]),ua(()=>{const e=s().find(e=>e.ref.current===document.activeElement);e?.ref.current?.scrollIntoView({block:"nearest"})},[s]),m.jsx(ba.div,{"aria-hidden":!0,...o,ref:t,style:{flexShrink:0,...o.style},onPointerDown:ra(o.onPointerDown,()=>{null===i.current&&(i.current=window.setInterval(r,50))}),onPointerMove:ra(o.onPointerMove,()=>{a.onItemLeave?.(),null===i.current&&(i.current=window.setInterval(r,50))}),onPointerLeave:ra(o.onPointerLeave,()=>{l()})})}),Ij=D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e;return m.jsx(ba.div,{"aria-hidden":!0,...r,ref:t})});Ij.displayName="SelectSeparator";var Aj="SelectArrow";D.forwardRef((e,t)=>{const{__scopeSelect:n,...r}=e,o=qE(n),a=GE(Aj,n),i=lj(Aj,n);return a.open&&"popper"===i.position?m.jsx(ll,{...o,...r,ref:t}):null}).displayName=Aj;var Fj=D.forwardRef(({__scopeSelect:e,value:t,...n},r)=>{const o=D.useRef(null),a=ia(r,o),i=function(e){const t=D.useRef({value:e,previous:e});return D.useMemo(()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous),[e])}(t);return D.useEffect(()=>{const e=o.current;if(!e)return;const n=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(n,"value").set;if(i!==t&&r){const n=new Event("change",{bubbles:!0});r.call(e,t),e.dispatchEvent(n)}},[i,t]),m.jsx(ba.select,{...n,style:{...LE,...n.style},ref:a,defaultValue:t})});function Lj(e){return""===e||void 0===e}function zj(e){const t=ka(e),n=D.useRef(""),r=D.useRef(0),o=D.useCallback(e=>{const o=n.current+e;t(o),function e(t){n.current=t,window.clearTimeout(r.current),""!==t&&(r.current=window.setTimeout(()=>e(""),1e3))}(o)},[t]),a=D.useCallback(()=>{n.current="",window.clearTimeout(r.current)},[]);return D.useEffect(()=>()=>window.clearTimeout(r.current),[]),[n,o,a]}function $j(e,t,n){const r=t.length>1&&Array.from(t).every(e=>e===t[0]),o=r?t[0]:t,a=n?e.indexOf(n):-1;let i=(s=e,l=Math.max(a,0),s.map((e,t)=>s[(l+t)%s.length]));var s,l;1===o.length&&(i=i.filter(e=>e!==n));const u=i.find(e=>e.textValue.toLowerCase().startsWith(o.toLowerCase()));return u!==n?u:void 0}Fj.displayName="SelectBubbleInput";var Hj=JE,Vj=nj,Bj=rj,Uj=aj,Wj=gj,qj=xj,Yj=_j,Gj=jj,Kj=Nj,Qj=Pj,Xj=Dj,Zj=Ij;const Jj=XE,eO=tj,tO=D.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Hj,{ref:r,className:Ko("flex h-10 w-full items-center hover:border-[#BFD7FE] justify-between rounded-md border focus:border-primary border-neutral-200 bg-white px-3 py-2 text-sm ring-offset-white placeholder:text-neutral-500 focus:outline-none disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1 ",e),...n,children:[t,m.jsx(Vj,{asChild:!0,children:m.jsx(Rd,{className:"h-4 w-4 opacity-50"})})]}));tO.displayName=Hj.displayName;const nO=D.forwardRef(({className:e,...t},n)=>m.jsx(Qj,{ref:n,className:Ko("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Td,{className:"h-4 w-4"})}));nO.displayName=Qj.displayName;const rO=D.forwardRef(({className:e,...t},n)=>m.jsx(Xj,{ref:n,className:Ko("flex cursor-default items-center justify-center py-1",e),...t,children:m.jsx(Rd,{className:"h-4 w-4"})}));rO.displayName=Xj.displayName;const oO=D.forwardRef(({className:e,children:t,position:n="popper",...r},o)=>m.jsx(Bj,{children:m.jsxs(Uj,{ref:o,className:Ko("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border border-neutral-200 bg-white text-neutral-950 shadow-md data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 dark:border-neutral-800 dark:bg-neutral-950 dark:text-neutral-50","popper"===n&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",e),position:n,...r,children:[m.jsx(nO,{}),m.jsx(Wj,{className:Ko("p-1","popper"===n&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:t}),m.jsx(rO,{})]})}));oO.displayName=Uj.displayName;D.forwardRef(({className:e,...t},n)=>m.jsx(qj,{ref:n,className:Ko("py-1.5 pl-8 pr-2 text-sm font-semibold",e),...t})).displayName=qj.displayName;const aO=D.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(Yj,{ref:r,className:Ko("relative flex w-full select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none focus:bg-primary/20 cursor-pointer focus:text-neutral-900 data-[disabled]:pointer-events-none data-[disabled]:opacity-50 dark:focus:bg-neutral-800 dark:focus:text-neutral-50",e),...n,children:[m.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:m.jsx(Kj,{children:m.jsx(Nd,{className:"h-4 w-4"})})}),m.jsx(Gj,{children:t})]}));aO.displayName=Yj.displayName;function iO({label:e,addonLabel:t,type:n,placeholder:r,selectPlaceholder:o,error:a,success:i,value:s,defaultValue:l,name:u,id:c,formik:d,onChange:f,inputRef:p,onBlur:h,required:g,disabled:y,loading:v,showError:b,selectOptions:w,disableSearch:x,searchSelectPlaceholder:S,showSelectSearch:C,onSelectValueChange:k,selectValue:_,showOutline:E=!0,cols:j,rows:O,labelClass:N,addonLabelClass:R,optional:P,info:T,addonInfo:M,icon:I,actionIcon:A,actionLabel:F,actionLabelInfo:L,actionLabelAction:z,className:$,textAreaOnChange:H,addOn:V,infoAlignment:B,addonInfoAlignment:U,inputContainerClass:W,showNegative:q,showPositive:Y,...G}){const[K,Q]=D.useState(n),[X,Z]=D.useState(!1),[J,ee]=D.useState(""),te=((e,t)=>{const n=e?.filter(e=>"string"==typeof e.label?e.label?.toLowerCase().includes(t.toLowerCase()):e.value?.toLowerCase().includes(t.toLowerCase())||e?.searchId?.toLowerCase().includes(t.toLowerCase()));return t?n:e})(w??[],J);return m.jsx(m.Fragment,{children:v?m.jsx(na,{className:"w-full h-12"}):m.jsx("div",{className:"w-full",children:m.jsxs("div",{className:`flex flex-col ${e&&"gap-2.5"} relative `,children:[m.jsxs("div",{className:"flex justify-between gap-2 flex-wrap",children:[t&&m.jsxs("label",{className:Ko("text-black flex items-center gap-1 first-letter:uppercase text-sm font-medium",R),children:[t," ",g?m.jsx("span",{className:"text-[#E12D39]",children:t&&"*"}):P?m.jsx("span",{className:"text-[#B5B5B5] font-normal",children:"(optional)"}):null,M&&m.jsx(kv,{fieldName:t,align:U,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:M})})]}),e&&m.jsxs("label",{className:Ko("text-black flex items-center gap-1 first-letter:uppercase text-sm font-medium",N),children:[e," ",g?m.jsx("span",{className:"text-[#E12D39]",children:e&&"*"}):P?m.jsx("span",{className:"text-[#B5B5B5] font-normal",children:"(optional)"}):null,T&&m.jsx(kv,{fieldName:e,align:B,children:m.jsx("p",{className:"font-normal first-letter:uppercase w-full whitespace-pre-wrap",children:T})})]}),F&&m.jsxs("button",{onClick:z,className:"text-primary flex items-center gap-1 first-letter:uppercase text-sm font-bold",children:[A,F,L&&m.jsx(kv,{fieldName:e,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:L})})]})]}),m.jsxs("div",{className:Ko(`border overflow-hidden rounded-md text-sm border-[#E1E3EA] hover:border-primary_light font-normal text-grey-950 flex gap-2 items-center bg-white px-3 ${"text-area"!==n&&"h-12"} ${(a||b)&&"!border-danger"} ${i&&"!border-success"} ${X&&E&&"!border-primary"}\n ${I&&"px-2"}\n ${V&&"px-0"}\n `,y?"cursor-not-allowed bg-gray-200":null,w?"px-0":null,W),children:[V&&m.jsx("span",{className:"bg-gray-200 text-[13px] font-semibold text-gray-700 h-full min-w-9.5 flex items-center justify-center shrink-0 rounded-l-md px-2 ",children:V}),I,w&&m.jsxs(Jj,{onValueChange:k,defaultValue:_,value:_,children:[m.jsx(tO,{disabled:x,className:" min-w-max w-max h-full border-0 border-r rounded-none hover:border-neutral-200 focus:border-neutral-200 bg-[#F9F9F9] hover:border-b-neutral-200 disabled:opacity-100 ",children:m.jsx(eO,{className:" text-sm text-[#5E6278] placeholder:font-medium outline-none",placeholder:o})}),m.jsxs(oO,{className:"bg-white w-full relative",children:[C&&m.jsx("input",{value:J,onChange:e=>{ee(e.target.value.toString())},placeholder:S??"Search...",className:"h-10 border mb-2 text-sm px-4 outline-none w-full border-neutral-200 rounded bg-white sticky top-0 z-20"}),te?.map((e,t)=>m.jsx(aO,{className:"text-sm",value:e.value,children:e.label},e.value))]})]}),"text-area"===n?m.jsx("textarea",{cols:j,rows:O,onFocus:()=>Z(!0),onBlur:e=>{Z(!1)},placeholder:r,className:Ko(`placeholder:text-[#7E8299] hover:border-primary_light py-2 h-full placeholder:font-medium outline-none w-full rounded ${y?"bg-[#EEEFF2] cursor-not-allowed":null} ${X&&E&&"!border-primary"} transition-all ease-in-out`,$),...G,value:s,name:u,onChange:H}):m.jsx("input",{onInput:e=>{const t=e.target;"number"===n&&(t.value=t.value.replace(/[^0-9.]/g,""),t.value=t.value.replace(/^\.|(\..*)\./g,"$1"),t.value.length>1&&t.value.startsWith("0")&&"."!==t.value[1]&&(t.value=t.value.replace(/^0+/,"")),""!==t.value&&"0"!==t.value||(t.value="0"))},type:"number"===K?"text":K,placeholder:r,className:Ko("placeholder:text-[#7E8299] h-full placeholder:font-medium outline-none w-full rounded disabled:cursor-not-allowed",w&&"number"===n?"pr-2":null,I||V?"pr-0":null,w&&"number"===n&&t&&"text-right pr-2",$,Y&&"0"!==s?.toString().trim()?"text-green-600 font-semibold":"",q&&s?.toString().trim().startsWith("-")?"text-red-600 font-semibold":""),onFocus:()=>Z(!0),onBlur:e=>{d&&h&&d&&h(e),Z(!1)},value:s||"",defaultValue:l,onChange:f,id:c,name:u,required:g,disabled:y,ref:p,...G}),"password"===n&&m.jsx("span",{className:"cursor-pointer",onClick:()=>{Q(e=>"password"===e?"text":"password")},children:"password"===K?Jy.eyeslash:Jy.eye})]}),a&&m.jsx("p",{className:"text-danger text-xs font-normal",children:a})]})})})}function sO({value:e,label:t,placeholder:n,uuid:r,name:o,displayValue:a,valueType:i,item_unit:s}){const{mutate:l,isPending:u}=ex();J();const[c,d]=D.useState(!1),[f,p]=D.useState({item_uuid:r,[o]:e});En();const[h,g]=D.useState("");return m.jsxs($C,{open:c,onOpenChange:d,children:[m.jsx(HC,{className:"flex items-center",children:m.jsx("button",{className:"hover:text-primary duration-150 underline disabled:no-underline disabled:hover:text-inherit",children:h?"selling_price"===o?rv(+h):ov(+h)+s:a})}),m.jsxs(VC,{align:"center",className:"shadow-[0_1px_2px_0px_#E4E5E73D,_0_12px_24px_0_#868C981F] space-y-2 bg-white rounded-xl p-3 w-[280px] relative before:absolute before:w-3 before:h-1.5 before:bg-white before:left-1/2 before:-translate-x-1/2 before:rotate-45 data-[side=bottom]:before:top-0 data-[side=top]:before:bottom-0",children:[m.jsx(iO,{type:i,value:f[o],label:t,placeholder:n,onChange:e=>{p(t=>({...t,[o]:e.target.value}))}}),m.jsxs("div",{className:"flex justify-end gap-2.5",children:[m.jsx(AC,{children:m.jsx(IE,{label:"Dismiss",className:"bg-gray-300 text-dark text-sm hover:bg-gray-300/90 font-medium",disabled:u})}),m.jsx(IE,{label:"Update",className:"text-sm font-medium",onClick:()=>{l({url:"/items/update_basic",payload:f},{onSuccess:()=>{g(f[o]),d(!1)},onError:()=>{g("")}})},loading:u})]})]})]})}D.forwardRef(({className:e,...t},n)=>m.jsx(Zj,{ref:n,className:Ko("-mx-1 my-1 h-px bg-neutral-100 dark:bg-neutral-800",e),...t})).displayName=Zj.displayName;const lO=[{accessorKey:"item_description",header:()=>m.jsxs("p",{children:[" ","Item description/ ",m.jsx("br",{})," Product code"," "]}),cell:({row:e})=>{const t=e.original;return m.jsxs("div",{className:"flex items-center gap-5",children:[m.jsx("div",{className:"w-[50px] h-[50px] rounded-2xl relative bg-gray-100",children:m.jsx("img",{src:t.item_image,alt:"item image",className:"rounded-2xl object-cover w-full h-full",draggable:!1})}),m.jsxs("div",{className:"space-y-1 max-w-[265px]",children:[m.jsx(cO,{title:t.item_description,item_uuid:t.uuid,item_type_id:t.item_type_id,data:t.fullData}),m.jsxs("p",{className:"text-dark text-xs font-normal flex items-center gap-1",children:[m.jsx("span",{className:"uppercase whitespace-nowrap",children:t.itemcode}),t.sku||t.barcode.length>0?m.jsx(kv,{align:"center",fieldName:"All item codes",trigger:m.jsxs("button",{className:"rounded bg-primary_light px-[5px] flex items-center text-primary font-semibold text-[11px] h-[18px]",children:["+",(t.barcode?.length||0)+(t.sku?1:0)]}),children:m.jsxs("div",{className:"space-y-2",children:[t.sku?m.jsxs("div",{className:"",children:[m.jsx("p",{children:" SKU:"}),m.jsx("ul",{className:"list-disc pl-4",children:m.jsx("li",{children:t.sku})})]}):null,t.barcode.length>0?m.jsxs("div",{children:[m.jsx("p",{children:"Barcodes:"}),m.jsx("ul",{className:"list-disc pl-4 ",children:t.barcode.map((e,t)=>m.jsx("li",{children:e.barcode},t))})]}):null,m.jsxs("div",{className:"",children:[m.jsx("p",{children:" Itemcode:"}),m.jsx("ul",{className:"list-disc pl-4",children:m.jsx("li",{children:t.itemcode})})]})]})}):null,t.expired?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"|"}),"Expired",m.jsx("span",{className:"rounded bg-danger_light px-[5px] flex items-center text-danger font-semibold text-[11px] h-[18px]",children:t.expired})]}):null,t.expiring?m.jsxs(m.Fragment,{children:[m.jsx("span",{children:"|"}),"Expiring",m.jsx("span",{className:"rounded bg-warning-light px-[5px] flex items-center text-warning font-semibold text-[11px] h-[18px]",children:t.expiring})]}):null]})]})]})}},{accessorKey:"quantity",header:()=>m.jsx("p",{children:"quantity"}),cell:({row:e})=>{const t=e.original;return m.jsxs(m.Fragment,{children:[m.jsx("div",{className:Ko("flex items-center",t.quantity<=0?"text-danger":Number(t.reorder_level)==t.quantity?"text-orange":null),children:m.jsx(sO,{label:"Edit item quantity",placeholder:"Enter quantity",uuid:t.uuid,name:"item_quantity",displayValue:ov(t.quantity)+t.unit,value:t.quantity,valueType:"number",item_unit:t.unit})}),t.all_quantity===t.quantity?null:m.jsx("p",{className:"text-gray-700",children:Intl.NumberFormat().format(t.all_quantity??0)+t.unit})]})}},{accessorKey:"type",cell:({row:e})=>{const t=e.original;return m.jsx("p",{className:"capitalize",children:t.type})}},{accessorKey:"selling_price",header:"Selling Price (₦)",cell:({row:e})=>{const t=e.original;return m.jsx(sO,{label:"Edit selling price (₦)",placeholder:"Enter selling price",uuid:t.uuid,name:"selling_price",displayValue:rv(t.selling_price??0),value:t.selling_price??0,valueType:"number"})}},{accessorKey:"categories",header:"categories/Tags",cell:({row:e})=>{const t=e.original;return m.jsxs(m.Fragment,{children:[" ",m.jsxs("div",{className:"flex items-center gap-2 capitalize",children:[t.categories&&t.categories?.length>0?t.categories?.[0]?.name:"...",t.categories.length>1?m.jsx(kv,{align:"center",fieldName:"Categories",trigger:m.jsxs("button",{className:"rounded bg-primary_light px-[5px] flex items-center text-primary font-semibold text-[11px] h-[18px]",children:["+",t.categories.length-1]}),children:m.jsx("ul",{className:"list-disc pl-4",children:t.categories.map((e,t)=>m.jsx("li",{children:e.name},t))})}):null]}),m.jsxs("div",{className:"text-gray-700 flex items-center gap-2 capitalize",children:[t.tags?.[0],t.tags?.length>1?m.jsx(kv,{align:"center",fieldName:"Tags",trigger:m.jsxs("button",{className:"rounded bg-primary_light px-[5px] flex items-center text-primary font-semibold text-[11px] h-[18px] border-primary",children:["+",t.tags.length-1]}),children:m.jsx("ul",{className:"list-disc pl-4",children:t.tags.map((e,t)=>m.jsx("li",{children:e},t))})}):null]})]})}},{accessorKey:"status",cell:({row:e})=>{const t=e.getValue("status");return m.jsx(_v,{status:t})}},{id:"actions",header:"actions",cell:({row:e})=>{const t=e.original;return m.jsx(uO,{item_uuid:t.uuid,item_type_id:t.item_type_id,data:t.fullData})}}],uO=({item_uuid:e,item_type_id:t,data:n})=>{const[r,o]=D.useState(null),a=()=>{o(null)},[i,s]=D.useState(!1),[l,u]=D.useState(!1),[c,d]=D.useState(!1),[f,p]=D.useState(!1),[h,g]=D.useState(!1),[y,v]=D.useState(!1),[b,w]=D.useState(!1),x=[{label:"view",icon:Jy.eye_outline,action:()=>s(!0)},{label:"delete",icon:Jy.trash,action:()=>p(!0)}];return m.jsxs(m.Fragment,{children:[m.jsxs(Fd,{children:[m.jsx(Ld,{asChild:!0,children:m.jsxs("button",{className:"bg-gray-100 rounded-md h-[30px] w-[90px] flex items-center justify-between p-2.5 font-semibold text-[10px] text-gray-500 hover:border duration-200",children:["Action"," ",m.jsx("svg",{width:"11",height:"6",viewBox:"0 0 11 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M5.50855 5.49304C5.42081 5.49355 5.33383 5.47673 5.25261 5.44356C5.17138 5.41038 5.09751 5.3615 5.03521 5.29971L1.03521 1.29971C0.972726 1.23773 0.92313 1.164 0.889284 1.08276C0.855438 1.00152 0.838013 0.914383 0.838013 0.826375C0.838013 0.738367 0.855438 0.65123 0.889284 0.56999C0.92313 0.488751 0.972726 0.415017 1.03521 0.353041C1.16012 0.228874 1.32909 0.15918 1.50521 0.15918C1.68134 0.15918 1.8503 0.228874 1.97521 0.353041L5.50855 3.88637L9.03521 0.353041C9.16012 0.228874 9.32909 0.15918 9.50521 0.15918C9.68134 0.15918 9.8503 0.228874 9.97521 0.353041C10.0377 0.415017 10.0873 0.488751 10.1211 0.56999C10.155 0.65123 10.1724 0.738367 10.1724 0.826375C10.1724 0.914383 10.155 1.00152 10.1211 1.08276C10.0873 1.164 10.0377 1.23773 9.97521 1.29971L5.97521 5.29971C5.85104 5.42287 5.68344 5.4923 5.50855 5.49304Z",fill:"#202125"})})]})}),m.jsx(zd,{align:"end",className:"flex flex-col gap-2.5 rounded-xl border-gray-200",children:x.map((e,t)=>m.jsxs($d,{className:`capitalize focus:bg-primary_light rounded-md focus:text-primary font-semibold text-gray-700 text-sm cursor-pointer px-[15px] flex items-center gap-[5px] ${t===x.length-1&&"text-danger focus:text-danger"}`,onMouseOver:()=>(e=>{o(e)})(t),onMouseOut:a,onClick:e.action,children:[M.cloneElement(e.icon,{fill:r===t?"#1868DB":"#5E6278"})," ",e.label]},t))})]}),m.jsx(QC,{isOpen:i,onClose:()=>s(!1),itemUUID:e}),m.jsx(AE,{isOpen:f,onClose:()=>p(!1),uuids:[e],single:!0})]})},cO=({title:e,item_uuid:t,item_type_id:n,data:r})=>{const[o,a]=D.useState(!1),[i,s]=D.useState(!1),[l,u]=D.useState(!1);return m.jsxs(m.Fragment,{children:[m.jsx("button",{className:Ko("text-primary font-bold text-sm first-letter:uppercase truncate max-w-[265px] cursor-pointer",r.expired?"text-danger":""),title:e,onClick:()=>a(!0),children:e}),m.jsx(QC,{isOpen:o,onClose:()=>a(!1),itemUUID:t})]})};var dO,fO={};function pO(){if(dO)return fO;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}dO=1,Object.defineProperty(fO,"__esModule",{value:!0}),fO.Collapse=void 0;var t,n=(t=f())&&t.__esModule?t:{default:t};function r(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function o(e,t){return o=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},o(e,t)}function a(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,o=s(t);if(n){var a=s(this).constructor;r=Reflect.construct(o,arguments,a)}else r=o.apply(this,arguments);return function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return i(t)}(this,r)}}function i(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e){return s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},s(e)}function l(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var u=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&o(e,t)}(s,e);var t=a(s);function s(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),l(i(n=t.call(this,e)),"timeout",void 0),l(i(n),"container",void 0),l(i(n),"content",void 0),l(i(n),"onResize",function(){if(clearTimeout(n.timeout),n.container&&n.content){var e=n.props,t=e.isOpened,r=e.checkTimeout,o=Math.floor(n.container.clientHeight),a=Math.floor(n.content.clientHeight),i=t&&Math.abs(a-o)<=1,s=!t&&Math.abs(o)<=1;i||s?n.onRest({isFullyOpened:i,isFullyClosed:s,isOpened:t,containerHeight:o,contentHeight:a}):(n.onWork({isFullyOpened:i,isFullyClosed:s,isOpened:t,containerHeight:o,contentHeight:a}),n.timeout=setTimeout(function(){return n.onResize()},r))}}),l(i(n),"onRest",function(e){var t=e.isFullyOpened,r=e.isFullyClosed,o=e.isOpened,a=e.containerHeight,i=e.contentHeight;if(n.container&&n.content){var s=o&&n.container.style.height==="".concat(i,"px"),l=!o&&"0px"===n.container.style.height;if(s||l){n.container.style.overflow=o?"initial":"hidden",n.container.style.height=o?"auto":"0px";var u=n.props.onRest;u&&u({isFullyOpened:t,isFullyClosed:r,isOpened:o,containerHeight:a,contentHeight:i})}}}),l(i(n),"onWork",function(e){var t=e.isFullyOpened,r=e.isFullyClosed,o=e.isOpened,a=e.containerHeight,i=e.contentHeight;if(n.container&&n.content){var s=o&&n.container.style.height==="".concat(i,"px"),l=!o&&"0px"===n.container.style.height;if(!s&&!l){n.container.style.overflow="hidden",n.container.style.height=o?"".concat(i,"px"):"0px";var u=n.props.onWork;u&&u({isFullyOpened:t,isFullyClosed:r,isOpened:o,containerHeight:a,contentHeight:i})}}}),l(i(n),"onRefContainer",function(e){n.container=e}),l(i(n),"onRefContent",function(e){n.content=e}),e.initialStyle?n.initialStyle=e.initialStyle:n.initialStyle=e.isOpened?{height:"auto",overflow:"initial"}:{height:"0px",overflow:"hidden"},n}return r(s,[{key:"componentDidMount",value:function(){this.onResize()}},{key:"shouldComponentUpdate",value:function(e){var t=this.props,n=t.theme,r=t.isOpened;return t.children!==e.children||r!==e.isOpened||Object.keys(n).some(function(t){return n[t]!==e.theme[t]})}},{key:"getSnapshotBeforeUpdate",value:function(){if(!this.container||!this.content)return null;if("auto"===this.container.style.height){var e=this.content.clientHeight;this.container.style.height="".concat(e,"px")}return null}},{key:"componentDidUpdate",value:function(){this.onResize()}},{key:"componentWillUnmount",value:function(){clearTimeout(this.timeout)}},{key:"render",value:function(){var e=this.props,t=e.theme,r=e.children,o=e.isOpened;return n.default.createElement("div",{ref:this.onRefContainer,className:t.collapse,style:this.initialStyle,"aria-hidden":!o},n.default.createElement("div",{ref:this.onRefContent,className:t.content},r))}}]),s}(n.default.Component);return fO.Collapse=u,l(u,"defaultProps",{theme:{collapse:"ReactCollapse--collapse",content:"ReactCollapse--content"},initialStyle:void 0,onRest:void 0,onWork:void 0,checkTimeout:50}),fO}var hO,mO,gO,yO={};function vO(){if(hO)return yO;function e(t){return e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},e(t)}hO=1,Object.defineProperty(yO,"__esModule",{value:!0}),yO.UnmountClosed=void 0;var t,n=(t=f())&&t.__esModule?t:{default:t},r=pO(),o=["isOpened"],a=["isOpened"];function i(){return i=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e},i.apply(this,arguments)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function l(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach(function(t){g(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function u(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}function c(e,t,n){return t&&function(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}(e.prototype,t),e}function d(e,t){return d=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},d(e,t)}function p(t){var n=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(e){return!1}}();return function(){var r,o=m(t);if(n){var a=m(this).constructor;r=Reflect.construct(o,arguments,a)}else r=o.apply(this,arguments);return function(t,n){if(n&&("object"===e(n)||"function"==typeof n))return n;if(void 0!==n)throw new TypeError("Derived constructors may only return object or undefined");return h(t)}(this,r)}}function h(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function m(e){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},m(e)}function g(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var y=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&d(e,t)}(s,e);var t=p(s);function s(e){var n;return function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),g(h(n=t.call(this,e)),"onWork",function(e){var t=e.isOpened,r=u(e,o);n.setState({isResting:!1,isOpened:t});var a=n.props.onWork;a&&a(l({isOpened:t},r))}),g(h(n),"onRest",function(e){var t=e.isOpened,r=u(e,a);n.setState({isResting:!0,isOpened:t,isInitialRender:!1});var o=n.props.onRest;o&&o(l({isOpened:t},r))}),g(h(n),"getInitialStyle",function(){var e=n.state,t=e.isOpened;return e.isInitialRender&&t?{height:"auto",overflow:"initial"}:{height:"0px",overflow:"hidden"}}),n.state={isResting:!0,isOpened:e.isOpened,isInitialRender:!0},n}return c(s,[{key:"componentDidUpdate",value:function(e){var t=this.props.isOpened;e.isOpened!==t&&this.setState({isResting:!1,isOpened:t,isInitialRender:!1})}},{key:"render",value:function(){var e=this.state,t=e.isResting,o=e.isOpened;return t&&!o?null:n.default.createElement(r.Collapse,i({},this.props,{initialStyle:this.getInitialStyle(),onWork:this.onWork,onRest:this.onRest}))}}]),s}(n.default.PureComponent);return yO.UnmountClosed=y,g(y,"defaultProps",{onWork:void 0,onRest:void 0}),yO}var bO=function(){if(gO)return mO;gO=1;var e=pO().Collapse,t=vO().UnmountClosed;return mO=t,t.Collapse=e,t.UnmountClosed=t,mO}();function wO({loading:e,data:t,meta:n}){const r=t?.otherscount?.map(e=>{const n=e.name;return{type:n,value:t?.result_array?.[n]?.total_selling_price??0}}),o=[{type:t?.result_array?.Retail?.pricegroup??t?.default,value:t?.result_array?.Retail?.total_selling_price??0},...r||[]],a=t?.otherscount?.map(e=>{const n=e.name;return{type:n,value:t?.result_array?.[n]?.total_profit??0}}),i=[{type:t?.result_array?.Retail?.pricegroup??t?.default,value:t?.result_array?.Retail?.total_profit??0},...a||[]],[s,l]=D.useState({type:o?.[0].type,value:o?.[0].value}),[u,c]=D.useState({type:i?.[0].type,value:i?.[0].value});M.useEffect(()=>{l({type:o?.[0].type,value:o?.[0].value}),c({type:i?.[0].type,value:i?.[0].value})},[e]);const d=[{label:"Total No. of Unique Item",count:Intl.NumberFormat().format(n?.total??0),desc:`With ${t?.unit_count??0} unit(s)`,icon:m.jsx("div",{className:"shrink-0 rounded-lg \r\n \r\n bg-[#EFF5FF] w-12 h-12 flex items-center justify-center border border-[#EDEEF1]",children:Jy.cube})},{label:"Total Cost Price",count:rv(t?.result_array?.Retail?.total_cost??0),desc:"Takes into Account FIFO & LIFO ",icon:m.jsx("div",{className:"shrink-0 rounded-lg bg-[#F9DFDD] w-12 h-12 flex items-center justify-center border border-[#EDEEF1]",children:M.cloneElement(Jy.price_tag,{fill:"#ED7400"})})},{label:"Total Selling Price",count:rv(s.value),desc:m.jsxs("p",{className:"flex gap-2 items-center flex-wrap",children:["Showing ",s.type," price"," ",m.jsxs(Fd,{children:[m.jsx(Ld,{asChild:!0,children:m.jsxs("button",{className:"rounded-lg h-8 flex items-center justify-between p-3 font-semibold text-xs text-gray-600 outline-none border border-gray-300 gap-2.5 capitalize bg-[#F9F9F9]",children:["change",m.jsx("span",{className:"rotate-90",children:Jy.arrow})]})}),m.jsx(zd,{align:"start",className:"flex flex-col gap-2.5 rounded-xl border-gray-200 py-2.5 w-[210px]",children:o.map((e,t)=>m.jsx($d,{className:Ko("capitalize focus:bg-primary_light rounded-md focus:text-primary font-semibold text-sm cursor-pointer px-[15px] flex items-center gap-[5px] \n \n ",e.type===s.type?"bg-primary_light text-primary":null),onClick:()=>l(t=>({...t,value:e.value,type:e.type})),children:e.type},t))})]})]}),icon:m.jsx("div",{className:"shrink-0 rounded-lg bg-[#D8CDF4] w-12 h-12 flex items-center justify-center border border-[#EDEEF1]",children:M.cloneElement(Jy.price_tag,{fill:"#9747FF"})})},{label:"Profit to be made",count:rv(u.value),desc:m.jsxs("p",{className:"flex gap-2 items-center flex-wrap",children:["Showing ",u.type," price"," ",m.jsxs(Fd,{children:[m.jsx(Ld,{asChild:!0,children:m.jsxs("button",{className:"rounded-lg h-8 flex items-center justify-between p-3 font-semibold text-xs text-gray-600 outline-none border border-gray-300 gap-2.5 capitalize bg-[#F9F9F9]",children:["change",m.jsx("span",{className:"rotate-90",children:Jy.arrow})]})}),m.jsx(zd,{align:"start",className:"flex flex-col gap-2.5 rounded-xl border-gray-200 py-2.5 w-[210px]",children:i.map((e,t)=>m.jsx($d,{className:Ko("capitalize focus:bg-primary_light rounded-md focus:text-primary font-semibold text-sm cursor-pointer px-[15px] flex items-center gap-[5px] \n \n ",e.type===u.type?"bg-primary_light text-primary":null),onClick:()=>c(t=>({...t,value:e.value,type:e.type})),children:e.type},t))})]})]}),icon:m.jsx("div",{className:"shrink-0 rounded-lg bg-[#C6E3D2] w-12 h-12 flex items-center justify-center border border-[#EDEEF1]",children:M.cloneElement(Jy.price_tag,{fill:"#378C5A"})})}],[f,p]=D.useState(!1);return m.jsxs(tS,{className:"bg-[#F6F8FA] p-2.5 flex flex-col",children:[m.jsxs("div",{className:"flex justify-between",children:[m.jsx("h1",{className:"capitalize text-dark font-semibold text-lg",children:"Items overview"}),m.jsxs("button",{className:"rounded-lg h-8 flex items-center justify-between p-3 font-semibold text-xs text-gray-600 outline-none border border-gray-300 gap-2.5 capitalize bg-white",onClick:()=>p(!f),children:[f?"Close":"Open"," ",m.jsx("span",{className:"rotate-90",children:Jy.arrow})]})]}),m.jsx(bO.Collapse,{isOpened:f,children:m.jsx("div",{className:"flex flex-wrap gap-2.5 mt-3",children:d.map((t,n)=>m.jsxs("div",{className:Ko("border rounded-xl border-[#E4E7EC] p-4 flex flex-col relative bg-right-bottom bg-no-repeat flex-auto",0===n?"bg-[#E4EEFA] bg-[url('/assets/images/ecstacy1.svg')]":1===n?"bg-[#FAEAE9] bg-[url('/assets/images/ecstacy2.svg')]":2===n?"bg-[#EEE9FA] bg-[url('/assets/images/ecstacy3.svg')]":3===n?"bg-[#EBF5EF] bg-[url('/assets/images/ecstacy4.svg')]":null),children:[m.jsxs("div",{className:"flex justify-between gap-1",children:[m.jsx("h1",{className:"text-dark text-sm font-medium",children:t.label}),m.jsx("div",{className:"shrink-0",children:t.icon})]}),m.jsxs("div",{className:"flex flex-col gap-1",children:[e?m.jsx(na,{className:"w-28 h-6 rounded"}):m.jsx("h1",{className:Ko("text-dark font-bold text-[29px] truncate",n===d.length-1&&u.value<0?"text-danger":null),title:t.count,children:t.count}),m.jsx("div",{className:"text-gray-700 text-sm font-medium ",children:t.desc})]})]},n))})})]})}function xO({placeholder:e,className:t,inputClass:n,...r}){return m.jsxs("div",{className:Ko("h-12 border border-gray-300 rounded-md w-[320px] flex",t),children:[m.jsx("span",{className:"bg-gray-200 w-9.5 flex items-center justify-center shrink-0 rounded-l-md ",children:Jy.magnifier}),m.jsx("input",{type:"search",placeholder:e,className:"w-full px-3 text-dark text-sm font-medium bg-transparent outline-none rounded-r-md",...r})]})}function SO(e,t){return e===t}function CO(e,t,n){var r=SO,o=D.useRef(e),a=D.useState({})[1],i=function(e,t,n,r){var o=this,a=D.useRef(null),i=D.useRef(0),s=D.useRef(0),l=D.useRef(null),u=D.useRef([]),c=D.useRef(),d=D.useRef(),f=D.useRef(e),p=D.useRef(!0);f.current=e;var h="undefined"!=typeof window,m=!t&&0!==t&&h;if("function"!=typeof e)throw new TypeError("Expected a function");t=+t||0;var g=!!(n=n||{}).leading,y=!("trailing"in n)||!!n.trailing,v="maxWait"in n,b="debounceOnServer"in n&&!!n.debounceOnServer,w=v?Math.max(+n.maxWait||0,t):null;D.useEffect(function(){return p.current=!0,function(){p.current=!1}},[]);var x=D.useMemo(function(){var e=function(e){var t=u.current,n=c.current;return u.current=c.current=null,i.current=e,s.current=s.current||e,d.current=f.current.apply(n,t)},n=function(e,t){m&&cancelAnimationFrame(l.current),l.current=m?requestAnimationFrame(e):setTimeout(e,t)},x=function(e){if(!p.current)return!1;var n=e-a.current;return!a.current||n>=t||n<0||v&&e-i.current>=w},S=function(t){return l.current=null,y&&u.current?e(t):(u.current=c.current=null,d.current)},C=function e(){var r=Date.now();if(g&&s.current===i.current&&k(),x(r))return S(r);if(p.current){var o=t-(r-a.current),l=v?Math.min(o,w-(r-i.current)):o;n(e,l)}},k=function(){r&&r({})},_=function(){if(h||b){var r=Date.now(),s=x(r);if(u.current=[].slice.call(arguments),c.current=o,a.current=r,s){if(!l.current&&p.current)return i.current=a.current,n(C,t),g?e(a.current):d.current;if(v)return n(C,t),e(a.current)}return l.current||n(C,t),d.current}};return _.cancel=function(){var e=l.current;e&&(m?cancelAnimationFrame(l.current):clearTimeout(l.current)),i.current=0,u.current=a.current=c.current=l.current=null,e&&r&&r({})},_.isPending=function(){return!!l.current},_.flush=function(){return l.current?S(Date.now()):d.current},_},[g,v,t,w,y,m,h,b,r]);return x}(D.useCallback(function(e){o.current=e,a({})},[a]),t,n,a),s=D.useRef(e);return r(s.current,e)||(i(e),s.current=e),[o.current,i]}function kO({placeholder:e,searchPlaceholder:t,options:n=[],showMultiSelectValues:r=!0,values:o,onChange:a,className:i,showCheckMark:s=!0,label:l,labelClass:u,required:c,info:d,optional:f,actionLabel:p,actionLabelAction:h,actionLabelInfo:g,removeSelectedValue:y,removeTag:v,loading:b,showCount:w,error:x}){const[S,C]=D.useState(!1),[k,_]=D.useState(0),E=D.useRef(null);D.useEffect(()=>{const e=()=>{E.current&&_(E?.current?.offsetWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[E]);const j=e=>{const t=o?.includes(e)?o?.filter(t=>t!==e):[...o||[],e];a&&a(t)};D.useEffect(()=>{y&&j(y)},[y]);const[O,N]=D.useState(null),R=e=>{N(t=>t===e?null:e)},P=e=>{for(let t of n){if(t.value===e)return t.label;if(t.subOptions){const n=t.subOptions.find(t=>t.value===e);if(n)return n.label}}return null};return m.jsx("div",{ref:E,children:b?m.jsx(na,{className:"w-full h-[48px]"}):m.jsxs("div",{className:Ko("flex flex-col gap-2.5",i),children:[m.jsxs("div",{className:"flex justify-between gap-2 flex-wrap",children:[l&&m.jsxs("label",{className:Ko("text-black flex items-center gap-1 first-letter:uppercase text-sm font-medium",u),children:[l," ",c?m.jsx("span",{className:"text-[#E12D39]",children:l&&"*"}):f?m.jsx("span",{className:"text-[#B5B5B5] font-normal",children:"(optional)"}):null,d&&m.jsx(kv,{fieldName:l,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:d})})]}),p&&m.jsxs("button",{onClick:h,className:"text-primary flex items-center gap-1 first-letter:uppercase text-sm font-medium",children:[p,g&&m.jsx(kv,{fieldName:l,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:g})})]})]}),m.jsxs($C,{modal:!0,open:S,onOpenChange:C,children:[m.jsx(HC,{asChild:!0,children:m.jsxs(UC,{variant:"outline",role:"combobox","aria-expanded":S,className:Ko(`w-full h-[48px] justify-between border focus:border-primary border-neutral-200 bg-white hover:bg-white hover:border-[#BFD7FE] ${x&&"!border-danger"}`,r?"h-auto py-3":null,i),children:[m.jsx("div",{className:"flex gap-2 text-[#5E6278] justify-start first-letter:uppercase flex-wrap",children:o?.length&&r?o.map((e,t)=>m.jsxs("div",{onClick:()=>{v||j(e),R(e)},className:"px-2 py-1 text-black flex items-center justify-between rounded gap-2 border bg-slate-200 text-xs font-medium",children:[m.jsx("span",{className:"flex justify-start text-start flex-wrap gap-2 whitespace-normal",children:P(e)}),m.jsx("span",{className:"",children:m.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M5.44001 4.49978L7.83334 2.12644C7.96064 1.99737 8.03146 1.82301 8.03021 1.64173C8.02896 1.46044 7.95575 1.28708 7.82667 1.15978C7.6976 1.03247 7.52324 0.961657 7.34196 0.962907C7.16067 0.964157 6.98731 1.03737 6.86001 1.16644L4.50001 3.55978L2.14001 1.21311C2.0151 1.08894 1.84613 1.01925 1.67001 1.01925C1.49388 1.01925 1.32492 1.08894 1.20001 1.21311C1.13752 1.27509 1.08793 1.34882 1.05408 1.43006C1.02023 1.5113 1.00281 1.59844 1.00281 1.68644C1.00281 1.77445 1.02023 1.86159 1.05408 1.94283C1.08793 2.02407 1.13752 2.0978 1.20001 2.15978L3.56001 4.49978L1.16667 6.87311C1.03937 7.00218 0.968554 7.17654 0.969804 7.35782C0.971054 7.53911 1.04427 7.71247 1.17334 7.83978C1.30241 7.96708 1.47677 8.0379 1.65805 8.03665C1.83934 8.0354 2.0127 7.96218 2.14001 7.83311L4.50001 5.43978L6.86001 7.78644C6.98492 7.91061 7.15388 7.98031 7.33001 7.98031C7.50613 7.98031 7.6751 7.91061 7.80001 7.78644C7.86249 7.72447 7.91209 7.65073 7.94594 7.56949C7.97978 7.48826 7.99721 7.40112 7.99721 7.31311C7.99721 7.2251 7.97978 7.13797 7.94594 7.05673C7.91209 6.97549 7.86249 6.90175 7.80001 6.83978L5.44001 4.49978Z",fill:"black"})})})]},t)):!r&&w&&o.length>0?`${o.length} ${l} selected`:e??"Select..."}),m.jsx(Dd,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),m.jsx(VC,{align:"start",style:{width:k},className:"w-[480px] p-0 bg-white rounded-xl border-gray-200",children:m.jsxs(cC,{children:[m.jsx(dC,{className:"placeholder:text-xs",placeholder:t??"Search..."}),m.jsx(pC,{children:"No result found."}),m.jsx(hC,{children:m.jsx(fC,{className:"",children:n?.map((e,t)=>m.jsxs("div",{children:[m.jsxs(mC,{value:"string"==typeof e.label?e.label:e.searchId,className:`first-letter:uppercase mb-1 focus:bg-primary_light w-full rounded-md focus:text-primary hover:text-primary font-semibold text-gray-700 text-sm cursor-pointer ${o?.includes(e.value)&&"bg-primary_light text-primary"}`,onSelect:()=>{j(e.value),e?.subOptions&&e?.subOptions?.length>0&&R(e.value)},children:[s&&m.jsx(Nd,{className:Ko("mr-2 h-4 w-4",o?.includes(e.value)?"opacity-100":"opacity-0")}),m.jsxs("p",{className:"flex justify-between w-full",children:[e.label,e?.subOptions&&e?.subOptions?.length>0&&m.jsx(Rd,{className:"ml-2 h-5 w-5 font-bold shrink-0 opacity-50"})]})]}),O===e.value&&e?.subOptions&&e?.subOptions?.map((e,t)=>m.jsxs(mC,{value:"string"==typeof e.label?e.label:e.searchId,className:`first-letter:uppercase mb-1 focus:bg-primary_light w-full rounded-md focus:text-primary hover:text-primary font-semibold text-gray-700 text-sm cursor-pointer pl-6 ${o?.includes(e.value)&&"bg-primary_light text-primary"}`,onSelect:()=>{j(e.value)},children:[s&&m.jsx(Nd,{className:Ko("mr-2 h-4 w-4",o?.includes(e.value)?"opacity-100":"opacity-0")}),e.label]},t))]},t))})})]})})]}),x&&m.jsx("p",{className:"text-danger text-xs font-normal",children:x})]})})}var _O="ScrollArea",[EO]=sa(_O),[jO,OO]=EO(_O),NO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,type:r="hover",dir:o,scrollHideDelay:a=600,...i}=e,[s,l]=D.useState(null),[u,c]=D.useState(null),[d,f]=D.useState(null),[p,h]=D.useState(null),[g,y]=D.useState(null),[v,b]=D.useState(0),[w,x]=D.useState(0),[S,C]=D.useState(!1),[k,_]=D.useState(!1),E=ia(t,e=>l(e)),j=Ca(o);return m.jsx(jO,{scope:n,type:r,dir:j,scrollHideDelay:a,scrollArea:s,viewport:u,onViewportChange:c,content:d,onContentChange:f,scrollbarX:p,onScrollbarXChange:h,scrollbarXEnabled:S,onScrollbarXEnabledChange:C,scrollbarY:g,onScrollbarYChange:y,scrollbarYEnabled:k,onScrollbarYEnabledChange:_,onCornerWidthChange:b,onCornerHeightChange:x,children:m.jsx(ba.div,{dir:j,...i,ref:E,style:{position:"relative","--radix-scroll-area-corner-width":v+"px","--radix-scroll-area-corner-height":w+"px",...e.style}})})});NO.displayName=_O;var RO="ScrollAreaViewport",PO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,children:r,nonce:o,...a}=e,i=OO(RO,n),s=ia(t,D.useRef(null),i.onViewportChange);return m.jsxs(m.Fragment,{children:[m.jsx("style",{dangerouslySetInnerHTML:{__html:"[data-radix-scroll-area-viewport]{scrollbar-width:none;-ms-overflow-style:none;-webkit-overflow-scrolling:touch;}[data-radix-scroll-area-viewport]::-webkit-scrollbar{display:none}"},nonce:o}),m.jsx(ba.div,{"data-radix-scroll-area-viewport":"",...a,ref:s,style:{overflowX:i.scrollbarXEnabled?"scroll":"hidden",overflowY:i.scrollbarYEnabled?"scroll":"hidden",...e.style},children:m.jsx("div",{ref:i.onContentChange,style:{minWidth:"100%",display:"table"},children:r})})]})});PO.displayName=RO;var TO="ScrollAreaScrollbar",DO=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OO(TO,e.__scopeScrollArea),{onScrollbarXEnabledChange:a,onScrollbarYEnabledChange:i}=o,s="horizontal"===e.orientation;return D.useEffect(()=>(s?a(!0):i(!0),()=>{s?a(!1):i(!1)}),[s,a,i]),"hover"===o.type?m.jsx(MO,{...r,ref:t,forceMount:n}):"scroll"===o.type?m.jsx(IO,{...r,ref:t,forceMount:n}):"auto"===o.type?m.jsx(AO,{...r,ref:t,forceMount:n}):"always"===o.type?m.jsx(FO,{...r,ref:t}):null});DO.displayName=TO;var MO=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OO(TO,e.__scopeScrollArea),[a,i]=D.useState(!1);return D.useEffect(()=>{const e=o.scrollArea;let t=0;if(e){const n=()=>{window.clearTimeout(t),i(!0)},r=()=>{t=window.setTimeout(()=>i(!1),o.scrollHideDelay)};return e.addEventListener("pointerenter",n),e.addEventListener("pointerleave",r),()=>{window.clearTimeout(t),e.removeEventListener("pointerenter",n),e.removeEventListener("pointerleave",r)}}},[o.scrollArea,o.scrollHideDelay]),m.jsx(cl,{present:n||a,children:m.jsx(AO,{"data-state":a?"visible":"hidden",...r,ref:t})})}),IO=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=OO(TO,e.__scopeScrollArea),a="horizontal"===e.orientation,i=nN(()=>l("SCROLL_END"),100),[s,l]=function(e,t){return D.useReducer((e,n)=>t[e][n]??e,e)}("hidden",{hidden:{SCROLL:"scrolling"},scrolling:{SCROLL_END:"idle",POINTER_ENTER:"interacting"},interacting:{SCROLL:"interacting",POINTER_LEAVE:"idle"},idle:{HIDE:"hidden",SCROLL:"scrolling",POINTER_ENTER:"interacting"}});return D.useEffect(()=>{if("idle"===s){const e=window.setTimeout(()=>l("HIDE"),o.scrollHideDelay);return()=>window.clearTimeout(e)}},[s,o.scrollHideDelay,l]),D.useEffect(()=>{const e=o.viewport,t=a?"scrollLeft":"scrollTop";if(e){let n=e[t];const r=()=>{const r=e[t];n!==r&&(l("SCROLL"),i()),n=r};return e.addEventListener("scroll",r),()=>e.removeEventListener("scroll",r)}},[o.viewport,a,l,i]),m.jsx(cl,{present:n||"hidden"!==s,children:m.jsx(FO,{"data-state":"hidden"===s?"hidden":"visible",...r,ref:t,onPointerEnter:ra(e.onPointerEnter,()=>l("POINTER_ENTER")),onPointerLeave:ra(e.onPointerLeave,()=>l("POINTER_LEAVE"))})})}),AO=D.forwardRef((e,t)=>{const n=OO(TO,e.__scopeScrollArea),{forceMount:r,...o}=e,[a,i]=D.useState(!1),s="horizontal"===e.orientation,l=nN(()=>{if(n.viewport){const e=n.viewport.offsetWidth<n.viewport.scrollWidth,t=n.viewport.offsetHeight<n.viewport.scrollHeight;i(s?e:t)}},10);return rN(n.viewport,l),rN(n.content,l),m.jsx(cl,{present:r||a,children:m.jsx(FO,{"data-state":a?"visible":"hidden",...o,ref:t})})}),FO=D.forwardRef((e,t)=>{const{orientation:n="vertical",...r}=e,o=OO(TO,e.__scopeScrollArea),a=D.useRef(null),i=D.useRef(0),[s,l]=D.useState({content:0,viewport:0,scrollbar:{size:0,paddingStart:0,paddingEnd:0}}),u=QO(s.viewport,s.content),c={...r,sizes:s,onSizesChange:l,hasThumb:Boolean(u>0&&u<1),onThumbChange:e=>a.current=e,onThumbPointerUp:()=>i.current=0,onThumbPointerDown:e=>i.current=e};function d(e,t){return function(e,t,n,r="ltr"){const o=XO(n),a=o/2,i=t||a,s=o-i,l=n.scrollbar.paddingStart+i,u=n.scrollbar.size-n.scrollbar.paddingEnd-s,c=n.content-n.viewport,d="ltr"===r?[0,c]:[-1*c,0];return JO([l,u],d)(e)}(e,i.current,s,t)}return"horizontal"===n?m.jsx(LO,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const e=ZO(o.viewport.scrollLeft,s,o.dir);a.current.style.transform=`translate3d(${e}px, 0, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollLeft=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollLeft=d(e,o.dir))}}):"vertical"===n?m.jsx(zO,{...c,ref:t,onThumbPositionChange:()=>{if(o.viewport&&a.current){const e=ZO(o.viewport.scrollTop,s);a.current.style.transform=`translate3d(0, ${e}px, 0)`}},onWheelScroll:e=>{o.viewport&&(o.viewport.scrollTop=e)},onDragScroll:e=>{o.viewport&&(o.viewport.scrollTop=d(e))}}):null}),LO=D.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=OO(TO,e.__scopeScrollArea),[i,s]=D.useState(),l=D.useRef(null),u=ia(t,l,a.onScrollbarXChange);return D.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),m.jsx(VO,{"data-orientation":"horizontal",...o,ref:u,sizes:n,style:{bottom:0,left:"rtl"===a.dir?"var(--radix-scroll-area-corner-width)":0,right:"ltr"===a.dir?"var(--radix-scroll-area-corner-width)":0,"--radix-scroll-area-thumb-width":XO(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.x),onDragScroll:t=>e.onDragScroll(t.x),onWheelScroll:(t,n)=>{if(a.viewport){const r=a.viewport.scrollLeft+t.deltaX;e.onWheelScroll(r),eN(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&r({content:a.viewport.scrollWidth,viewport:a.viewport.offsetWidth,scrollbar:{size:l.current.clientWidth,paddingStart:KO(i.paddingLeft),paddingEnd:KO(i.paddingRight)}})}})}),zO=D.forwardRef((e,t)=>{const{sizes:n,onSizesChange:r,...o}=e,a=OO(TO,e.__scopeScrollArea),[i,s]=D.useState(),l=D.useRef(null),u=ia(t,l,a.onScrollbarYChange);return D.useEffect(()=>{l.current&&s(getComputedStyle(l.current))},[l]),m.jsx(VO,{"data-orientation":"vertical",...o,ref:u,sizes:n,style:{top:0,right:"ltr"===a.dir?0:void 0,left:"rtl"===a.dir?0:void 0,bottom:"var(--radix-scroll-area-corner-height)","--radix-scroll-area-thumb-height":XO(n)+"px",...e.style},onThumbPointerDown:t=>e.onThumbPointerDown(t.y),onDragScroll:t=>e.onDragScroll(t.y),onWheelScroll:(t,n)=>{if(a.viewport){const r=a.viewport.scrollTop+t.deltaY;e.onWheelScroll(r),eN(r,n)&&t.preventDefault()}},onResize:()=>{l.current&&a.viewport&&i&&r({content:a.viewport.scrollHeight,viewport:a.viewport.offsetHeight,scrollbar:{size:l.current.clientHeight,paddingStart:KO(i.paddingTop),paddingEnd:KO(i.paddingBottom)}})}})}),[$O,HO]=EO(TO),VO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,sizes:r,hasThumb:o,onThumbChange:a,onThumbPointerUp:i,onThumbPointerDown:s,onThumbPositionChange:l,onDragScroll:u,onWheelScroll:c,onResize:d,...f}=e,p=OO(TO,n),[h,g]=D.useState(null),y=ia(t,e=>g(e)),v=D.useRef(null),b=D.useRef(""),w=p.viewport,x=r.content-r.viewport,S=ka(c),C=ka(l),k=nN(d,10);function _(e){if(v.current){const t=e.clientX-v.current.left,n=e.clientY-v.current.top;u({x:t,y:n})}}return D.useEffect(()=>{const e=e=>{const t=e.target,n=h?.contains(t);n&&S(e,x)};return document.addEventListener("wheel",e,{passive:!1}),()=>document.removeEventListener("wheel",e,{passive:!1})},[w,h,x,S]),D.useEffect(C,[r,C]),rN(h,k),rN(p.content,k),m.jsx($O,{scope:n,scrollbar:h,hasThumb:o,onThumbChange:ka(a),onThumbPointerUp:ka(i),onThumbPositionChange:C,onThumbPointerDown:ka(s),children:m.jsx(ba.div,{...f,ref:y,style:{position:"absolute",...f.style},onPointerDown:ra(e.onPointerDown,e=>{if(0===e.button){e.target.setPointerCapture(e.pointerId),v.current=h.getBoundingClientRect(),b.current=document.body.style.webkitUserSelect,document.body.style.webkitUserSelect="none",p.viewport&&(p.viewport.style.scrollBehavior="auto"),_(e)}}),onPointerMove:ra(e.onPointerMove,_),onPointerUp:ra(e.onPointerUp,e=>{const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),document.body.style.webkitUserSelect=b.current,p.viewport&&(p.viewport.style.scrollBehavior=""),v.current=null})})})}),BO="ScrollAreaThumb",UO=D.forwardRef((e,t)=>{const{forceMount:n,...r}=e,o=HO(BO,e.__scopeScrollArea);return m.jsx(cl,{present:n||o.hasThumb,children:m.jsx(WO,{ref:t,...r})})}),WO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,style:r,...o}=e,a=OO(BO,n),i=HO(BO,n),{onThumbPositionChange:s}=i,l=ia(t,e=>i.onThumbChange(e)),u=D.useRef(void 0),c=nN(()=>{u.current&&(u.current(),u.current=void 0)},100);return D.useEffect(()=>{const e=a.viewport;if(e){const t=()=>{if(c(),!u.current){const t=tN(e,s);u.current=t,s()}};return s(),e.addEventListener("scroll",t),()=>e.removeEventListener("scroll",t)}},[a.viewport,c,s]),m.jsx(ba.div,{"data-state":i.hasThumb?"visible":"hidden",...o,ref:l,style:{width:"var(--radix-scroll-area-thumb-width)",height:"var(--radix-scroll-area-thumb-height)",...r},onPointerDownCapture:ra(e.onPointerDownCapture,e=>{const t=e.target.getBoundingClientRect(),n=e.clientX-t.left,r=e.clientY-t.top;i.onThumbPointerDown({x:n,y:r})}),onPointerUp:ra(e.onPointerUp,i.onThumbPointerUp)})});UO.displayName=BO;var qO="ScrollAreaCorner",YO=D.forwardRef((e,t)=>{const n=OO(qO,e.__scopeScrollArea),r=Boolean(n.scrollbarX&&n.scrollbarY);return"scroll"!==n.type&&r?m.jsx(GO,{...e,ref:t}):null});YO.displayName=qO;var GO=D.forwardRef((e,t)=>{const{__scopeScrollArea:n,...r}=e,o=OO(qO,n),[a,i]=D.useState(0),[s,l]=D.useState(0),u=Boolean(a&&s);return rN(o.scrollbarX,()=>{const e=o.scrollbarX?.offsetHeight||0;o.onCornerHeightChange(e),l(e)}),rN(o.scrollbarY,()=>{const e=o.scrollbarY?.offsetWidth||0;o.onCornerWidthChange(e),i(e)}),u?m.jsx(ba.div,{...r,ref:t,style:{width:a,height:s,position:"absolute",right:"ltr"===o.dir?0:void 0,left:"rtl"===o.dir?0:void 0,bottom:0,...e.style}}):null});function KO(e){return e?parseInt(e,10):0}function QO(e,t){const n=e/t;return isNaN(n)?0:n}function XO(e){const t=QO(e.viewport,e.content),n=e.scrollbar.paddingStart+e.scrollbar.paddingEnd,r=(e.scrollbar.size-n)*t;return Math.max(r,18)}function ZO(e,t,n="ltr"){const r=XO(t),o=t.scrollbar.paddingStart+t.scrollbar.paddingEnd,a=t.scrollbar.size-o,i=t.content-t.viewport,s=a-r,l=FE(e,"ltr"===n?[0,i]:[-1*i,0]);return JO([0,i],[0,s])(l)}function JO(e,t){return n=>{if(e[0]===e[1]||t[0]===t[1])return t[0];const r=(t[1]-t[0])/(e[1]-e[0]);return t[0]+r*(n-e[0])}}function eN(e,t){return e>0&&e<t}var tN=(e,t=()=>{})=>{let n={left:e.scrollLeft,top:e.scrollTop},r=0;return function o(){const a={left:e.scrollLeft,top:e.scrollTop},i=n.left!==a.left,s=n.top!==a.top;(i||s)&&t(),n=a,r=window.requestAnimationFrame(o)}(),()=>window.cancelAnimationFrame(r)};function nN(e,t){const n=ka(e),r=D.useRef(0);return D.useEffect(()=>()=>window.clearTimeout(r.current),[]),D.useCallback(()=>{window.clearTimeout(r.current),r.current=window.setTimeout(n,t)},[n,t])}function rN(e,t){const n=ka(t);ua(()=>{let t=0;if(e){const r=new ResizeObserver(()=>{cancelAnimationFrame(t),t=window.requestAnimationFrame(n)});return r.observe(e),()=>{window.cancelAnimationFrame(t),r.unobserve(e)}}},[e,n])}var oN=NO,aN=PO,iN=YO;const sN=D.forwardRef(({className:e,children:t,...n},r)=>m.jsxs(oN,{ref:r,className:Ko("relative overflow-hidden",e),...n,children:[m.jsx(aN,{className:"h-full w-full rounded-[inherit]",children:t}),m.jsx(lN,{}),m.jsx(iN,{})]}));sN.displayName=oN.displayName;const lN=D.forwardRef(({className:e,orientation:t="vertical",...n},r)=>m.jsx(DO,{ref:r,orientation:t,className:Ko("flex touch-none select-none transition-colors","vertical"===t&&"h-full w-2.5 border-l border-l-transparent p-[1px]","horizontal"===t&&"h-2.5 flex-col border-t border-t-transparent p-[1px]",e),...n,children:m.jsx(UO,{className:"relative flex-1 rounded-full bg-neutral-200 dark:bg-neutral-800"})}));function uN({placeholder:e,searchPlaceholder:t,options:n=[],showMultiSelectValues:r=!0,values:o,onChange:a,className:i,showCheckMark:s=!0,label:l,labelClass:u,required:c,info:d,optional:f,actionLabel:p,actionLabelAction:h,actionLabelInfo:g,removeSelectedValue:y,removeTag:v,loading:b,showCount:w,error:x,showError:S,onChangeSearch:C,searching:k,contentStyle:_,disabled:E,searchValue:j}){const[O,N]=D.useState(!1),[R,P]=D.useState(0),T=D.useRef(null);D.useEffect(()=>{const e=()=>{T.current&&P(T?.current?.offsetWidth)};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)},[]);const M=o?.filter(e=>""!==e),I=e=>{const t=M?.includes(e)?M?.filter(t=>t!==e):[...M||[],e];a&&a(t)};return D.useEffect(()=>{y&&I(y)},[y]),m.jsx(m.Fragment,{children:b?m.jsx(na,{className:"w-full h-[48px]"}):m.jsxs("div",{className:Ko("flex flex-col gap-2.5",i),children:[m.jsxs("div",{className:"flex justify-between gap-2 flex-wrap",children:[l&&m.jsxs("label",{className:Ko("text-black flex items-center gap-1 first-letter:uppercase text-sm font-medium",u),children:[l," ",c?m.jsx("span",{className:"text-[#E12D39]",children:l&&"*"}):f?m.jsx("span",{className:"text-[#B5B5B5] font-normal",children:"(optional)"}):null,d&&m.jsx(kv,{fieldName:l,children:m.jsx("p",{className:"font-normal first-letter:uppercase",children:d})})]}),p&&m.jsxs("button",{onClick:h,className:"text-primary flex items-center gap-1 first-letter:uppercase text-sm font-medium",children:[p,g&&m.jsx(kv,{fieldName:p,children:m.jsx("p",{className:"font-normal first-letter:uppercase text-left",children:g})})]})]}),m.jsxs($C,{modal:!0,open:O,onOpenChange:N,children:[m.jsx(HC,{disabled:E,asChild:!0,children:m.jsxs(UC,{ref:T,variant:"outline",role:"combobox","aria-expanded":O,className:Ko(`w-full h-[48px] justify-between border focus:border-primary border-neutral-200 bg-white hover:bg-white hover:border-[#BFD7FE] ${(x||S)&&"!border-danger"}`,r?"h-auto py-3":null,i),children:[m.jsx("div",{className:"flex gap-2 text-[#5E6278] justify-start first-letter:uppercase flex-wrap",children:M?.length>0&&r?M?.map((e,t)=>m.jsxs("div",{onClick:()=>{!v&&I(e)},className:"px-2 py-1 text-black flex items-center justify-between rounded gap-2 border bg-slate-200 text-xs font-medium",children:[n?.[0].searchId?n?.find(t=>t.value===e)?.searchId:n?.find(t=>t.value===e)?.label,m.jsx("span",{className:"",children:m.jsx("svg",{width:"9",height:"9",viewBox:"0 0 9 9",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:m.jsx("path",{d:"M5.44001 4.49978L7.83334 2.12644C7.96064 1.99737 8.03146 1.82301 8.03021 1.64173C8.02896 1.46044 7.95575 1.28708 7.82667 1.15978C7.6976 1.03247 7.52324 0.961657 7.34196 0.962907C7.16067 0.964157 6.98731 1.03737 6.86001 1.16644L4.50001 3.55978L2.14001 1.21311C2.0151 1.08894 1.84613 1.01925 1.67001 1.01925C1.49388 1.01925 1.32492 1.08894 1.20001 1.21311C1.13752 1.27509 1.08793 1.34882 1.05408 1.43006C1.02023 1.5113 1.00281 1.59844 1.00281 1.68644C1.00281 1.77445 1.02023 1.86159 1.05408 1.94283C1.08793 2.02407 1.13752 2.0978 1.20001 2.15978L3.56001 4.49978L1.16667 6.87311C1.03937 7.00218 0.968554 7.17654 0.969804 7.35782C0.971054 7.53911 1.04427 7.71247 1.17334 7.83978C1.30241 7.96708 1.47677 8.0379 1.65805 8.03665C1.83934 8.0354 2.0127 7.96218 2.14001 7.83311L4.50001 5.43978L6.86001 7.78644C6.98492 7.91061 7.15388 7.98031 7.33001 7.98031C7.50613 7.98031 7.6751 7.91061 7.80001 7.78644C7.86249 7.72447 7.91209 7.65073 7.94594 7.56949C7.97978 7.48826 7.99721 7.40112 7.99721 7.31311C7.99721 7.2251 7.97978 7.13797 7.94594 7.05673C7.91209 6.97549 7.86249 6.90175 7.80001 6.83978L5.44001 4.49978Z",fill:"black"})})})]},t)):!r&&w&&o.length>0?`${M.length} ${l} selected`:e??"Select..."}),m.jsx(Dd,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),m.jsx(VC,{align:"start",style:{width:R},className:Ko("w-[480px] p-0 bg-white rounded-xl border-gray-200",_),children:m.jsx(sN,{children:m.jsxs(cC,{children:[m.jsx(dC,{onChangeCapture:C,className:"placeholder:text-xs",placeholder:t??"Search..."}),k?m.jsx("div",{className:"flex flex-col gap-2 p-2",children:[1,2,3].map((e,t)=>m.jsx(na,{className:"h-9 rounded-md"},t))}):m.jsx(pC,{children:j?"No result found.":e}),m.jsx(hC,{children:m.jsx(fC,{className:"",children:n?.map(e=>m.jsxs(mC,{value:"string"==typeof e.label?e.label:e.searchId,className:`first-letter:uppercase mb-1 focus:bg-primary_light w-full rounded-md focus:text-primary hover:text-primary font-semibold text-gray-700 text-sm cursor-pointer ${o?.includes(e.value)&&"bg-primary_light text-primary"}`,onSelect:()=>{I(e.value)},children:[s&&m.jsx(Nd,{className:Ko("mr-2 h-4 w-4",o?.includes(e.value)?"opacity-100":"opacity-0")}),e.label]},e.value))})})]})})})]})]})})}lN.displayName=DO.displayName;const cN=D.createContext({dragDropManager:void 0});function dN(e){return"Minified Redux error #"+e+"; visit https://redux.js.org/Errors?code="+e+" for the full message or use the non-minified dev environment for full errors. "}var fN="function"==typeof Symbol&&Symbol.observable||"@@observable",pN=function(){return Math.random().toString(36).substring(7).split("").join(".")},hN={INIT:"@@redux/INIT"+pN(),REPLACE:"@@redux/REPLACE"+pN()};function mN(e,t,n){var r;if("function"==typeof t&&"function"==typeof n||"function"==typeof n&&"function"==typeof arguments[3])throw new Error(dN(0));if("function"==typeof t&&void 0===n&&(n=t,t=void 0),void 0!==n){if("function"!=typeof n)throw new Error(dN(1));return n(mN)(e,t)}if("function"!=typeof e)throw new Error(dN(2));var o=e,a=t,i=[],s=i,l=!1;function u(){s===i&&(s=i.slice())}function c(){if(l)throw new Error(dN(3));return a}function d(e){if("function"!=typeof e)throw new Error(dN(4));if(l)throw new Error(dN(5));var t=!0;return u(),s.push(e),function(){if(t){if(l)throw new Error(dN(6));t=!1,u();var n=s.indexOf(e);s.splice(n,1),i=null}}}function f(e){if(!function(e){if("object"!=typeof e||null===e)return!1;for(var t=e;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}(e))throw new Error(dN(7));if(void 0===e.type)throw new Error(dN(8));if(l)throw new Error(dN(9));try{l=!0,a=o(a,e)}finally{l=!1}for(var t=i=s,n=0;n<t.length;n++){(0,t[n])()}return e}return f({type:hN.INIT}),(r={dispatch:f,subscribe:d,getState:c,replaceReducer:function(e){if("function"!=typeof e)throw new Error(dN(10));o=e,f({type:hN.REPLACE})}})[fN]=function(){var e,t=d;return(e={subscribe:function(e){if("object"!=typeof e||null===e)throw new Error(dN(11));function n(){e.next&&e.next(c())}return n(),{unsubscribe:t(n)}}})[fN]=function(){return this},e},r}function gN(e,t,...n){if("undefined"!=typeof process&&"production"===process.env.NODE_ENV&&void 0===t)throw new Error("invariant requires an error message argument");if(!e){let e;if(void 0===t)e=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{let r=0;e=new Error(t.replace(/%s/g,function(){return n[r++]})),e.name="Invariant Violation"}throw e.framesToPop=1,e}}function yN(e){return"object"==typeof e}const vN="dnd-core/INIT_COORDS",bN="dnd-core/BEGIN_DRAG",wN="dnd-core/PUBLISH_DRAG_SOURCE",xN="dnd-core/HOVER",SN="dnd-core/DROP",CN="dnd-core/END_DRAG";function kN(e,t){return{type:vN,payload:{sourceClientOffset:t||null,clientOffset:e||null}}}const _N={type:vN,payload:{clientOffset:null,sourceClientOffset:null}};function EN(e){return function(t=[],n={publishSource:!0}){const{publishSource:r=!0,clientOffset:o,getSourceClientOffset:a}=n,i=e.getMonitor(),s=e.getRegistry();e.dispatch(kN(o)),function(e,t,n){gN(!t.isDragging(),"Cannot call beginDrag while dragging."),e.forEach(function(e){gN(n.getSource(e),"Expected sourceIds to be registered.")})}(t,i,s);const l=function(e,t){let n=null;for(let r=e.length-1;r>=0;r--)if(t.canDragSource(e[r])){n=e[r];break}return n}(t,i);if(null==l)return void e.dispatch(_N);let u=null;if(o){if(!a)throw new Error("getSourceClientOffset must be defined");!function(e){gN("function"==typeof e,"When clientOffset is provided, getSourceClientOffset must be a function.")}(a),u=a(l)}e.dispatch(kN(o,u));const c=s.getSource(l).beginDrag(i,l);if(null==c)return;!function(e){gN(yN(e),"Item must be an object.")}(c),s.pinSource(l);const d=s.getSourceType(l);return{type:bN,payload:{itemType:d,item:c,sourceId:l,clientOffset:o||null,sourceClientOffset:u||null,isSourcePublic:!!r}}}}function jN(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function ON(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){jN(e,t,n[t])})}return e}function NN(e){return function(t={}){const n=e.getMonitor(),r=e.getRegistry();!function(e){gN(e.isDragging(),"Cannot call drop while not dragging."),gN(!e.didDrop(),"Cannot call drop twice during one drag operation.")}(n);const o=function(e){const t=e.getTargetIds().filter(e.canDropOnTarget,e);return t.reverse(),t}(n);o.forEach((o,a)=>{const i=function(e,t,n,r){const o=n.getTarget(e);let a=o?o.drop(r,e):void 0;(function(e){gN(void 0===e||yN(e),"Drop result must either be an object or undefined.")})(a),void 0===a&&(a=0===t?{}:r.getDropResult());return a}(o,a,r,n),s={type:SN,payload:{dropResult:ON({},t,i)}};e.dispatch(s)})}}function RN(e){return function(){const t=e.getMonitor(),n=e.getRegistry();!function(e){gN(e.isDragging(),"Cannot call endDrag while not dragging.")}(t);const r=t.getSourceId();if(null!=r){n.getSource(r,!0).endDrag(t,r),n.unpinSource()}return{type:CN}}}function PN(e,t){return null===t?null===e:Array.isArray(e)?e.some(e=>e===t):e===t}function TN(e){return function(t,{clientOffset:n}={}){!function(e){gN(Array.isArray(e),"Expected targetIds to be an array.")}(t);const r=t.slice(0),o=e.getMonitor(),a=e.getRegistry();return function(e,t,n){for(let r=e.length-1;r>=0;r--){const o=e[r];PN(t.getTargetType(o),n)||e.splice(r,1)}}(r,a,o.getItemType()),function(e,t,n){gN(t.isDragging(),"Cannot call hover while not dragging."),gN(!t.didDrop(),"Cannot call hover after drop.");for(let t=0;t<e.length;t++){const r=e[t];gN(e.lastIndexOf(r)===t,"Expected targetIds to be unique in the passed array.");gN(n.getTarget(r),"Expected targetIds to be registered.")}}(r,o,a),function(e,t,n){e.forEach(function(e){n.getTarget(e).hover(t,e)})}(r,o,a),{type:xN,payload:{targetIds:r,clientOffset:n||null}}}}function DN(e){return function(){if(e.getMonitor().isDragging())return{type:wN}}}class MN{receiveBackend(e){this.backend=e}getMonitor(){return this.monitor}getBackend(){return this.backend}getRegistry(){return this.monitor.registry}getActions(){const e=this,{dispatch:t}=this.store;const n=function(e){return{beginDrag:EN(e),publishDragSource:DN(e),hover:TN(e),drop:NN(e),endDrag:RN(e)}}(this);return Object.keys(n).reduce((r,o)=>{const a=n[o];var i;return r[o]=(i=a,(...n)=>{const r=i.apply(e,n);void 0!==r&&t(r)}),r},{})}dispatch(e){this.store.dispatch(e)}constructor(e,t){this.isSetUp=!1,this.handleRefCountChange=()=>{const e=this.store.getState().refCount>0;this.backend&&(e&&!this.isSetUp?(this.backend.setup(),this.isSetUp=!0):!e&&this.isSetUp&&(this.backend.teardown(),this.isSetUp=!1))},this.store=e,this.monitor=t,e.subscribe(this.handleRefCountChange)}}function IN(e,t){return{x:e.x-t.x,y:e.y-t.y}}const AN=[],FN=[];AN.__IS_NONE__=!0,FN.__IS_ALL__=!0;class LN{subscribeToStateChange(e,t={}){const{handlerIds:n}=t;gN("function"==typeof e,"listener must be a function."),gN(void 0===n||Array.isArray(n),"handlerIds, when specified, must be an array of strings.");let r=this.store.getState().stateId;return this.store.subscribe(()=>{const t=this.store.getState(),o=t.stateId;try{const a=o===r||o===r+1&&!function(e,t){return e!==AN&&(e===FN||void 0===t||(n=e,t.filter(e=>n.indexOf(e)>-1)).length>0);var n}(t.dirtyHandlerIds,n);a||e()}finally{r=o}})}subscribeToOffsetChange(e){gN("function"==typeof e,"listener must be a function.");let t=this.store.getState().dragOffset;return this.store.subscribe(()=>{const n=this.store.getState().dragOffset;n!==t&&(t=n,e())})}canDragSource(e){if(!e)return!1;const t=this.registry.getSource(e);return gN(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()&&t.canDrag(this,e)}canDropOnTarget(e){if(!e)return!1;const t=this.registry.getTarget(e);if(gN(t,`Expected to find a valid target. targetId=${e}`),!this.isDragging()||this.didDrop())return!1;return PN(this.registry.getTargetType(e),this.getItemType())&&t.canDrop(this,e)}isDragging(){return Boolean(this.getItemType())}isDraggingSource(e){if(!e)return!1;const t=this.registry.getSource(e,!0);if(gN(t,`Expected to find a valid source. sourceId=${e}`),!this.isDragging()||!this.isSourcePublic())return!1;return this.registry.getSourceType(e)===this.getItemType()&&t.isDragging(this,e)}isOverTarget(e,t={shallow:!1}){if(!e)return!1;const{shallow:n}=t;if(!this.isDragging())return!1;const r=this.registry.getTargetType(e),o=this.getItemType();if(o&&!PN(r,o))return!1;const a=this.getTargetIds();if(!a.length)return!1;const i=a.indexOf(e);return n?i===a.length-1:i>-1}getItemType(){return this.store.getState().dragOperation.itemType}getItem(){return this.store.getState().dragOperation.item}getSourceId(){return this.store.getState().dragOperation.sourceId}getTargetIds(){return this.store.getState().dragOperation.targetIds}getDropResult(){return this.store.getState().dragOperation.dropResult}didDrop(){return this.store.getState().dragOperation.didDrop}isSourcePublic(){return Boolean(this.store.getState().dragOperation.isSourcePublic)}getInitialClientOffset(){return this.store.getState().dragOffset.initialClientOffset}getInitialSourceClientOffset(){return this.store.getState().dragOffset.initialSourceClientOffset}getClientOffset(){return this.store.getState().dragOffset.clientOffset}getSourceClientOffset(){return function(e){const{clientOffset:t,initialClientOffset:n,initialSourceClientOffset:r}=e;return t&&n&&r?IN(function(e,t){return{x:e.x+t.x,y:e.y+t.y}}(t,r),n):null}(this.store.getState().dragOffset)}getDifferenceFromInitialOffset(){return function(e){const{clientOffset:t,initialClientOffset:n}=e;return t&&n?IN(t,n):null}(this.store.getState().dragOffset)}constructor(e,t){this.store=e,this.registry=t}}const zN="undefined"!=typeof global?global:self,$N=zN.MutationObserver||zN.WebKitMutationObserver;function HN(e){return function(){const t=setTimeout(r,0),n=setInterval(r,50);function r(){clearTimeout(t),clearInterval(n),e()}}}const VN="function"==typeof $N?function(e){let t=1;const n=new $N(e),r=document.createTextNode("");return n.observe(r,{characterData:!0}),function(){t=-t,r.data=t}}:HN;class BN{call(){try{this.task&&this.task()}catch(e){this.onError(e)}finally{this.task=null,this.release(this)}}constructor(e,t){this.onError=e,this.release=t,this.task=null}}const UN=new class{enqueueTask(e){const{queue:t,requestFlush:n}=this;t.length||(n(),this.flushing=!0),t[t.length]=e}constructor(){this.queue=[],this.pendingErrors=[],this.flushing=!1,this.index=0,this.capacity=1024,this.flush=()=>{const{queue:e}=this;for(;this.index<e.length;){const t=this.index;if(this.index++,e[t].call(),this.index>this.capacity){for(let t=0,n=e.length-this.index;t<n;t++)e[t]=e[t+this.index];e.length-=this.index,this.index=0}}e.length=0,this.index=0,this.flushing=!1},this.registerPendingError=e=>{this.pendingErrors.push(e),this.requestErrorThrow()},this.requestFlush=VN(this.flush),this.requestErrorThrow=HN(()=>{if(this.pendingErrors.length)throw this.pendingErrors.shift()})}},WN=new class{create(e){const t=this.freeTasks,n=t.length?t.pop():new BN(this.onError,e=>t[t.length]=e);return n.task=e,n}constructor(e){this.onError=e,this.freeTasks=[]}}(UN.registerPendingError);const qN="dnd-core/ADD_SOURCE",YN="dnd-core/ADD_TARGET",GN="dnd-core/REMOVE_SOURCE",KN="dnd-core/REMOVE_TARGET";function QN(e,t){t&&Array.isArray(e)?e.forEach(e=>QN(e,!1)):gN("string"==typeof e||"symbol"==typeof e,t?"Type can only be a string, a symbol, or an array of either.":"Type can only be a string or a symbol.")}var XN;!function(e){e.SOURCE="SOURCE",e.TARGET="TARGET"}(XN||(XN={}));let ZN=0;function JN(e){const t=(ZN++).toString();switch(e){case XN.SOURCE:return`S${t}`;case XN.TARGET:return`T${t}`;default:throw new Error(`Unknown Handler Role: ${e}`)}}function eR(e){switch(e[0]){case"S":return XN.SOURCE;case"T":return XN.TARGET;default:throw new Error(`Cannot parse handler ID: ${e}`)}}function tR(e,t){const n=e.entries();let r=!1;do{const{done:e,value:[,o]}=n.next();if(o===t)return!0;r=!!e}while(!r);return!1}class nR{addSource(e,t){QN(e),function(e){gN("function"==typeof e.canDrag,"Expected canDrag to be a function."),gN("function"==typeof e.beginDrag,"Expected beginDrag to be a function."),gN("function"==typeof e.endDrag,"Expected endDrag to be a function.")}(t);const n=this.addHandler(XN.SOURCE,e,t);return this.store.dispatch(function(e){return{type:qN,payload:{sourceId:e}}}(n)),n}addTarget(e,t){QN(e,!0),function(e){gN("function"==typeof e.canDrop,"Expected canDrop to be a function."),gN("function"==typeof e.hover,"Expected hover to be a function."),gN("function"==typeof e.drop,"Expected beginDrag to be a function.")}(t);const n=this.addHandler(XN.TARGET,e,t);return this.store.dispatch(function(e){return{type:YN,payload:{targetId:e}}}(n)),n}containsHandler(e){return tR(this.dragSources,e)||tR(this.dropTargets,e)}getSource(e,t=!1){gN(this.isSourceId(e),"Expected a valid source ID.");return t&&e===this.pinnedSourceId?this.pinnedSource:this.dragSources.get(e)}getTarget(e){return gN(this.isTargetId(e),"Expected a valid target ID."),this.dropTargets.get(e)}getSourceType(e){return gN(this.isSourceId(e),"Expected a valid source ID."),this.types.get(e)}getTargetType(e){return gN(this.isTargetId(e),"Expected a valid target ID."),this.types.get(e)}isSourceId(e){return eR(e)===XN.SOURCE}isTargetId(e){return eR(e)===XN.TARGET}removeSource(e){var t;gN(this.getSource(e),"Expected an existing source."),this.store.dispatch(function(e){return{type:GN,payload:{sourceId:e}}}(e)),t=()=>{this.dragSources.delete(e),this.types.delete(e)},UN.enqueueTask(WN.create(t))}removeTarget(e){gN(this.getTarget(e),"Expected an existing target."),this.store.dispatch(function(e){return{type:KN,payload:{targetId:e}}}(e)),this.dropTargets.delete(e),this.types.delete(e)}pinSource(e){const t=this.getSource(e);gN(t,"Expected an existing source."),this.pinnedSourceId=e,this.pinnedSource=t}unpinSource(){gN(this.pinnedSource,"No source is pinned at the time."),this.pinnedSourceId=null,this.pinnedSource=null}addHandler(e,t,n){const r=JN(e);return this.types.set(r,t),e===XN.SOURCE?this.dragSources.set(r,n):e===XN.TARGET&&this.dropTargets.set(r,n),r}constructor(e){this.types=new Map,this.dragSources=new Map,this.dropTargets=new Map,this.pinnedSourceId=null,this.pinnedSource=null,this.store=e}}const rR=(e,t)=>e===t;function oR(e=AN,t){switch(t.type){case xN:break;case qN:case YN:case KN:case GN:return AN;default:return FN}const{targetIds:n=[],prevTargetIds:r=[]}=t.payload,o=function(e,t){const n=new Map,r=e=>{n.set(e,n.has(e)?n.get(e)+1:1)};e.forEach(r),t.forEach(r);const o=[];return n.forEach((e,t)=>{1===e&&o.push(t)}),o}(n,r),a=o.length>0||!function(e,t,n=rR){if(e.length!==t.length)return!1;for(let r=0;r<e.length;++r)if(!n(e[r],t[r]))return!1;return!0}(n,r);if(!a)return AN;const i=r[r.length-1],s=n[n.length-1];return i!==s&&(i&&o.push(i),s&&o.push(s)),o}function aR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}const iR={initialSourceClientOffset:null,initialClientOffset:null,clientOffset:null};function sR(e=iR,t){const{payload:n}=t;switch(t.type){case vN:case bN:return{initialSourceClientOffset:n.sourceClientOffset,initialClientOffset:n.clientOffset,clientOffset:n.clientOffset};case xN:return r=e.clientOffset,o=n.clientOffset,!r&&!o||r&&o&&r.x===o.x&&r.y===o.y?e:function(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){aR(e,t,n[t])})}return e}({},e,{clientOffset:n.clientOffset});case CN:case SN:return iR;default:return e}var r,o}function lR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function uR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){lR(e,t,n[t])})}return e}const cR={itemType:null,item:null,sourceId:null,targetIds:[],dropResult:null,didDrop:!1,isSourcePublic:null};function dR(e=cR,t){const{payload:n}=t;switch(t.type){case bN:return uR({},e,{itemType:n.itemType,item:n.item,sourceId:n.sourceId,isSourcePublic:n.isSourcePublic,dropResult:null,didDrop:!1});case wN:return uR({},e,{isSourcePublic:!0});case xN:return uR({},e,{targetIds:n.targetIds});case KN:return-1===e.targetIds.indexOf(n.targetId)?e:uR({},e,{targetIds:(r=e.targetIds,o=n.targetId,r.filter(e=>e!==o))});case SN:return uR({},e,{dropResult:n.dropResult,didDrop:!0,targetIds:[]});case CN:return uR({},e,{itemType:null,item:null,sourceId:null,dropResult:null,didDrop:!1,isSourcePublic:null,targetIds:[]});default:return e}var r,o}function fR(e=0,t){switch(t.type){case qN:case YN:return e+1;case GN:case KN:return e-1;default:return e}}function pR(e=0){return e+1}function hR(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function mR(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){hR(e,t,n[t])})}return e}function gR(e={},t){return{dirtyHandlerIds:oR(e.dirtyHandlerIds,{type:t.type,payload:mR({},t.payload,{prevTargetIds:(n=e,r="dragOperation.targetIds",o=[],r.split(".").reduce((e,t)=>e&&e[t]?e[t]:o||null,n))})}),dragOffset:sR(e.dragOffset,t),refCount:fR(e.refCount,t),dragOperation:dR(e.dragOperation,t),stateId:pR(e.stateId)};var n,r,o}function yR(e,t=void 0,n={},r=!1){const o=function(e){const t="undefined"!=typeof window&&window.__REDUX_DEVTOOLS_EXTENSION__;return mN(gR,e&&t&&t({name:"dnd-core",instanceId:"dnd-core"}))}(r),a=new LN(o,new nR(o)),i=new MN(o,a),s=e(i,t,n);return i.receiveBackend(s),i}function vR(e,t){if(null==e)return{};var n,r,o=function(e,t){if(null==e)return{};var n,r,o={},a=Object.keys(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||(o[n]=e[n]);return o}(e,t);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);for(r=0;r<a.length;r++)n=a[r],t.indexOf(n)>=0||Object.prototype.propertyIsEnumerable.call(e,n)&&(o[n]=e[n])}return o}let bR=0;const wR=Symbol.for("__REACT_DND_CONTEXT_INSTANCE__");var xR,SR,CR=D.memo(function(e){var{children:t}=e,n=vR(e,["children"]);const[r,o]=function(e){if("manager"in e){return[{dragDropManager:e.manager},!1]}const t=function(e,t=kR(),n,r){const o=t;o[wR]||(o[wR]={dragDropManager:yR(e,t,n,r)});return o[wR]}(e.backend,e.context,e.options,e.debugMode),n=!e.context;return[t,n]}(n);return D.useEffect(()=>{if(o){const e=kR();return++bR,()=>{0===--bR&&(e[wR]=null)}}},[]),m.jsx(cN.Provider,{value:r,children:t})});function kR(){return"undefined"!=typeof global?global:window}var _R=(SR||(SR=1,xR=function e(t,n){if(t===n)return!0;if(t&&n&&"object"==typeof t&&"object"==typeof n){if(t.constructor!==n.constructor)return!1;var r,o,a;if(Array.isArray(t)){if((r=t.length)!=n.length)return!1;for(o=r;0!==o--;)if(!e(t[o],n[o]))return!1;return!0}if(t.constructor===RegExp)return t.source===n.source&&t.flags===n.flags;if(t.valueOf!==Object.prototype.valueOf)return t.valueOf()===n.valueOf();if(t.toString!==Object.prototype.toString)return t.toString()===n.toString();if((r=(a=Object.keys(t)).length)!==Object.keys(n).length)return!1;for(o=r;0!==o--;)if(!Object.prototype.hasOwnProperty.call(n,a[o]))return!1;for(o=r;0!==o--;){var i=a[o];if(!e(t[i],n[i]))return!1}return!0}return t!=t&&n!=n}),xR),ER=n(_R);const jR="undefined"!=typeof window?D.useLayoutEffect:D.useEffect;function OR(e,t,n){const[r,o]=function(e,t,n){const[r,o]=D.useState(()=>t(e)),a=D.useCallback(()=>{const a=t(e);ER(r,a)||(o(a),n&&n())},[r,e,n]);return jR(a),[r,a]}(e,t,n);return jR(function(){const t=e.getHandlerId();if(null!=t)return e.subscribeToStateChange(o,{handlerIds:[t]})},[e,o]),r}function NR(e,t,n){return OR(t,e||(()=>({})),()=>n.reconnect())}function RR(e,t){const n=[...t||[]];return null==t&&"function"!=typeof e&&n.push(e),D.useMemo(()=>"function"==typeof e?e():e,n)}function PR(e){return D.useMemo(()=>e.hooks.dragSource(),[e])}function TR(e){return D.useMemo(()=>e.hooks.dragPreview(),[e])}let DR=!1,MR=!1;class IR{receiveHandlerId(e){this.sourceId=e}getHandlerId(){return this.sourceId}canDrag(){gN(!DR,"You may not call monitor.canDrag() inside your canDrag() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return DR=!0,this.internalMonitor.canDragSource(this.sourceId)}finally{DR=!1}}isDragging(){if(!this.sourceId)return!1;gN(!MR,"You may not call monitor.isDragging() inside your isDragging() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drag-source-monitor");try{return MR=!0,this.internalMonitor.isDraggingSource(this.sourceId)}finally{MR=!1}}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}isDraggingSource(e){return this.internalMonitor.isDraggingSource(e)}isOverTarget(e,t){return this.internalMonitor.isOverTarget(e,t)}getTargetIds(){return this.internalMonitor.getTargetIds()}isSourcePublic(){return this.internalMonitor.isSourcePublic()}getSourceId(){return this.internalMonitor.getSourceId()}subscribeToOffsetChange(e){return this.internalMonitor.subscribeToOffsetChange(e)}canDragSource(e){return this.internalMonitor.canDragSource(e)}canDropOnTarget(e){return this.internalMonitor.canDropOnTarget(e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.sourceId=null,this.internalMonitor=e.getMonitor()}}let AR=!1;class FR{receiveHandlerId(e){this.targetId=e}getHandlerId(){return this.targetId}subscribeToStateChange(e,t){return this.internalMonitor.subscribeToStateChange(e,t)}canDrop(){if(!this.targetId)return!1;gN(!AR,"You may not call monitor.canDrop() inside your canDrop() implementation. Read more: http://react-dnd.github.io/react-dnd/docs/api/drop-target-monitor");try{return AR=!0,this.internalMonitor.canDropOnTarget(this.targetId)}finally{AR=!1}}isOver(e){return!!this.targetId&&this.internalMonitor.isOverTarget(this.targetId,e)}getItemType(){return this.internalMonitor.getItemType()}getItem(){return this.internalMonitor.getItem()}getDropResult(){return this.internalMonitor.getDropResult()}didDrop(){return this.internalMonitor.didDrop()}getInitialClientOffset(){return this.internalMonitor.getInitialClientOffset()}getInitialSourceClientOffset(){return this.internalMonitor.getInitialSourceClientOffset()}getSourceClientOffset(){return this.internalMonitor.getSourceClientOffset()}getClientOffset(){return this.internalMonitor.getClientOffset()}getDifferenceFromInitialOffset(){return this.internalMonitor.getDifferenceFromInitialOffset()}constructor(e){this.targetId=null,this.internalMonitor=e.getMonitor()}}function LR(e,t,n,r){let o;if(void 0!==o)return!!o;if(e===t)return!0;if("object"!=typeof e||!e||"object"!=typeof t||!t)return!1;const a=Object.keys(e),i=Object.keys(t);if(a.length!==i.length)return!1;const s=Object.prototype.hasOwnProperty.bind(t);for(let n=0;n<a.length;n++){const r=a[n];if(!s(r))return!1;const i=e[r],l=t[r];if(o=void 0,!1===o||void 0===o&&i!==l)return!1}return!0}function zR(e){return null!==e&&"object"==typeof e&&Object.prototype.hasOwnProperty.call(e,"current")}function $R(e){return(t=null,n=null)=>{if(!D.isValidElement(t)){const r=t;return e(r,n),r}const r=t;!function(e){if("string"==typeof e.type)return;const t=e.type.displayName||e.type.name||"the component";throw new Error(`Only native element nodes can now be passed to React DnD connectors.You can either wrap ${t} into a <div>, or turn it into a drag source or a drop target itself.`)}(r);const o=n?t=>e(t,n):e;return function(e,t){const n=e.ref;return gN("string"!=typeof n,"Cannot connect React DnD to an element with an existing string ref. Please convert it to use a callback ref instead, or wrap it into a <span> or <div>. Read more: https://reactjs.org/docs/refs-and-the-dom.html#callback-refs"),n?D.cloneElement(e,{ref:e=>{VR(n,e),VR(t,e)}}):D.cloneElement(e,{ref:t})}(r,o)}}function HR(e){const t={};return Object.keys(e).forEach(n=>{const r=e[n];if(n.endsWith("Ref"))t[n]=e[n];else{const e=$R(r);t[n]=()=>e}}),t}function VR(e,t){"function"==typeof e?e(t):e.current=t}class BR{receiveHandlerId(e){this.handlerId!==e&&(this.handlerId=e,this.reconnect())}get connectTarget(){return this.dragSource}get dragSourceOptions(){return this.dragSourceOptionsInternal}set dragSourceOptions(e){this.dragSourceOptionsInternal=e}get dragPreviewOptions(){return this.dragPreviewOptionsInternal}set dragPreviewOptions(e){this.dragPreviewOptionsInternal=e}reconnect(){const e=this.reconnectDragSource();this.reconnectDragPreview(e)}reconnectDragSource(){const e=this.dragSource,t=this.didHandlerIdChange()||this.didConnectedDragSourceChange()||this.didDragSourceOptionsChange();return t&&this.disconnectDragSource(),this.handlerId?e?(t&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragSource=e,this.lastConnectedDragSourceOptions=this.dragSourceOptions,this.dragSourceUnsubscribe=this.backend.connectDragSource(this.handlerId,e,this.dragSourceOptions)),t):(this.lastConnectedDragSource=e,t):t}reconnectDragPreview(e=!1){const t=this.dragPreview,n=e||this.didHandlerIdChange()||this.didConnectedDragPreviewChange()||this.didDragPreviewOptionsChange();n&&this.disconnectDragPreview(),this.handlerId&&(t?n&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDragPreview=t,this.lastConnectedDragPreviewOptions=this.dragPreviewOptions,this.dragPreviewUnsubscribe=this.backend.connectDragPreview(this.handlerId,t,this.dragPreviewOptions)):this.lastConnectedDragPreview=t)}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didConnectedDragSourceChange(){return this.lastConnectedDragSource!==this.dragSource}didConnectedDragPreviewChange(){return this.lastConnectedDragPreview!==this.dragPreview}didDragSourceOptionsChange(){return!LR(this.lastConnectedDragSourceOptions,this.dragSourceOptions)}didDragPreviewOptionsChange(){return!LR(this.lastConnectedDragPreviewOptions,this.dragPreviewOptions)}disconnectDragSource(){this.dragSourceUnsubscribe&&(this.dragSourceUnsubscribe(),this.dragSourceUnsubscribe=void 0)}disconnectDragPreview(){this.dragPreviewUnsubscribe&&(this.dragPreviewUnsubscribe(),this.dragPreviewUnsubscribe=void 0,this.dragPreviewNode=null,this.dragPreviewRef=null)}get dragSource(){return this.dragSourceNode||this.dragSourceRef&&this.dragSourceRef.current}get dragPreview(){return this.dragPreviewNode||this.dragPreviewRef&&this.dragPreviewRef.current}clearDragSource(){this.dragSourceNode=null,this.dragSourceRef=null}clearDragPreview(){this.dragPreviewNode=null,this.dragPreviewRef=null}constructor(e){this.hooks=HR({dragSource:(e,t)=>{this.clearDragSource(),this.dragSourceOptions=t||null,zR(e)?this.dragSourceRef=e:this.dragSourceNode=e,this.reconnectDragSource()},dragPreview:(e,t)=>{this.clearDragPreview(),this.dragPreviewOptions=t||null,zR(e)?this.dragPreviewRef=e:this.dragPreviewNode=e,this.reconnectDragPreview()}}),this.handlerId=null,this.dragSourceRef=null,this.dragSourceOptionsInternal=null,this.dragPreviewRef=null,this.dragPreviewOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDragSource=null,this.lastConnectedDragSourceOptions=null,this.lastConnectedDragPreview=null,this.lastConnectedDragPreviewOptions=null,this.backend=e}}class UR{get connectTarget(){return this.dropTarget}reconnect(){const e=this.didHandlerIdChange()||this.didDropTargetChange()||this.didOptionsChange();e&&this.disconnectDropTarget();const t=this.dropTarget;this.handlerId&&(t?e&&(this.lastConnectedHandlerId=this.handlerId,this.lastConnectedDropTarget=t,this.lastConnectedDropTargetOptions=this.dropTargetOptions,this.unsubscribeDropTarget=this.backend.connectDropTarget(this.handlerId,t,this.dropTargetOptions)):this.lastConnectedDropTarget=t)}receiveHandlerId(e){e!==this.handlerId&&(this.handlerId=e,this.reconnect())}get dropTargetOptions(){return this.dropTargetOptionsInternal}set dropTargetOptions(e){this.dropTargetOptionsInternal=e}didHandlerIdChange(){return this.lastConnectedHandlerId!==this.handlerId}didDropTargetChange(){return this.lastConnectedDropTarget!==this.dropTarget}didOptionsChange(){return!LR(this.lastConnectedDropTargetOptions,this.dropTargetOptions)}disconnectDropTarget(){this.unsubscribeDropTarget&&(this.unsubscribeDropTarget(),this.unsubscribeDropTarget=void 0)}get dropTarget(){return this.dropTargetNode||this.dropTargetRef&&this.dropTargetRef.current}clearDropTarget(){this.dropTargetRef=null,this.dropTargetNode=null}constructor(e){this.hooks=HR({dropTarget:(e,t)=>{this.clearDropTarget(),this.dropTargetOptions=t,zR(e)?this.dropTargetRef=e:this.dropTargetNode=e,this.reconnect()}}),this.handlerId=null,this.dropTargetRef=null,this.dropTargetOptionsInternal=null,this.lastConnectedHandlerId=null,this.lastConnectedDropTarget=null,this.lastConnectedDropTargetOptions=null,this.backend=e}}function WR(){const{dragDropManager:e}=D.useContext(cN);return gN(null!=e,"Expected drag drop context"),e}class qR{beginDrag(){const e=this.spec,t=this.monitor;let n=null;return n="object"==typeof e.item?e.item:"function"==typeof e.item?e.item(t):{},null!=n?n:null}canDrag(){const e=this.spec,t=this.monitor;return"boolean"==typeof e.canDrag?e.canDrag:"function"!=typeof e.canDrag||e.canDrag(t)}isDragging(e,t){const n=this.spec,r=this.monitor,{isDragging:o}=n;return o?o(r):t===e.getSourceId()}endDrag(){const e=this.spec,t=this.monitor,n=this.connector,{end:r}=e;r&&r(t.getItem(),t),n.reconnect()}constructor(e,t,n){this.spec=e,this.monitor=t,this.connector=n}}function YR(e,t,n){const r=WR(),o=function(e,t,n){const r=D.useMemo(()=>new qR(e,t,n),[t,n]);return D.useEffect(()=>{r.spec=e},[e]),r}(e,t,n),a=function(e){return D.useMemo(()=>{const t=e.type;return gN(null!=t,"spec.type must be defined"),t},[e])}(e);jR(function(){if(null!=a){const[e,i]=function(e,t,n){const r=n.getRegistry(),o=r.addSource(e,t);return[o,()=>r.removeSource(o)]}(a,o,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),i}},[r,t,n,o,a])}function GR(e,t){const n=RR(e,t);gN(!n.begin,"useDrag::spec.begin was deprecated in v14. Replace spec.begin() with spec.item(). (see more here - https://react-dnd.github.io/react-dnd/docs/api/use-drag)");const r=function(){const e=WR();return D.useMemo(()=>new IR(e),[e])}(),o=function(e,t){const n=WR(),r=D.useMemo(()=>new BR(n.getBackend()),[n]);return jR(()=>(r.dragSourceOptions=e||null,r.reconnect(),()=>r.disconnectDragSource()),[r,e]),jR(()=>(r.dragPreviewOptions=t||null,r.reconnect(),()=>r.disconnectDragPreview()),[r,t]),r}(n.options,n.previewOptions);return YR(n,r,o),[NR(n.collect,r,o),PR(o),TR(o)]}function KR(e){return D.useMemo(()=>e.hooks.dropTarget(),[e])}class QR{canDrop(){const e=this.spec,t=this.monitor;return!e.canDrop||e.canDrop(t.getItem(),t)}hover(){const e=this.spec,t=this.monitor;e.hover&&e.hover(t.getItem(),t)}drop(){const e=this.spec,t=this.monitor;if(e.drop)return e.drop(t.getItem(),t)}constructor(e,t){this.spec=e,this.monitor=t}}function XR(e,t,n){const r=WR(),o=function(e,t){const n=D.useMemo(()=>new QR(e,t),[t]);return D.useEffect(()=>{n.spec=e},[e]),n}(e,t),a=function(e){const{accept:t}=e;return D.useMemo(()=>(gN(null!=e.accept,"accept must be defined"),Array.isArray(t)?t:[t]),[t])}(e);jR(function(){const[e,i]=function(e,t,n){const r=n.getRegistry(),o=r.addTarget(e,t);return[o,()=>r.removeTarget(o)]}(a,o,r);return t.receiveHandlerId(e),n.receiveHandlerId(e),i},[r,t,o,n,a.map(e=>e.toString()).join("|")])}function ZR(e,t){const n=RR(e,t),r=function(){const e=WR();return D.useMemo(()=>new FR(e),[e])}(),o=function(e){const t=WR(),n=D.useMemo(()=>new UR(t.getBackend()),[t]);return jR(()=>(n.dropTargetOptions=e||null,n.reconnect(),()=>n.disconnectDropTarget()),[e]),n}(n.options);return XR(n,r,o),[NR(n.collect,r,o),KR(o)]}function JR(e){let t=null;return()=>(null==t&&(t=e()),t)}class eP{enter(e){const t=this.entered.length;return this.entered=function(e,t){const n=new Set,r=e=>n.add(e);e.forEach(r),t.forEach(r);const o=[];return n.forEach(e=>o.push(e)),o}(this.entered.filter(t=>this.isNodeInDocument(t)&&(!t.contains||t.contains(e))),[e]),0===t&&this.entered.length>0}leave(e){const t=this.entered.length;var n,r;return this.entered=(n=this.entered.filter(this.isNodeInDocument),r=e,n.filter(e=>e!==r)),t>0&&0===this.entered.length}reset(){this.entered=[]}constructor(e){this.entered=[],this.isNodeInDocument=e}}class tP{initializeExposedProperties(){Object.keys(this.config.exposeProperties).forEach(e=>{Object.defineProperty(this.item,e,{configurable:!0,enumerable:!0,get:()=>(console.warn(`Browser doesn't allow reading "${e}" until the drop event.`),null)})})}loadDataTransfer(e){if(e){const t={};Object.keys(this.config.exposeProperties).forEach(n=>{const r=this.config.exposeProperties[n];null!=r&&(t[n]={value:r(e,this.config.matchesTypes),configurable:!0,enumerable:!0})}),Object.defineProperties(this.item,t)}}canDrag(){return!0}beginDrag(){return this.item}isDragging(e,t){return t===e.getSourceId()}endDrag(){}constructor(e){this.config=e,this.item={},this.initializeExposedProperties()}}const nP="__NATIVE_FILE__",rP="__NATIVE_URL__",oP="__NATIVE_TEXT__",aP="__NATIVE_HTML__";var iP=Object.freeze({__proto__:null,FILE:nP,HTML:aP,TEXT:oP,URL:rP});function sP(e,t,n){const r=t.reduce((t,n)=>t||e.getData(n),"");return null!=r?r:n}const lP={[nP]:{exposeProperties:{files:e=>Array.prototype.slice.call(e.files),items:e=>e.items,dataTransfer:e=>e},matchesTypes:["Files"]},[aP]:{exposeProperties:{html:(e,t)=>sP(e,t,""),dataTransfer:e=>e},matchesTypes:["Html","text/html"]},[rP]:{exposeProperties:{urls:(e,t)=>sP(e,t,"").split("\n"),dataTransfer:e=>e},matchesTypes:["Url","text/uri-list"]},[oP]:{exposeProperties:{text:(e,t)=>sP(e,t,""),dataTransfer:e=>e},matchesTypes:["Text","text/plain"]}};function uP(e){if(!e)return null;const t=Array.prototype.slice.call(e.types||[]);return Object.keys(lP).filter(e=>{const n=lP[e];return!!(null==n?void 0:n.matchesTypes)&&n.matchesTypes.some(e=>t.indexOf(e)>-1)})[0]||null}const cP=JR(()=>/firefox/i.test(navigator.userAgent)),dP=JR(()=>Boolean(window.safari));class fP{interpolate(e){const{xs:t,ys:n,c1s:r,c2s:o,c3s:a}=this;let i=t.length-1;if(e===t[i])return n[i];let s,l=0,u=a.length-1;for(;l<=u;){s=Math.floor(.5*(l+u));const r=t[s];if(r<e)l=s+1;else{if(!(r>e))return n[s];u=s-1}}i=Math.max(0,u);const c=e-t[i],d=c*c;return n[i]+r[i]*c+o[i]*d+a[i]*c*d}constructor(e,t){const{length:n}=e,r=[];for(let e=0;e<n;e++)r.push(e);r.sort((t,n)=>e[t]<e[n]?-1:1);const o=[],a=[];let i,s;for(let r=0;r<n-1;r++)i=e[r+1]-e[r],s=t[r+1]-t[r],o.push(i),a.push(s/i);const l=[a[0]];for(let e=0;e<o.length-1;e++){const t=a[e],n=a[e+1];if(t*n<=0)l.push(0);else{i=o[e];const r=o[e+1],a=i+r;l.push(3*a/((a+r)/t+(a+i)/n))}}l.push(a[a.length-1]);const u=[],c=[];let d;for(let e=0;e<l.length-1;e++){d=a[e];const t=l[e],n=1/o[e],r=t+l[e+1]-d-d;u.push((d-t-r)*n),c.push(r*n*n)}this.xs=e,this.ys=t,this.c1s=l,this.c2s=u,this.c3s=c}}function pP(e){const t=1===e.nodeType?e:e.parentElement;if(!t)return null;const{top:n,left:r}=t.getBoundingClientRect();return{x:r,y:n}}function hP(e){return{x:e.clientX,y:e.clientY}}function mP(e,t,n,r,o){const a=function(e){var t;return"IMG"===e.nodeName&&(cP()||!(null===(t=document.documentElement)||void 0===t?void 0:t.contains(e)))}(t),i=pP(a?e:t),s={x:n.x-i.x,y:n.y-i.y},{offsetWidth:l,offsetHeight:u}=e,{anchorX:c,anchorY:d}=r,{dragPreviewWidth:f,dragPreviewHeight:p}=function(e,t,n,r){let o=e?t.width:n,a=e?t.height:r;return dP()&&e&&(a/=window.devicePixelRatio,o/=window.devicePixelRatio),{dragPreviewWidth:o,dragPreviewHeight:a}}(a,t,l,u),{offsetX:h,offsetY:m}=o,g=0===m||m;return{x:0===h||h?h:new fP([0,.5,1],[s.x,s.x/l*f,s.x+f-l]).interpolate(c),y:g?m:(()=>{let e=new fP([0,.5,1],[s.y,s.y/u*p,s.y+p-u]).interpolate(d);return dP()&&a&&(e+=(window.devicePixelRatio-1)*p),e})()}}class gP{get window(){return this.globalContext?this.globalContext:"undefined"!=typeof window?window:void 0}get document(){var e;return(null===(e=this.globalContext)||void 0===e?void 0:e.document)?this.globalContext.document:this.window?this.window.document:void 0}get rootElement(){var e;return(null===(e=this.optionsArgs)||void 0===e?void 0:e.rootElement)||this.window}constructor(e,t){this.ownerDocument=null,this.globalContext=e,this.optionsArgs=t}}function yP(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function vP(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{},r=Object.keys(n);"function"==typeof Object.getOwnPropertySymbols&&(r=r.concat(Object.getOwnPropertySymbols(n).filter(function(e){return Object.getOwnPropertyDescriptor(n,e).enumerable}))),r.forEach(function(t){yP(e,t,n[t])})}return e}class bP{profile(){var e,t;return{sourcePreviewNodes:this.sourcePreviewNodes.size,sourcePreviewNodeOptions:this.sourcePreviewNodeOptions.size,sourceNodeOptions:this.sourceNodeOptions.size,sourceNodes:this.sourceNodes.size,dragStartSourceIds:(null===(e=this.dragStartSourceIds)||void 0===e?void 0:e.length)||0,dropTargetIds:this.dropTargetIds.length,dragEnterTargetIds:this.dragEnterTargetIds.length,dragOverTargetIds:(null===(t=this.dragOverTargetIds)||void 0===t?void 0:t.length)||0}}get window(){return this.options.window}get document(){return this.options.document}get rootElement(){return this.options.rootElement}setup(){const e=this.rootElement;if(void 0!==e){if(e.__isReactDndBackendSetUp)throw new Error("Cannot have two HTML5 backends at the same time.");e.__isReactDndBackendSetUp=!0,this.addEventListeners(e)}}teardown(){const e=this.rootElement;var t;void 0!==e&&(e.__isReactDndBackendSetUp=!1,this.removeEventListeners(this.rootElement),this.clearCurrentDragSourceNode(),this.asyncEndDragFrameId&&(null===(t=this.window)||void 0===t||t.cancelAnimationFrame(this.asyncEndDragFrameId)))}connectDragPreview(e,t,n){return this.sourcePreviewNodeOptions.set(e,n),this.sourcePreviewNodes.set(e,t),()=>{this.sourcePreviewNodes.delete(e),this.sourcePreviewNodeOptions.delete(e)}}connectDragSource(e,t,n){this.sourceNodes.set(e,t),this.sourceNodeOptions.set(e,n);const r=t=>this.handleDragStart(t,e),o=e=>this.handleSelectStart(e);return t.setAttribute("draggable","true"),t.addEventListener("dragstart",r),t.addEventListener("selectstart",o),()=>{this.sourceNodes.delete(e),this.sourceNodeOptions.delete(e),t.removeEventListener("dragstart",r),t.removeEventListener("selectstart",o),t.setAttribute("draggable","false")}}connectDropTarget(e,t){const n=t=>this.handleDragEnter(t,e),r=t=>this.handleDragOver(t,e),o=t=>this.handleDrop(t,e);return t.addEventListener("dragenter",n),t.addEventListener("dragover",r),t.addEventListener("drop",o),()=>{t.removeEventListener("dragenter",n),t.removeEventListener("dragover",r),t.removeEventListener("drop",o)}}addEventListeners(e){e.addEventListener&&(e.addEventListener("dragstart",this.handleTopDragStart),e.addEventListener("dragstart",this.handleTopDragStartCapture,!0),e.addEventListener("dragend",this.handleTopDragEndCapture,!0),e.addEventListener("dragenter",this.handleTopDragEnter),e.addEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.addEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.addEventListener("dragover",this.handleTopDragOver),e.addEventListener("dragover",this.handleTopDragOverCapture,!0),e.addEventListener("drop",this.handleTopDrop),e.addEventListener("drop",this.handleTopDropCapture,!0))}removeEventListeners(e){e.removeEventListener&&(e.removeEventListener("dragstart",this.handleTopDragStart),e.removeEventListener("dragstart",this.handleTopDragStartCapture,!0),e.removeEventListener("dragend",this.handleTopDragEndCapture,!0),e.removeEventListener("dragenter",this.handleTopDragEnter),e.removeEventListener("dragenter",this.handleTopDragEnterCapture,!0),e.removeEventListener("dragleave",this.handleTopDragLeaveCapture,!0),e.removeEventListener("dragover",this.handleTopDragOver),e.removeEventListener("dragover",this.handleTopDragOverCapture,!0),e.removeEventListener("drop",this.handleTopDrop),e.removeEventListener("drop",this.handleTopDropCapture,!0))}getCurrentSourceNodeOptions(){const e=this.monitor.getSourceId(),t=this.sourceNodeOptions.get(e);return vP({dropEffect:this.altKeyPressed?"copy":"move"},t||{})}getCurrentDropEffect(){return this.isDraggingNativeItem()?"copy":this.getCurrentSourceNodeOptions().dropEffect}getCurrentSourcePreviewNodeOptions(){const e=this.monitor.getSourceId();return vP({anchorX:.5,anchorY:.5,captureDraggingState:!1},this.sourcePreviewNodeOptions.get(e)||{})}isDraggingNativeItem(){const e=this.monitor.getItemType();return Object.keys(iP).some(t=>iP[t]===e)}beginDragNativeItem(e,t){this.clearCurrentDragSourceNode(),this.currentNativeSource=function(e,t){const n=lP[e];if(!n)throw new Error(`native type ${e} has no configuration`);const r=new tP(n);return r.loadDataTransfer(t),r}(e,t),this.currentNativeHandle=this.registry.addSource(e,this.currentNativeSource),this.actions.beginDrag([this.currentNativeHandle])}setCurrentDragSourceNode(e){this.clearCurrentDragSourceNode(),this.currentDragSourceNode=e;this.mouseMoveTimeoutTimer=setTimeout(()=>{var e;return null===(e=this.rootElement)||void 0===e?void 0:e.addEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0)},1e3)}clearCurrentDragSourceNode(){if(this.currentDragSourceNode){var e;if(this.currentDragSourceNode=null,this.rootElement)null===(e=this.window)||void 0===e||e.clearTimeout(this.mouseMoveTimeoutTimer||void 0),this.rootElement.removeEventListener("mousemove",this.endDragIfSourceWasRemovedFromDOM,!0);return this.mouseMoveTimeoutTimer=null,!0}return!1}handleDragStart(e,t){e.defaultPrevented||(this.dragStartSourceIds||(this.dragStartSourceIds=[]),this.dragStartSourceIds.unshift(t))}handleDragEnter(e,t){this.dragEnterTargetIds.unshift(t)}handleDragOver(e,t){null===this.dragOverTargetIds&&(this.dragOverTargetIds=[]),this.dragOverTargetIds.unshift(t)}handleDrop(e,t){this.dropTargetIds.unshift(t)}constructor(e,t,n){this.sourcePreviewNodes=new Map,this.sourcePreviewNodeOptions=new Map,this.sourceNodes=new Map,this.sourceNodeOptions=new Map,this.dragStartSourceIds=null,this.dropTargetIds=[],this.dragEnterTargetIds=[],this.currentNativeSource=null,this.currentNativeHandle=null,this.currentDragSourceNode=null,this.altKeyPressed=!1,this.mouseMoveTimeoutTimer=null,this.asyncEndDragFrameId=null,this.dragOverTargetIds=null,this.lastClientOffset=null,this.hoverRafId=null,this.getSourceClientOffset=e=>{const t=this.sourceNodes.get(e);return t&&pP(t)||null},this.endDragNativeItem=()=>{this.isDraggingNativeItem()&&(this.actions.endDrag(),this.currentNativeHandle&&this.registry.removeSource(this.currentNativeHandle),this.currentNativeHandle=null,this.currentNativeSource=null)},this.isNodeInDocument=e=>Boolean(e&&this.document&&this.document.body&&this.document.body.contains(e)),this.endDragIfSourceWasRemovedFromDOM=()=>{const e=this.currentDragSourceNode;null==e||this.isNodeInDocument(e)||(this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover())},this.scheduleHover=e=>{null===this.hoverRafId&&"undefined"!=typeof requestAnimationFrame&&(this.hoverRafId=requestAnimationFrame(()=>{this.monitor.isDragging()&&this.actions.hover(e||[],{clientOffset:this.lastClientOffset}),this.hoverRafId=null}))},this.cancelHover=()=>{null!==this.hoverRafId&&"undefined"!=typeof cancelAnimationFrame&&(cancelAnimationFrame(this.hoverRafId),this.hoverRafId=null)},this.handleTopDragStartCapture=()=>{this.clearCurrentDragSourceNode(),this.dragStartSourceIds=[]},this.handleTopDragStart=e=>{if(e.defaultPrevented)return;const{dragStartSourceIds:t}=this;this.dragStartSourceIds=null;const n=hP(e);this.monitor.isDragging()&&(this.actions.endDrag(),this.cancelHover()),this.actions.beginDrag(t||[],{publishSource:!1,getSourceClientOffset:this.getSourceClientOffset,clientOffset:n});const{dataTransfer:r}=e,o=uP(r);if(this.monitor.isDragging()){if(r&&"function"==typeof r.setDragImage){const e=this.monitor.getSourceId(),t=this.sourceNodes.get(e),o=this.sourcePreviewNodes.get(e)||t;if(o){const{anchorX:e,anchorY:a,offsetX:i,offsetY:s}=this.getCurrentSourcePreviewNodeOptions(),l=mP(t,o,n,{anchorX:e,anchorY:a},{offsetX:i,offsetY:s});r.setDragImage(o,l.x,l.y)}}try{null==r||r.setData("application/json",{})}catch(e){}this.setCurrentDragSourceNode(e.target);const{captureDraggingState:t}=this.getCurrentSourcePreviewNodeOptions();t?this.actions.publishDragSource():setTimeout(()=>this.actions.publishDragSource(),0)}else if(o)this.beginDragNativeItem(o);else{if(r&&!r.types&&(e.target&&!e.target.hasAttribute||!e.target.hasAttribute("draggable")))return;e.preventDefault()}},this.handleTopDragEndCapture=()=>{this.clearCurrentDragSourceNode()&&this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleTopDragEnterCapture=e=>{var t;(this.dragEnterTargetIds=[],this.isDraggingNativeItem())&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer));if(!this.enterLeaveCounter.enter(e.target)||this.monitor.isDragging())return;const{dataTransfer:n}=e,r=uP(n);r&&this.beginDragNativeItem(r,n)},this.handleTopDragEnter=e=>{const{dragEnterTargetIds:t}=this;if(this.dragEnterTargetIds=[],!this.monitor.isDragging())return;this.altKeyPressed=e.altKey,t.length>0&&this.actions.hover(t,{clientOffset:hP(e)});t.some(e=>this.monitor.canDropOnTarget(e))&&(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect()))},this.handleTopDragOverCapture=e=>{var t;(this.dragOverTargetIds=[],this.isDraggingNativeItem())&&(null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer))},this.handleTopDragOver=e=>{const{dragOverTargetIds:t}=this;if(this.dragOverTargetIds=[],!this.monitor.isDragging())return e.preventDefault(),void(e.dataTransfer&&(e.dataTransfer.dropEffect="none"));this.altKeyPressed=e.altKey,this.lastClientOffset=hP(e),this.scheduleHover(t);(t||[]).some(e=>this.monitor.canDropOnTarget(e))?(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect=this.getCurrentDropEffect())):this.isDraggingNativeItem()?e.preventDefault():(e.preventDefault(),e.dataTransfer&&(e.dataTransfer.dropEffect="none"))},this.handleTopDragLeaveCapture=e=>{this.isDraggingNativeItem()&&e.preventDefault();this.enterLeaveCounter.leave(e.target)&&(this.isDraggingNativeItem()&&setTimeout(()=>this.endDragNativeItem(),0),this.cancelHover())},this.handleTopDropCapture=e=>{var t;(this.dropTargetIds=[],this.isDraggingNativeItem())?(e.preventDefault(),null===(t=this.currentNativeSource)||void 0===t||t.loadDataTransfer(e.dataTransfer)):uP(e.dataTransfer)&&e.preventDefault();this.enterLeaveCounter.reset()},this.handleTopDrop=e=>{const{dropTargetIds:t}=this;this.dropTargetIds=[],this.actions.hover(t,{clientOffset:hP(e)}),this.actions.drop({dropEffect:this.getCurrentDropEffect()}),this.isDraggingNativeItem()?this.endDragNativeItem():this.monitor.isDragging()&&this.actions.endDrag(),this.cancelHover()},this.handleSelectStart=e=>{const t=e.target;"function"==typeof t.dragDrop&&("INPUT"===t.tagName||"SELECT"===t.tagName||"TEXTAREA"===t.tagName||t.isContentEditable||(e.preventDefault(),t.dragDrop()))},this.options=new gP(t,n),this.actions=e.getActions(),this.monitor=e.getMonitor(),this.registry=e.getRegistry(),this.enterLeaveCounter=new eP(this.isNodeInDocument)}}const wP=function(e,t,n){return new bP(e,t,n)};var xP,SP,CP=Object.create,kP=Object.defineProperty,_P=Object.getOwnPropertyDescriptor,EP=Object.getOwnPropertyNames,jP=Object.getPrototypeOf,OP=Object.prototype.hasOwnProperty,NP=(e,t,n)=>(n=null!=e?CP(jP(e)):{},((e,t,n,r)=>{if(t&&"object"==typeof t||"function"==typeof t)for(let o of EP(t))OP.call(e,o)||o===n||kP(e,o,{get:()=>t[o],enumerable:!(r=_P(t,o))||r.enumerable});return e})(kP(n,"default",{value:e,enumerable:!0}),e)),RP=(xP={"node_modules/classnames/index.js"(e,t){!function(){var e={}.hasOwnProperty;function n(){for(var t=[],r=0;r<arguments.length;r++){var o=arguments[r];if(o){var a=typeof o;if("string"===a||"number"===a)t.push(o);else if(Array.isArray(o)){if(o.length){var i=n.apply(null,o);i&&t.push(i)}}else if("object"===a){if(o.toString!==Object.prototype.toString&&!o.toString.toString().includes("[native code]")){t.push(o.toString());continue}for(var s in o)e.call(o,s)&&o[s]&&t.push(s)}}}return t.join(" ")}void 0!==t&&t.exports?(n.default=n,t.exports=n):"function"==typeof define&&"object"==typeof define.amd&&define.amd?define("classnames",[],function(){return n}):window.classNames=n}()}},function(){return SP||(0,xP[EP(xP)[0]])((SP={exports:{}}).exports,SP),SP.exports}),PP=NP(RP()),TP="object"==typeof global&&global&&global.Object===Object&&global,DP="object"==typeof self&&self&&self.Object===Object&&self,MP=TP||DP||Function("return this")(),IP=MP.Symbol,AP=Object.prototype,FP=AP.hasOwnProperty,LP=AP.toString,zP=IP?IP.toStringTag:void 0;var $P=function(e){var t=FP.call(e,zP),n=e[zP];try{e[zP]=void 0;var r=!0}catch(e){}var o=LP.call(e);return r&&(t?e[zP]=n:delete e[zP]),o},HP=Object.prototype.toString;var VP=function(e){return HP.call(e)},BP=IP?IP.toStringTag:void 0;var UP=function(e){return null==e?void 0===e?"[object Undefined]":"[object Null]":BP&&BP in Object(e)?$P(e):VP(e)};var WP=function(e){return null!=e&&"object"==typeof e};var qP=function(e){return"symbol"==typeof e||WP(e)&&"[object Symbol]"==UP(e)};var YP=function(e,t){for(var n=-1,r=null==e?0:e.length,o=Array(r);++n<r;)o[n]=t(e[n],n,e);return o},GP=Array.isArray,KP=IP?IP.prototype:void 0,QP=KP?KP.toString:void 0;var XP=function e(t){if("string"==typeof t)return t;if(GP(t))return YP(t,e)+"";if(qP(t))return QP?QP.call(t):"";var n=t+"";return"0"==n&&1/t==-1/0?"-0":n};var ZP=function(e){var t=typeof e;return null!=e&&("object"==t||"function"==t)};var JP,eT=function(e){if(!ZP(e))return!1;var t=UP(e);return"[object Function]"==t||"[object GeneratorFunction]"==t||"[object AsyncFunction]"==t||"[object Proxy]"==t},tT=MP["__core-js_shared__"],nT=(JP=/[^.]+$/.exec(tT&&tT.keys&&tT.keys.IE_PROTO||""))?"Symbol(src)_1."+JP:"";var rT=function(e){return!!nT&&nT in e},oT=Function.prototype.toString;var aT=function(e){if(null!=e){try{return oT.call(e)}catch(e){}try{return e+""}catch(e){}}return""},iT=/^\[object .+?Constructor\]$/,sT=Function.prototype,lT=Object.prototype,uT=sT.toString,cT=lT.hasOwnProperty,dT=RegExp("^"+uT.call(cT).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$");var fT=function(e){return!(!ZP(e)||rT(e))&&(eT(e)?dT:iT).test(aT(e))};var pT=function(e,t){return null==e?void 0:e[t]};var hT=function(e,t){var n=pT(e,t);return fT(n)?n:void 0},mT=hT(MP,"WeakMap");var gT=function(){};var yT=function(e,t,n,r){for(var o=e.length,a=n+(r?1:-1);r?a--:++a<o;)if(t(e[a],a,e))return a;return-1};var vT=function(e){return e!=e};var bT=function(e,t,n){for(var r=n-1,o=e.length;++r<o;)if(e[r]===t)return r;return-1};var wT=function(e,t,n){return t==t?bT(e,t,n):yT(e,vT,n)};var xT=function(e,t){return!!(null==e?0:e.length)&&wT(e,t,0)>-1},ST=/^(?:0|[1-9]\d*)$/;var CT=function(e,t){var n=typeof e;return!!(t=null==t?9007199254740991:t)&&("number"==n||"symbol"!=n&&ST.test(e))&&e>-1&&e%1==0&&e<t};var kT=function(e,t){return e===t||e!=e&&t!=t};var _T=function(e){return"number"==typeof e&&e>-1&&e%1==0&&e<=9007199254740991};var ET=function(e){return null!=e&&_T(e.length)&&!eT(e)},jT=Object.prototype;var OT=function(e){var t=e&&e.constructor;return e===("function"==typeof t&&t.prototype||jT)};var NT=function(e,t){for(var n=-1,r=Array(e);++n<e;)r[n]=t(n);return r};var RT=function(e){return WP(e)&&"[object Arguments]"==UP(e)},PT=Object.prototype,TT=PT.hasOwnProperty,DT=PT.propertyIsEnumerable,MT=RT(function(){return arguments}())?RT:function(e){return WP(e)&&TT.call(e,"callee")&&!DT.call(e,"callee")},IT=MT;var AT=function(){return!1},FT="object"==typeof e&&e&&!e.nodeType&&e,LT=FT&&"object"==typeof module&&module&&!module.nodeType&&module,zT=LT&&LT.exports===FT?MP.Buffer:void 0,$T=(zT?zT.isBuffer:void 0)||AT,HT={};HT["[object Float32Array]"]=HT["[object Float64Array]"]=HT["[object Int8Array]"]=HT["[object Int16Array]"]=HT["[object Int32Array]"]=HT["[object Uint8Array]"]=HT["[object Uint8ClampedArray]"]=HT["[object Uint16Array]"]=HT["[object Uint32Array]"]=!0,HT["[object Arguments]"]=HT["[object Array]"]=HT["[object ArrayBuffer]"]=HT["[object Boolean]"]=HT["[object DataView]"]=HT["[object Date]"]=HT["[object Error]"]=HT["[object Function]"]=HT["[object Map]"]=HT["[object Number]"]=HT["[object Object]"]=HT["[object RegExp]"]=HT["[object Set]"]=HT["[object String]"]=HT["[object WeakMap]"]=!1;var VT=function(e){return WP(e)&&_T(e.length)&&!!HT[UP(e)]};var BT=function(e){return function(t){return e(t)}},UT="object"==typeof e&&e&&!e.nodeType&&e,WT=UT&&"object"==typeof module&&module&&!module.nodeType&&module,qT=WT&&WT.exports===UT&&TP.process,YT=function(){try{var e=WT&&WT.require&&WT.require("util").types;return e||qT&&qT.binding&&qT.binding("util")}catch(e){}}(),GT=YT&&YT.isTypedArray,KT=GT?BT(GT):VT,QT=Object.prototype.hasOwnProperty;var XT=function(e,t){var n=GP(e),r=!n&&IT(e),o=!n&&!r&&$T(e),a=!n&&!r&&!o&&KT(e),i=n||r||o||a,s=i?NT(e.length,String):[],l=s.length;for(var u in e)!t&&!QT.call(e,u)||i&&("length"==u||o&&("offset"==u||"parent"==u)||a&&("buffer"==u||"byteLength"==u||"byteOffset"==u)||CT(u,l))||s.push(u);return s};var ZT=function(e,t){return function(n){return e(t(n))}},JT=ZT(Object.keys,Object),eD=Object.prototype.hasOwnProperty;var tD=function(e){if(!OT(e))return JT(e);var t=[];for(var n in Object(e))eD.call(e,n)&&"constructor"!=n&&t.push(n);return t};var nD=function(e){return ET(e)?XT(e):tD(e)},rD=hT(Object,"create");var oD=function(){this.__data__=rD?rD(null):{},this.size=0};var aD=function(e){var t=this.has(e)&&delete this.__data__[e];return this.size-=t?1:0,t},iD=Object.prototype.hasOwnProperty;var sD=function(e){var t=this.__data__;if(rD){var n=t[e];return"__lodash_hash_undefined__"===n?void 0:n}return iD.call(t,e)?t[e]:void 0},lD=Object.prototype.hasOwnProperty;var uD=function(e){var t=this.__data__;return rD?void 0!==t[e]:lD.call(t,e)};var cD=function(e,t){var n=this.__data__;return this.size+=this.has(e)?0:1,n[e]=rD&&void 0===t?"__lodash_hash_undefined__":t,this};function dD(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}dD.prototype.clear=oD,dD.prototype.delete=aD,dD.prototype.get=sD,dD.prototype.has=uD,dD.prototype.set=cD;var fD=dD;var pD=function(){this.__data__=[],this.size=0};var hD=function(e,t){for(var n=e.length;n--;)if(kT(e[n][0],t))return n;return-1},mD=Array.prototype.splice;var gD=function(e){var t=this.__data__,n=hD(t,e);return!(n<0)&&(n==t.length-1?t.pop():mD.call(t,n,1),--this.size,!0)};var yD=function(e){var t=this.__data__,n=hD(t,e);return n<0?void 0:t[n][1]};var vD=function(e){return hD(this.__data__,e)>-1};var bD=function(e,t){var n=this.__data__,r=hD(n,e);return r<0?(++this.size,n.push([e,t])):n[r][1]=t,this};function wD(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}wD.prototype.clear=pD,wD.prototype.delete=gD,wD.prototype.get=yD,wD.prototype.has=vD,wD.prototype.set=bD;var xD=wD,SD=hT(MP,"Map");var CD=function(){this.size=0,this.__data__={hash:new fD,map:new(SD||xD),string:new fD}};var kD=function(e){var t=typeof e;return"string"==t||"number"==t||"symbol"==t||"boolean"==t?"__proto__"!==e:null===e};var _D=function(e,t){var n=e.__data__;return kD(t)?n["string"==typeof t?"string":"hash"]:n.map};var ED=function(e){var t=_D(this,e).delete(e);return this.size-=t?1:0,t};var jD=function(e){return _D(this,e).get(e)};var OD=function(e){return _D(this,e).has(e)};var ND=function(e,t){var n=_D(this,e),r=n.size;return n.set(e,t),this.size+=n.size==r?0:1,this};function RD(e){var t=-1,n=null==e?0:e.length;for(this.clear();++t<n;){var r=e[t];this.set(r[0],r[1])}}RD.prototype.clear=CD,RD.prototype.delete=ED,RD.prototype.get=jD,RD.prototype.has=OD,RD.prototype.set=ND;var PD=RD;var TD=function(e){return null==e?"":XP(e)};var DD=function(e,t){for(var n=-1,r=t.length,o=e.length;++n<r;)e[o+n]=t[n];return e};var MD=function(e){return function(t){return null==e?void 0:e[t]}};var ID=function(){this.__data__=new xD,this.size=0};var AD=function(e){var t=this.__data__,n=t.delete(e);return this.size=t.size,n};var FD=function(e){return this.__data__.get(e)};var LD=function(e){return this.__data__.has(e)};var zD=function(e,t){var n=this.__data__;if(n instanceof xD){var r=n.__data__;if(!SD||r.length<199)return r.push([e,t]),this.size=++n.size,this;n=this.__data__=new PD(r)}return n.set(e,t),this.size=n.size,this};function $D(e){var t=this.__data__=new xD(e);this.size=t.size}$D.prototype.clear=ID,$D.prototype.delete=AD,$D.prototype.get=FD,$D.prototype.has=LD,$D.prototype.set=zD;var HD=$D;var VD=function(e,t){for(var n=-1,r=null==e?0:e.length,o=0,a=[];++n<r;){var i=e[n];t(i,n,e)&&(a[o++]=i)}return a};var BD=function(){return[]},UD=Object.prototype.propertyIsEnumerable,WD=Object.getOwnPropertySymbols,qD=WD?function(e){return null==e?[]:(e=Object(e),VD(WD(e),function(t){return UD.call(e,t)}))}:BD;var YD=function(e,t,n){var r=t(e);return GP(e)?r:DD(r,n(e))};var GD=function(e){return YD(e,nD,qD)},KD=hT(MP,"DataView"),QD=hT(MP,"Promise"),XD=hT(MP,"Set"),ZD="[object Map]",JD="[object Promise]",eM="[object Set]",tM="[object WeakMap]",nM="[object DataView]",rM=aT(KD),oM=aT(SD),aM=aT(QD),iM=aT(XD),sM=aT(mT),lM=UP;(KD&&lM(new KD(new ArrayBuffer(1)))!=nM||SD&&lM(new SD)!=ZD||QD&&lM(QD.resolve())!=JD||XD&&lM(new XD)!=eM||mT&&lM(new mT)!=tM)&&(lM=function(e){var t=UP(e),n="[object Object]"==t?e.constructor:void 0,r=n?aT(n):"";if(r)switch(r){case rM:return nM;case oM:return ZD;case aM:return JD;case iM:return eM;case sM:return tM}return t});var uM=lM,cM=MP.Uint8Array;var dM=function(e){return this.__data__.set(e,"__lodash_hash_undefined__"),this};var fM=function(e){return this.__data__.has(e)};function pM(e){var t=-1,n=null==e?0:e.length;for(this.__data__=new PD;++t<n;)this.add(e[t])}pM.prototype.add=pM.prototype.push=dM,pM.prototype.has=fM;var hM=pM;var mM=function(e,t){for(var n=-1,r=null==e?0:e.length;++n<r;)if(t(e[n],n,e))return!0;return!1};var gM=function(e,t){return e.has(t)};var yM=function(e,t,n,r,o,a){var i=1&n,s=e.length,l=t.length;if(s!=l&&!(i&&l>s))return!1;var u=a.get(e),c=a.get(t);if(u&&c)return u==t&&c==e;var d=-1,f=!0,p=2&n?new hM:void 0;for(a.set(e,t),a.set(t,e);++d<s;){var h=e[d],m=t[d];if(r)var g=i?r(m,h,d,t,e,a):r(h,m,d,e,t,a);if(void 0!==g){if(g)continue;f=!1;break}if(p){if(!mM(t,function(e,t){if(!gM(p,t)&&(h===e||o(h,e,n,r,a)))return p.push(t)})){f=!1;break}}else if(h!==m&&!o(h,m,n,r,a)){f=!1;break}}return a.delete(e),a.delete(t),f};var vM=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n};var bM=function(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n},wM=IP?IP.prototype:void 0,xM=wM?wM.valueOf:void 0;var SM=function(e,t,n,r,o,a,i){switch(n){case"[object DataView]":if(e.byteLength!=t.byteLength||e.byteOffset!=t.byteOffset)return!1;e=e.buffer,t=t.buffer;case"[object ArrayBuffer]":return!(e.byteLength!=t.byteLength||!a(new cM(e),new cM(t)));case"[object Boolean]":case"[object Date]":case"[object Number]":return kT(+e,+t);case"[object Error]":return e.name==t.name&&e.message==t.message;case"[object RegExp]":case"[object String]":return e==t+"";case"[object Map]":var s=vM;case"[object Set]":var l=1&r;if(s||(s=bM),e.size!=t.size&&!l)return!1;var u=i.get(e);if(u)return u==t;r|=2,i.set(e,t);var c=yM(s(e),s(t),r,o,a,i);return i.delete(e),c;case"[object Symbol]":if(xM)return xM.call(e)==xM.call(t)}return!1},CM=Object.prototype.hasOwnProperty;var kM=function(e,t,n,r,o,a){var i=1&n,s=GD(e),l=s.length;if(l!=GD(t).length&&!i)return!1;for(var u=l;u--;){var c=s[u];if(!(i?c in t:CM.call(t,c)))return!1}var d=a.get(e),f=a.get(t);if(d&&f)return d==t&&f==e;var p=!0;a.set(e,t),a.set(t,e);for(var h=i;++u<l;){var m=e[c=s[u]],g=t[c];if(r)var y=i?r(g,m,c,t,e,a):r(m,g,c,e,t,a);if(!(void 0===y?m===g||o(m,g,n,r,a):y)){p=!1;break}h||(h="constructor"==c)}if(p&&!h){var v=e.constructor,b=t.constructor;v==b||!("constructor"in e)||!("constructor"in t)||"function"==typeof v&&v instanceof v&&"function"==typeof b&&b instanceof b||(p=!1)}return a.delete(e),a.delete(t),p},_M="[object Arguments]",EM="[object Array]",jM="[object Object]",OM=Object.prototype.hasOwnProperty;var NM=function(e,t,n,r,o,a){var i=GP(e),s=GP(t),l=i?EM:uM(e),u=s?EM:uM(t),c=(l=l==_M?jM:l)==jM,d=(u=u==_M?jM:u)==jM,f=l==u;if(f&&$T(e)){if(!$T(t))return!1;i=!0,c=!1}if(f&&!c)return a||(a=new HD),i||KT(e)?yM(e,t,n,r,o,a):SM(e,t,l,n,r,o,a);if(!(1&n)){var p=c&&OM.call(e,"__wrapped__"),h=d&&OM.call(t,"__wrapped__");if(p||h){var m=p?e.value():e,g=h?t.value():t;return a||(a=new HD),o(m,g,n,r,a)}}return!!f&&(a||(a=new HD),kM(e,t,n,r,o,a))};var RM=function e(t,n,r,o,a){return t===n||(null==t||null==n||!WP(t)&&!WP(n)?t!=t&&n!=n:NM(t,n,r,o,e,a))};var PM=function(e,t,n){for(var r=-1,o=null==e?0:e.length;++r<o;)if(n(t,e[r]))return!0;return!1},TM=MD({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"}),DM=/[&<>"']/g,MM=RegExp(DM.source);var IM=function(e){return(e=TD(e))&&MM.test(e)?e.replace(DM,TM):e},AM=/[\\^$.*+?()[\]{}|]/g,FM=RegExp(AM.source);var LM=function(e){return(e=TD(e))&&FM.test(e)?e.replace(AM,"\\$&"):e};var zM=function(e,t){return RM(e,t)},$M=XD&&1/bM(new XD([,-0]))[1]==1/0?function(e){return new XD(e)}:gT,HM=$M;var VM=function(e,t,n){var r=-1,o=xT,a=e.length,i=!0,s=[],l=s;if(n)i=!1,o=PM;else if(a>=200){var u=t?null:HM(e);if(u)return bM(u);i=!1,o=gM,l=new hM}else l=t?[]:s;e:for(;++r<a;){var c=e[r],d=t?t(c):c;if(c=n||0!==c?c:0,i&&d==d){for(var f=l.length;f--;)if(l[f]===d)continue e;t&&l.push(d),s.push(c)}else o(l,d,n)||(l!==s&&l.push(d),s.push(c))}return s};var BM=function(e){return e&&e.length?VM(e):[]},UM={ENTER:[10,13],TAB:9,BACKSPACE:8,UP_ARROW:38,DOWN_ARROW:40,SPACE:32},WM={ENTER:"Enter",TAB:"Tab",COMMA:",",SPACE:" ",SEMICOLON:";"},qM="Press enter to add new tag",YM="text",GM={tags:"ReactTags__tags",tagInput:"ReactTags__tagInput",tagInputField:"ReactTags__tagInputField",selected:"ReactTags__selected",tag:"ReactTags__tag",remove:"ReactTags__remove",suggestions:"ReactTags__suggestions",activeSuggestion:"ReactTags__activeSuggestion",editTagInput:"ReactTags__editTagInput",editTagInputField:"ReactTags__editTagInputField",clearAll:"ReactTags__clearAll"},KM="inline",QM="top",XM="bottom",ZM="Tag limit reached!";function JM(e){const{moveTag:t,readOnly:n,allowDragDrop:r}=e;return void 0!==t&&!n&&r}var eI=e=>{const{readOnly:t,removeComponent:n,onRemove:r,className:o,tag:a,index:i}=e,s=e=>{if(UM.ENTER.includes(e.keyCode)||e.keyCode===UM.SPACE)return e.preventDefault(),void e.stopPropagation();e.keyCode===UM.BACKSPACE&&r(e)};if(t)return m.jsx("span",{});const l=`Tag at index ${i} with value ${a.id} focussed. Press backspace to remove`;if(n){const e=n;return m.jsx(e,{"data-testid":"remove",onRemove:r,onKeyDown:s,className:o,"aria-label":l,tag:a,index:i})}return m.jsx("button",{"data-testid":"remove",onClick:r,onKeyDown:s,className:o,type:"button","aria-label":l,children:m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"12",width:"12",fill:"#fff",children:m.jsx("path",{d:"M376.6 84.5c11.3-13.6 9.5-33.8-4.1-45.1s-33.8-9.5-45.1 4.1L192 206 56.6 43.5C45.3 29.9 25.1 28.1 11.5 39.4S-3.9 70.9 7.4 84.5L150.3 256 7.4 427.5c-11.3 13.6-9.5 33.8 4.1 45.1s33.8 9.5 45.1-4.1L192 306 327.4 468.5c11.3 13.6 31.5 15.4 45.1 4.1s15.4-31.5 4.1-45.1L233.7 256 376.6 84.5z"})})})},tI="tag",nI=e=>{const t=D.useRef(null),{readOnly:n=!1,tag:r,classNames:o,index:a,moveTag:i,allowDragDrop:s=!0,labelField:l="text",tags:u}=e,[{isDragging:c},d]=GR(()=>({type:tI,collect:e=>({isDragging:!!e.isDragging()}),item:e,canDrag:()=>JM({moveTag:i,readOnly:n,allowDragDrop:s})}),[u]),[,f]=ZR(()=>({accept:tI,drop:t=>{const n=t.index,r=a;n!==r&&e?.moveTag?.(n,r)},canDrop:e=>function(e){const{readOnly:t,allowDragDrop:n}=e;return!t&&n}(e)}),[u]);d(f(t));const p=e.tag[l],{className:h=""}=r,g=c?0:1;return m.jsxs("span",{ref:t,className:(0,PP.default)("tag-wrapper",o.tag,h),style:{opacity:g,cursor:JM({moveTag:i,readOnly:n,allowDragDrop:s})?"move":"auto"},"data-testid":"tag",onClick:e.onTagClicked,onTouchStart:e.onTagClicked,children:[p,m.jsx(eI,{tag:e.tag,className:o.remove,removeComponent:e.removeComponent,onRemove:e.onDelete,readOnly:n,index:a})]})},rI=e=>m.jsx("button",{"aria-label":e["aria-label"],className:e.classNames.clearAll,onClick:e.onClick,children:"Clear all"}),oI=(e,t,n,r)=>"function"==typeof r?r(e):e.length>=t&&n,aI=D.memo(e=>{const t=D.createRef(),{labelField:n,minQueryLength:r,isFocused:o,classNames:a,selectedIndex:i,query:s}=e;D.useEffect(()=>{if(!t.current)return;const e=t.current.querySelector(`.${a.activeSuggestion}`);e&&((e,t)=>{const n=t.offsetHeight,r=e.offsetHeight,o=e.offsetTop-t.scrollTop;o+r>=n?t.scrollTop+=o-n+r:o<0&&(t.scrollTop+=o)})(e,t.current)},[i]);const l=(e,t)=>{const r=t.trim().replace(/[-\\^$*+?.()|[\]{}]/g,"\\$&"),{[n]:o}=e;return{__html:o.replace(RegExp(r,"gi"),e=>`<mark>${IM(e)}</mark>`)}},u=(t,n)=>"function"==typeof e.renderSuggestion?e.renderSuggestion(t,n):m.jsx("span",{dangerouslySetInnerHTML:l(t,n)}),c=e.suggestions.map((t,n)=>m.jsx("li",{onMouseDown:e.handleClick.bind(null,n),onTouchStart:e.handleClick.bind(null,n),onMouseOver:e.handleHover.bind(null,n),className:n===e.selectedIndex?e.classNames.activeSuggestion:"",children:u(t,e.query)},n));return 0!==c.length&&oI(s,r||2,o,e.shouldRenderSuggestions)?m.jsx("div",{ref:t,className:a.suggestions,"data-testid":"suggestions",children:m.jsxs("ul",{children:[" ",c," "]})}):null},(e,t)=>{const{query:n,minQueryLength:r=2,isFocused:o,suggestions:a}=t;return!(e.isFocused!==o||!zM(e.suggestions,a)||oI(n,r,o,t.shouldRenderSuggestions)!==oI(e.query,e.minQueryLength??2,e.isFocused,e.shouldRenderSuggestions)||e.selectedIndex!==t.selectedIndex)}),iI=aI,sI=NP(RP()),lI=e=>{const{autofocus:t,autoFocus:n,readOnly:r,labelField:o,allowDeleteFromEmptyInput:a,allowAdditionFromPaste:i,allowDragDrop:s,minQueryLength:l,shouldRenderSuggestions:u,removeComponent:c,autocomplete:d,inline:f,maxTags:p,allowUnique:h,editable:g,placeholder:y,delimiters:v,separators:b,tags:w,inputFieldPosition:x,inputProps:S,classNames:C,maxLength:k,inputValue:_,clearAll:E,ariaAttrs:j}=e,[O,N]=D.useState(e.suggestions),[R,P]=D.useState(""),[T,M]=D.useState(!1),[I,A]=D.useState(-1),[F,L]=D.useState(!1),[z,$]=D.useState(""),[H,V]=D.useState(-1),[B,U]=D.useState(""),W=D.createRef(),q=D.useRef(null),Y=D.useRef(null);D.useEffect(()=>{v.length&&console.warn("[Deprecation] The delimiters prop is deprecated and will be removed in v7.x.x, please use separators instead. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/960")},[]),D.useEffect(()=>{void 0!==f&&console.warn("[Deprecation] The inline attribute is deprecated and will be removed in v7.x.x, please use inputFieldPosition instead.")},[f]),D.useEffect(()=>{void 0!==t&&console.warn("[Deprecated] autofocus prop will be removed in 7.x so please migrate to autoFocus prop."),(t||n&&!1!==t)&&!r&&Q()},[n,n,r]),D.useEffect(()=>{ee()},[R,e.suggestions]);const G=t=>{let n=e.suggestions.slice();if(h){const e=w.map(e=>e.id.trim().toLowerCase());n=n.filter(t=>!e.includes(t.id.toLowerCase()))}if(e.handleFilterSuggestions)return e.handleFilterSuggestions(t,n);const r=n.filter(e=>0===K(t,e)),o=n.filter(e=>K(t,e)>0);return r.concat(o)},K=(e,t)=>t[o].toLowerCase().indexOf(e.toLowerCase()),Q=()=>{P(""),q.current&&(q.current.value="",q.current.focus())},X=(t,n)=>{n.preventDefault(),n.stopPropagation();const r=w.slice();0!==r.length&&(U(""),e?.handleDelete?.(t,n),Z(t,r))},Z=(e,t)=>{if(!W?.current)return;const n=W.current.querySelectorAll(".ReactTags__remove");let r="";0===e&&t.length>1?(r=`Tag at index ${e} with value ${t[e].id} deleted. Tag at index 0 with value ${t[1].id} focussed. Press backspace to remove`,n[0].focus()):e>0?(r=`Tag at index ${e} with value ${t[e].id} deleted. Tag at index ${e-1} with value ${t[e-1].id} focussed. Press backspace to remove`,n[e-1].focus()):(r=`Tag at index ${e} with value ${t[e].id} deleted. Input focussed. Press enter to add a new tag`,q.current?.focus()),$(r)},J=t=>{e.handleInputChange&&e.handleInputChange(t.target.value,t);const n=t.target.value.trim();P(n)},ee=()=>{const e=G(R);N(e),A(I>=e.length?e.length-1:I)},te=t=>{const n=t.target.value;e.handleInputFocus&&e.handleInputFocus(n,t),M(!0)},ne=t=>{const n=t.target.value;e.handleInputBlur&&(e.handleInputBlur(n,t),q.current&&(q.current.value="")),M(!1),V(-1)},re=e=>{if(!e.nativeEvent.isComposing){if("Escape"===e.key&&(e.preventDefault(),e.stopPropagation(),A(-1),L(!1),N([]),V(-1)),(-1!==b.indexOf(e.key)||-1!==v.indexOf(e.keyCode))&&!e.shiftKey){e.keyCode===UM.TAB&&""===R||e.preventDefault();const t=F&&-1!==I?O[I]:{id:R.trim(),[o]:R.trim(),className:""};Object.keys(t)&&ie(t)}"Backspace"!==e.key||""!==R||!a&&x!==KM||X(w.length-1,e),e.keyCode===UM.UP_ARROW&&(e.preventDefault(),A(I<=0?O.length-1:I-1),L(!0)),e.keyCode===UM.DOWN_ARROW&&(e.preventDefault(),L(!0),0===O.length?A(-1):A((I+1)%O.length))}},oe=()=>p&&w.length>=p,ae=t=>{if(!i)return;if(oe())return U(ZM),void Q();U(""),t.preventDefault();const n=t.clipboardData||window.clipboardData,r=n.getData("text"),{maxLength:a=r.length}=e,s=Math.min(a,r.length),l=n.getData("text").substr(0,s);let u=v;b.length&&(u=[],b.forEach(e=>{const t=function(e){switch(e){case WM.ENTER:return[10,13];case WM.TAB:return 9;case WM.COMMA:return 188;case WM.SPACE:return 32;case WM.SEMICOLON:return 186;default:return 0}}(e);Array.isArray(t)?u=[...u,...t]:u.push(t)}));const c=function(e){const t=e.map(e=>{const t=e-48*Math.floor(e/48);return String.fromCharCode(96<=e?t:e)}).join(""),n=LM(t);return new RegExp(`[${n}]+`)}(u),d=l.split(c).map(e=>e.trim());BM(d).forEach(e=>ie({id:e.trim(),[o]:e.trim(),className:""}))},ie=t=>{if(!t.id||!t[o])return;if(-1===H){if(oe())return U(ZM),void Q();U("")}const n=w.map(e=>e.id.toLowerCase());if(!(h&&n.indexOf(t.id.trim().toLowerCase())>=0)){if(d){const e=G(t[o]);console.warn("[Deprecation] The autocomplete prop will be removed in 7.x to simplify the integration and make it more intutive. If you have any concerns regarding this, please share your thoughts in https://github.com/react-tags/react-tags/issues/949"),(1===d&&1===e.length||!0===d&&e.length)&&(t=e[0])}-1!==H&&e.onTagUpdate?e.onTagUpdate(H,t):e?.handleAddition?.(t),P(""),L(!1),A(-1),V(-1),Q()}},se=(t,n)=>{const r=w[t];e?.handleDrag?.(r,t,n)},le=(()=>{const t={...GM,...e.classNames};return w.map((n,a)=>m.jsx(D.Fragment,{children:H===a?m.jsx("div",{className:t.editTagInput,children:m.jsx("input",{ref:e=>{Y.current=e},onFocus:te,value:R,onChange:J,onKeyDown:re,onBlur:ne,className:t.editTagInputField,onPaste:ae,"data-testid":"tag-edit"})}):m.jsx(nI,{index:a,tag:n,tags:w,labelField:o,onDelete:e=>X(a,e),moveTag:s?se:void 0,removeComponent:c,onTagClicked:t=>((t,n,a)=>{r||(g&&(V(t),P(n[o]),Y.current?.focus()),e.handleTagClick?.(t,a))})(a,n,t),readOnly:r,classNames:t,allowDragDrop:s})},a))})(),ue={...GM,...C},{name:ce,id:de}=e,fe=!1===f?XM:x,pe=r?null:m.jsxs("div",{className:ue.tagInput,children:[m.jsx("input",{...S,ref:e=>{q.current=e},className:ue.tagInputField,type:"text",placeholder:y,"aria-label":y,onFocus:te,onBlur:ne,onChange:J,onKeyDown:re,onPaste:ae,name:ce,id:de,maxLength:k,value:_,"data-automation":"input","data-testid":"input"}),m.jsx(iI,{query:R.trim(),suggestions:O,labelField:o,selectedIndex:I,handleClick:e=>{ie(O[e])},handleHover:e=>{A(e),L(!0)},minQueryLength:l,shouldRenderSuggestions:u,isFocused:T,classNames:ue,renderSuggestion:e.renderSuggestion}),E&&w.length>0&&m.jsx(rI,{"aria-label":j?.clearAllLabel,classNames:ue,onClick:()=>{e.onClearAll&&e.onClearAll(),U(""),Q()}}),B&&m.jsxs("div",{"data-testid":"error",className:"ReactTags__error",children:[m.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 512 512",height:"24",width:"24",fill:"#e03131",children:m.jsx("path",{d:"M256 32c14.2 0 27.3 7.5 34.5 19.8l216 368c7.3 12.4 7.3 27.7 .2 40.1S486.3 480 472 480H40c-14.3 0-27.6-7.7-34.7-20.1s-7-27.8 .2-40.1l216-368C228.7 39.5 241.8 32 256 32zm0 128c-13.3 0-24 10.7-24 24V296c0 13.3 10.7 24 24 24s24-10.7 24-24V184c0-13.3-10.7-24-24-24zm32 224a32 32 0 1 0 -64 0 32 32 0 1 0 64 0z"})}),B]})]});return m.jsxs("div",{className:(0,sI.default)(ue.tags,"react-tags-wrapper"),ref:W,children:[m.jsx("p",{role:"alert",className:"sr-only",style:{position:"absolute",overflow:"hidden",clip:"rect(0 0 0 0)",margin:"-1px",padding:0,width:"1px",height:"1px",border:0},children:z}),fe===QM&&pe,m.jsxs("div",{className:ue.selected,children:[le,fe===KM&&pe]}),fe===XM&&pe]})},uI=e=>{const{placeholder:t=qM,labelField:n=YM,suggestions:r=[],delimiters:o=[],separators:a=(e.delimiters?.length?[]:[WM.ENTER,WM.TAB]),autofocus:i,autoFocus:s=!0,inline:l,inputFieldPosition:u="inline",allowDeleteFromEmptyInput:c=!1,allowAdditionFromPaste:d=!0,autocomplete:f=!1,readOnly:p=!1,allowUnique:h=!0,allowDragDrop:g=!0,tags:y=[],inputProps:v={},editable:b=!1,clearAll:w=!1,ariaAttrs:x={clearAllLabel:"clear all tags"},handleDelete:S,handleAddition:C,onTagUpdate:k,handleDrag:_,handleFilterSuggestions:E,handleTagClick:j,handleInputChange:O,handleInputFocus:N,handleInputBlur:R,minQueryLength:P,shouldRenderSuggestions:T,removeComponent:D,onClearAll:M,classNames:I,name:A,id:F,maxLength:L,inputValue:z,maxTags:$,renderSuggestion:H}=e;return m.jsx(lI,{placeholder:t,labelField:n,suggestions:r,delimiters:o,separators:a,autofocus:i,autoFocus:s,inline:l,inputFieldPosition:u,allowDeleteFromEmptyInput:c,allowAdditionFromPaste:d,autocomplete:f,readOnly:p,allowUnique:h,allowDragDrop:g,tags:y,inputProps:v,editable:b,clearAll:w,ariaAttrs:x,handleDelete:S,handleAddition:C,onTagUpdate:k,handleDrag:_,handleFilterSuggestions:E,handleTagClick:j,handleInputChange:O,handleInputFocus:N,handleInputBlur:R,minQueryLength:P,shouldRenderSuggestions:T,removeComponent:D,onClearAll:M,classNames:I,name:A,id:F,maxLength:L,inputValue:z,maxTags:$,renderSuggestion:H})},cI=({...e})=>m.jsx(CR,{backend:wP,children:m.jsx(uI,{...e})});
224
224
  /*! Bundled license information:
225
225
 
226
226
  classnames/index.js: