@embedreach/components 0.1.80 → 0.1.82
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/chunks/index.js +11 -2
- package/dist/index.umd.js +1 -1
- package/package.json +1 -1
package/dist/index.umd.js
CHANGED
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
*
|
|
50
50
|
* This source code is licensed under the MIT license found in the
|
|
51
51
|
* LICENSE file in the root directory of this source tree.
|
|
52
|
-
*/cD.exports="production"===process.env.NODE_ENV?function(){if(lD)return uD;lD=1;var e="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},t=n.useState,r=n.useEffect,o=n.useLayoutEffect,i=n.useDebugValue;function s(t){var n=t.getSnapshot;t=t.value;try{var r=n();return!e(t,r)}catch(o){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,n){var a=n(),l=t({inst:{value:a,getSnapshot:n}}),c=l[0].inst,u=l[1];return o((function(){c.value=a,c.getSnapshot=n,s(c)&&u({inst:c})}),[e,a,n]),r((function(){return s(c)&&u({inst:c}),e((function(){s(c)&&u({inst:c})}))}),[e]),i(a),a};return uD.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:a,uD}():(dD||(dD=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(o){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=n,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(n,u){l||void 0===t.startTransition||(l=!0);var d=u();if(!c){var p=u();r(d,p)||(c=!0)}var f=(p=o({inst:{value:d,getSnapshot:u}}))[0].inst,h=p[1];return s((function(){f.value=d,f.getSnapshot=u,e(f)&&h({inst:f})}),[n,d,u]),i((function(){return e(f)&&h({inst:f}),n((function(){e(f)&&h({inst:f})}))}),[n]),a(d),d};pD.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),pD);var fD=cD.exports,hD='[cmdk-group=""]',mD='[cmdk-group-items=""]',gD='[cmdk-item=""]',yD=`${gD}:not([aria-disabled="true"])`,vD="cmdk-item-select",bD="data-value",xD=(e,t,n)=>aD(e,t,n),wD=i.createContext(void 0),SD=()=>i.useContext(wD),CD=i.createContext(void 0),kD=()=>i.useContext(CD),ED=i.createContext(void 0),_D=i.forwardRef(((e,t)=>{let n=qD((()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",filtered:{count:0,items:new Map,groups:new Set}}})),r=qD((()=>new Set)),o=qD((()=>new Map)),s=qD((()=>new Map)),a=qD((()=>new Set)),l=FD(e),{label:c,children:u,value:d,onValueChange:p,filter:f,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:y=!0,...v}=e,b=T_(),x=T_(),w=T_(),S=i.useRef(null),C=VD();$D((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),$D((()=>{C(6,P)}),[]);let k=i.useMemo((()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)N(),j(),C(1,T);else if("value"===e&&(r||C(5,P),void 0!==(null==(o=l.current)?void 0:o.value))){return void(null==(s=(i=l.current).onValueChange)||s.call(i,null!=t?t:""))}k.emit()}},emit:()=>{a.current.forEach((e=>e()))}})),[]),E=i.useMemo((()=>({value:(e,t,r)=>{var o;t!==(null==(o=s.current.get(e))?void 0:o.value)&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,_(t,r)),C(2,(()=>{j(),k.emit()})))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),C(3,(()=>{N(),j(),n.current.value||T(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=D();C(4,(()=>{N(),(null==t?void 0:t.getAttribute("id"))===e&&T(),k.emit()}))}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:x,listInnerRef:S})),[]);function _(e,t){var r,o;let i=null!=(o=null==(r=l.current)?void 0:r.filter)?o:xD;return e?i(e,n.current.search,t):0}function j(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach((n=>{let r=o.current.get(n),i=0;r.forEach((t=>{let n=e.get(t);i=Math.max(n,i)})),t.push([n,i])}));let r=S.current;M().sort(((t,n)=>{var r,o;let i=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(o=e.get(i))?o:0)})).forEach((e=>{let t=e.closest(mD);t?t.appendChild(e.parentElement===t?e:e.closest(`${mD} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${mD} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{var t;let n=null==(t=S.current)?void 0:t.querySelector(`${hD}[${bD}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)}))}function T(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(bD);k.setState("value",t||void 0)}function N(){var e,t,i,a;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=_(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(a=null==(i=s.current.get(o))?void 0:i.keywords)?a:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[r,s]of o.current)for(let e of s)if(n.current.filtered.items.get(e)>0){n.current.filtered.groups.add(r);break}n.current.filtered.count=c}function P(){var e,t,n;let r=D();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(hD))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function D(){var e;return null==(e=S.current)?void 0:e.querySelector(`${gD}[aria-selected="true"]`)}function M(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(yD))||[])}function A(e){let t=M()[e];t&&k.setState("value",t.getAttribute(bD))}function O(e){var t;let n=D(),r=M(),o=r.findIndex((e=>e===n)),i=r[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),i&&k.setState("value",i.getAttribute(bD))}function R(e){let t,n=D(),r=null==n?void 0:n.closest(hD);for(;r&&!t;)r=e>0?LD(r,hD):ID(r,hD),t=null==r?void 0:r.querySelector(yD);t?k.setState("value",t.getAttribute(bD)):O(e)}let L=()=>A(M().length-1),I=e=>{e.preventDefault(),e.metaKey?L():e.altKey?R(1):O(1)},F=e=>{e.preventDefault(),e.metaKey?A(0):e.altKey?R(-1):O(-1)};return i.createElement(f_.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=v.onKeyDown)||t.call(v,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":y&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),A(0);break;case"End":e.preventDefault(),L();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=D();if(t){let e=new Event(vD);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:HD},c),KD(e,(e=>i.createElement(CD.Provider,{value:k},i.createElement(wD.Provider,{value:E},e)))))})),jD=i.forwardRef(((e,t)=>{var n,r;let o=T_(),s=i.useRef(null),a=i.useContext(ED),l=SD(),c=FD(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;$D((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=BD(o,s,[e.value,e.children,s],e.keywords),p=kD(),f=zD((e=>e.value&&e.value===d.current)),h=zD((e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0)));function m(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){p.setState("value",d.current,!0)}if(i.useEffect((()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(vD,m),()=>t.removeEventListener(vD,m)}),[h,e.onSelect,e.disabled]),!h)return null;let{disabled:y,value:v,onSelect:b,forceMount:x,keywords:w,...S}=e;return i.createElement(f_.div,{ref:UD([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!f,"data-disabled":!!y,"data-selected":!!f,onPointerMove:y||l.getDisablePointerSelection()?void 0:g,onClick:y?void 0:m},e.children)})),TD=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=T_(),l=i.useRef(null),c=i.useRef(null),u=T_(),d=SD(),p=zD((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));$D((()=>d.group(a)),[]),BD(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(f_.div,{ref:UD([l,t]),...s,"cmdk-group":"",role:"presentation",hidden:!p||void 0},n&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),KD(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement(ED.Provider,{value:f},e)))))})),ND=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=zD((e=>!e.search));return n||s?i.createElement(f_.div,{ref:UD([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),PD=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=kD(),a=zD((e=>e.search)),l=zD((e=>e.value)),c=SD(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${gD}[${bD}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return i.useEffect((()=>{null!=e.value&&s.setState("search",e.value)}),[e.value]),i.createElement(f_.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||s.setState("search",e.target.value),null==n||n(e.target.value)}})})),DD=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=SD();return i.useEffect((()=>{if(a.current&&s.current){let e,t=a.current,n=s.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{n.style.setProperty("--cmdk-list-height",t.offsetHeight.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),i.createElement(f_.div,{ref:UD([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},KD(e,(e=>i.createElement("div",{ref:UD([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),MD=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(Tm,{open:n,onOpenChange:r},i.createElement(Nm,{container:a},i.createElement(Pm,{"cmdk-overlay":"",className:o}),i.createElement(Dm,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(_D,{ref:t,...l}))))})),AD=i.forwardRef(((e,t)=>zD((e=>0===e.filtered.count))?i.createElement(f_.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),OD=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(f_.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},KD(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),RD=Object.assign(_D,{List:DD,Item:jD,Input:PD,Group:TD,Separator:ND,Dialog:MD,Empty:AD,Loading:OD});function LD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ID(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function FD(e){let t=i.useRef(e);return $D((()=>{t.current=e})),t}var $D="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function qD(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function UD(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function zD(e){let t=kD(),n=()=>e(t.snapshot());return fD.useSyncExternalStore(t.subscribe,n,n)}function BD(e,t,n,r=[]){let o=i.useRef(),s=SD();return $D((()=>{var i;let a=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=r.map((e=>e.trim()));s.value(e,a,l),null==(i=t.current)||i.setAttribute(bD,a),o.current=a})),o}var VD=()=>{let[e,t]=i.useState(),n=qD((()=>new Map));return $D((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function KD({asChild:e,children:t},n){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var HD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const WD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD,{ref:r,className:_d("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));WD.displayName=RD.displayName;const GD=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(xu,{className:"mr-2 h-4 w-4 shrink-0 opacity-50 "}),t.jsx(RD.Input,{ref:o,className:_d("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})));GD.displayName=RD.Input.displayName;const YD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD.List,{ref:r,className:_d("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));YD.displayName=RD.List.displayName;const QD=i.forwardRef(((e,n)=>t.jsx(RD.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));QD.displayName=RD.Empty.displayName;const XD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD.Group,{ref:r,className:_d("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n})));XD.displayName=RD.Group.displayName;const JD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD.Separator,{ref:r,className:_d("-mx-1 h-px bg-border",e),...n})));JD.displayName=RD.Separator.displayName;const ZD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD.Item,{ref:r,className:_d("relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...n})));ZD.displayName=RD.Item.displayName;var eM,tM="dismissableLayer.update",nM="dismissableLayer.pointerDownOutside",rM="dismissableLayer.focusOutside",oM=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),iM=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(oM),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=uf(n,(e=>f(e))),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){aM(nM,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h),k=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){aM(rM,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return g_((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(eM=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),sM(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=eM)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),sM())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(tM,e),()=>document.removeEventListener(tM,e)}),[]),t.jsx(f_.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:i_(e.onFocusCapture,k.onFocusCapture),onBlurCapture:i_(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:i_(e.onPointerDownCapture,C.onPointerDownCapture)})}));iM.displayName="DismissableLayer";function sM(){const e=new CustomEvent(tM);document.dispatchEvent(e)}function aM(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?h_(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(oM),o=i.useRef(null),s=uf(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(f_.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var lM=0;function cM(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uM()),document.body.insertAdjacentElement("beforeend",e[1]??uM()),lM++,()=>{1===lM&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),lM--}}),[])}function uM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var dM="focusScope.autoFocusOnMount",pM="focusScope.autoFocusOnUnmount",fM={bubbles:!1,cancelable:!0},hM=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=m_(s),p=m_(a),f=i.useRef(null),h=uf(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:vM(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||vM(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&vM(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){bM.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(dM,fM);c.addEventListener(dM,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vM(r,{select:t}),document.activeElement!==n)return}((e=mM(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&vM(c))}return()=>{c.removeEventListener(dM,d),setTimeout((()=>{const e=new CustomEvent(pM,fM);c.addEventListener(pM,p),c.dispatchEvent(e),e.defaultPrevented||vM(t??document.body,{select:!0}),c.removeEventListener(pM,p),bM.remove(m)}),0)}}var e}),[c,d,p,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=mM(e),n=gM(t,e),r=gM(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&vM(i,{select:!0})):(e.preventDefault(),r&&vM(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(f_.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})}));function mM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function gM(e,t){for(const n of e)if(!yM(n,{upTo:t}))return n}function yM(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function vM(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hM.displayName="FocusScope";var bM=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xM(e,t),e.unshift(t)},remove(t){e=xM(e,t),e[0]?.resume()}}}();function xM(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var wM="Popover",[SM,CM]=s_(wM,[lT]),kM=lT(),[EM,_M]=SM(wM),jM=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=kM(n),u=i.useRef(null),[d,p]=i.useState(!1),[f=!1,h]=DT({prop:o,defaultProp:s,onChange:a});return t.jsx(kT,{...c,children:t.jsx(EM,{scope:n,contentId:T_(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback((()=>p(!0)),[]),onCustomAnchorRemove:i.useCallback((()=>p(!1)),[]),modal:l,children:r})})};jM.displayName=wM;var TM="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=_M(TM,r),a=kM(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(ET,{...a,...o,ref:n})})).displayName=TM;var NM="PopoverTrigger",PM=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=_M(NM,r),s=kM(r),a=uf(n,i.triggerRef),l=t.jsx(f_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":UM(i.open),...o,ref:a,onClick:i_(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(ET,{asChild:!0,...s,children:l})}));PM.displayName=NM;var DM="PopoverPortal",[MM,AM]=SM(DM,{forceMount:void 0}),OM=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=_M(DM,n);return t.jsx(MM,{scope:n,forceMount:r,children:t.jsx(NT,{present:r||s.open,children:t.jsx(TT,{asChild:!0,container:i,children:o})})})};OM.displayName=DM;var RM="PopoverContent",LM=i.forwardRef(((e,n)=>{const r=AM(RM,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=_M(RM,e.__scopePopover);return t.jsx(NT,{present:o||s.open,children:t.jsx(s.modal?IM:FM,{...i,ref:n})})}));LM.displayName=RM;var IM=i.forwardRef(((e,n)=>{const r=_M(RM,e.__scopePopover),o=i.useRef(null),s=uf(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return Yh(e)}),[]),t.jsx(zh,{as:l_,allowPinchZoom:!0,children:t.jsx($M,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:i_(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:i_(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:i_(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),FM=i.forwardRef(((e,n)=>{const r=_M(RM,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx($M,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),$M=i.forwardRef(((e,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...p}=e,f=_M(RM,r),h=kM(r);return cM(),t.jsx(hM,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(iM,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(_T,{"data-state":UM(f.open),role:"dialog",id:f.contentId,...h,...p,ref:n,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),qM="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=_M(qM,r);return t.jsx(f_.button,{type:"button",...o,ref:n,onClick:i_(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=qM;function UM(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=kM(r);return t.jsx(jT,{...i,...o,ref:n})})).displayName="PopoverArrow";var zM=OM,BM=LM;const VM=jM,KM=PM,HM=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,...o},i)=>t.jsx(zM,{children:t.jsx(BM,{ref:i,align:n,sideOffset:r,className:_d("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",e),...o})})));HM.displayName=BM.displayName;const WM=({options:e,value:n,onChange:r,placeholder:o})=>{const[s,a]=i.useState(!1);return t.jsxs(VM,{modal:!0,open:s,onOpenChange:a,children:[t.jsx(KM,{asChild:!0,children:t.jsxs(nk,{"aria-expanded":s,className:"w-[200px] overflow-hidden justify-between",variant:"outline",children:[n?e.find((e=>e.value===n))?.label:o,t.jsx(nu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(HM,{className:"w-[200px] p-0",children:t.jsxs(WD,{children:[t.jsx(GD,{placeholder:`Search ${o.toLowerCase()}...`}),t.jsxs(YD,{children:[t.jsxs(QD,{children:["No ",o.toLowerCase()," found."]}),t.jsx(XD,{children:e.map((e=>t.jsxs(ZD,{value:e.value,onSelect:e=>{r(e===n?"":e),a(!1)},children:[t.jsx(Xc,{className:_d("mr-2 h-4 w-4",n===e.value?"opacity-100":"opacity-0")}),e.label]},e.id||e.value)))})]})]})})]})};function GM(e){return(GM="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)}function YM(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function QM(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function XM(e){QM(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===GM(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function JM(e,t){QM(2,arguments);var n=XM(e),r=YM(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function ZM(e,t){QM(2,arguments);var n=XM(e),r=YM(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());return i.setMonth(n.getMonth()+r+1,0),o>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var eA={};function tA(){return eA}function nA(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=XM(e),f=p.getDay(),h=(f<d?7:0)+f-d;return p.setDate(p.getDate()-h),p.setHours(0,0,0,0),p}function rA(e){return QM(1,arguments),nA(e,{weekStartsOn:1})}function oA(e){QM(1,arguments);var t=function(e){QM(1,arguments);var t=XM(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=rA(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=rA(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),rA(n)}function iA(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function sA(e){QM(1,arguments);var t=XM(e);return t.setHours(0,0,0,0),t}function aA(e,t){QM(2,arguments);var n=sA(e),r=sA(t),o=n.getTime()-iA(n),i=r.getTime()-iA(r);return Math.round((o-i)/864e5)}function lA(e,t){return QM(2,arguments),JM(e,7*YM(t))}function cA(e,t){return QM(2,arguments),ZM(e,12*YM(t))}function uA(e,t){QM(2,arguments);var n=sA(e),r=sA(t);return n.getTime()===r.getTime()}function dA(e){return QM(1,arguments),e instanceof Date||"object"===GM(e)&&"[object Date]"===Object.prototype.toString.call(e)}function pA(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function fA(e){QM(1,arguments);var t=XM(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function hA(e){QM(1,arguments);var t=XM(e);return t.setDate(1),t.setHours(0,0,0,0),t}function mA(e){QM(1,arguments);var t=XM(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function gA(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=XM(e),f=p.getDay(),h=6+(f<d?-7:0)-(f-d);return p.setDate(p.getDate()+h),p.setHours(23,59,59,999),p}function yA(e){return QM(1,arguments),gA(e,{weekStartsOn:1})}function vA(e,t){return QM(2,arguments),function(e,t){QM(2,arguments);var n=XM(e).getTime(),r=YM(t);return new Date(n+r)}(e,-YM(t))}function bA(e){QM(1,arguments);var t=XM(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function xA(e){QM(1,arguments);var t=XM(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=bA(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=bA(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function wA(e){QM(1,arguments);var t=XM(e),n=bA(t).getTime()-function(e){QM(1,arguments);var t=xA(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),bA(n)}(t).getTime();return Math.round(n/6048e5)+1}function SA(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=XM(e),f=p.getUTCDay(),h=(f<d?7:0)+f-d;return p.setUTCDate(p.getUTCDate()-h),p.setUTCHours(0,0,0,0),p}function CA(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=XM(e),d=u.getUTCFullYear(),p=tA(),f=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:p.firstWeekContainsDate)&&void 0!==r?r:null===(l=p.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(d+1,0,f),h.setUTCHours(0,0,0,0);var m=SA(h,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var y=SA(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=y.getTime()?d:d-1}function kA(e,t){QM(1,arguments);var n=XM(e),r=SA(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),p=CA(e,t),f=new Date(0);return f.setUTCFullYear(p,0,d),f.setUTCHours(0,0,0,0),SA(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function EA(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var _A=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return EA("yy"===t?r%100:r,t.length)},jA=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):EA(n+1,2)},TA=function(e,t){return EA(e.getUTCDate(),t.length)},NA=function(e,t){return EA(e.getUTCHours()%12||12,t.length)},PA=function(e,t){return EA(e.getUTCHours(),t.length)},DA=function(e,t){return EA(e.getUTCMinutes(),t.length)},MA=function(e,t){return EA(e.getUTCSeconds(),t.length)},AA=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return EA(Math.floor(r*Math.pow(10,n-3)),t.length)},OA="midnight",RA="noon",LA="morning",IA="afternoon",FA="evening",$A="night",qA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return _A(e,t)},Y:function(e,t,n,r){var o=CA(e,r),i=o>0?o:1-o;return"YY"===t?EA(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):EA(i,t.length)},R:function(e,t){return EA(xA(e),t.length)},u:function(e,t){return EA(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return EA(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return EA(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return jA(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return EA(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=kA(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):EA(o,t.length)},I:function(e,t,n){var r=wA(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):EA(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):TA(e,t)},D:function(e,t,n){var r=function(e){QM(1,arguments);var t=XM(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime();return Math.floor((n-r)/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):EA(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return EA(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return EA(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return EA(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?RA:0===o?OA:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?FA:o>=12?IA:o>=4?LA:$A,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return NA(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):PA(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):EA(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):EA(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):DA(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):MA(e,t)},S:function(e,t){return AA(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return zA(o);case"XXXX":case"XX":return BA(o);default:return BA(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return zA(o);case"xxxx":case"xx":return BA(o);default:return BA(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+UA(o,":");default:return"GMT"+BA(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+UA(o,":");default:return"GMT"+BA(o,":")}},t:function(e,t,n,r){return EA(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return EA((r._originalDate||e).getTime(),t.length)}};function UA(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var s=t;return n+String(o)+s+EA(i,2)}function zA(e,t){return e%60==0?(e>0?"-":"+")+EA(Math.abs(e)/60,2):BA(e,t)}function BA(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+EA(Math.floor(o/60),2)+n+EA(o%60,2)}var VA=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},KA=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},HA={p:KA,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return VA(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",VA(o,t)).replace("{{time}}",KA(i,t))}},WA=["D","DD"],GA=["YY","YYYY"];function YA(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var QA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function XA(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var JA={date:XA({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:XA({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:XA({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ZA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function eO(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var s=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var tO={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:eO({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:eO({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:eO({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:eO({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:eO({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function nO(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;var i,s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(function(e){return e.test(s)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(a,(function(e){return e.test(s)}));return i=e.valueCallback?e.valueCallback(l):l,{value:i=n.valueCallback?n.valueCallback(i):i,rest:t.slice(s.length)}}}var rO={ordinalNumber:function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:nO({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:nO({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:nO({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:nO({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:nO({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},oO={code:"en-US",formatDistance:function(e,t,n){var r,o=QA[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:JA,formatRelative:function(e,t,n,r){return ZA[e]},localize:tO,match:rO,options:{weekStartsOn:0,firstWeekContainsDate:1}},iO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aO=/^'([^]*?)'?$/,lO=/''/g,cO=/[a-zA-Z]/;function uO(e,t,n){var r,o,i,s,a,l,c,u,d,p,f,h,m,g,y,v,b,x;QM(2,arguments);var w=String(t),S=tA(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:oO,k=YM(null!==(i=null!==(s=null!==(a=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==a?a:S.firstWeekContainsDate)&&void 0!==s?s:null===(d=S.locale)||void 0===d||null===(p=d.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==i?i:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=YM(null!==(f=null!==(h=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(y=n.locale)||void 0===y||null===(v=y.options)||void 0===v?void 0:v.weekStartsOn)&&void 0!==m?m:S.weekStartsOn)&&void 0!==h?h:null===(b=S.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==f?f:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var _=XM(e);if(!function(e){if(QM(1,arguments),!dA(e)&&"number"!=typeof e)return!1;var t=XM(e);return!isNaN(Number(t))}(_))throw new RangeError("Invalid time value");var j=vA(_,iA(_)),T={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:_};return w.match(sO).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,HA[t])(e,C.formatLong):e})).join("").match(iO).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(aO);if(!t)return e;return t[1].replace(lO,"'")}(r);var i=qA[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===GA.indexOf(r)||YA(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==WA.indexOf(e)}(r)||YA(r,t,String(e)),i(j,r,C.localize,T);if(o.match(cO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function dO(e){return QM(1,arguments),Math.floor(function(e){return QM(1,arguments),XM(e).getTime()}(e)/1e3)}function pO(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),p=function(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=XM(e),d=u.getFullYear(),p=tA(),f=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:p.firstWeekContainsDate)&&void 0!==r?r:null===(l=p.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setFullYear(d+1,0,f),h.setHours(0,0,0,0);var m=nA(h,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var y=nA(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=y.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(p,0,d),f.setHours(0,0,0,0),nA(f,t)}function fO(e,t){return QM(1,arguments),function(e,t,n){QM(2,arguments);var r=nA(e,n),o=nA(t,n),i=r.getTime()-iA(r),s=o.getTime()-iA(o);return Math.round((i-s)/6048e5)}(function(e){QM(1,arguments);var t=XM(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),hA(e),t)+1}function hO(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return n.getTime()>r.getTime()}function mO(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return n.getTime()<r.getTime()}function gO(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function yO(e,t){return QM(2,arguments),JM(e,-YM(t))}function vO(e,t){QM(2,arguments);var n=XM(e),r=YM(t),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=function(e){QM(1,arguments);var t=XM(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(s);return n.setMonth(r,Math.min(i,a)),n}function bO(e,t){QM(2,arguments);var n=XM(e),r=YM(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var xO=function(){return xO=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},xO.apply(this,arguments)};function wO(e,t,n){for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function SO(e){return"multiple"===e.mode}function CO(e){return"range"===e.mode}function kO(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var EO={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var _O=Object.freeze({__proto__:null,formatCaption:function(e,t){return uO(e,"LLLL y",t)},formatDay:function(e,t){return uO(e,"d",t)},formatMonthCaption:function(e,t){return uO(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return uO(e,"cccccc",t)},formatYearCaption:function(e,t){return uO(e,"yyyy",t)}}),jO=Object.freeze({__proto__:null,labelDay:function(e,t,n){return uO(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return uO(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var TO=n.createContext(void 0);function NO(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:EO,formatters:_O,labels:jO,locale:oO,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},s=function(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=hA(r):t&&(i=new Date(t,0,1)),o?s=fA(o):n&&(s=new Date(n,11,31)),{fromDate:i?sA(i):void 0,toDate:s?sA(s):void 0}}(o),a=s.fromDate,l=s.toDate,c=null!==(n=o.captionLayout)&&void 0!==n?n:i.captionLayout;"buttons"===c||a&&l||(c="buttons"),(kO(o)||SO(o)||CO(o))&&(r=o.onSelect);var u=xO(xO(xO({},i),o),{captionLayout:c,classNames:xO(xO({},i.classNames),o.classNames),components:xO({},o.components),formatters:xO(xO({},i.formatters),o.formatters),fromDate:a,labels:xO(xO({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:xO(xO({},i.modifiers),o.modifiers),modifiersClassNames:xO(xO({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:xO(xO({},i.styles),o.styles),toDate:l});return t.jsx(TO.Provider,{value:u,children:e.children})}function PO(){var e=n.useContext(TO);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function DO(e){var n=PO();return t.jsx("div",{className:n.classNames.caption_label,style:n.styles.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:(0,n.formatters.formatCaption)(e.displayMonth,{locale:n.locale})})}function MO(e){return t.jsx("svg",xO({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function AO(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=PO(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:MO;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:o,children:s}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function OO(e){var n,r=PO(),o=r.fromDate,i=r.toDate,s=r.styles,a=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,u=r.components,d=r.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});var p=[];if(function(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=hA(o),h=o.getMonth();h<=i.getMonth();h++)p.push(vO(f,h));else for(f=hA(new Date),h=0;h<=11;h++)p.push(vO(f,h));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:AO;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=vO(hA(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:a}),children:p.map((function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:a})},e.getMonth())}))})}function RO(e){var n,r=e.displayMonth,o=PO(),i=o.fromDate,s=o.toDate,a=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,p=o.labels.labelYearDropdown,f=[];if(!i)return t.jsx(t.Fragment,{});if(!s)return t.jsx(t.Fragment,{});for(var h=i.getFullYear(),m=s.getFullYear(),g=h;g<=m;g++)f.push(bO(mA(new Date),g));var y=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:AO;return t.jsx(y,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=bO(hA(r),Number(t.target.value));e.onChange(n)},value:r.getFullYear(),caption:d(r,{locale:a}),children:f.map((function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:a})},e.getFullYear())}))})}function LO(){var e=PO(),t=function(e){var t=e.month||e.defaultMonth||e.today||new Date,n=e.toDate,r=e.fromDate,o=e.numberOfMonths,i=void 0===o?1:o;return n&&pA(n,t)<0&&(t=ZM(n,-1*(i-1))),r&&pA(t,r)<0&&(t=r),hA(t)}(e),r=function(e,t){var r=n.useState(e);return[void 0===t?r[0]:t,r[1]]}(t,e.month),o=r[1];return[r[0],function(t){var n;if(!e.disableNavigation){var r=hA(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var IO=n.createContext(void 0);function FO(e){var n=PO(),r=LO(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=hA(e),i=pA(hA(ZM(o,r)),o),s=[],a=0;a<i;a++){var l=ZM(o,a);s.push(l)}return n&&(s=s.reverse()),s}(o,n),a=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.numberOfMonths,o=void 0===r?1:r,i=t.pagedNavigation?o:1,s=hA(e);if(!n)return ZM(s,i);if(!(pA(n,e)<o))return ZM(s,i)}}(o,n),l=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.numberOfMonths,o=t.pagedNavigation?void 0===r?1:r:1,i=hA(e);if(!n)return ZM(i,-o);if(!(pA(i,n)<=0))return ZM(i,-o)}}(o,n),c=function(e){return s.some((function(t){return gO(e,t)}))};return t.jsx(IO.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&mO(e,t)?i(ZM(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function $O(){var e=n.useContext(IO);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function qO(e){var n,r=PO(),o=r.classNames,i=r.styles,s=r.components,a=$O().goToMonth,l=function(t){a(ZM(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:DO,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:i.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(OO,{onChange:l,displayMonth:e.displayMonth}),t.jsx(RO,{onChange:l,displayMonth:e.displayMonth})]})}function UO(e){return t.jsx("svg",xO({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function zO(e){return t.jsx("svg",xO({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var BO=n.forwardRef((function(e,n){var r=PO(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=xO(xO({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",xO({},e,{ref:n,type:"button",className:a,style:l}))}));function VO(e){var n,r,o=PO(),i=o.dir,s=o.locale,a=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,p=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var f=u(e.previousMonth,{locale:s}),h=[a.nav_button,a.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:s}),g=[a.nav_button,a.nav_button_next].join(" "),y=null!==(n=null==p?void 0:p.IconRight)&&void 0!==n?n:zO,v=null!==(r=null==p?void 0:p.IconLeft)&&void 0!==r?r:UO;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(BO,{name:"previous-month","aria-label":f,className:h,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:t.jsx("rtl"===i?y:v,{className:a.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(BO,{name:"next-month","aria-label":m,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:t.jsx("rtl"===i?v:y,{className:a.nav_icon,style:l.nav_icon})})]})}function KO(e){var n=PO().numberOfMonths,r=$O(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return gO(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(VO,{displayMonth:e.displayMonth,hideNext:n>1&&(c||!u),hidePrevious:n>1&&(u||!c),nextMonth:i,previousMonth:o,onPreviousClick:function(){o&&s(o)},onNextClick:function(){i&&s(i)}})}function HO(e){var n,r,o=PO(),i=o.classNames,s=o.styles,a=o.captionLayout,l=o.components,c=null!==(n=null==l?void 0:l.CaptionLabel)&&void 0!==n?n:DO;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(qO,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(qO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(KO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(KO,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function WO(e){var n=PO(),r=n.footer;return r?t.jsx("tfoot",{className:n.classNames.tfoot,style:n.styles.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:r})})}):t.jsx(t.Fragment,{})}function GO(){var e=PO(),n=e.classNames,r=e.styles,o=e.showWeekNumber,i=e.locale,s=e.formatters.formatWeekdayName,a=e.labels.labelWeekday,l=function(e,t,n){for(var r=n?rA(new Date):nA(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=JM(r,i);o.push(s)}return o}(i,e.weekStartsOn,e.ISOWeek);return t.jsxs("tr",{style:r.head_row,className:n.head_row,children:[o&&t.jsx("td",{style:r.head_cell,className:n.head_cell}),l.map((function(e,o){return t.jsx("th",{scope:"col",className:n.head_cell,style:r.head_cell,"aria-label":a(e,{locale:i}),children:s(e,{locale:i})},o)}))]})}function YO(){var e,n=PO(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:GO;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function QO(e){var n=PO();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var XO=n.createContext(void 0);function JO(e){if(!SO(e.initialProps)){return t.jsx(XO.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(ZO,{initialProps:e.initialProps,children:e.children})}function ZO(e){var n=e.initialProps,r=e.children,o=n.selected,i=n.min,s=n.max,a={disabled:[]};return o&&a.disabled.push((function(e){var t=s&&o.length>s-1,n=o.some((function(t){return uA(t,e)}));return Boolean(t&&!n)})),t.jsx(XO.Provider,{value:{selected:o,onDayClick:function(e,t,r){var a,l;if((null===(a=n.onDayClick)||void 0===a||a.call(n,e,t,r),!Boolean(t.selected&&i&&(null==o?void 0:o.length)===i))&&!Boolean(!t.selected&&s&&(null==o?void 0:o.length)===s)){var c=o?wO([],o):[];if(t.selected){var u=c.findIndex((function(t){return uA(e,t)}));c.splice(u,1)}else c.push(e);null===(l=n.onSelect)||void 0===l||l.call(n,c,e,t,r)}},modifiers:a},children:r})}function eR(){var e=n.useContext(XO);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var tR,nR,rR=n.createContext(void 0);function oR(e){if(!CO(e.initialProps)){return t.jsx(rR.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(iR,{initialProps:e.initialProps,children:e.children})}function iR(e){var n=e.initialProps,r=e.children,o=n.selected,i=o||{},s=i.from,a=i.to,l=n.min,c=n.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(u.range_start=[s],a?(u.range_end=[a],uA(s,a)||(u.range_middle=[{after:s,before:a}])):u.range_end=[s]):a&&(u.range_start=[a],u.range_end=[a]),l&&(s&&!a&&u.disabled.push({after:yO(s,l-1),before:JM(s,l-1)}),s&&a&&u.disabled.push({after:s,before:JM(s,l-1)}),!s&&a&&u.disabled.push({after:yO(a,l-1),before:JM(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:JM(s,1-c)}),u.disabled.push({after:JM(s,c-1)})),s&&a){var d=c-(aA(a,s)+1);u.disabled.push({before:yO(s,d)}),u.disabled.push({after:JM(a,d)})}!s&&a&&(u.disabled.push({before:JM(a,1-c)}),u.disabled.push({after:JM(a,c-1)}))}return t.jsx(rR.Provider,{value:{selected:o,onDayClick:function(e,t,r){var i,s;null===(i=n.onDayClick)||void 0===i||i.call(n,e,t,r);var a=function(e,t){var n=t||{},r=n.from,o=n.to;if(r&&o){if(uA(o,e)&&uA(r,e))return;if(uA(o,e))return{from:o,to:void 0};if(uA(r,e))return;return hO(r,e)?{from:e,to:o}:{from:r,to:e}}return o?hO(e,o)?{from:o,to:e}:{from:e,to:o}:r?mO(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}(e,o);null===(s=n.onSelect)||void 0===s||s.call(n,a,e,t,r)},modifiers:u},children:r})}function sR(){var e=n.useContext(rR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function aR(e){return Array.isArray(e)?wO([],e):void 0!==e?[e]:[]}(nR=tR||(tR={})).Outside="outside",nR.Disabled="disabled",nR.Selected="selected",nR.Hidden="hidden",nR.Today="today",nR.RangeStart="range_start",nR.RangeEnd="range_end",nR.RangeMiddle="range_middle";var lR=tR.Selected,cR=tR.Disabled,uR=tR.Hidden,dR=tR.Today,pR=tR.RangeEnd,fR=tR.RangeMiddle,hR=tR.RangeStart,mR=tR.Outside;var gR=n.createContext(void 0);function yR(e){var n=PO(),r=function(e,t,n){var r,o=((r={})[lR]=aR(e.selected),r[cR]=aR(e.disabled),r[uR]=aR(e.hidden),r[dR]=[e.today],r[pR]=[],r[fR]=[],r[hR]=[],r[mR]=[],r);return e.fromDate&&o[cR].push({before:e.fromDate}),e.toDate&&o[cR].push({after:e.toDate}),SO(e)?o[cR]=o[cR].concat(t.modifiers[cR]):CO(e)&&(o[cR]=o[cR].concat(n.modifiers[cR]),o[hR]=n.modifiers[hR],o[fR]=n.modifiers[fR],o[pR]=n.modifiers[pR]),o}(n,eR(),sR()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=aR(e[1])})),t}(n.modifiers),i=xO(xO({},r),o);return t.jsx(gR.Provider,{value:i,children:e.children})}function vR(){var e=n.useContext(gR);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function bR(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(dA(t))return uA(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(dA)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"==typeof e&&"from"in e)}(t))return n=e,s=(r=t).to,(i=r.from)&&s?(aA(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),aA(n,i)>=0&&aA(s,n)>=0):s?uA(s,n):!!i&&uA(i,n);if(function(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var a=aA(t.before,e)>0,l=aA(t.after,e)<0;return hO(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?aA(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?aA(t.before,e)>0:"function"==typeof t&&t(e)}))}function xR(e,t,n){var r=Object.keys(t).reduce((function(n,r){return bR(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!gO(e,n)&&(o.outside=!0),o}function wR(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=void 0===s?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,p={day:JM,week:lA,month:ZM,year:cA,startOfWeek:function(e){return o.ISOWeek?rA(e):nA(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?yA(e):gA(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?p=function(e){var t,n;if(QM(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==GM(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=XM(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)})),n||new Date(NaN)}([c,p]):"after"===r&&u&&(p=function(e){var t,n;if(QM(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==GM(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=XM(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,p]));var f=!0;if(i){var h=xR(p,i);f=!h.disabled&&!h.hidden}return f?p:a.count>365?a.lastFocused:wR(p,{moveBy:n,direction:r,context:o,modifiers:i,retry:xO(xO({},a),{count:a.count+1})})}var SR=n.createContext(void 0);function CR(e){var r=$O(),o=vR(),i=n.useState(),s=i[0],a=i[1],l=n.useState(),c=l[0],u=l[1],d=function(e,t){for(var n,r,o=hA(e[0]),i=fA(e[e.length-1]),s=o;s<=i;){var a=xR(s,t);if(a.disabled||a.hidden)s=JM(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=JM(s,1)}}return r||n}(r.displayMonths,o),p=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},h=PO(),m=function(e,t){if(s){var n=wR(s,{moveBy:e,direction:t,context:h,modifiers:o});uA(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(SR.Provider,{value:{focusedDay:s,focusTarget:p,blur:function(){u(s),a(void 0)},focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}},children:e.children})}function kR(){var e=n.useContext(SR);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var ER=n.createContext(void 0);function _R(e){if(!kO(e.initialProps)){return t.jsx(ER.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(jR,{initialProps:e.initialProps,children:e.children})}function jR(e){var n=e.initialProps;return t.jsx(ER.Provider,{value:{selected:n.selected,onDayClick:function(e,t,r){var o,i,s;null===(o=n.onDayClick)||void 0===o||o.call(n,e,t,r),!t.selected||n.required?null===(s=n.onSelect)||void 0===s||s.call(n,e,e,t,r):null===(i=n.onSelect)||void 0===i||i.call(n,void 0,e,t,r)}},children:e.children})}function TR(){var e=n.useContext(ER);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function NR(e,t){var n=[e.classNames.day];return Object.keys(t).forEach((function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(function(e){return Object.values(tR).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function PR(e,r,o){var i,s,a,l=PO(),c=kR(),u=function(e,t){return xR(e,vR(),t)}(e,r),d=function(e,t){var n=PO(),r=TR(),o=eR(),i=sR(),s=kR(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,p=s.focus,f=s.focusMonthBefore,h=s.focusMonthAfter,m=s.focusYearBefore,g=s.focusYearAfter,y=s.focusStartOfWeek,v=s.focusEndOfWeek;return{onClick:function(s){var a,l,c,u;kO(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):SO(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):CO(n)?null===(c=i.onDayClick)||void 0===c||c.call(i,e,t,s):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,s)},onFocus:function(r){var o;p(e),null===(o=n.onDayFocus)||void 0===o||o.call(n,e,t,r)},onBlur:function(r){var o;d(),null===(o=n.onDayBlur)||void 0===o||o.call(n,e,t,r)},onKeyDown:function(r){var o;switch(r.key){case"ArrowLeft":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?a():l();break;case"ArrowRight":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?l():a();break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),c();break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),u();break;case"PageUp":r.preventDefault(),r.stopPropagation(),r.shiftKey?m():f();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():h();break;case"Home":r.preventDefault(),r.stopPropagation(),y();break;case"End":r.preventDefault(),r.stopPropagation(),v()}null===(o=n.onDayKeyDown)||void 0===o||o.call(n,e,t,r)},onKeyUp:function(r){var o;null===(o=n.onDayKeyUp)||void 0===o||o.call(n,e,t,r)},onMouseEnter:function(r){var o;null===(o=n.onDayMouseEnter)||void 0===o||o.call(n,e,t,r)},onMouseLeave:function(r){var o;null===(o=n.onDayMouseLeave)||void 0===o||o.call(n,e,t,r)},onPointerEnter:function(r){var o;null===(o=n.onDayPointerEnter)||void 0===o||o.call(n,e,t,r)},onPointerLeave:function(r){var o;null===(o=n.onDayPointerLeave)||void 0===o||o.call(n,e,t,r)},onTouchCancel:function(r){var o;null===(o=n.onDayTouchCancel)||void 0===o||o.call(n,e,t,r)},onTouchEnd:function(r){var o;null===(o=n.onDayTouchEnd)||void 0===o||o.call(n,e,t,r)},onTouchMove:function(r){var o;null===(o=n.onDayTouchMove)||void 0===o||o.call(n,e,t,r)},onTouchStart:function(r){var o;null===(o=n.onDayTouchStart)||void 0===o||o.call(n,e,t,r)}}}(e,u),p=function(){var e=PO(),t=TR(),n=eR(),r=sR();return kO(e)?t.selected:SO(e)?n.selected:CO(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&uA(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var h=NR(l,u).join(" "),m=function(e,t){var n=xO({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=xO(xO({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])})),n}(l,u),g=Boolean(u.outside&&!l.showOutsideDays||u.hidden),y=null!==(a=null===(s=l.components)||void 0===s?void 0:s.DayContent)&&void 0!==a?a:QO,v={style:m,className:h,children:t.jsx(y,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&uA(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&uA(c.focusedDay,e),w=xO(xO(xO({},v),((i={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,i.tabIndex=x||b?0:-1,i)),d);return{isButton:f,isHidden:g,activeModifiers:u,selectedDays:p,buttonProps:w,divProps:v}}function DR(e){var r=n.useRef(null),o=PR(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(BO,xO({name:"day",ref:r},o.buttonProps)):t.jsx("div",xO({},o.divProps))}function MR(e){var n=e.number,r=e.dates,o=PO(),i=o.onWeekNumberClick,s=o.styles,a=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(n),{locale:l});if(!i)return t.jsx("span",{className:a.weeknumber,style:s.weeknumber,children:u});var d=c(Number(n),{locale:l});return t.jsx(BO,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function AR(e){var n,r,o,i=PO(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:DR,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:MR;return i.showWeekNumber&&(o=t.jsx("td",{className:a.cell,style:s.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:a.row,style:s.row,children:[o,e.dates.map((function(n){return t.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:t.jsx(c,{displayMonth:e.displayMonth,date:n})},dO(n))}))]})}function OR(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?yA(t):gA(t,n),o=(null==n?void 0:n.ISOWeek)?rA(e):nA(e,n),i=aA(r,o),s=[],a=0;a<=i;a++)s.push(JM(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){QM(1,arguments);var t=XM(e),n=rA(t).getTime()-oA(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){QM(1,arguments);var n=XM(e),r=nA(n,t).getTime()-pO(n,t).getTime();return Math.round(r/6048e5)+1}(t,n),o=e.find((function(e){return e.weekNumber===r}));return o?(o.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)}),[]);return l}function RR(e){var n,r,o,i=PO(),s=i.locale,a=i.classNames,l=i.styles,c=i.hideHead,u=i.components,d=i.weekStartsOn,p=i.firstWeekContainsDate,f=i.ISOWeek,h=function(e,t){var n=OR(hA(e),fA(e),t);if(null==t?void 0:t.useFixedWeeks){var r=fO(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=lA(i,6-r),a=OR(lA(i,1),s,t);n.push.apply(n,a)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(i.fixedWeeks),ISOWeek:f,locale:s,weekStartsOn:d,firstWeekContainsDate:p}),m=null!==(n=null==u?void 0:u.Head)&&void 0!==n?n:YO,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:AR,y=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:WO;return t.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(m,{}),t.jsx("tbody",{className:a.tbody,style:l.tbody,children:h.map((function(n){return t.jsx(g,{displayMonth:e.displayMonth,dates:n.dates,weekNumber:n.weekNumber},n.weekNumber)}))}),t.jsx(y,{displayMonth:e.displayMonth})]})}var LR="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,IR=!1,FR=0;function $R(){return"react-day-picker-".concat(++FR)}function qR(e){var r,o,i=PO(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=$O().displayMonths,d=function(e){var t,r=null!=e?e:IR?$R():null,o=n.useState(r),i=o[0],s=o[1];return LR((function(){null===i&&s($R())}),[]),n.useEffect((function(){!1===IR&&(IR=!0)}),[]),null!==(t=null!=e?e:i)&&void 0!==t?t:void 0}(i.id?"".concat(i.id,"-").concat(e.displayIndex):void 0),p=i.id?"".concat(i.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],h=l.month,m=0===e.displayIndex,g=e.displayIndex===u.length-1,y=!m&&!g;"rtl"===s&&(g=(r=[m,g])[0],m=r[1]),m&&(f.push(a.caption_start),h=xO(xO({},h),l.caption_start)),g&&(f.push(a.caption_end),h=xO(xO({},h),l.caption_end)),y&&(f.push(a.caption_between),h=xO(xO({},h),l.caption_between));var v=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:HO;return t.jsxs("div",{className:f.join(" "),style:h,children:[t.jsx(v,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(RR,{id:p,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function UR(e){var n=PO();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function zR(e){var r,o,i=e.initialProps,s=PO(),a=kR(),l=$O(),c=n.useState(!1),u=c[0],d=c[1];n.useEffect((function(){s.initialFocus&&a.focusTarget&&(u||(a.focus(a.focusTarget),d(!0)))}),[s.initialFocus,u,a.focus,a.focusTarget,a]);var p=[s.classNames.root,s.className];s.numberOfMonths>1&&p.push(s.classNames.multiple_months),s.showWeekNumber&&p.push(s.classNames.with_weeknumber);var f=xO(xO({},s.styles.root),s.style),h=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return xO(xO({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:UR;return t.jsx("div",xO({className:p.join(" "),style:f,dir:s.dir,id:s.id,nonce:i.nonce,title:i.title,lang:i.lang},h,{children:t.jsx(m,{children:l.displayMonths.map((function(e,n){return t.jsx(qR,{displayIndex:n,displayMonth:e},n)}))})}))}function BR(e){var n=e.children,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children"]);return t.jsx(NO,{initialProps:r,children:t.jsx(FO,{children:t.jsx(_R,{initialProps:r,children:t.jsx(JO,{initialProps:r,children:t.jsx(oR,{initialProps:r,children:t.jsx(yR,{children:t.jsx(CR,{children:n})})})})})})})}function VR(e){return t.jsx(BR,xO({},e,{children:t.jsx(zR,{initialProps:e})}))}function KR({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(VR,{showOutsideDays:r,className:_d("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:_d(tk({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:_d("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===o.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:_d(tk({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:()=>t.jsx(Zc,{className:"h-4 w-4"}),IconRight:()=>t.jsx(eu,{className:"h-4 w-4"})},...o})}KR.displayName="Calendar";var HR=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(YR);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(WR,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(WR,{...o,ref:n,children:r})}));HR.displayName="Slot";var WR=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?cf(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));WR.displayName="SlotClone";var GR=({children:e})=>t.jsx(t.Fragment,{children:e});function YR(e){return i.isValidElement(e)&&e.type===GR}var QR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?HR:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{}),XR="horizontal",JR=["horizontal","vertical"],ZR=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=XR,...i}=e,s=function(e){return JR.includes(e)}(o)?o:XR;return t.jsx(QR.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));ZR.displayName="Separator";var eL=ZR;const tL=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(eL,{ref:i,decorative:r,orientation:n,className:_d("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));tL.displayName=eL.displayName;const nL=Vc("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),rL=i.forwardRef((({options:e,onValueChange:n,variant:r,placeholder:o="Select options",animation:s=0,maxCount:a=3,modalPopover:l=!0,className:c,extraCommandItems:u,searchPlaceholder:d="Search...",handleSearchInput:p,emptyMessage:f="No results found.",searchIcon:h=t.jsx(xu,{className:"h-4 w-4 mr-2"}),selectedValues:m,setSelectedValues:g,...y},v)=>{const[b,x]=i.useState(!1),[w,S]=i.useState(!1),C=e=>{const t=m.includes(e)?m.filter((t=>t!==e)):[...m,e];g(t),n(t)},k=()=>{g([]),n([])};return t.jsxs(VM,{open:b,onOpenChange:x,modal:l,children:[t.jsx(KM,{asChild:!0,children:t.jsx("button",{type:"button",ref:v,...y,onClick:()=>{x((e=>!e))},className:_d("flex w-full p-1 rounded-md border min-h-9 h-auto items-center justify-between bg-white hover:bg-gray-50 [&_svg]:pointer-events-auto data-[state=open]:bg-gray-50",c),children:t.jsxs("div",m.length>0?{className:"flex justify-between items-center w-full",children:[t.jsxs("div",{className:"flex flex-wrap items-center",children:[m.slice(0,a).map((n=>{const o=e.find((e=>e.value===n)),i=o?.icon;return t.jsxs(jP,{className:_d(w?"animate-bounce":"",nL({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(iu,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(jP,{className:_d("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",nL({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(iu,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=m.slice(0,a);g(e),n(e)})()}})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Mu,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(tL,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(Jc,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}:{className:"flex items-center justify-between w-full mx-auto",children:[t.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:o}),t.jsx(Jc,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(HM,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),children:t.jsxs(WD,{children:[t.jsx(GD,{searchIcon:h,placeholder:d,onKeyDown:e=>{if("Enter"===e.key)x(!0),p&&(p(e.currentTarget.value),x(!1));else if("Backspace"===e.key&&!e.currentTarget.value){const e=[...m];e.pop(),g(e),n(e)}}}),t.jsxs(YD,{children:[t.jsx(QD,{children:f}),t.jsxs(XD,{children:[t.jsxs(ZD,{onSelect:()=>{if(m.length===e.length)k();else{const t=e.map((e=>e.value));g(t),n(t)}},className:"cursor-pointer",children:[t.jsx("div",{className:_d("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",m.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(Xc,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(ZD,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:_d("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",n?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(Xc,{className:"h-4 w-4"})}),e.icon&&t.jsx(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:e.label})]},e.value)}))]}),t.jsx(JD,{}),t.jsx(XD,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(ZD,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(tL,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(ZD,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u.map((e=>e(x)))]})})]})]})}),s>0&&m.length>0&&t.jsx(Du,{className:_d("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function oL(e,[t,n]){return Math.min(n,Math.max(t,e))}function iL(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function sL(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>i.createContext(e)));return function(n){const r=n?.[e]||t;return i.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const s=i.createContext(o),a=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,c=r?.[e]?.[a]||s,u=i.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(t,r){const l=i.useContext(r?.[e]?.[a]||s);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},aL(o,...n)]}function aL(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return i.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function lL(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function cL(...e){return t=>{let n=!1;const r=e.map((e=>{const r=lL(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():lL(e[t],null)}}}}function uL(...e){return i.useCallback(cL(...e),e)}function dL(e){const n=pL(e),r=i.forwardRef(((e,r)=>{const{children:o,...s}=e,a=i.Children.toArray(o),l=a.find(hL);if(l){const e=l.props.children,o=a.map((t=>t===l?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(n,{...s,ref:r,children:i.isValidElement(e)?i.cloneElement(e,void 0,o):null})}return t.jsx(n,{...s,ref:r,children:o})}));return r.displayName=`${e}.Slot`,r}function pL(e){const t=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?cL(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}rL.displayName="MultiSelect";var fL=Symbol("radix.slottable");function hL(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===fL}var mL=i.createContext(void 0);var gL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,n)=>{const r=dL(`Primitive.${n}`),o=i.forwardRef(((e,o)=>{const{asChild:i,...s}=e,a=i?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(a,{...s,ref:o})}));return o.displayName=`Primitive.${n}`,{...e,[n]:o}}),{});function yL(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}var vL,bL="dismissableLayer.update",xL="dismissableLayer.pointerDownOutside",wL="dismissableLayer.focusOutside",SL=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),CL=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(SL),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=uL(n,(e=>f(e))),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=yL(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){EL(xL,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h),k=function(e,t=globalThis?.document){const n=yL(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){EL(wL,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return function(e,t=globalThis?.document){const n=yL(e);i.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(vL=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),kL(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=vL)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),kL())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(bL,e),()=>document.removeEventListener(bL,e)}),[]),t.jsx(gL.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:iL(e.onFocusCapture,k.onFocusCapture),onBlurCapture:iL(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:iL(e.onPointerDownCapture,C.onPointerDownCapture)})}));CL.displayName="DismissableLayer";function kL(){const e=new CustomEvent(bL);document.dispatchEvent(e)}function EL(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(SL),o=i.useRef(null),s=uL(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(gL.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var _L=0;function jL(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var TL="focusScope.autoFocusOnMount",NL="focusScope.autoFocusOnUnmount",PL={bubbles:!1,cancelable:!0},DL=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=yL(s),p=yL(a),f=i.useRef(null),h=uL(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:RL(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||RL(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&RL(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){LL.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(TL,PL);c.addEventListener(TL,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(RL(r,{select:t}),document.activeElement!==n)return}((e=ML(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&RL(c))}return()=>{c.removeEventListener(TL,d),setTimeout((()=>{const e=new CustomEvent(NL,PL);c.addEventListener(NL,p),c.dispatchEvent(e),e.defaultPrevented||RL(t??document.body,{select:!0}),c.removeEventListener(NL,p),LL.remove(m)}),0)}}var e}),[c,d,p,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=ML(e),n=AL(t,e),r=AL(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&RL(i,{select:!0})):(e.preventDefault(),r&&RL(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(gL.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})}));function ML(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function AL(e,t){for(const n of e)if(!OL(n,{upTo:t}))return n}function OL(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function RL(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}DL.displayName="FocusScope";var LL=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=IL(e,t),e.unshift(t)},remove(t){e=IL(e,t),e[0]?.resume()}}}();function IL(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var FL=globalThis?.document?i.useLayoutEffect:()=>{},$L=i[" useId ".trim().toString()]||(()=>{}),qL=0;function UL(e){const[t,n]=i.useState($L());return FL((()=>{n((e=>e??String(qL++)))}),[e]),e||(t?`radix-${t}`:"")}var zL=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(gL.svg,{...s,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));zL.displayName="Arrow";var BL=zL;var VL="Popper",[KL,HL]=sL(VL),[WL,GL]=KL(VL),YL=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(WL,{scope:n,anchor:o,onAnchorChange:s,children:r})};YL.displayName=VL;var QL="PopperAnchor",XL=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=GL(QL,r),l=i.useRef(null),c=uL(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(gL.div,{...s,ref:c})}));XL.displayName=QL;var JL="PopperContent",[ZL,eI]=KL(JL),tI=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=e,v=GL(JL,r),[b,x]=i.useState(null),w=uL(n,(e=>x(e))),[S,C]=i.useState(null),k=function(e){const[t,n]=i.useState(void 0);return FL((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(S),E=k?.width??0,_=k?.height??0,j=o+("center"!==a?"-"+a:""),T="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(d)?d:[d],P=N.length>0,D={padding:T,boundary:N.filter(iI),altBoundary:P},{refs:M,floatingStyles:A,placement:O,isPositioned:R,middlewareData:L}=Gj({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Oj(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[Qj({mainAxis:s+_,alignmentAxis:l}),u&&Xj({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Jj():void 0,...D}),u&&Zj({...D}),eT({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),S&&nT({element:S,padding:c}),sI({arrowWidth:E,arrowHeight:_}),h&&tT({strategy:"referenceHidden",...D})]}),[I,F]=aI(O),$=yL(g);FL((()=>{R&&$?.()}),[R,$]);const q=L.arrow?.x,U=L.arrow?.y,z=0!==L.arrow?.centerOffset,[B,V]=i.useState();return FL((()=>{b&&V(window.getComputedStyle(b).zIndex)}),[b]),t.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:R?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(ZL,{scope:r,placedSide:I,onArrowChange:C,arrowX:q,arrowY:U,shouldHideArrow:z,children:t.jsx(gL.div,{"data-side":I,"data-align":F,...y,ref:w,style:{...y.style,animation:R?void 0:"none"}})})})}));tI.displayName=JL;var nI="PopperArrow",rI={top:"bottom",right:"left",bottom:"top",left:"right"},oI=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=eI(nI,r),s=rI[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(BL,{...o,ref:n,style:{...o.style,display:"block"}})})}));function iI(e){return null!==e}oI.displayName=nI;var sI=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=aI(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,p=(o.arrow?.y??0)+a/2;let f="",h="";return"bottom"===l?(f=i?u:`${d}px`,h=-a+"px"):"top"===l?(f=i?u:`${d}px`,h=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",h=i?u:`${p}px`):"left"===l&&(f=`${r.floating.width+a}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function aI(e){const[t,n="center"]=e.split("-");return[t,n]}var lI=YL,cI=XL,uI=tI,dI=oI,pI=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);FL((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(gL.div,{...s,ref:n}),c):null}));pI.displayName="Portal";var fI=i[" useInsertionEffect ".trim().toString()]||FL;function hI({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=function({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),s=i.useRef(t);return fI((()=>{s.current=t}),[t]),i.useEffect((()=>{o.current!==n&&(s.current?.(n),o.current=n)}),[n,o]),[n,r,s]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:o;{const t=i.useRef(void 0!==e);i.useEffect((()=>{const e=t.current;if(e!==l){}t.current=l}),[l,r])}const u=i.useCallback((t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&a.current?.(n)}else s(t)}),[l,e,s,a]);return[c,u]}var mI=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"});i.forwardRef(((e,n)=>t.jsx(gL.span,{...e,ref:n,style:{...mI,...e.style}}))).displayName="VisuallyHidden";var gI=[" ","Enter","ArrowUp","ArrowDown"],yI=[" ","Enter"],vI="Select",[bI,xI,wI]=function(e){const r=e+"CollectionProvider",[o,i]=sL(r),[s,a]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:o}=e,i=n.useRef(null),a=n.useRef(new Map).current;return t.jsx(s,{scope:r,itemMap:a,collectionRef:i,children:o})};l.displayName=r;const c=e+"CollectionSlot",u=dL(c),d=n.forwardRef(((e,n)=>{const{scope:r,children:o}=e,i=uL(n,a(c,r).collectionRef);return t.jsx(u,{ref:i,children:o})}));d.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",h=dL(p),m=n.forwardRef(((e,r)=>{const{scope:o,children:i,...s}=e,l=n.useRef(null),c=uL(r,l),u=a(p,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)}))),t.jsx(h,{[f]:"",ref:c,children:i})}));return m.displayName=p,[{Provider:l,Slot:d,ItemSlot:m},function(t){const r=a(e+"CollectionConsumer",t);return n.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},i]}(vI),[SI,CI]=sL(vI,[wI,HL]),kI=HL(),[EI,_I]=SI(vI),[jI,TI]=SI(vI),NI=e=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:s,onOpenChange:a,value:l,defaultValue:c,onValueChange:u,dir:d,name:p,autoComplete:f,disabled:h,required:m,form:g}=e,y=kI(n),[v,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=function(e){const t=i.useContext(mL);return e||t||"ltr"}(d),[E,_]=hI({prop:o,defaultProp:s??!1,onChange:a,caller:vI}),[j,T]=hI({prop:l,defaultProp:c,onChange:u,caller:vI}),N=i.useRef(null),P=!v||(g||!!v.closest("form")),[D,M]=i.useState(new Set),A=Array.from(D).map((e=>e.props.value)).join(";");return t.jsx(lI,{...y,children:t.jsxs(EI,{required:m,scope:n,trigger:v,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:UL(),value:j,onValueChange:T,open:E,onOpenChange:_,dir:k,triggerPointerDownPosRef:N,disabled:h,children:[t.jsx(bI.Provider,{scope:n,children:t.jsx(jI,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback((e=>{M((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:i.useCallback((e=>{M((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:r})}),P?t.jsxs(mF,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:f,value:j,onChange:e=>T(e.target.value),disabled:h,form:g,children:[void 0===j?t.jsx("option",{value:""}):null,Array.from(D)]},A):null]})})};NI.displayName=vI;var PI="SelectTrigger",DI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=kI(r),l=_I(PI,r),c=l.disabled||o,u=uL(n,l.onTriggerChange),d=xI(r),p=i.useRef("touch"),[f,h,m]=yF((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=vF(t,e,n);void 0!==r&&l.onValueChange(r.value)})),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(cI,{asChild:!0,...a,children:t.jsx(gL.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":gF(l.value)?"":void 0,...s,ref:u,onClick:iL(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)})),onPointerDown:iL(s.onPointerDown,(e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())})),onKeyDown:iL(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||gI.includes(e.key)&&(g(),e.preventDefault())}))})})}));DI.displayName=PI;var MI="SelectValue",AI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=_I(MI,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,p=uL(n,c.onValueNodeChange);return FL((()=>{u(d)}),[u,d]),t.jsx(gL.span,{...l,ref:p,style:{pointerEvents:"none"},children:gF(c.value)?t.jsx(t.Fragment,{children:a}):s})}));AI.displayName=MI;var OI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(gL.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));OI.displayName="SelectIcon";var RI=e=>t.jsx(pI,{asChild:!0,...e});RI.displayName="SelectPortal";var LI="SelectContent",II=i.forwardRef(((e,n)=>{const r=_I(LI,e.__scopeSelect),[o,a]=i.useState();if(FL((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx($I,{scope:e.__scopeSelect,children:t.jsx(bI.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(zI,{...e,ref:n})}));II.displayName=LI;var FI=10,[$I,qI]=SI(LI),UI=dL("SelectContent.RemoveScroll"),zI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=e,x=_I(LI,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=uL(n,(e=>S(e))),[_,j]=i.useState(null),[T,N]=i.useState(null),P=xI(r),[D,M]=i.useState(!1),A=i.useRef(!1);i.useEffect((()=>{if(w)return Yh(w)}),[w]),i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jL()),document.body.insertAdjacentElement("beforeend",e[1]??jL()),_L++,()=>{1===_L&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),_L--}}),[]);const O=i.useCallback((e=>{const[t,...n]=P().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(i?.scrollIntoView({block:"nearest"}),i===t&&C&&(C.scrollTop=0),i===r&&C&&(C.scrollTop=C.scrollHeight),i?.focus(),document.activeElement!==o)return}}),[P,C]),R=i.useCallback((()=>O([_,w])),[O,_,w]);i.useEffect((()=>{D&&R()}),[D,R]);const{onOpenChange:L,triggerPointerDownPosRef:I}=x;i.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[w,L,I]),i.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[F,$]=yF((e=>{const t=P().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=vF(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),q=i.useCallback(((e,t,n)=>{const r=!A.current&&!n;(void 0!==x.value&&x.value===t||r)&&(j(e),r&&(A.current=!0))}),[x.value]),U=i.useCallback((()=>w?.focus()),[w]),z=i.useCallback(((e,t,n)=>{(void 0!==x.value&&x.value===t||!A.current&&!n)&&N(e)}),[x.value]),B="popper"===o?VI:BI,V=B===VI?{side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return t.jsx($I,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:_,onItemLeave:U,itemTextRefCallback:z,focusSelectedItem:R,selectedItemText:T,position:o,isPositioned:D,searchRef:F,children:t.jsx(zh,{as:UI,allowPinchZoom:!0,children:t.jsx(DL,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:iL(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(CL,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(B,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:iL(b.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().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=t.indexOf(e.target);t=t.slice(n+1)}setTimeout((()=>O(t))),e.preventDefault()}}))})})})})})}));zI.displayName="SelectContentImpl";var BI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=_I(LI,r),l=qI(LI,r),[c,u]=i.useState(null),[d,p]=i.useState(null),f=uL(n,(e=>p(e))),h=xI(r),m=i.useRef(!1),g=i.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback((()=>{if(a.trigger&&a.valueNode&&c&&d&&y&&v&&b){const e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-(r.left-t.left),i=e.width+(e.left-o),s=Math.max(i,t.width),a=window.innerWidth-FI,l=oL(o,[FI,Math.max(FI,a-s)]);c.style.minWidth=i+"px",c.style.left=l+"px"}else{const o=window.innerWidth-n.right-(t.right-r.right),i=window.innerWidth-e.right-o,s=e.width+i,a=Math.max(s,t.width),l=window.innerWidth-FI,u=oL(o,[FI,Math.max(FI,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=h(),s=window.innerHeight-2*FI,l=y.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),f=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=p+f+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(y),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),E=e.top+e.height/2-FI,_=s-E,j=v.offsetHeight/2,T=p+f+(v.offsetTop+j),N=x-T;if(T<=E){const e=i.length>0&&v===i[i.length-1].ref.current;c.style.bottom="0px";const t=Math.max(_,j+(e?k:0)+(d.clientHeight-y.offsetTop-y.offsetHeight)+g);c.style.height=T+t+"px"}else{const e=i.length>0&&v===i[0].ref.current;c.style.top="0px";const t=Math.max(E,p+y.offsetTop+(e?C:0)+j);c.style.height=t+N+"px",y.scrollTop=T-E+y.offsetTop}c.style.margin=`${FI}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>m.current=!0))}}),[h,a.trigger,a.valueNode,c,d,y,v,b,a.dir,o]);FL((()=>w()),[w]);const[S,C]=i.useState();FL((()=>{d&&C(window.getComputedStyle(d).zIndex)}),[d]);const k=i.useCallback((e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)}),[w,x]);return t.jsx(KI,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t.jsx(gL.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));BI.displayName="SelectItemAlignedPosition";var VI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=FI,...s}=e,a=kI(r);return t.jsx(uI,{...a,...s,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})}));VI.displayName="SelectPopperPosition";var[KI,HI]=SI(LI,{}),WI="SelectViewport",GI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=qI(WI,r),l=HI(WI,r),c=uL(n,a.onViewportChange),u=i.useRef(0);return t.jsxs(t.Fragment,{children:[t.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:o}),t.jsx(bI.Slot,{scope:r,children:t.jsx(gL.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:iL(s.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*FI,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),s=Math.max(o,i);if(s<r){const o=s+e,i=Math.min(r,o),a=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop}))})})]})}));GI.displayName=WI;var YI="SelectGroup",[QI,XI]=SI(YI);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=UL();return t.jsx(QI,{scope:r,id:i,children:t.jsx(gL.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=YI;var JI="SelectLabel",ZI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=XI(JI,r);return t.jsx(gL.div,{id:i.id,...o,ref:n})}));ZI.displayName=JI;var eF="SelectItem",[tF,nF]=SI(eF),rF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=_I(eF,r),u=qI(eF,r),d=c.value===o,[p,f]=i.useState(a??""),[h,m]=i.useState(!1),g=uL(n,(e=>u.itemRefCallback?.(e,o,s))),y=UL(),v=i.useRef("touch"),b=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)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 t.jsx(tF,{scope:r,value:o,disabled:s,textId:y,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(bI.ItemSlot,{scope:r,value:o,disabled:s,textValue:p,children:t.jsx(gL.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:iL(l.onFocus,(()=>m(!0))),onBlur:iL(l.onBlur,(()=>m(!1))),onClick:iL(l.onClick,(()=>{"mouse"!==v.current&&b()})),onPointerUp:iL(l.onPointerUp,(()=>{"mouse"===v.current&&b()})),onPointerDown:iL(l.onPointerDown,(e=>{v.current=e.pointerType})),onPointerMove:iL(l.onPointerMove,(e=>{v.current=e.pointerType,s?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:iL(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:iL(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(yI.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));rF.displayName=eF;var oF="SelectItemText",iF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=_I(oF,r),u=qI(oF,r),d=nF(oF,r),p=TI(oF,r),[f,h]=i.useState(null),m=uL(n,(e=>h(e)),d.onItemTextChange,(e=>u.itemTextRefCallback?.(e,d.value,d.disabled))),g=f?.textContent,y=i.useMemo((()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value)),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=p;return FL((()=>(v(y),()=>b(y))),[v,b,y]),t.jsxs(t.Fragment,{children:[t.jsx(gL.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));iF.displayName=oF;var sF="SelectItemIndicator",aF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return nF(sF,r).isSelected?t.jsx(gL.span,{"aria-hidden":!0,...o,ref:n}):null}));aF.displayName=sF;var lF="SelectScrollUpButton",cF=i.forwardRef(((e,n)=>{const r=qI(lF,e.__scopeSelect),o=HI(lF,e.__scopeSelect),[s,a]=i.useState(!1),l=uL(n,o.onScrollButtonChange);return FL((()=>{if(r.viewport&&r.isPositioned){let e=function(){a(t.scrollTop>0)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(pF,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));cF.displayName=lF;var uF="SelectScrollDownButton",dF=i.forwardRef(((e,n)=>{const r=qI(uF,e.__scopeSelect),o=HI(uF,e.__scopeSelect),[s,a]=i.useState(!1),l=uL(n,o.onScrollButtonChange);return FL((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(pF,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));dF.displayName=uF;var pF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=qI("SelectScrollButton",r),l=i.useRef(null),c=xI(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),FL((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(gL.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:iL(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:iL(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:iL(s.onPointerLeave,(()=>{u()}))})})),fF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(gL.div,{"aria-hidden":!0,...o,ref:n})}));fF.displayName="SelectSeparator";var hF="SelectArrow";i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=kI(r),s=_I(hF,r),a=qI(hF,r);return s.open&&"popper"===a.position?t.jsx(dI,{...i,...o,ref:n}):null})).displayName=hF;var mF=i.forwardRef((({__scopeSelect:e,value:n,...r},o)=>{const s=i.useRef(null),a=uL(o,s),l=function(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(n);return i.useEffect((()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}}),[l,n]),t.jsx(gL.select,{...r,style:{...mI,...r.style},ref:a,defaultValue:n})}));function gF(e){return""===e||void 0===e}function yF(e){const t=yL(e),n=i.useRef(""),r=i.useRef(0),o=i.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]),s=i.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return i.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,o,s]}function vF(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=n?e.indexOf(n):-1;let i=(s=e,a=Math.max(o,0),s.map(((e,t)=>s[(a+t)%s.length])));var s,a;1===r.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}mF.displayName="SelectBubbleInput";var bF=DI,xF=OI,wF=RI,SF=II,CF=GI,kF=ZI,EF=rF,_F=iF,jF=aF,TF=cF,NF=dF,PF=fF;const DF=NI,MF=AI,AF=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(bF,{ref:o,className:_d("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-border/10 px-3 py-2 text-sm shadow-sm ring-offset-background !placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,t.jsx(xF,{asChild:!0,children:t.jsx(Jc,{className:"h-4 w-4 opacity-50"})})]})));AF.displayName=bF.displayName;const OF=i.forwardRef((({className:e,...n},r)=>t.jsx(TF,{ref:r,className:_d("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(tu,{className:"h-4 w-4"})})));OF.displayName=TF.displayName;const RF=i.forwardRef((({className:e,...n},r)=>t.jsx(NF,{ref:r,className:_d("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(Jc,{className:"h-4 w-4"})})));RF.displayName=NF.displayName;const LF=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(wF,{children:t.jsxs(SF,{ref:i,className:_d("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground 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","popper"===r&&"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:r,...o,children:[t.jsx(OF,{}),t.jsx(CF,{className:_d("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(RF,{})]})})));LF.displayName=SF.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(kF,{ref:r,className:_d("px-2 py-1.5 text-sm font-semibold text-muted-foreground",e),...n}))).displayName=kF.displayName;const IF=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(EF,{ref:o,className:_d("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(jF,{children:t.jsx(Xc,{className:"h-4 w-4"})})}),t.jsx(_F,{children:n})]})));IF.displayName=EF.displayName;function FF(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}i.forwardRef((({className:e,...n},r)=>t.jsx(PF,{ref:r,className:_d("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=PF.displayName;var $F="Switch",[qF,UF]=s_($F),[zF,BF]=qF($F),VF=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,name:o,checked:s,defaultChecked:a,required:l,disabled:c,value:u="on",onCheckedChange:d,form:p,...f}=e,[h,m]=i.useState(null),g=uf(n,(e=>m(e))),y=i.useRef(!1),v=!h||(p||!!h.closest("form")),[b=!1,x]=DT({prop:s,defaultProp:a,onChange:d});return t.jsxs(zF,{scope:r,checked:b,disabled:c,children:[t.jsx(f_.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":GF(b),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:g,onClick:i_(e.onClick,(e=>{x((e=>!e)),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())}))}),v&&t.jsx(WF,{control:h,bubbles:!y.current,name:o,value:u,checked:b,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})}));VF.displayName=$F;var KF="SwitchThumb",HF=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,...o}=e,i=BF(KF,r);return t.jsx(f_.span,{"data-state":GF(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})}));HF.displayName=KF;var WF=e=>{const{control:n,checked:r,bubbles:o=!0,...s}=e,a=i.useRef(null),l=FF(r),c=iT(n);return i.useEffect((()=>{const e=a.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function GF(e){return e?"checked":"unchecked"}var YF=VF,QF=HF;const XF=i.forwardRef((({className:e,...n},r)=>t.jsx(YF,{className:_d("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input/50",e),...n,ref:r,children:t.jsx(QF,{className:_d("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})));XF.displayName=YF.displayName;var JF=(e=>(e.DAYS="days",e))(JF||{});const ZF=e=>!("number"!=typeof e.value||e.value<0)&&(e.unit===JF.DAYS&&(("before"===e.direction||"after"===e.direction)&&"relative"===e.type)),e$=({fieldType:e,operator:n,value:r,onChange:o,options:s,toast:a,metadata:l})=>{const c=r.length>0&&"object"==typeof r[0]&&"type"in r[0]&&"relative"===r[0].type,[u,d]=i.useState((e===RP.Date||e===RP.DateTime)&&r.length>0&&r[0]instanceof Date?r[0]:void 0),[p,f]=i.useState(c),[h,m]=i.useState(c?r[0]:{type:"relative",value:0,unit:JF.DAYS,direction:"before"});if(i.useEffect((()=>{n!==IP.EQUALS_MONTH_DAY&&n!==IP.EQUALS_MONTH_DAY_YEAR&&p&&(f(!1),o(u?[u]:[]))}),[n,p,u,o]),e===RP.String||e===RP.ReachResource||e===RP.Array)return n===IP.EXISTS?null:t.jsx(rL,{maxCount:2,options:(s||[]).map((e=>({label:e.displayName,value:e.id}))),value:r.map((e=>{const t=(s||[]).find((t=>t.id===String(e)||t.displayName===String(e)||t.id===t.displayName&&t.id===String(e)));return t?.id||String(e)})),onValueChange:e=>{o(e)},selectedValues:r.map((e=>{const t=(s||[]).find((t=>t.id===String(e)||t.displayName===String(e)||t.id===t.displayName&&t.id===String(e)));return t?.id||String(e)})),setSelectedValues:e=>{o(e)},searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:e=>{if(e.length>0){const t=(e=>{const{value:t,type:n}=e;switch(n){case RP.ReachResource:case RP.Array:case RP.String:return t.length>0;case RP.Number:return!isNaN(Number(t));case RP.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case RP.Boolean:return"true"===t||"false"===t;case RP.Date:case RP.DateTime:return!isNaN(new Date(t).getTime());default:throw hk(n,RP)}})({value:e,type:l.type});t?o([...new Set([...r,e])]):a({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${l.type} type`,variant:"destructive"})}}});if(e===RP.Date||e===RP.DateTime){const e=n===IP.EQUALS_MONTH_DAY||n===IP.EQUALS_MONTH_DAY_YEAR,r=e=>{ZF(e)?(m(e),p&&o([e])):a({title:"Invalid relative date",description:"Please enter a valid non-negative number of days.",variant:"destructive"})},i=e=>{e&&(e=>e instanceof Date?!isNaN(e.getTime()):"object"==typeof e&&"type"in e&&"relative"===e.type&&ZF(e))(e)?(d(e),o([e]),f(!1)):e||(d(void 0),o([]),f(!1))},s=e=>{f(e),o(e?[h]:u?[u]:[])};return t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsxs("div",{className:"min-h-[36px] flex items-center",children:[" ",(!p||!e)&&t.jsxs(VM,{modal:!0,children:[t.jsx(KM,{asChild:!0,children:t.jsxs(nk,{variant:"outline",className:_d("w-[200px] justify-start text-left font-normal h-9",!u&&"text-muted-foreground"),children:[t.jsx(Qc,{className:"mr-2 h-4 w-4"}),u?hP(u,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(HM,{className:"w-auto p-0",align:"start",children:t.jsx(KR,{mode:"single",selected:u,onSelect:i,initialFocus:!0})})]}),e&&p&&t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(mk,{type:"number",value:h.value,onChange:e=>{const t=parseInt(e.target.value,10),n=isNaN(t)||t<0?0:t;r({...h,value:n})},className:"w-20 h-9",min:"0","aria-label":"Relative days value"}),t.jsxs(DF,{value:h.direction,onValueChange:e=>{r({...h,direction:e})},children:[t.jsx(AF,{className:"w-[180px] h-9","aria-label":"Relative direction",children:t.jsx(MF,{placeholder:"Select direction..."})}),t.jsxs(LF,{children:[t.jsx(IF,{value:"before",children:"days before today"}),t.jsx(IF,{value:"after",children:"days after today"})]})]})]})]}),e&&t.jsxs("div",{className:"flex items-center space-x-1 pl-1",children:[t.jsx(XF,{id:"relative-date-switch",checked:p,onCheckedChange:s,"aria-label":"Toggle relative date input"}),t.jsx(XP,{htmlFor:"relative-date-switch",className:"text-xs font-normal text-muted-foreground cursor-pointer",children:"Relative"})]})]})}if(e===RP.Number||e===RP.Integer)return n===IP.EXISTS?null:t.jsx(mk,{type:"number",value:r.length>0?String(r[0]):"",onChange:e=>o([Number(e.target.value)]),className:"w-[200px]"});if(e===RP.Boolean){if(n===IP.EXISTS)return null;const e=r.length>0&&Boolean(r[0]);return t.jsx(XF,{checked:e,onCheckedChange:e=>o([e])})}return t.jsx(mk,{value:r.length>0?String(r[0]):"",onChange:e=>o([e.target.value]),className:"w-[200px]",disabled:!0})},t$=({condition:e,onUpdate:n,onDuplicate:r,onDelete:o,segmentsConditions:i})=>{const{toast:s}=wl(),a=(e=>{const t=i.conditions.find((t=>t.field===e));return t||null})(e.field)||{operators:[],type:RP.String,options:void 0,itemType:void 0},l=a.operators,c=a.type,u=i.conditions.map((e=>e.field)).map((e=>({value:e,label:ZP[e]||e})));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx(WM,{options:u,value:e.field,onChange:t=>{const r=t,o=i.conditions.find((e=>e.field===r));if(!o)return;const s=o.operators.map((e=>({value:e,label:JP[e]||e,fieldType:o.type}))),a=s[0]?.value;let l=[];switch(o.type){case RP.Boolean:l=[!1];break;case RP.Number:l=[0];break;case RP.Date:case RP.DateTime:l=[new Date];break;case RP.String:l=o.options?.length?o.options.map((e=>e.displayName)):[];break;default:l=[]}n({...e,field:r,operator:a,value:l})},placeholder:"Select field"}),t.jsx(WM,{options:l.map((e=>({value:e,label:JP[e]||e}))),value:e.operator,onChange:t=>n({...e,operator:t}),placeholder:"Select operator"}),t.jsx("div",{className:"max-w-2xl w-full overflow-hidden",children:t.jsx(e$,{fieldType:c,operator:e.operator,options:"string"==typeof e.value[0]&&e.value[0]&&Array.isArray(a.options)?[...(a.options||[]).map((e=>({displayName:e.displayName,id:e.id}))),...e.value.filter((e=>!a.options?.some((t=>t.id===e||t.displayName===e)))).map((e=>({displayName:e,id:e})))]:a.options?.map((e=>({displayName:e.displayName,id:e.id}))),value:e.value,onChange:t=>n({...e,value:t}),toast:s,metadata:{field:e.field,type:c,itemType:a.itemType}})})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx(nk,{size:"icon",variant:"ghost",onClick:r,children:t.jsx(au,{className:"h-4 w-4"})}),t.jsx(nk,{size:"icon",variant:"ghost",onClick:o,children:t.jsx(Eu,{className:"h-4 w-4"})})]})]})},n$=({onSelectStyle:e})=>{const[r,o]=n.useState(null);return t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 max-w-4xl mx-auto",children:[t.jsx(ik,{onClick:()=>{o("ai"),e("ai")},title:"Build with AI",subtitle:"Describe your audience in plain language and let AI create the conditions",icon:t.jsx("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:t.jsx("div",{className:"w-6 h-6 text-[hsl(var(--reach-primary))]",children:t.jsx(ku,{className:"w-full h-full"})})}),selected:"ai"===r}),t.jsx(ik,{onClick:()=>{o("manual"),e("manual")},title:"Build Manually",subtitle:`Create your ${Fp("engage:segment")} by configuring conditions directly`,icon:t.jsx("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:t.jsx("div",{className:"w-6 h-6 text-[hsl(var(--reach-primary))]",children:t.jsx(Su,{className:"w-full h-full"})})}),selected:"manual"===r})]})},r$=({segmentId:e,setOpen:n,setTextToSegment:r,promptBuilderStyle:o,textToSegment:i})=>t.jsx("div",{children:t.jsx(qm,{className:"",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Um,{className:"text-3xl font-normal",children:e?`Edit ${Fp("engage:segment")}`:`Create ${Fp("engage:segment")}`}),t.jsxs("div",{className:"flex items-center gap-2",children:[!1===o&&!1===i&&t.jsx(lN,{children:t.jsxs(cN,{children:[t.jsx(uN,{asChild:!0,children:t.jsx(nk,{variant:"outline",size:"sm",onClick:()=>r(!0),children:t.jsx(ku,{className:"h-4 w-3"})})}),t.jsx(dN,{children:t.jsxs("p",{children:["Use AI to create ",Fp("engage:segment")," by describing them in natural language"]})})]})}),t.jsx(nk,{variant:"ghost",size:"icon",onClick:()=>{!0===i?r(!1):n(!1)},className:"h-8 w-8",children:t.jsx(Mu,{className:"h-4 w-4"})})]})]})})}),o$=({setTextToSegment:e,setSegment:r})=>{const[o,i]=n.useState(""),[s,l]=n.useState(!1),{toast:c}=wl();return t.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Describe your audience"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Describe the audience you want to target in plain language, and our AI will create the conditions for you."})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(ng,{children:[s&&t.jsx(JC,{children:t.jsx(XC,{})}),!s&&t.jsx(JC,{children:t.jsx(gk,{placeholder:"Describe your target audience...",className:"min-h-[120px] resize-none",value:o,onChange:e=>i(e.target.value)})})]}),t.jsx("div",{className:"flex justify-end gap-2",children:t.jsxs(nk,{onClick:async()=>{if(!o)return void c({title:"Please enter a description",description:"Please enter a description of your target audience",variant:"destructive"});l(!0);const t=await(async e=>(await Ee(`${a}/text-to-segment`,{method:"POST",body:JSON.stringify({text:e})})).data)(o);t.success&&t.conditions?(c({title:`${Fp("engage:segment")} conditions built successfully 🚀`,description:`Your ${Fp("engage:segment")} conditions have been built successfully`}),r(t.conditions)):c({title:`${Fp("engage:segment")} build failed`,description:"Please try again",variant:"destructive"}),e(!1),l(!1)},children:[t.jsx(ku,{className:"h-4 w-4"}),"Generate ",Fp("engage:segment")]})})]})]})};function i$({segmentId:e,setOpen:n,onSegmentUpdated:r}){const{toast:o}=wl(),s=void 0===e,[a,l]=i.useState(!1),[c,u]=i.useState({version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[]}),{segment:d,isLoading:p}=qP(e||""),{updateSegment:f}=UP(e),{createSegment:h,isCreating:m,segmentsConditions:g}=FP(),[y,v]=i.useState(!1),[b,x]=i.useState(!!s);i.useEffect((()=>{g&&u(d?{version:"1.0",id:d.id,name:d.name,description:d.description,logic:"AND",conditions:d.conditions}:{version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[{field:g.conditions[0].field,operator:g.conditions[0].operators[0],value:[]}]})}),[d,g]);const w=e=>e.value.some((e=>"object"==typeof e&&"type"in e&&"relative"===e.type));if(!g||p)return t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(XC,{})});return t.jsx(t.Fragment,{children:t.jsxs(ng,{children:[t.jsx(r$,{segmentId:e,setOpen:n,setTextToSegment:v,promptBuilderStyle:b,textToSegment:y},"segment-builder-header"),b?t.jsx(JC,{children:t.jsx(n$,{onSelectStyle:e=>{"ai"===e&&v(!0),x(!1)}})},"prompt-builder-style"):t.jsx(JC,{children:t.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex flex-1 flex-col overflow-hidden px-8 py-2",children:t.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-visible",children:t.jsx(ng,{children:y?t.jsx(JC,{children:t.jsx(o$,{setTextToSegment:v,setSegment:e=>u({...c,conditions:e})})}):t.jsxs(JC,{children:[t.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-2",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(XP,{className:"text-muted-foreground text-xs",children:"Name"}),t.jsx(mk,{placeholder:`${Fp("engage:segment")} name`,value:c.name,onChange:e=>u({...c,name:e.target.value})})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsx(XP,{className:"text-muted-foreground text-xs",children:"Description"}),t.jsx(mk,{placeholder:`${Fp("engage:segment")} description`,value:c.description,onChange:e=>u({...c,description:e.target.value})})]})]}),c.conditions.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto pb-8",children:t.jsx("div",{className:"grid",children:t.jsx(ng,{mode:"popLayout",children:c.conditions.map(((e,n)=>t.jsxs(qC.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{type:"spring",stiffness:300,damping:30,mass:.5},children:[n>0&&t.jsxs(qC.div,{className:"relative flex items-center gap-3 py-1",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1},children:[t.jsx(qC.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}}),t.jsx(qC.span,{className:"text-muted-foreground text-xs",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:"AND"}),t.jsx(qC.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}})]}),t.jsx(t$,{condition:e,onUpdate:e=>((e,t)=>{const n=[...c.conditions];n[e]=t,u({...c,conditions:n})})(n,e),segmentsConditions:g,onDuplicate:()=>(e=>{const t=[...c.conditions];t.splice(e+1,0,{...c.conditions[e]}),u({...c,conditions:t})})(n),onDelete:()=>(e=>{const t=c.conditions.filter(((t,n)=>n!==e));u({...c,conditions:t})})(n)})]},n)))})})})]})})})}),t.jsx("div",{className:"border-t px-8 py-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(nk,{variant:"secondary",onClick:()=>{u({...c,conditions:[...c.conditions,{field:g.conditions[0].field,operator:g.conditions[0].operators[0],value:[]}]})},children:[t.jsx(bu,{className:"h-4 w-4"}),"Add Condition"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(nk,{variant:"secondary",onClick:()=>n(!1),children:"Cancel"}),t.jsx(nk,{variant:"secondary",onClick:async()=>{if(!c.name||!c.description)return void o({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:i}=(e=>{for(const t of e){if(!t.field||!t.operator)return{valid:!1,error:"Please ensure all fields are filled out"};if(t.operator!==IP.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===IP.EXISTS&&t.value.length>0)return{valid:!1,error:"EXISTS operator can only be used with an empty array"};if(w(t)&&t.operator!==IP.EQUALS_MONTH_DAY&&t.operator!==IP.EQUALS_MONTH_DAY_YEAR)return{valid:!1,error:"Relative dates can only be used with the month and day or month, day, and year operator"}}return{valid:!0,error:void 0}})(c.conditions);if(t){l(!0);try{e&&d?f({name:c.name,description:c.description,conditions:c.conditions},{onSuccess:()=>{o({title:"Segment updated successfully"}),n(!1),r?.(c.id)},onError:()=>{o({title:"Error updating segment",description:"Please try again",variant:"destructive"}),r?.("error")}}):h({name:c.name,description:c.description,conditions:c.conditions},{onSuccess:()=>{o({title:"Segment created successfully"}),n(!1),r?.(c.id)},onError:()=>{o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),r?.("error")}})}catch(s){o({title:"Error saving segment",description:"Please try again",variant:"destructive"}),r?.("error")}finally{l(!1)}}else o({title:"Conditions are invalid",description:i??"Please ensure all fields are filled out",variant:"destructive"})},disabled:a||m,children:a||m?t.jsxs(t.Fragment,{children:[t.jsx(du,{className:"mr-2 h-4 w-4 animate-spin"}),e?"Updating...":"Creating..."]}):e?"Update":"Create"})]})]})})]})},"manual-builder-style")]})})}function s$({open:e,setOpen:n,segmentId:r,onSegmentUpdated:o}){return t.jsx(Lm,{open:e,onOpenChange:n,children:t.jsxs($m,{className:"flex max-h-[86vh] flex-col gap-0 overflow-visible max-w-5xl w-full",hideCloseButton:!0,children:[t.jsxs(gf,{children:[t.jsxs(Um,{children:[Fp("engage:segment")," Builder"]}),t.jsxs(zm,{children:["Build a ",Fp("engage:segment")," to target your audience"]})]}),t.jsx(i$,{segmentId:r,setOpen:n,onSegmentUpdated:e=>{o?.(e),n(!1)}})]})})}const a$=()=>{const[e,r]=n.useState(""),{toast:o}=wl(),[i,s]=n.useState(!1),[a,l]=n.useState(null),c=e=>{const n={[LP.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[LP.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[LP.CUSTOM];return t.jsx(jP,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsx(s$,{open:i,setOpen:s,segmentId:a??void 0}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(xu,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(mk,{placeholder:"Search segments...",value:e,onChange:e=>r(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2"}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(nk,{variant:"outline",onClick:()=>s(!0),children:[t.jsx(bu,{}),"Create New ",Fp("engage:segment")]})})]}),t.jsx(kP,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-foreground",children:e}),c(n.type)]}),t.jsx("span",{className:"text-sm text-muted-foreground truncate max-w-[300px]",children:n.description})]})})},{header:"Users",accessorKey:"user_count",width:"25%",cell:e=>t.jsxs("div",{className:"text-muted-foreground",children:[e.toLocaleString()," ",1===e?"user":"users"]})},{header:"Modified",accessorKey:"user_count_updated_at",width:"25%",cell:e=>t.jsx("div",{className:"text-muted-foreground",children:e?gP(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:t,limit:n})=>{const r=await OP({cursor:t,limit:n,search:e||void 0});return{items:r.results,cursor:r.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-user-group h-12 w-12 text-muted-foreground"}),title:"No Segments Found",description:"Create your first segment to get started."},onRowClick:e=>{e.type===LP.CUSTOM?(l(e.id),s(!0)):o({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},l$=({iconDefinitions:e})=>{const r=bE(),o=ek(e),[i,s]=n.useState("automations"),a=[{id:"automations",label:`${Fp("engage:automation",{count:2})}`,content:t.jsx(AP,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)},iconDefinitions:o})},{id:"segments",label:`${Fp("engage:segment",{count:2})}`,content:t.jsx(a$,{})}];return t.jsxs("div",{className:"h-full container max-w-screen-xl mx-auto flex flex-col",children:[t.jsx(mN,{iconDefinitions:o}),t.jsx("div",{className:"flex-1",children:t.jsx(o_,{tabs:a,activeTab:i,onTabChange:e=>s(e)})})]})},c$=e=>{const t=me({queryKey:["communication-group",e],queryFn:()=>e?(async e=>(await Ee(`${u}/${e}`)).data)(e):null,enabled:!!e});return{communicationGroup:t.data,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},u$=()=>{const e=ae(),t=ge({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await Ee(`${u}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data)(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{updateCommunicationGroup:t.mutate,isUpdating:t.isPending,updateError:t.error,isUpdateSuccess:t.isSuccess}},d$=e=>{const t=me({queryKey:["merge-fields",e],queryFn:()=>(async e=>{if(!e)return{mergeFields:[]};return(await Ee(`${u}/${e}/merge-fields`)).data})(e)});return{getMergeFields:t.data,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},p$=()=>{const e=ge({mutationFn:({id:e,params:t})=>(async(e,t)=>(await Ee(`${u}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}};var f$=(e=>(e[e.SelectTrigger=0]="SelectTrigger",e[e.SelectAudience=1]="SelectAudience",e[e.SelectCommunication=2]="SelectCommunication",e[e.PreviewAndSchedule=3]="PreviewAndSchedule",e))(f$||{});const h$=(e,t)=>{const r=n.useRef(!0),[o,i]=n.useState(!1),{automation:s,isLoading:a,invalidateAutomation:l}=je(e),c=s,{updateAutomation:u,isUpdating:d}=Pe(e),p=c?.action_data?.find((e=>"send_communication"===e.action_type))?.action_metadata.communication_group_id,{communicationGroup:f,isGetting:h}=c$(p||void 0),{updateCommunicationGroup:m,isUpdating:g}=u$(),{estimatedMatchesStats:y}=(e=>{const{data:t}=$P({include_segments:e?.includeSegmentIds??[],exclude_segments:e?.excludeSegmentIds??[]}),r=n.useMemo((()=>t?.recipients?t.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[t?.recipients]);return{estimatedMatches:t,estimatedMatchesStats:r}})(c),[v,b]=n.useState(!1),[x,w]=n.useState(!1),S=n.useCallback((()=>{l()}),[l]);n.useEffect((()=>{w((a||d||h||v||g||o)&&r.current)}),[t,s,a,d,h,v,g,o]),n.useEffect((()=>()=>{r.current=!1}),[]);const C=n.useCallback((async e=>{if(!c)return{canMove:!1,errorMessage:"Automation not loaded"};try{return b(!0),await(async e=>{const{currentStep:t,automation:n,communicationGroup:r}=e;if(0===t)return{canMove:!0,errorMessage:null};if(1===t)return{canMove:n.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(2===t){const e=n.action_data?.find((e=>"send_communication"===e.action_type));if(!e)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};if(!r||!r.sms_channel_sender_id&&!r.email_channel_sender_id)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};if(r.email_channel_sender_id&&(!r.email_html_body||!r.email_subject))return{canMove:!1,errorMessage:"Please ensure you have a email body and subject"};if(r.sms_channel_sender_id&&!r.sms_message_body)return{canMove:!1,errorMessage:"Please ensure you have a sms message body"}}if(3===t){if(Ae(n.trigger_metadata)){const e=n.trigger_metadata;return{canMove:Boolean(e.scheduled_at&&new Date(e.scheduled_at)>new Date&&n.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id))),errorMessage:"Please ensure you have set a valid future date for your one-time automation"}}return{canMove:Boolean(n.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id))),errorMessage:null}}return{canMove:!0,errorMessage:null}})({currentStep:e,automation:c,communicationGroup:f})}finally{r.current&&b(!1)}}),[c,f]),k=n.useCallback((e=>{r.current&&i(e)}),[]);return{automation:c,updateAutomation:u,communicationGroup:f,updateCommunicationGroup:m,isLoading:x,setIsLoading:k,invalidateAutomation:S,validateStep:C,estimatedMatchesStats:y}},m$=()=>{const e=me({queryKey:["channel-senders"],queryFn:()=>(async()=>(await Ee(`${c}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},g$=()=>{const e=ae(),t=ge({mutationFn:e=>(async(e,t)=>(await Ee(`${c}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data)(e.toUpdate,e.id),onSuccess:()=>{e.invalidateQueries({queryKey:["channel-senders"]})}});return{updateChannelSender:t.mutate,isUpdating:t.isPending,updateError:t.error}},y$=e=>e.friendlyName||e.from||e.messageServiceSid||"Unknown Sender",v$=({type:e})=>t.jsxs("div",{className:"w-full h-full min-h-[300px] flex flex-col items-center justify-center bg-gradient-to-b from-gray-50 to-white p-8",children:[t.jsx("div",{className:"mb-4 text-gray-300",children:t.jsx("svg",{className:"w-16 h-16",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"})})}),t.jsxs("p",{className:"text-gray-400 font-medium text-lg text-center mb-2",children:["No ","email"===e?"Email":"SMS"," Preview Available"]}),t.jsxs("p",{className:"text-gray-400 text-sm text-center",children:["Edit your ","email"===e?"Email":"SMS"," template to see a preview here"]})]}),b$=({html:e,height:n,width:r})=>t.jsx("div",{className:"w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out flex items-center justify-center",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll h-full",style:{border:"none",backgroundColor:"white",height:n||"100%",width:r||"100%"}}):t.jsx(v$,{type:"email"})}),x$=({emailFromName:e,emailSubject:r,emailPreviewText:o,emailBody:i,emailBaseDomain:s})=>{const[a,l]=n.useState({width:0,height:0}),c=n.useRef(null);return n.useEffect((()=>{const e=()=>{c.current&&requestAnimationFrame((()=>{l({width:c.current?c.current.offsetWidth-100:0,height:c.current?c.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[c]),t.jsxs("div",{className:"space-y-6 h-full",children:[t.jsxs("div",{className:"bg-gray-50 p-5 rounded-lg space-y-4 border border-gray-100",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e?`${e} <${s}>`:s})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Subject:"}),t.jsx("span",{className:"text-gray-800 font-medium",children:r})]}),o&&t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Preview Text:"}),t.jsx("span",{className:"text-gray-600 italic",children:o})]})]}),t.jsx("div",{className:"border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",ref:c,children:t.jsx(b$,{html:i,height:a.height,width:a.width})})]})},w$=({fromPhone:e,body:n})=>t.jsxs("div",{className:"max-w-sm mx-auto min-h-[400px] flex flex-col justify-center",children:[t.jsx("div",{className:"bg-gray-50 p-5 rounded-lg border border-gray-100 mb-6",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e})]})}),t.jsx("div",{className:"border-4 border-gray-800 rounded-3xl p-1 bg-gray-800 shadow-xl mx-auto max-w-xs transform scale-[0.67] origin-top",children:t.jsx("div",{className:"bg-gray-100 rounded-2xl p-4 h-[500px] w-[280px] aspect-[9/16] overflow-y-auto",children:t.jsx("div",{className:"flex justify-end mb-4",children:t.jsx("div",{className:"bg-green-500 text-white rounded-2xl rounded-tr-sm py-3 px-4 max-w-[80%] shadow-sm whitespace-pre-wrap text-[1.5rem]",children:n})})})})]}),S$=({emailPreview:e,smsPreview:r,iconDefinitions:o})=>{const[i,s]=n.useState("email");return n.useEffect((()=>{e?s("email"):r&&s("sms")}),[e,r]),t.jsx(qC.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"w-full",children:t.jsxs("div",{className:"bg-gray-200 rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-white",children:[e&&t.jsxs(nk,{onClick:()=>s("email"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("email"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o?.EmailIcon&&t.jsx(o.EmailIcon,{className:"w-5 h-5 transition-colors duration-200 "+("email"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"Email Preview"})]}),"email"===i&&t.jsx(qC.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]}),r&&t.jsxs(nk,{onClick:()=>s("sms"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("sms"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o?.SmsIcon&&t.jsx(o.SmsIcon,{className:"w-5 h-5 transition-colors duration-200 "+("sms"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"SMS Preview"})]}),"sms"===i&&t.jsx(qC.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]})]}),t.jsx("div",{className:"p-6",children:t.jsxs(ng,{children:["email"===i&&e&&t.jsx(qC.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(x$,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(qC.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(w$,{fromPhone:r.fromPhone,body:r.companyName?`${r.companyName}:\n${r.body}`:r.body})},"sms")]})})]})})},C$=({iconDefinitions:e,isLoading:r,communicationGroup:o})=>{const{channelSenders:i}=m$(),[s,a]=n.useState(null),[l,c]=n.useState(null),[u,d]=n.useState(!1);return n.useEffect((()=>{if(o&&i){d(!0);try{const e=o.email_channel_sender_id,t=i.results.find((t=>t.id===e));t&&o.email_html_body&&o.email_subject&&a({emailHtml:o.email_html_body,emailSubject:o.email_subject,emailBaseDomain:t.channel_sender_metadata.baseDomain,emailFromName:t.channel_sender_metadata.emailFromName,emailFromEmail:`${t.channel_sender_metadata.userPart}@${t.channel_sender_metadata.baseDomain}`,emailPreviewText:o.email_preview_text});const n=o.sms_channel_sender_id,r=i.results.find((e=>e.id===n));r&&(r.channel_sender_metadata.from||r.channel_sender_metadata.messageServiceSid)&&o.sms_message_body&&c({fromPhone:y$(r.channel_sender_metadata),smsBody:o.sms_message_body,companyName:o.text_message_company_name})}finally{d(!1)}}else d(!1)}),[o,i]),u||r||r?t.jsx(XC,{text:["Fetching Automation","Finishing up"]}):t.jsx("div",{className:"p-6 bg-background",children:t.jsxs("div",s||l?{className:"space-y-4",children:[t.jsx(S$,{iconDefinitions:e,emailPreview:s&&s.emailFromEmail&&s.emailSubject&&s.emailHtml?{fromEmail:s?.emailFromEmail,fromName:s?.emailFromName??null,subject:s?.emailSubject,previewText:s?.emailPreviewText??null,body:s?.emailHtml}:null,smsPreview:l&&l.fromPhone&&l.smsBody?{fromPhone:l?.fromPhone,body:l?.smsBody,companyName:l?.companyName}:null}),t.jsx("div",{className:"text-center text-sm text-gray-500",children:t.jsx("p",{children:"These previews show exactly how your messages will appear to your customers"})})]}:{className:"py-12 flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-6",children:t.jsx("svg",{className:"w-16 h-16 text-gray-300",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Automation Content Missing"}),t.jsx("p",{className:"text-gray-500 max-w-md",children:"Complete your automation setup to preview the content here. We'll guide you through each step. Start by clicking Actions in the top right, and then click Edit!"})]})})},k$=({automationId:e,iconDefinitions:n,automation:r,isLoading:o})=>{const{recipients:i,isLoading:s,fetchError:a}=Te(e),{isLoading:l}=De(e);if(s||l||o)return t.jsx(XC,{text:["Fetching Recipients","Finishing up"]});if(a)return t.jsxs("div",{children:["Error: ",a.message]});if(!i||0===i.recipients.length)return t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-4",children:t.jsx(ZC.UserIcon,{className:"h-12 w-12 text-gray-400"})}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:"No Recipients Found"}),t.jsx("p",{className:"text-gray-500",children:"This automation currently has no assigned recipients. Please update the include or exclude segments to add recipients."})]});const c="30%",u="35%",d="35%";return t.jsxs("div",{className:"relative bg-background",children:[t.jsx("div",{children:t.jsx(mN,{automationId:e,iconDefinitions:n,automation:r})}),t.jsx(tL,{className:"my-4"}),t.jsxs(vP,{children:[t.jsx(bP,{children:t.jsxs(wP,{children:[t.jsx(SP,{style:{width:c},children:"Name"}),t.jsx(SP,{style:{width:u},children:"Email"}),t.jsx(SP,{style:{width:d},children:"Phone"})]})}),t.jsx(xP,{children:i.recipients.map((e=>t.jsxs(wP,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(CP,{style:{width:c},children:e.first_name||e.last_name?`${e.first_name||""} ${e.last_name||""}`.trim():t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(CP,{style:{width:u},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(CP,{style:{width:d},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};function E$(e){const r=e+"CollectionProvider",[o,i]=s_(r),[s,a]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:o}=e,i=n.useRef(null),a=n.useRef(new Map).current;return t.jsx(s,{scope:r,itemMap:a,collectionRef:i,children:o})};l.displayName=r;const c=e+"CollectionSlot",u=n.forwardRef(((e,n)=>{const{scope:r,children:o}=e,i=uf(n,a(c,r).collectionRef);return t.jsx(l_,{ref:i,children:o})}));u.displayName=c;const d=e+"CollectionItemSlot",p="data-radix-collection-item",f=n.forwardRef(((e,r)=>{const{scope:o,children:i,...s}=e,l=n.useRef(null),c=uf(r,l),u=a(d,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)}))),t.jsx(l_,{[p]:"",ref:c,children:i})}));return f.displayName=d,[{Provider:l,Slot:u,ItemSlot:f},function(t){const r=a(e+"CollectionConsumer",t);return n.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},i]}var _$=i.createContext(void 0);function j$(e){const t=i.useContext(_$);return e||t||"ltr"}var T$,N$="dismissableLayer.update",P$="dismissableLayer.pointerDownOutside",D$="dismissableLayer.focusOutside",M$=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),A$=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(M$),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=uf(n,(e=>f(e))),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){R$(P$,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h),k=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){R$(D$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return g_((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(T$=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),O$(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=T$)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),O$())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(N$,e),()=>document.removeEventListener(N$,e)}),[]),t.jsx(f_.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:i_(e.onFocusCapture,k.onFocusCapture),onBlurCapture:i_(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:i_(e.onPointerDownCapture,C.onPointerDownCapture)})}));A$.displayName="DismissableLayer";function O$(){const e=new CustomEvent(N$);document.dispatchEvent(e)}function R$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?h_(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(M$),o=i.useRef(null),s=uf(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(f_.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var L$="rovingFocusGroup.onEntryFocus",I$={bubbles:!1,cancelable:!0},F$="RovingFocusGroup",[$$,q$,U$]=E$(F$),[z$,B$]=s_(F$,[U$]),[V$,K$]=z$(F$),H$=i.forwardRef(((e,n)=>t.jsx($$.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx($$.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(W$,{...e,ref:n})})})));H$.displayName=F$;var W$=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,h=i.useRef(null),m=uf(n,h),g=j$(a),[y=null,v]=DT({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=m_(d),S=q$(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(L$,w),()=>e.removeEventListener(L$,w)}),[w]),t.jsx(V$,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:y,onItemFocus:i.useCallback((e=>v(e)),[v]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>E((e=>e-1))),[]),children:t.jsx(f_.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:i_(e.onMouseDown,(()=>{C.current=!0})),onFocus:i_(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(L$,I$);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));X$([e.find((e=>e.active)),e.find((e=>e.id===y)),...e].filter(Boolean).map((e=>e.ref.current)),p)}}C.current=!1})),onBlur:i_(e.onBlur,(()=>x(!1)))})})})),G$="RovingFocusGroupItem",Y$=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=T_(),u=a||c,d=K$(G$,r),p=d.currentTabStopId===u,f=q$(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return h(),()=>m()}),[o,h,m]),t.jsx($$.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(f_.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:i_(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:i_(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:i_(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Q$[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>X$(o)))}var n,r}))})})}));Y$.displayName=G$;var Q$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function X$(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var J$=H$,Z$=Y$,eq=["Enter"," "],tq=["ArrowUp","PageDown","End"],nq=["ArrowDown","PageUp","Home",...tq],rq={ltr:[...eq,"ArrowRight"],rtl:[...eq,"ArrowLeft"]},oq={ltr:["ArrowLeft"],rtl:["ArrowRight"]},iq="Menu",[sq,aq,lq]=E$(iq),[cq,uq]=s_(iq,[lq,lT,B$]),dq=lT(),pq=B$(),[fq,hq]=cq(iq),[mq,gq]=cq(iq),yq=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=dq(n),[u,d]=i.useState(null),p=i.useRef(!1),f=m_(a),h=j$(s);return i.useEffect((()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(kT,{...c,children:t.jsx(fq,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(mq,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:p,dir:h,modal:l,children:o})})})};yq.displayName=iq;var vq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=dq(r);return t.jsx(ET,{...i,...o,ref:n})}));vq.displayName="MenuAnchor";var bq="MenuPortal",[xq,wq]=cq(bq,{forceMount:void 0}),Sq=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=hq(bq,n);return t.jsx(xq,{scope:n,forceMount:r,children:t.jsx(NT,{present:r||s.open,children:t.jsx(TT,{asChild:!0,container:i,children:o})})})};Sq.displayName=bq;var Cq="MenuContent",[kq,Eq]=cq(Cq),_q=i.forwardRef(((e,n)=>{const r=wq(Cq,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=hq(Cq,e.__scopeMenu),a=gq(Cq,e.__scopeMenu);return t.jsx(sq.Provider,{scope:e.__scopeMenu,children:t.jsx(NT,{present:o||s.open,children:t.jsx(sq.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?jq:Tq,{...i,ref:n})})})})})),jq=i.forwardRef(((e,n)=>{const r=hq(Cq,e.__scopeMenu),o=i.useRef(null),s=uf(n,o);return i.useEffect((()=>{const e=o.current;if(e)return Yh(e)}),[]),t.jsx(Nq,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:i_(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),Tq=i.forwardRef(((e,n)=>{const r=hq(Cq,e.__scopeMenu);return t.jsx(Nq,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),Nq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:g,...y}=e,v=hq(Cq,r),b=gq(Cq,r),x=dq(r),w=pq(r),S=aq(r),[C,k]=i.useState(null),E=i.useRef(null),_=uf(n,E,v.onContentChange),j=i.useRef(0),T=i.useRef(""),N=i.useRef(0),P=i.useRef(null),D=i.useRef("right"),M=i.useRef(0),A=g?zh:i.Fragment,O=g?{as:l_,allowPinchZoom:!0}:void 0,R=e=>{const t=T.current+e,n=S().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,o),s=n.find((e=>e.textValue===i))?.ref.current;!function e(t){T.current=t,window.clearTimeout(j.current),""!==t&&(j.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))};i.useEffect((()=>()=>window.clearTimeout(j.current)),[]),cM();const L=i.useCallback((e=>D.current===P.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,t)}(e,P.current?.area)),[]);return t.jsx(kq,{scope:r,searchRef:T,onItemEnter:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),onItemLeave:i.useCallback((e=>{L(e)||(E.current?.focus(),k(null))}),[L]),onTriggerLeave:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),pointerGraceTimerRef:N,onPointerGraceIntentChange:i.useCallback((e=>{P.current=e}),[]),children:t.jsx(A,{...O,children:t.jsx(hM,{asChild:!0,trapped:s,onMountAutoFocus:i_(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(A$,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:t.jsx(J$,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:i_(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(_T,{role:"menu","aria-orientation":"vertical","data-state":tU(v.open),"data-radix-menu-content":"",dir:b.dir,...x,...y,ref:_,style:{outline:"none",...y.style},onKeyDown:i_(y.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&R(e.key));if(e.target!==E.current)return;if(!nq.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));tq.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:i_(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),T.current="")})),onPointerMove:i_(e.onPointerMove,oU((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){D.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));_q.displayName=Cq;var Pq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(f_.div,{role:"group",...o,ref:n})}));Pq.displayName="MenuGroup";var Dq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(f_.div,{...o,ref:n})}));Dq.displayName="MenuLabel";var Mq="MenuItem",Aq="menu.itemSelect",Oq=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=gq(Mq,e.__scopeMenu),c=Eq(Mq,e.__scopeMenu),u=uf(n,a),d=i.useRef(!1);return t.jsx(Rq,{...s,ref:u,disabled:r,onClick:i_(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(Aq,{bubbles:!0,cancelable:!0});e.addEventListener(Aq,(e=>o?.(e)),{once:!0}),h_(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:i_(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:i_(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||eq.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));Oq.displayName=Mq;var Rq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=Eq(Mq,r),c=pq(r),u=i.useRef(null),d=uf(n,u),[p,f]=i.useState(!1),[h,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[a.children]),t.jsx(sq.ItemSlot,{scope:r,disabled:o,textValue:s??h,children:t.jsx(Z$,{asChild:!0,...c,focusable:!o,children:t.jsx(f_.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:i_(e.onPointerMove,oU((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:i_(e.onPointerLeave,oU((e=>l.onItemLeave(e)))),onFocus:i_(e.onFocus,(()=>f(!0))),onBlur:i_(e.onBlur,(()=>f(!1)))})})})})),Lq=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(Vq,{scope:e.__scopeMenu,checked:r,children:t.jsx(Oq,{role:"menuitemcheckbox","aria-checked":nU(r)?"mixed":r,...i,ref:n,"data-state":rU(r),onSelect:i_(i.onSelect,(()=>o?.(!!nU(r)||!r)),{checkForDefaultPrevented:!1})})})}));Lq.displayName="MenuCheckboxItem";var Iq="MenuRadioGroup",[Fq,$q]=cq(Iq,{value:void 0,onValueChange:()=>{}}),qq=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=m_(o);return t.jsx(Fq,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(Pq,{...i,ref:n})})}));qq.displayName=Iq;var Uq="MenuRadioItem",zq=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=$q(Uq,e.__scopeMenu),s=r===i.value;return t.jsx(Vq,{scope:e.__scopeMenu,checked:s,children:t.jsx(Oq,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":rU(s),onSelect:i_(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));zq.displayName=Uq;var Bq="MenuItemIndicator",[Vq,Kq]=cq(Bq,{checked:!1}),Hq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=Kq(Bq,r);return t.jsx(NT,{present:o||nU(s.checked)||!0===s.checked,children:t.jsx(f_.span,{...i,ref:n,"data-state":rU(s.checked)})})}));Hq.displayName=Bq;var Wq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(f_.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));Wq.displayName="MenuSeparator";var Gq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=dq(r);return t.jsx(jT,{...i,...o,ref:n})}));Gq.displayName="MenuArrow";var[Yq,Qq]=cq("MenuSub"),Xq="MenuSubTrigger",Jq=i.forwardRef(((e,n)=>{const r=hq(Xq,e.__scopeMenu),o=gq(Xq,e.__scopeMenu),s=Qq(Xq,e.__scopeMenu),a=Eq(Xq,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},p=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>p),[p]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(vq,{asChild:!0,...d,children:t.jsx(Rq,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":tU(r.open),...e,ref:cf(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:i_(e.onPointerMove,oU((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(a.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),p()}),100))}))),onPointerLeave:i_(e.onPointerLeave,oU((e=>{p();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],s=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:i_(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||rq[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));Jq.displayName=Xq;var Zq="MenuSubContent",eU=i.forwardRef(((e,n)=>{const r=wq(Cq,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=hq(Cq,e.__scopeMenu),l=gq(Cq,e.__scopeMenu),c=Qq(Zq,e.__scopeMenu),u=i.useRef(null),d=uf(n,u);return t.jsx(sq.Provider,{scope:e.__scopeMenu,children:t.jsx(NT,{present:o||a.open,children:t.jsx(sq.Slot,{scope:e.__scopeMenu,children:t.jsx(Nq,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:i_(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:i_(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:i_(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=oq[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function tU(e){return e?"open":"closed"}function nU(e){return"indeterminate"===e}function rU(e){return nU(e)?"indeterminate":e?"checked":"unchecked"}function oU(e){return t=>"mouse"===t.pointerType?e(t):void 0}eU.displayName=Zq;var iU=yq,sU=vq,aU=Sq,lU=_q,cU=Pq,uU=Dq,dU=Oq,pU=Lq,fU=qq,hU=zq,mU=Hq,gU=Wq,yU=Gq,vU=Jq,bU=eU,xU="DropdownMenu",[wU,SU]=s_(xU,[uq]),CU=uq(),[kU,EU]=wU(xU),_U=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=CU(n),d=i.useRef(null),[p=!1,f]=DT({prop:s,defaultProp:a,onChange:l});return t.jsx(kU,{scope:n,triggerId:T_(),triggerRef:d,contentId:T_(),open:p,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(iU,{...u,open:p,onOpenChange:f,dir:o,modal:c,children:r})})};_U.displayName=xU;var jU="DropdownMenuTrigger",TU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=EU(jU,r),a=CU(r);return t.jsx(sU,{asChild:!0,...a,children:t.jsx(f_.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:cf(n,s.triggerRef),onPointerDown:i_(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:i_(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));TU.displayName=jU;var NU=e=>{const{__scopeDropdownMenu:n,...r}=e,o=CU(n);return t.jsx(aU,{...o,...r})};NU.displayName="DropdownMenuPortal";var PU="DropdownMenuContent",DU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=EU(PU,r),a=CU(r),l=i.useRef(!1);return t.jsx(lU,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:i_(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:i_(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;s.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));DU.displayName=PU;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(cU,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var MU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(uU,{...i,...o,ref:n})}));MU.displayName="DropdownMenuLabel";var AU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(dU,{...i,...o,ref:n})}));AU.displayName="DropdownMenuItem";var OU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(pU,{...i,...o,ref:n})}));OU.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(fU,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var RU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(hU,{...i,...o,ref:n})}));RU.displayName="DropdownMenuRadioItem";var LU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(mU,{...i,...o,ref:n})}));LU.displayName="DropdownMenuItemIndicator";var IU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(gU,{...i,...o,ref:n})}));IU.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(yU,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var FU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(vU,{...i,...o,ref:n})}));FU.displayName="DropdownMenuSubTrigger";var $U=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(bU,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));$U.displayName="DropdownMenuSubContent";var qU=NU,UU=DU,zU=MU,BU=AU,VU=OU,KU=RU,HU=LU,WU=IU,GU=FU,YU=$U;const QU=_U,XU=TU;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(GU,{ref:i,className:_d("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(eu,{className:"ml-auto"})]}))).displayName=GU.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(YU,{ref:r,className:_d("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...n}))).displayName=YU.displayName;const JU=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(qU,{children:t.jsx(UU,{ref:o,sideOffset:n,className:_d("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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",e),...r})})));JU.displayName=UU.displayName;const ZU=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(BU,{ref:o,className:_d("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));ZU.displayName=BU.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(VU,{ref:i,className:_d("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(HU,{children:t.jsx(Xc,{className:"h-4 w-4"})})}),n]}))).displayName=VU.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(KU,{ref:o,className:_d("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(HU,{children:t.jsx(su,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=KU.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(zU,{ref:o,className:_d("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=zU.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(WU,{ref:r,className:_d("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=WU.displayName;const ez="reach-styles-module__stepIndicatorContainer___FoKXB",tz="reach-styles-module__iconContainer___Ki-1n",nz="reach-styles-module__checkIcon___-krUS",rz="reach-styles-module__minusIcon___r5cKs",oz="reach-styles-module__minusIconActive___-4JHM",iz="reach-styles-module__minusIconInactive___JtvVB",sz="reach-styles-module__label___tiCMA",az="reach-styles-module__labelActive___EXydD",lz="reach-styles-module__labelInactive___g-J3r",cz=({label:e,isCompleted:n,isActive:r,onClick:o})=>t.jsxs(o?"button":"div",{className:ez,onClick:o,children:[t.jsx("div",n?{className:tz,children:t.jsx(Xc,{className:nz})}:{className:tz,children:t.jsx(yu,{className:_d(rz,r?oz:iz)})}),t.jsx("span",{className:_d(sz,r?az:lz),children:e})]}),uz=e=>{const{mergeFieldName:t}=e;return`{{${t}}}`},dz=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},pz=()=>{const e=me({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await Ee("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var fz=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(fz||{});const hz=()=>t.jsxs("div",{className:"p-6 overflow-y-auto",children:[t.jsxs("div",{className:"mb-8 text-center",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Email Editor Help Center"}),t.jsx("p",{className:"text-gray-500",children:"Learn how to use our email editor's powerful features"})]}),t.jsxs("div",{className:"space-y-4 max-w-xl mx-auto",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Using Dynamic Content"}),t.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-50",children:[t.jsx("img",{src:"https://cdn.embedreach.com/assets/engage/merge-tags-demo.gif",alt:"Merge Tags Demo",className:"w-full shadow-lg max-w-md mx-auto"}),t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/50 to-transparent p-4",children:t.jsx("p",{className:"text-white text-sm",children:"Demonstration: Adding merge tags to personalize your emails"})})]}),t.jsx("div",{className:"px-2",children:t.jsx(ik,{onClick:()=>{},title:"Dynamic Content",subtitle:"Dynamic content is a way to insert dynamic content into your email such as the customer's name, email, or other details.",icon:t.jsx(hu,{}),selected:!0})})]})]}),mz=({type:e})=>t.jsxs("div",{className:"flex items-start space-x-2 text-sm text-gray-600",children:[t.jsx("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),t.jsxs("span",{children:["Please configure at least one ",e," sender before editing the template"]})]}),gz=({containerRef:e,stripoDialogDimensions:n,showSaving:r})=>t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[t.jsx("div",{id:"externalSystemContainer",className:"flex items-center px-4 py-2"}),r&&t.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-black/50 flex items-center justify-center z-50",children:t.jsx(XC,{textColor:"white",text:["Saving..."]})}),t.jsx("div",{id:"stripoEditorContainer",ref:e,style:{width:n.width-75,height:n.height-75},className:"overflow-auto z-10"})]}),yz="UiEditorScript",vz=e=>new Promise(((t,n)=>{const r=()=>{window.UIEditor&&(window.UIEditor.initEditor(e.container,{metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:e=>{Promise.resolve().then((async()=>{try{const{token:t}=await(async()=>(await Ee(`${d}/token`)).data)();e(t)}catch(t){}}))},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),t(void 0))};if(document.getElementById(yz))r();else{const e=document.createElement("script");e.id=yz,e.type="module",e.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",e.onload=()=>{window.UIEditor?r():n(new Error("UIEditor not found after script load"))},e.onerror=e=>{n(e)},document.head.appendChild(e)}})),bz=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a,mergeFieldsResponse:l})=>{const c=n.useRef(!1),u=n.useRef(null),{data:d,isLoading:p}=QC(e.id),{data:f,isLoading:h}=(()=>{const e=ae();return{...me({queryKey:GC.editorData(),queryFn:YC,...xe}),invalidateEditorData:()=>e.invalidateQueries({queryKey:GC.editorData()})}})(),[m,g]=n.useState(!1),[y,v]=n.useState(!1),{updateCommunicationGroup:b}=u$();return n.useEffect((()=>{if(o&&window.UIEditor&&d?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(d.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(b({groupId:d.communicationGroupId,params:{email_html_body:t}}),v(!0))},minimize:!0,mergeTags:[],forseAmp:!1,resetDataSavedFlag:!1,disableLineHeightsReplace:!0});window.StripoEditorApi.actionsApi.save((function(e){e||g(!0)}))}}),[o,u,i,r,d,b,a]),n.useEffect((()=>{(async()=>{m&&y&&(window.UIEditor&&window.UIEditor.removeEditor(),i(!1),g(!1),v(!1),r(!1))})()}),[m,y,r,i]),n.useEffect((()=>{f?.businessId&&u.current&&d&&(c.current||(vz({emailId:d.communicationGroupId,html:d.html||"<div></div>",css:d.css||"",container:u.current,businessId:f.businessId,mergeFields:l.mergeFields||[]}).catch((e=>{})),c.current=!0))}),[f,l,d]),t.jsx("div",p||h||!f||!d?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(XC,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(gz,{containerRef:u,stripoDialogDimensions:s,showSaving:o})})},xz=({automation:e,mergeFieldsResponse:r,communicationGroup:o,updateCommunicationGroup:i})=>{const[s,a]=n.useState(!1),[l,c]=n.useState(o.email_channel_sender_id||null),[u,d]=n.useState(o.email_subject||null),[p,f]=n.useState(o.email_preview_text||null),[h,m]=n.useState(o.email_html_body||null),[g,y]=n.useState(!1),[v,b]=n.useState(!1),[x,w]=n.useState(""),[S,C]=n.useState(""),[k,E]=n.useState(null),{refetchAutomation:_}=je(e.id),[j,T]=n.useState(!1),N=n.useRef(!0),[P,D]=n.useState(!0),[M,A]=n.useState(!1),O=dz(u,500),R=dz(p,500),L=dz(x,500),I=dz(S,500),{channelSenders:F}=m$(),{channelAccounts:$}=pz(),{updateChannelSender:q}=g$(),U=n.useMemo((()=>F?.results?.filter((e=>e.channel_sender_metadata.userPart))?.flatMap((e=>{const t=$?.results?.find((t=>t.id===e.channel_account_id));return t&&t.channel_account_metadata.type===fz.REACH_MANAGED?[{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`}]:[]}))||[]),[F?.results,$?.results]),[z,B]=n.useState({width:0,height:0}),V=n.useMemo((()=>({width:800,height:400})),[]),K=n.useRef(null);return n.useEffect((()=>{const e=setTimeout((()=>{N.current=!1}),500);return()=>clearTimeout(e)}),[]),n.useEffect((()=>{o.email_html_body&&m(o.email_html_body)}),[o.email_html_body,_]),n.useEffect((()=>{if(s){const e=setTimeout((()=>{a(!1)}),2e3);return()=>clearTimeout(e)}}),[s]),n.useEffect((()=>{const e=()=>{B({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),n.useEffect((()=>{if(!N.current&&l&&O&&h&&o.id){a(!0);(async()=>{try{i({groupId:o.id,params:{email_channel_sender_id:l,email_html_body:h,email_subject:O,...R&&{email_preview_text:R}}})}catch(e){}finally{a(!1)}})()}}),[l,O,R,h,o.id,i]),n.useEffect((()=>{if(F?.results&&l){const e=F.results.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),M&&!P||C(e.channel_sender_metadata.emailReplyTo),D(!1))}}),[F?.results,l,M,P]),n.useEffect((()=>{if(F?.results&&!l){const e=F.results.filter((e=>e.channel_sender_metadata.userPart));if(e[0]){const t=e[0];c(t.id),i({groupId:o.id,params:{email_channel_sender_id:t.id}})}}}),[F?.results,l,o.id,i]),n.useEffect((()=>{if(!N.current&&L&&l){a(!0);(async()=>{try{const e=F?.results?.find((e=>e.id===l));e&&await q({id:l,toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:L}}})}catch(e){}finally{a(!1)}})()}}),[L,F?.results,l,q]),n.useEffect((()=>{if(I){const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(I);E(e?null:"Please enter a valid email address")}else E(null)}),[I]),n.useEffect((()=>{if(!N.current&&I&&l&&!k){a(!0);(async()=>{try{const e=F?.results?.find((e=>e.id===l));e&&await q({id:l,toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:I}}})}catch(e){}finally{a(!1)}})()}}),[I,F?.results,l,q,k]),n.useEffect((()=>{!1===g&&o.id&&_()}),[g,o.id,_]),$&&F?t.jsxs("div",{className:"relative",children:[t.jsx(Lm,{open:j,onOpenChange:T,children:t.jsxs($m,{className:"max-h-[86vh] gap-0 overflow-visible max-w-3xl w-full h-full",children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Email Preview Help"}),t.jsx(zm,{children:"Learn more about the email preview and how to use it to create your email."})]}),t.jsx(hz,{})]})}),t.jsx(Lm,{open:g,onOpenChange:y,children:t.jsxs($m,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Email Editor"}),t.jsx(zm,{children:"Learn more about the email editor and how to use it to create your email."})]}),t.jsxs("div",{className:"w-full h-full",children:[t.jsxs("div",{className:"flex justify-between items-center p-1 border-b",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Email Editor"}),t.jsx(pN,{title:"Click to learn more about email template ",onClick:()=>T(!0)})]}),t.jsx("button",{onClick:()=>b(!0),className:"text-sm bg-black text-white px-3 py-1 rounded",children:"Save"})]}),t.jsx("div",{className:" w-full",children:t.jsx(bz,{showStripoEditor:g,automation:e,setShowStripoEditor:y,saveClicked:v,setSaveClicked:b,stripoDialogDimensions:z,mergeFieldsResponse:r,setCommunicationGroupId:()=>{}})})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(XP,{children:"From Email"}),t.jsxs(DF,{onValueChange:e=>{c(e),D(!0),A(!1)},value:l??void 0,disabled:s,children:[t.jsx(AF,{children:t.jsx(MF,{placeholder:"Select email",children:l?U?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(LF,{children:U?.map((e=>t.jsx(IF,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(XP,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(pN,{title:"This will be the friendly name of the sender that the customer will see in the inbox",alertText:"Changes to the sender name will be applied across all emails using this address"})]})}),t.jsx(mk,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:s||!l||P})]}),t.jsxs("div",{children:[t.jsx(XP,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(pN,{title:"This will be the email address that customer can reply to on the email",alertText:"Changes to the reply to email will be applied across all emails using this address"})]})}),t.jsx(mk,{placeholder:"Enter reply to email",value:S??"",onChange:e=>{C(e.target.value),A(!0)},disabled:s||!l||P}),k&&t.jsx("p",{className:"text-sm text-red-500 mt-1",children:k})]}),t.jsxs("div",{children:[t.jsx(XP,{children:"Subject"}),t.jsx(mk,{placeholder:"Enter email subject",value:u??"",onChange:e=>d(e.target.value),disabled:s||P})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(XP,{children:"Preview Text"}),t.jsx(pN,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(mk,{placeholder:"Enter preview text",value:p??"",onChange:e=>f(e.target.value),disabled:s||P})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 h-full flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsxs("div",{children:[t.jsx(nk,{onClick:()=>y(!0),className:"text-sm px-3 py-1 rounded",disabled:s||0===(U?.length??0),children:"Edit"}),0===(U?.length??0)&&t.jsx("div",{className:"relative inline-block",children:t.jsx("div",{className:"absolute right-0 top-full mt-2 w-64 p-3 bg-white border rounded-lg shadow-lg z-10",children:t.jsx(mz,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1 w-full overflow-auto",ref:K,style:{height:"400px"},children:t.jsx(b$,{html:h??"",height:V.height,width:V.width})})]})]})]}):t.jsx("div",{className:"flex justify-center items-center flex-1 h-full bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",children:t.jsx(XC,{text:["Fetching Email Preview..."]})})};var wz="Checkbox",[Sz,Cz]=s_(wz),[kz,Ez]=Sz(wz),_z=i.forwardRef(((e,n)=>{const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:a,required:l,disabled:c,value:u="on",onCheckedChange:d,form:p,...f}=e,[h,m]=i.useState(null),g=uf(n,(e=>m(e))),y=i.useRef(!1),v=!h||(p||!!h.closest("form")),[b=!1,x]=DT({prop:s,defaultProp:a,onChange:d}),w=i.useRef(b);return i.useEffect((()=>{const e=h?.form;if(e){const t=()=>x(w.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[h,x]),t.jsxs(kz,{scope:r,state:b,disabled:c,children:[t.jsx(f_.button,{type:"button",role:"checkbox","aria-checked":Pz(b)?"mixed":b,"aria-required":l,"data-state":Dz(b),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:g,onKeyDown:i_(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:i_(e.onClick,(e=>{x((e=>!!Pz(e)||!e)),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())}))}),v&&t.jsx(Nz,{control:h,bubbles:!y.current,name:o,value:u,checked:b,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"},defaultChecked:!Pz(a)&&a})]})}));_z.displayName=wz;var jz="CheckboxIndicator",Tz=i.forwardRef(((e,n)=>{const{__scopeCheckbox:r,forceMount:o,...i}=e,s=Ez(jz,r);return t.jsx(NT,{present:o||Pz(s.state)||!0===s.state,children:t.jsx(f_.span,{"data-state":Dz(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:n,style:{pointerEvents:"none",...e.style}})})}));Tz.displayName=jz;var Nz=e=>{const{control:n,checked:r,bubbles:o=!0,defaultChecked:s,...a}=e,l=i.useRef(null),c=FF(r),u=iT(n);i.useEffect((()=>{const e=l.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(c!==r&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Pz(r),n.call(e,!Pz(r)&&r),e.dispatchEvent(t)}}),[c,r,o]);const d=i.useRef(!Pz(r)&&r);return t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??d.current,...a,tabIndex:-1,ref:l,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Pz(e){return"indeterminate"===e}function Dz(e){return Pz(e)?"indeterminate":e?"checked":"unchecked"}var Mz=_z,Az=Tz;const Oz=({selectedChannels:e,setSelectedChannels:n,iconDefinitions:r})=>{const{toast:o}=wl(),i=[{label:"Email",value:"email",icon:r.EmailIcon,checked:e.includes("email")},{label:"SMS",value:"sms",icon:r.SmsIcon,checked:e.includes("sms")}];return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-xl",children:"Message Types"}),t.jsx("p",{className:"text-gray-600 mb-2 text-sm",children:"Select the channels you want to use in this automation"})]}),t.jsx("div",{className:"w-full grid grid-cols-2 gap-3",children:i.map((r=>t.jsxs(Mz,{checked:r.checked,onCheckedChange:()=>{"email"===r.value?e.includes("email")?e.includes("sms")?n(["sms"]):o({title:"Cant Remove Email",description:"At least one channel is required for an automation",variant:"destructive"}):n([...e,"email"]):e.includes("sms")?e.includes("email")?n(["email"]):o({title:"Cant Remove SMS",description:"At least one channel is required for an automation",variant:"destructive"}):n([...e,"sms"])},className:"relative ring-[1px] ring-border rounded-lg px-4 py-3 text-start text-muted-foreground data-[state=checked]:ring-2 data-[state=checked]:ring-primary data-[state=checked]:text-primary",children:[t.jsx(r.icon,{className:"mb-3",size:20}),t.jsx("span",{className:"font-medium tracking-tight",children:r.label}),t.jsx(Az,{className:"absolute top-2 right-2",children:t.jsx(ou,{className:"fill-primary text-primary-foreground"})})]},r.value)))})]})},Rz=async()=>(await Ee("/businesses/me")).data,Lz=["me"],Iz=({automation:e,iconDefinitions:r,mergeFieldsResponse:o})=>{const[i,s]=n.useState(!1),a=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[l,c]=n.useState(""),[u,d]=n.useState(null),[p,f]=n.useState(!1),[h,m]=n.useState(null),[g,y]=n.useState(null),[v,b]=n.useState(!1),{channelSenders:x}=m$(),{data:w,isLoading:S}=me({queryKey:Lz,queryFn:Rz,...xe}),{channelAccounts:C}=pz(),{updateCommunicationGroup:k}=u$(),{communicationGroup:E}=c$(a()??void 0),_=n.useRef(null),j=dz(g,1e3),T=dz(u,1e3),N=dz(h,1e3),P=e=>D?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??D?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{if(null!==T&&null!==j&&!i){s(!0);const e=a();e&&k({groupId:e,params:{sms_channel_sender_id:T,sms_message_body:j,text_message_company_name:N}}),s(!1)}}),[T,j,N,i,k,a]),n.useEffect((()=>{E&&(d(E.sms_channel_sender_id),y(E.sms_message_body),E.text_message_company_name&&m(E.text_message_company_name))}),[E]);if(n.useEffect((()=>{if(void 0!==x&&!u){const e=x.results.filter((e=>e.channel_sender_metadata.from));e?.[0]&&(d(e[0].id),E?.id&&k({groupId:E.id,params:{sms_channel_sender_id:e[0].id}}))}}),[x,u,E?.id,k]),n.useEffect((()=>{h||!w?.name||p||(f(!0),m(w.name))}),[h,w?.name,p]),!C||!x||S)return t.jsx("div",{children:t.jsx(XC,{text:["Loading..."]})});const D=x.results.filter((e=>e.channel_sender_metadata.from||e.channel_sender_metadata.messageServiceSid));return t.jsxs("div",{children:[t.jsx(Lm,{open:v,onOpenChange:b,children:t.jsxs($m,{children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"SMS Editor"}),t.jsx(zm,{children:"Learn more about the SMS editor and how to use it to create your SMS."})]}),t.jsxs("div",{className:"",children:[t.jsx(gk,{ref:_,className:"min-h-[300px]",placeholder:"Text message content...",value:g??"",onChange:e=>{y(e.target.value)},maxLength:1600-(h?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(DF,{value:l,onValueChange:e=>{const t=_.current,n=g||"",r=t?.selectionStart??n.length,o=t?.selectionEnd??n.length,i=n.slice(0,r)+e+n.slice(o);y(i),c(""),setTimeout((()=>{const n=r+e.length;t?.focus(),t?.setSelectionRange(n,n)}),0)},children:[t.jsx(AF,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(LF,{children:o?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(IF,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(pN,{title:"Dynamic content is a way to insert dynamic content into your messages such as the customer's name, email, or other details."})]}),t.jsxs("div",{className:"flex justify-end mt-2 text-sm transition-colors duration-300 "+(g&&g.length>1400?g.length>=1600?"text-red-500":"text-amber-500":"text-gray-500"),children:[g?g.length:0,"/",1600-(h?.length||0)," ","characters"]})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(XP,{children:"From Number"}),t.jsxs(DF,{onValueChange:e=>{d(e)},value:u??void 0,children:[t.jsx(AF,{children:t.jsx(MF,{placeholder:"Select number",children:u?P(u):"Select number"})}),t.jsx(LF,{children:D?.map((e=>t.jsx(IF,{value:e.id,children:e.channel_sender_metadata.friendlyName??e.channel_sender_metadata.from??"Select number"},e.id)))})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(XP,{children:"Company Name"}),t.jsx(pN,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(mk,{placeholder:"Enter company name",value:h??"",onChange:e=>{m(e.target.value??null)},disabled:!u})]})]}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsx("div",{children:t.jsx(nk,{onClick:()=>b(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(D?.length??0),children:"Edit"})})]}),t.jsx("div",{children:u?t.jsx(t.Fragment,{children:u&&g?t.jsx(w$,{fromPhone:P(u),body:h?`${h}:\n${g}`:g}):t.jsx(v$,{type:"sms"})}):t.jsx(mz,{type:"sms"})})]})]})]})},Fz=({automation:e,iconDefinitions:r,getExtraMergeFields:o,communicationGroup:i,updateAutomation:s,updateCommunicationGroup:a})=>{const[l,c]=n.useState(null),u=n.useRef(null),{toast:d}=wl(),{getMergeFields:p,isGetting:f}=d$(i?.id??void 0),[h,m]=n.useState(void 0);n.useEffect((()=>{const e=i?.id;e&&l&&(l.includes("email")||a({groupId:e,params:{email_channel_sender_id:null}}),l.includes("sms")||a({groupId:e,params:{sms_channel_sender_id:null}}))}),[l,a,i]),n.useEffect((()=>{const e=i?.id;e||l||c(["email"])}),[e,i,l]);const g=n.useCallback((e=>{const t=[];e.email_channel_sender_id&&t.push("email"),e.sms_channel_sender_id&&t.push("sms"),0===t.length&&t.push("email"),c(t)}),[]);return n.useEffect((()=>{i&&!l&&g(i)}),[i,g,l]),n.useEffect((()=>{f||void 0===h&&(o?o().then((e=>{if(i?.id){g(i);const t=new Set((i.extra_merge_fields||[]).map((e=>e.templateName))),n=e.filter((e=>!t.has(e.templateName)));i.extra_merge_fields&&n.length>0&&d({title:"Oops!",description:"Check your merge fields, it looks like some are missing!",variant:"destructive"}),a({groupId:i?.id,params:{extra_merge_fields:e}})}const t={mergeFields:[...p?.mergeFields||[],...e.map((e=>({category:"Extra Fields Passed In",entries:[{label:e.displayName||"Untitled Field",value:uz({mergeFieldName:e.templateName||""})}]})))]},n={mergeFields:Object.values(t.mergeFields.reduce(((t,n)=>{if("Extra Fields"===n.category||"Extra Fields Passed In"===n.category){const r="Extra Fields";t[r]||(t[r]={category:r,entries:[]});const o=n.entries.map((t=>{const n=e?.find((e=>uz({mergeFieldName:e.templateName})===t.value));return{...t,label:n?.displayName||t.label}})),i=new Set(t[r].entries.map((e=>e.value))),s=o.filter((e=>!i.has(e.value)));t[r].entries=[...t[r].entries,...s]}else if(t[n.category]){const e=new Set(t[n.category].entries.map((e=>e.value))),r=n.entries.filter((t=>!e.has(t.value)));t[n.category].entries=[...t[n.category].entries,...r]}else t[n.category]=n;return t}),{}))};m(n)})):(i?.id&&a({groupId:i?.id,params:{extra_merge_fields:null}}),m(p)))}),[o,a,i,d,f,p,h,g]),l&&!f&&h?t.jsxs("div",{className:"flex flex-col gap-4 flex-shrink-0",children:[t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",children:t.jsx(Oz,{selectedChannels:l,setSelectedChannels:c,iconDefinitions:r})}),l.includes("email")&&t.jsxs("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",ref:u,children:[t.jsx("h4",{className:"text-xl",children:"Email Campaign"}),t.jsx(xz,{automation:e,iconDefinitions:r,updateAutomation:s,communicationGroup:i,updateCommunicationGroup:a,mergeFieldsResponse:h})]}),l.includes("sms")&&t.jsxs("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",children:[t.jsx("h4",{className:"text-xl",children:"SMS Campaign"}),t.jsx(Iz,{automation:e,iconDefinitions:r,mergeFieldsResponse:h})]})]}):t.jsx("div",{className:"flex justify-center items-center flex-1 h-full bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",children:t.jsx(XC,{text:["Fetching Content..."]})})},$z="reach-styles-module__header___-izE2",qz="reach-styles-module__title___n1hA9",Uz="reach-styles-module__description___EvXM-",zz="reach-styles-module__content___okv68",Bz="reach-styles-module__footer___YA4U4",Vz=Vc("reach-styles-module__base___zJcoE",{variants:{variant:{default:"reach-styles-module__default___88Q0d",destructive:"reach-styles-module__destructive___5EWhN",outline:"reach-styles-module__outline___gj9sC",secondary:"reach-styles-module__secondary___cN5Wj"}},defaultVariants:{variant:"default"}}),Kz=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:_d(Vz({variant:n}),e),...r})));Kz.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d($z,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(qz,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(Uz,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(zz,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(Bz,e),...n}))).displayName="CardFooter";const Hz=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=$P({include_segments:r,exclude_segments:o});n.useEffect((()=>{c()}),[r,o]);const u=n.useMemo((()=>a?.recipients?a.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[a?.recipients]);return t.jsxs("div",{className:"w-full p-4",children:[t.jsxs("div",{className:"mb-4 md:mb-6",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:i}),s&&t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[30rem]:grid-cols-3 gap-2 md:gap-3 mb-4 md:mb-6",children:[t.jsx(qC.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"hidden @[200px]/card:block bg-blue-100/50 rounded-xl p-2.5",children:t.jsx(e.UserIcon,{className:"w-5 h-5 text-blue-600"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Total Matches"}),t.jsx("p",{className:"text-xl font-semibold text-gray-900 truncate",children:l?t.jsx("span",{className:"animate-pulse",children:"..."}):a?.count?.toLocaleString()??0})]})]})}),t.jsx(qC.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(qC.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-blue-100/50 text-blue-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.emails/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Email Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.emails}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(qC.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(qC.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-green-100/50 text-green-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.phones/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Phone Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.phones}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.phones?"contact":"contacts"})]})]})]})})]})}),!l&&a?.recipients&&t.jsx("div",{className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl border border-gray-100 overflow-hidden",children:t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-gray-100/90 backdrop-blur-sm",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Name"}),t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Contact"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-200/50",children:a.recipients.map(((e,n)=>t.jsxs("tr",{className:"hover:bg-white/50 transition-colors",children:[t.jsxs("td",{className:"px-3 sm:px-4 py-3 text-sm text-gray-900",children:[e.first_name," ",e.last_name]}),t.jsx("td",{className:"px-3 sm:px-4 py-3",children:t.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:[e.email&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-blue-100/50 text-blue-700 rounded-lg",children:"Email"}),e.phone&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-green-100/50 text-green-700 rounded-lg",children:"Phone"})]})})]},n)))})]})})})]})},Wz=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(VM,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(KM,{asChild:!0,children:t.jsxs(nk,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(nu,{className:"opacity-50"})]})}),t.jsx(HM,{className:"w-[200px] p-0",children:t.jsxs(WD,{children:[t.jsx(GD,{placeholder:r,className:"h-9"}),t.jsxs(YD,{children:[t.jsx(QD,{children:o}),t.jsx(XD,{children:e.map((e=>t.jsxs(ZD,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(Xc,{className:_d("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},Gz=({automation:e})=>{const r=()=>Ae(e.trigger_metadata)&&e.trigger_metadata.scheduled_at?new Date(e.trigger_metadata.scheduled_at):jN(new Date,15),[o,s]=i.useState(r()),[a,l]=i.useState(r()<new Date?"Please select a time in the future":null),[c,u]=i.useState(hP(o,"HH:mm")),{updateAutomation:d}=Pe(e.id),[p,f]=i.useState(Ae(e.trigger_metadata)&&e.trigger_metadata.timezone?e.trigger_metadata.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone),h=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=jN(new Date,15);new Date(e.toLocaleString("en-US",{timeZone:p}))<new Date(t.toLocaleString("en-US",{timeZone:p}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(e))};return n.useEffect((()=>{const e=new Date(o.toLocaleString("en-US",{timeZone:p})),t=-e.getTimezoneOffset(),n=Math.floor(Math.abs(t)/60).toString().padStart(2,"0"),r=(Math.abs(t)%60).toString().padStart(2,"0"),i=t>=0?"+":"-",s=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:00${i}${n}:${r}`;d({trigger:{trigger_type:Me.ONE_TIME,scheduled_at:s,timezone:p}})}),[o,p,d,e.id]),t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full ",children:[t.jsxs(VM,{children:[t.jsx(KM,{asChild:!0,children:t.jsxs(nk,{variant:"outline",className:_d("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(Qc,{className:"mr-2 h-4 w-4"}),o?hP(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(HM,{className:"w-auto p-0",children:t.jsx(KR,{mode:"single",selected:o,onSelect:e=>{if(!e)return;const[t,n]=c.split(":").map(Number);e.setHours(t,n),m(e)},disabled:e=>{const t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0})})]}),t.jsx("input",{type:"time",value:c,onChange:e=>{if(u(e.target.value),o&&e.target.value){const[t,n]=e.target.value.split(":").map(Number),r=new Date(o);r.setHours(t,n),m(r)}},className:_d("flex h-9 w-full sm:w-[150px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a&&"border-red-500")}),t.jsx(Wz,{data:h,placeholder:"Select timezone...",searchPlaceholder:"Search timezone...",noResultsMessage:"No timezone found",value:p,setValue:e=>{const t=new Date(o.toLocaleString("en-US",{timeZone:e})),n=jN(new Date,15);t<new Date(n.toLocaleString("en-US",{timeZone:e}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(t),f(e))}})]}),a&&t.jsxs("p",{className:"text-destructive text-sm mt-2 flex items-center",children:[t.jsx("span",{className:"mr-2",children:"⚠️"}),a]})]})},Yz=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{className:"@container",children:t.jsx(qC.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full",children:t.jsxs("div",{className:"flex @[1000px]:flex-row flex-col gap-8 items-center",children:[t.jsxs("div",{className:"flex-1 w-full",children:[t.jsxs("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-4",children:[t.jsx(ik,{selected:"sendNow"===i,title:"Send Now",subtitle:"Campaign will begin sending in 5 minutes",icon:t.jsx(e.SendButton,{}),onClick:()=>{s("sendNow"),o({trigger:{trigger_type:Me.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(ik,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(ng,{children:"schedule"===i&&t.jsx(qC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"overflow-hidden mt-8",children:t.jsx("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center",children:t.jsx(Gz,{automation:r})})})})]}),Ae(r.trigger_metadata)&&r.trigger_metadata.scheduled_at&&t.jsxs(qC.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.6,ease:[.23,1,.32,1],delay:.1},className:"@[1000px]:w-80 max-w-md w-full shrink-0 h-fit p-4 bg-blue-50 rounded-xl border border-blue-100 backdrop-blur-sm",children:[t.jsx(qC.p,{initial:{opacity:0},animate:{opacity:.8},transition:{delay:.3,duration:.4},className:"text-sm font-medium text-gray-700",children:"Currently scheduled for:"}),t.jsx(qC.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4,duration:.4},className:"text-md font-bold text-gray-800",children:new Date(r.trigger_metadata.scheduled_at).toLocaleString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short",timeZone:r.trigger_metadata.timezone||void 0})})]})]})})})},Qz=({automation:e,iconDefinitions:r,isLoading:o,communicationGroup:i,updateAutomation:s})=>{const{updateAutomation:a}=Pe(e.id),l=s||(e=>a(e)),{channelSenders:c}=m$(),{channelAccounts:u}=pz(),[d,p]=n.useState(null),[f,h]=n.useState(null),[m,g]=n.useState(null),[y,v]=n.useState(null);return n.useEffect((()=>{c&&g(c),u&&v(u)}),[c,u]),n.useEffect((()=>{if(i&&m&&y){const e=i.email_channel_sender_id,t=i.sms_channel_sender_id,n=m.results.find((t=>t.id===e)),r=m.results.find((e=>e.id===t));if(n&&i.email_subject&&i.email_html_body){const e=n.channel_sender_metadata?.userPart,t=y.results.find((e=>e.id===n.channel_account_id));if(t)switch(t.channel_account_metadata.type){case fz.REACH_MANAGED:p({fromEmail:`${e}@${t.channel_account_metadata.baseDomain}.embedreach.com`,fromName:n.channel_sender_metadata.emailFromName,subject:i.email_subject,previewText:i.email_preview_text,body:i.email_html_body});break;case fz.TWILLIO:break;default:throw hk(t.channel_account_metadata.type,fz)}}r&&i.sms_message_body&&h({fromPhone:y$(r.channel_sender_metadata),body:i.sms_message_body,companyName:i.text_message_company_name})}}),[i,m,y]),o?t.jsx(XC,{text:["Loading..."]}):d||f?t.jsxs("div",{className:"w-full",children:[t.jsxs("div",{className:"flex gap-4 w-full",children:[t.jsx(S$,{emailPreview:d,smsPreview:f,iconDefinitions:r}),t.jsx(Hz,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),e.trigger_type===Me.ONE_TIME&&t.jsx(Kz,{className:"p-4 shadow-sm border-none mt-4",children:t.jsx(Yz,{automation:e,iconDefinitions:r,updateAutomation:l})})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("div",{children:"No preview data Please complete previous steps"})})},Xz=({iconDefinitions:e,onSelectionChange:r,defaultValue:o="all"})=>{const[i,s]=n.useState(o),a=e=>{s(e),r?.(e)};return t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(ik,{onClick:()=>a("all"),title:`All ${Fp("engage:user",{count:2})}`,subtitle:"Send to everyone",icon:t.jsx(e.UsersIcon,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"all"===i}),t.jsx(ik,{onClick:()=>a("segments"),title:`Select ${Fp("engage:user",{count:2})}`,subtitle:"Choose from segments",icon:t.jsx(e.UserEdit,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"segments"===i})]})},Jz=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,setOpenCreateSegmentDialog:s,iconDefinitions:a})=>{const[l,c]=n.useState([]),u=r.map((e=>({label:e.name,value:e.id})));return n.useEffect((()=>{c(e)}),[e]),t.jsx("div",{children:t.jsx(rL,{selectedValues:l,setSelectedValues:c,options:u,defaultValue:e,onValueChange:t=>{const n=t.filter((t=>!e.includes(t))),r=e.filter((e=>!t.includes(e)));n.forEach(o),r.forEach(i)},placeholder:"Select segments",maxCount:5,extraCommandItems:[e=>t.jsxs(ZD,{onSelect:()=>{e(!1),s(!0)},className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]},"new-segment")]})})},Zz=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,setOpenCreateSegmentDialog:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(Jz,{segments:r,allSegments:l?.results||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),setOpenCreateSegmentDialog:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(nk,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(qC.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{children:"Don't send to"})]}),t.jsx(ng,{children:u&&t.jsx(qC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},style:{},children:t.jsx(Jz,{segments:o,allSegments:l?.results||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),setOpenCreateSegmentDialog:a,iconDefinitions:e})})})]})]})},eB=({iconDefinitions:e,automation:r})=>{const[o,i]=n.useState(!1),[s,a]=n.useState(!1),{segments:l,isLoading:c}=(()=>{const e=me({queryKey:["segments"],queryFn:()=>OP()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:u}=Pe(r.id),[d,p]=n.useState(r.includeSegmentIds||[]),[f,h]=n.useState(r.excludeSegmentIds||[]),m=1===d.length&&0===f.length&&void 0!==l?.results?.find((e=>e.type===LP.ALL_USERS&&e.id===d[0])),[g,y]=n.useState(m?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(d)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(f))&&u({include_segments:d,exclude_segments:f})}),[d,f,r.includeSegmentIds,r.excludeSegmentIds,u,r.id]);const v=n.useCallback((()=>l?.results?.find((e=>e.type===LP.ALL_USERS))),[l]);return n.useEffect((()=>{if("all"===g&&l){const e=v();e&&p([e.id]),h([])}}),[g,l,v]),n.useEffect((()=>{if(!s&&l){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){y("all");const e=v();return e&&u({include_segments:[e.id],exclude_segments:[]}),void a(!0)}y(m?"all":"segments"),a(!0)}}),[g,d.length,f.length,l,s,m,v,u,r.includeSegmentIds,r.excludeSegmentIds,r.id]),!c&&l&&s?t.jsxs("div",{className:"flex justify-center items-center gap-4",children:[t.jsx(Lm,{open:o,modal:!0,onOpenChange:i,children:t.jsxs($m,{hideCloseButton:!0,children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Create Segment"}),t.jsx(zm,{children:"Create a new segment to use in your automation."})]}),t.jsx(s$,{open:o,setOpen:i})]})}),t.jsxs(qC.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center flex-1 flex-shrink-0",children:[t.jsx(Xz,{iconDefinitions:e,onSelectionChange:e=>{y(e)},defaultValue:g}),t.jsx(ng,{children:"segments"===g&&t.jsx(qC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3,ease:"easeInOut"},className:"w-full pt-4",children:t.jsx(Zz,{iconDefinitions:e,includedSegments:d,excludedSegments:f,handleAddSegment:(e,t)=>{"include"===t?p((t=>[...t,e])):h((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?p((t=>t.filter((t=>t!==e)))):h((t=>t.filter((t=>t!==e))))},setOpenCreateSegmentDialog:i,segments:l,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(qC.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:" rounded-lg flex flex-col justify-start h-full shadow-sm flex-1 flex-shrink-0",children:t.jsx(Hz,{iconDefinitions:e,includeSegments:d,excludeSegments:f,title:"Estimated Matches",subtitle:"The number of recipients will update in real-time as you add or remove lists."})})]}):t.jsx("div",{children:t.jsx(XC,{text:["Fetching segments","Finishing up"]})})},tB=({title:e,subtitle:n,content:r,className:o})=>t.jsxs("div",{className:Rm("flex flex-col gap-4 w-full p-6",o),children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-semibold",children:e}),n&&t.jsx("p",{className:"text-gray-600 mt-1",children:n})]}),t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 relative",children:r})]}),nB={hidden:{opacity:0},visible:{opacity:1,transition:{duration:.5,staggerChildren:.1}}},rB={hidden:{opacity:0,y:10},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},oB=({automation:e})=>t.jsx("div",e.name?{className:"w-full flex justify-center flex-wrap gap-4",children:t.jsxs(qC.div,{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-6 max-w-lg",variants:nB,initial:"hidden",animate:"visible",children:[t.jsxs("div",{className:"flex items-start gap-4",children:[t.jsx(qC.div,{className:"h-12 w-12 rounded-full bg-blue-50 flex items-center justify-center shrink-0",variants:rB,animate:{scale:[1,1.05,1]},transition:{repeat:1/0,repeatType:"reverse",duration:2},children:t.jsx(Au,{className:"text-primary"})}),t.jsx("div",{children:t.jsx(qC.h2,{className:"text-2xl font-semibold text-primary group",variants:rB,children:e.name})})]}),t.jsx(qC.div,{className:"mt-6 bg-muted rounded-xl p-4",variants:rB,custom:2,children:t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:e.description})})]})}:{className:"flex items-center justify-center min-h-[200px]",children:t.jsx(XC,{})}),iB=({iconDefinitions:e,handleBack:n,handleNext:r,backText:o,nextText:i,backDisabled:s,nextDisabled:a,hideBack:l,thirdOptionText:c,thirdOptionOnClick:u})=>t.jsxs("div",{className:"flex gap-4 py-2",children:[!l&&t.jsxs(nk,{onClick:n,disabled:s,variant:"secondary",className:_d("flex items-center gap-2",s&&"opacity-50 cursor-not-allowed"),children:[t.jsx(e.BackButton,{}),t.jsx("span",{children:o})]}),c&&u&&t.jsx(nk,{onClick:u,variant:"secondary",className:"flex items-center gap-2",children:t.jsx("span",{children:c})}),t.jsxs(nk,{onClick:r,disabled:a,className:_d("flex items-center gap-2 --reach-destructive",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),sB=({automation:e,updateAutomation:r,communicationGroup:o,updateCommunicationGroup:i,iconDefinitions:s,setOpenEditAutomationPopup:a,logoUrl:l,getExtraMergeFields:c,onBeforeSchedule:u,estimatedMatchesStats:d,isLoading:p,validateCanGoToNextStep:f,setIsLoading:h})=>{const{toast:m}=wl(),[g,y]=n.useState(e.trigger_type===Me.TRIGGER_BASED?f$.SelectTrigger:f$.SelectAudience),[v,b]=n.useState(!1),x=(({automation:e,updateAutomation:n,communicationGroup:r,updateCommunicationGroup:o,iconDefinitions:i,getExtraMergeFields:s,handleSaveAsDraft:a,isLoading:l})=>e?[...e.trigger_type===Me.TRIGGER_BASED?[{id:"trigger",title:"Trigger",isValid:()=>!0,step:f$.SelectTrigger,content:t.jsx(tB,{title:"Trigger",content:t.jsx(oB,{iconDefinitions:i,automation:e})},"trigger"),footerConfig:{backText:"Cancel",nextText:"Next",hideBack:!0,backDisabled:!0,nextDisabled:()=>!1}}]:[],{id:"audience",title:"Audience",step:f$.SelectAudience,isValid:()=>e.includeSegmentIds.length>0,content:t.jsx(tB,{title:"Choose Audience",content:t.jsx(eB,{iconDefinitions:i,automation:e})},"audience"),footerConfig:{backText:"Back",nextText:"Next",hideBack:e.trigger_type===Me.ONE_TIME,backDisabled:!1,nextDisabled:()=>!1}},{id:"content",title:"Content",step:f$.SelectCommunication,isValid:()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return!(!t||!t.action_metadata.communication_group_id||!r||!r.sms_channel_sender_id&&!r.email_channel_sender_id||!(!r.email_channel_sender_id||r.email_html_body&&r.email_subject)||r.sms_channel_sender_id&&!r.sms_message_body)},content:t.jsxs("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl bg-gray-100 flex-1 h-full",children:[t.jsx("h2",{className:"text-2xl font-semibold",children:"Edit Content"}),t.jsx(Fz,{automation:e,updateAutomation:n,communicationGroup:r,updateCommunicationGroup:o,iconDefinitions:i,getExtraMergeFields:s})]},"content"),footerConfig:{backText:"Back",nextText:"Next",hideBack:!1,backDisabled:!1,nextDisabled:()=>!1}},{id:"send",title:"Send",step:f$.PreviewAndSchedule,isValid:()=>Boolean(e.trigger_metadata?.trigger_type===Me.ONE_TIME&&e.trigger_metadata?.scheduled_at&&new Date(e.trigger_metadata.scheduled_at)>new Date&&e.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id))),content:t.jsx(tB,{className:"flex-1",title:"Preview and Schedule",content:t.jsx(Qz,{automation:e,iconDefinitions:i,isLoading:l,communicationGroup:r})},"send"),footerConfig:{backText:"Back",nextText:e.trigger_metadata?.trigger_type===Me.ONE_TIME?"Schedule":"Start",hideBack:!1,backDisabled:!1,nextDisabled:()=>e.trigger_metadata?.trigger_type===Me.ONE_TIME&&!(e.trigger_metadata?.scheduled_at&&new Date(e.trigger_metadata?.scheduled_at)>new Date&&Boolean(e.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:"Save as Draft",thirdOptionOnClick:a}}]:[])({automation:e,iconDefinitions:s,getExtraMergeFields:c,handleSaveAsDraft:()=>{h(!0),r({status:Oe.DRAFT}),a(!1),m({title:"Automation saved as draft",description:"You can continue editing it later"}),h(!1)},isLoading:p,communicationGroup:o,updateAutomation:r,updateCommunicationGroup:i});if(p)return t.jsx("div",{className:"flex-1 flex flex-col @container justify-center items-center h-[500px]",children:t.jsx(XC,{text:["Fetching Automation data","Finishing up"]})});const w=async()=>{const{canMove:t,errorMessage:n}=await f({currentStep:g,automation:e,communicationGroup:o});t?g===f$.PreviewAndSchedule?await(async()=>{if(u)try{const e=await u({estimatedEmailRecipients:d.emails,estimatedSmsRecipients:d.phones});!0===e?(h(!0),r({status:Oe.ACTIVE}),a(!1),m({title:"Automation scheduled!"}),h(!1)):m({title:"Oops!",description:e,variant:"destructive"})}catch(e){m({title:"Oops!",description:"An error occurred while checking scheduling conditions",variant:"destructive"})}else h(!0),r({status:Oe.ACTIVE}),a(!1),m({title:"Automation scheduled!"}),h(!1)})():y(g+1):m({title:"Oops!",description:n,variant:"destructive"})},S=()=>{g>f$.SelectTrigger&&y(g-1)};return t.jsxs("div",{className:"flex-1 flex flex-col @container",children:[t.jsxs("header",{className:"w-full flex items-center gap-4 h-16 px-6",children:[t.jsx(nk,{onClick:()=>a(!1),size:"icon",variant:"ghost",children:t.jsx(Zc,{className:"w-4 h-4"})}),l&&t.jsx("div",{className:"flex-shrink-0",children:t.jsx("img",{src:l,alt:"Logo",className:"w-6 h-6"})}),t.jsx("h1",{className:"text-xl font-bold leading-none",children:e.name}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(jP,{variant:e.status===Oe.ACTIVE?"default":e.status===Oe.DRAFT?"secondary":"outline",children:e.status===Oe.ACTIVE?"Active":e.status===Oe.DRAFT?"Draft":"Inactive"}),t.jsxs("span",{className:"text-xs text-gray-500",children:["Last modified"," ",e?.updated_at?gP(new Date(e.updated_at))+" ago":"N/A"]})]})]}),t.jsxs("main",{className:"flex gap-4 flex-1",children:[t.jsx("div",{className:"hidden @[1000px]:block",children:t.jsx("nav",{className:"space-y-0 w-50 self-start pr-6 pl-8 pt-4 ",children:x.map((n=>t.jsx("div",{className:`\n rounded-md transition-colors\n ${n.step===g?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n.step<g?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,children:t.jsx(cz,{label:n.title,isActive:n.step===g,isCompleted:n.isValid(),onClick:async()=>{if(!v)if(n.step>g){const{canMove:t,errorMessage:r}=await(async t=>{if(t<=g)return{canMove:!0,errorMessage:null};b(!0);try{for(let n=g;n<t;n++){const{canMove:t,errorMessage:r}=await f({currentStep:n,automation:e,communicationGroup:o});if(!t)return{canMove:t,errorMessage:r}}return{canMove:!0,errorMessage:null}}finally{b(!1)}})(n.step);t?y(n.step):r&&m({title:"Cannot navigate to this step",description:r,variant:"destructive"})}else y(n.step)}})},n.step)))})}),t.jsx("section",{className:"flex-1 mr-6 w-full relative rounded-xl bg-gray-100 ml-6 @[1000px]:ml-0",children:t.jsx("div",{className:"absolute overflow-y-auto top-0 left-0 right-0 bottom-0 flex-1 h-full flex-col flex",children:t.jsx(ng,{children:t.jsx(JC,{className:"pt-0 h-full",children:x.find((e=>e.step===g))?.content},g)})})})]}),t.jsx("footer",{className:"w-full flex justify-end shadow-md z-10 items-center h-16 px-6",children:t.jsx(iB,{iconDefinitions:s,handleBack:S,handleNext:w,hideBack:x.find((e=>e.step===g))?.footerConfig.hideBack??!1,backText:x.find((e=>e.step===g))?.footerConfig.backText??"Back",nextText:x.find((e=>e.step===g))?.footerConfig.nextText??"Next",backDisabled:x.find((e=>e.step===g))?.footerConfig.backDisabled??!1,nextDisabled:x.find((e=>e.step===g))?.footerConfig.nextDisabled()??!1,thirdOptionText:x.find((e=>e.step===g))?.footerConfig.thirdOptionText??void 0,thirdOptionOnClick:x.find((e=>e.step===g))?.footerConfig.thirdOptionOnClick??void 0})})]})},aB=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),lB=e=>{if(!/^[0-9\s()+.-]+$/.test(e))return!1;const t=e.replace(/\D/g,"");return e.startsWith("+")?t.length>=10&&t.length<=15:10===t.length||!(11!==t.length||!t.startsWith("1"))},cB=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),[u,d]=n.useState(null),[p,f]=n.useState(!1),{sendTestCommunication:h,sendError:m,isSendSuccess:g}=p$(),{toast:y}=wl(),v=e.action_data?.find((e=>"send_communication"===e.action_type)),b=v?.action_metadata.communication_group_id,{communicationGroup:x,isGetting:w}=c$(b??void 0),S=n.useCallback((()=>{if(!b)return Promise.resolve(null);if(!x)return Promise.reject(new Error("Communication group not loaded"));switch(r){case"email":return Promise.resolve(x.email_channel_sender_id);case"sms":return Promise.resolve(x.sms_channel_sender_id);default:return Promise.reject(new Error(`Unsupported type: ${r}`))}}),[x,r,b]);n.useEffect((()=>{(async()=>{try{const e=await S();d(e)}catch(e){d(null)}finally{f(!0)}})()}),[S]),n.useEffect((()=>{g&&(y({title:"Success",description:`Preview ${"email"===r?"email":"SMS"} sent successfully!`}),o(!1))}),[g,r,o,y]),n.useEffect((()=>{m&&(y({title:"Error",description:`Failed to send preview: ${m.message}`,variant:"destructive"}),o(!1))}),[m,y,o]);return!p||w?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(XC,{text:["Fetching sender id","Finishing up"]})}):u?t.jsxs("div",{className:"",children:[t.jsxs("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:["Send Preview ","email"===r?"Email":"SMS"]}),t.jsx(mk,{type:"email"===r?"email":"tel",placeholder:"email"===r?"Enter email address":"Enter phone number",value:s,onChange:e=>{a(e.target.value),c("")},className:"w-full px-3 py-3 border border-gray-300 rounded-lg text-base mb-4 \n focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent\n placeholder-gray-400"}),l&&t.jsx("p",{className:"text-red-500 text-sm mb-4 -mt-2",children:l}),t.jsx(nk,{onClick:()=>{if(!("email"===r?aB(s):lB(s)))return void c("Please enter a valid "+("email"===r?"email address":"phone number"));if(!u)return void c("No sender found, please update the automation first!");const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;if(!n)return Promise.resolve(null);h({id:n,params:"email"===r?{email_address:s}:{phone_number:s}})},disabled:!s,className:"w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium\n hover:bg-blue-700 transition-colors duration-200\n disabled:bg-gray-400 disabled:cursor-not-allowed",children:"Send Preview"})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsxs("div",{className:"text-center flex flex-col justify-center items-center gap-2",children:[t.jsx(i.AlertCircleIcon,{className:"h-12 w-12 text-gray-400 mb-4"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No sender found"}),t.jsx("p",{className:"text-gray-500",children:"Please update the automation to include a sender for this type"})]})})},uB=n.memo((({automation:e,updateAutomation:r,communicationGroup:o,updateCommunicationGroup:i,isLoading:s,setIsLoading:a,iconDefinitions:c,autoOpenEditPopup:u,logoUrl:d,getExtraMergeFields:p,onDuplicationCreated:f,onBeforeSchedule:h,invalidateAutomation:m,estimatedMatchesStats:g,validateStep:y,showBackButton:v=!1})=>{const[b,x]=n.useState(!1),[w,S]=n.useState(!1),[C,k]=n.useState(!1),[E,_]=n.useState(!1),j=ek(c),T=bE(),{toast:N}=wl();n.useEffect((()=>{u&&x(!0)}),[u]);const P=()=>{r({status:Oe.DEACTIVATED}),k(!1)},D=()=>{r({status:Oe.DRAFT})},M=async()=>{const{id:t}=await(async e=>(await Ee(`${l}`,{method:"POST",body:JSON.stringify({duplicate:!0,source_id:e})})).data)(e.id);t?(f&&f(t),N({title:"Automation duplicated!",description:"The automation has been duplicated"})):N({title:"Error duplicating automation",description:"Please try again"})},A=async e=>y(e.currentStep),O=()=>t.jsxs(QU,{modal:!1,children:[t.jsx(XU,{asChild:!0,children:t.jsxs(nk,{children:["Actions",t.jsx(j.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(JU,{children:[e.status===Oe.DRAFT&&t.jsx(ZU,{onClick:()=>x(!0),children:"Edit"}),e.status===Oe.ACTIVE&&t.jsx(ZU,{onClick:D,children:"Convert to Draft"}),e.status!==Oe.COMPLETED&&e.status!==Oe.FAILED&&e.status!==Oe.DEACTIVATED&&t.jsx(ZU,{onClick:()=>k(!0),children:"Cancel"}),t.jsx(ZU,{onClick:()=>S(!0),children:"Send Preview SMS"}),t.jsx(ZU,{onClick:()=>_(!0),children:"Send Preview Email"}),t.jsx(ZU,{onClick:M,children:"Duplicate"})]})]});return t.jsxs(t.Fragment,{children:[t.jsx(Lm,{open:b,onOpenChange:e=>{!0===b&&!1===e&&setTimeout((()=>{m()}),0),x(e)},children:t.jsxs($m,{className:"max-w-7xl w-full overflow-hidden p-0 h-full max-h-[calc(100dvh-10dvh)]",hideCloseButton:!0,children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Edit Automation"}),t.jsx(zm,{children:"Edit the automation to change the content, schedule, and other details."})]}),t.jsx(sB,{automation:e,updateAutomation:r,communicationGroup:o,updateCommunicationGroup:i,isLoading:s,setIsLoading:a,iconDefinitions:j,setOpenEditAutomationPopup:x,logoUrl:d,getExtraMergeFields:p,onBeforeSchedule:h,estimatedMatchesStats:g,validateCanGoToNextStep:A})]})}),t.jsx(Lm,{open:C,onOpenChange:k,children:t.jsxs($m,{className:"sm:max-w-[425px]",children:[t.jsx(Um,{className:"text-xl font-semibold",children:"Cancel Automation"}),t.jsx(zm,{className:"text-gray-600 mt-2 text-center",children:"Are you sure you want to cancel this automation? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-center gap-3 mt-6",children:[t.jsx(nk,{variant:"outline",onClick:()=>k(!1),children:"Keep Running"}),t.jsx(nk,{variant:"destructive",onClick:P,children:"Yes, Cancel Automation"})]})]})}),t.jsx(Lm,{open:w,onOpenChange:S,children:t.jsxs($m,{children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Send Preview SMS"}),t.jsx(zm,{children:"Send a preview SMS to the automation."})]}),t.jsx(cB,{automation:e,type:"sms",setOpenSendPreviewPopup:S,iconDefinitions:j})]})}),t.jsx(Lm,{open:E,onOpenChange:_,children:t.jsxs($m,{children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Send Preview Email"}),t.jsx(zm,{children:"Send a preview email to the automation."})]}),t.jsx(cB,{automation:e,type:"email",setOpenSendPreviewPopup:_,iconDefinitions:j})]})}),t.jsxs("div",{className:"p-6 border-b border-gray-200 bg-background",children:[v?t.jsx("div",{className:"flex justify-between items-start mb-4",children:t.jsx("div",{children:t.jsx(nk,{onClick:()=>T(-1),children:"Back"})})}):null,t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("h1",{className:"text-2xl font-semibold mb-1",children:[e.name," "]}),t.jsx(TP,{status:e.status})]}),t.jsxs("div",{className:"text-sm text-gray-600",children:["View and edit this ",Fp("engage:automation")]})]}),O()]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[750px]:grid-cols-2 gap-6",children:[t.jsxs("div",{className:"",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Name"}),t.jsx("div",{className:"font-medium truncate",children:e.name})]}),e.description&&t.jsxs("div",{className:"",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Description"}),t.jsx("div",{className:"font-medium whitespace-pre-wrap",children:e.description})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Date Created"}),t.jsx("div",{className:"font-medium",children:hP(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Sales"}),t.jsx("div",{className:"font-medium",children:yP(e.derived_revenue)})]}),e.trigger_type===Me.ONE_TIME&&Ae(e.trigger_metadata)&&t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Type"}),t.jsx("div",{className:"font-medium",children:"One Time"})]}),e.trigger_type===Me.TRIGGER_BASED&&(R=e.trigger_metadata,"trigger_based"===R?.trigger_type)&&t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Type"}),t.jsx("div",{className:"font-medium",children:"Trigger Based"})]}),e.trigger_type===Me.ONE_TIME&&Ae(e.trigger_metadata)&&t.jsx("div",{className:"col-span-1 @[400px]:col-span-2",children:t.jsx("div",{className:"border-t border-gray-200"})}),e.trigger_type===Me.ONE_TIME&&Ae(e.trigger_metadata)&&e.trigger_metadata.scheduled_at&&t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Scheduled For"}),t.jsx("div",{className:"font-medium",children:hP(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})]})})]})]});var R})),dB=({iconDefinitions:e,autoOpenEditPopup:r,automationId:o,showBackButton:s=!1,logoUrl:a,getExtraMergeFields:l,onDuplicationCreated:c,onBeforeSchedule:u})=>{const d=function(){let{matches:e}=i.useContext(fE),t=e[e.length-1];return t?t.params:{}}(),[p]=t_(),f=ek(e),[h,m]=n.useState("content"),g=o||d?.automationId||p.get("automationId")||"",y=r||p.get("autoOpenEditPopup"),v="true"===p.get("showBackButton")||s,{automation:b,updateAutomation:x,communicationGroup:w,updateCommunicationGroup:S,isLoading:C,setIsLoading:k,invalidateAutomation:E,validateStep:_,estimatedMatchesStats:j}=h$(g);return b&&w?t.jsxs("div",{className:"bg-background",children:[t.jsx(uB,{automation:b,updateAutomation:x,communicationGroup:w,updateCommunicationGroup:S,isLoading:C,setIsLoading:k,iconDefinitions:f,autoOpenEditPopup:y,showBackButton:v,logoUrl:a,getExtraMergeFields:l,onDuplicationCreated:c,onBeforeSchedule:u,invalidateAutomation:E,estimatedMatchesStats:j,validateStep:_}),t.jsx(o_,{tabs:[{id:"content",label:"Content",content:t.jsx(C$,{iconDefinitions:f,isLoading:C,communicationGroup:w})},{id:"recipients",label:"Recipients",content:t.jsx(k$,{automationId:b.id,iconDefinitions:f,automation:b,isLoading:C})}],activeTab:h,onTabChange:m,tabsLocation:"left"})]}):t.jsx("div",{className:"flex h-screen items-center justify-center",children:t.jsx(XC,{text:["Fetching Automation data","Finishing up"]})})};Object.values(Object.assign({}));var pB=e=>null!=e;var fB=e=>"function"!=typeof e||e.length?e:e(),hB=e=>Array.isArray(e)?e:e?[e]:[];var mB=lt;var gB,yB=function(e){const[t,n]=Ze(),r=e?.throw?(e,t)=>{throw n(e instanceof Error?e:new Error(t)),e}:(e,t)=>{n(e instanceof Error?e:new Error(t))},o=e?.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),i=e?.prefix?`${e.prefix}.`:"",s=new Map,a=new Proxy({},{get(t,n){let a=s.get(n);a||(a=Ze(void 0,{equals:!1}),s.set(n,a)),a[0]();const l=o.reduce(((e,t)=>{if(null!==e||!t)return e;try{return t.getItem(`${i}${n}`)}catch(DX){return r(DX,`Error reading ${i}${n} from ${t.name}`),null}}),null);return null!==l&&e?.deserializer?e.deserializer(l,n,e.options):l}});return!1!==e?.sync&&at((()=>{const e=e=>{let t=!1;o.forEach((n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(DX){r(DX,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}})),t&&e.key&&s.get(e.key)?.[1]()};"addEventListener"in globalThis?(globalThis.addEventListener("storage",e),lt((()=>globalThis.removeEventListener("storage",e)))):(o.forEach((t=>t.addEventListener?.("storage",e))),lt((()=>o.forEach((t=>t.removeEventListener?.("storage",e))))))})),[a,(t,n,a)=>{const l=e?.serializer?e.serializer(n,t,a??e.options):n,c=`${i}${t}`;o.forEach((e=>{try{e.getItem(c)!==l&&e.setItem(c,l)}catch(DX){r(DX,`Error setting ${i}${t} to ${l} in ${e.name}`)}}));const u=s.get(t);u&&u[1]()},{clear:()=>o.forEach((e=>{try{e.clear()}catch(DX){r(DX,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(DX){r(DX,`Error removing ${i}${e} from ${t.name}`)}})),toJSON:()=>{const t={},n=(n,r)=>{if(!t.hasOwnProperty(n)){const o=r&&e?.deserializer?e.deserializer(r,n,e.options):r;o&&(t[n]=o)}};return o.forEach((e=>{if("function"==typeof e.getAll){let t;try{t=e.getAll()}catch(DX){r(DX,`Error getting all values from in ${e.name}`)}for(const e of t)n(e,t[e])}else{let o,i=0;try{for(;o=e.key(i++);)t.hasOwnProperty(o)||n(o,e.getItem(o))}catch(DX){r(DX,`Error getting all values from ${e.name}`)}}})),t}}]},vB=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:"boolean"==typeof r?`; ${n}`:`; ${n}=${r}`}return t},bB=("function"==typeof(gB={_cookies:[globalThis.document,"cookie"],getItem:e=>bB._cookies[0][bB._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=bB.getItem(e);bB._cookies[0][bB._cookies[1]]=`${e}=${t}${vB(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:bB});window.dispatchEvent(o)},removeItem:e=>{bB._cookies[0][bB._cookies[1]]=`${e}=deleted${vB({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return bB._cookies[0][bB._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return bB._cookies[0][bB._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(gB.clear=()=>{let e;for(;e=gB.key(0);)gB.removeItem(e)}),gB),xB=796,wB="bottom",SB="system",CB=Object.keys(wr)[0],kB=Object.keys(kr)[0],EB=ft({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function _B(){return ht(EB)}var jB=ft(void 0),TB=e=>{const[t,n]=Ze(null),r=()=>{const e=t();null!=e&&(e.close(),n(null))},o=(r,o)=>{if(null!=t())return;const i=window.open("","TSQD-Devtools-Panel",`width=${r},height=${o},popup`);if(!i)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");i.document.head.innerHTML="",i.document.body.innerHTML="",function(e=window.document){if(e[nn]){for(let t of e[nn].keys())e.removeEventListener(t,yn);delete e[nn]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(_B().shadowDOMTarget||document).styleSheets].forEach((e=>{try{const t=[...e.cssRules].map((e=>e.cssText)).join(""),n=document.createElement("style"),r=e.ownerNode;let o="";r&&"id"in r&&(o=r.id),o&&n.setAttribute("id",o),n.textContent=t,i.document.head.appendChild(n)}catch(PX){const n=document.createElement("link");if(null==e.href)return;n.rel="stylesheet",n.type=e.type,n.media=e.media.toString(),n.href=e.href,i.document.head.appendChild(n)}})),sn(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],i.document),e.setLocalStore("pip_open","true"),n(i)};nt((()=>{"true"!==(e.localStore.pip_open??"false")||e.disabled||o(Number(window.innerWidth),Number(e.localStore.height||500))})),nt((()=>{const e=(_B().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(_B().shadowDOMTarget||n.document).querySelector("#_goober");t&&(t.textContent=e.textContent)}));t.observe(e,{childList:!0,subtree:!0,characterDataOldValue:!0}),lt((()=>{t.disconnect()}))}}));const i=rt((()=>({pipWindow:t(),requestPipWindow:o,closePipWindow:r,disabled:e.disabled??!1})));return At(jB.Provider,{value:i,get children(){return e.children}})},NB=()=>rt((()=>{const e=ht(jB);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),PB=ft((()=>"dark"));function DB(){return ht(PB)}var MB={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z"},AB=Object.keys(MB).join("|"),OB=new RegExp(AB,"g");var RB=7,LB=6,IB=5,FB=4,$B=3,qB=2,UB=1,zB=0;function BB(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:UB,!n.accessors){const r=VB(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}const o=function(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const o=t[r],i=GB(o),s=HB(e,o);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:i})}return n}(e,n.accessors),i={rankedValue:e,rank:zB,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=VB(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=UB?r=a:r>l&&(r=l),r=Math.min(r,l),r>=c&&r>i.rank&&(i.rank=r,i.passed=!0,i.accessorIndex=s,i.accessorThreshold=c,i.rankedValue=e.itemValue)}return i}function VB(e,t,n){return e=KB(e,n),(t=KB(t,n)).length>e.length?zB:e===t?RB:(e=e.toLowerCase())===(t=t.toLowerCase())?LB:e.startsWith(t)?IB:e.includes(` ${t}`)?FB:e.includes(t)?$B:1===t.length?zB:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?qB:function(e,t){let n=0,r=0;function o(e,t,r){for(let o=r,i=t.length;o<i;o++){if(t[o]===e)return n+=1,o+1}return-1}function i(e){return UB+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return zB;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return zB}return i(r-s)}(e,t)}function KB(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(OB,(e=>MB[e]))),e}function HB(e,t){let n=t;"object"==typeof t&&(n=t.accessor);const r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}var WB={maxRanking:1/0,minRanking:-1/0};function GB(e){return"function"==typeof e?WB:{...WB,...e}}var YB={data:""},QB=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,XB=/\/\*[^]*?\*\/| +/g,JB=/\n+/g,ZB=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+s+";":r+="f"==i[1]?ZB(s,i):i+"{"+ZB(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=ZB(s,t?t.replace(/([^,])+/g,(e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=s&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=ZB.p?ZB.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},eV={},tV=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+tV(e[n]);return t}return e};function nV(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=tV(e),s=eV[i]||(eV[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!eV[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=QB.exec(e.replace(XB,""));)t[4]?r.shift():t[3]?(n=t[3].replace(JB," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(JB," ").trim();return r[0]})(e);eV[s]=ZB(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&eV.g?eV.g:null;return n&&(eV.g=eV[s]),l=eV[s],c=t,u=r,(d=a)?c.data=c.data.replace(d,l):-1===c.data.indexOf(l)&&(c.data=u?l+c.data:c.data+l),s;var l,c,u,d})(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":ZB(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||YB),t.g,t.o,t.k);var r}function rV(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=rV(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function oV(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=rV(e))&&(r&&(r+=" "),r+=t);return r}function iV(e,t){const n=it(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=Ze([],{equals:!1}),[l]=[dt,ut],c=e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u=(e,t,n)=>e.splice(n,0,t);return rt((t=>{const n=s(),a=e();if(it(l))return l(),t;if(n.length){const e=t.filter((e=>!n.includes(e)));return n.length=0,r({list:e,added:[],removed:[],unchanged:e,finishRemoved:c}),e}return it((()=>{const e=new Set(a),n=a.slice(),s=[],l=[],d=[];for(const t of a)(o.has(t)?d:s).push(t);let p=!s.length;for(let r=0;r<t.length;r++){const o=t[r];e.has(o)||(i.has(o)||(l.push(o),i.add(o)),u(n,o,r)),p&&o!==n[r]&&(p=!1)}return!l.length&&p?t:(r({list:n,added:s,removed:l,unchanged:d,finishRemoved:c}),o=e,n)}))}),t.appear?[]:n.slice())}function sV(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}nV.bind({g:1}),nV.bind({k:1});var aV=e=>e instanceof Element;function lV(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return lV(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=lV(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function cV(e,t=aV,n=aV){const r=rt(e),o=rt((()=>lV(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function uV(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function dV(e,t,n,r){const{onBeforeEnter:o,onEnter:i,onAfterEnter:s}=t;function a(t){t&&t.target!==n||(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),s?.(n))}o?.(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask((()=>{if(!n.parentNode)return r?.();i?.(n,(()=>a()))})),uV((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function pV(e,t,n,r){const{onBeforeExit:o,onExit:i,onAfterExit:s}=t;if(!n.parentNode)return r?.();function a(t){t&&t.target!==n||(r?.(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),s?.(n))}o?.(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),i?.(n,(()=>a())),uV((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var fV=e=>{const t=function(e){return rt((()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}}))}(e);return iV(cV((()=>e.children)).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)dV(s,e,t);const a=[];for(const e of i)e.isConnected&&(e instanceof HTMLElement||e instanceof SVGElement)&&a.push({el:e,rect:e.getBoundingClientRect()});queueMicrotask((()=>{const e=[];for(const{el:t,rect:n}of a)if(t.isConnected){const r=t.getBoundingClientRect(),o=n.left-r.left,i=n.top-r.top;(o||i)&&(t.style.transform=`translate(${o}px, ${i}px)`,t.style.transitionDuration="0s",e.push(t))}document;for(const t of e){let e=function(n){(n.target===t||/transform$/.test(n.propertyName))&&(t.removeEventListener("transitionend",e),t.classList.remove(...s.move))};t.classList.add(...s.move),t.style.transform=t.style.transitionDuration="",t.addEventListener("transitionend",e)}}));for(const t of r)pV(s,e,t,(()=>o([t])))}})},hV=Symbol("fallback");function mV(e){for(const t of e)t.dispose()}function gV(e){const{by:t}=e;return rt(function(e,t,n,r={}){const o=new Map;return lt((()=>mV(o.values()))),()=>{const n=e()||[];return it((()=>{if(!n.length)return mV(o.values()),o.clear(),r.fallback?[Je((e=>(o.set(hV,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(hV);if(!o.size||s){s?.dispose(),o.delete(hV);for(let r=0;r<n.length;r++){const o=n[r];i(e,o,r,t(o,r))}return e}const a=new Set(o.keys());for(let r=0;r<n.length;r++){const s=n[r],l=t(s,r);a.delete(l);const c=o.get(l);c?(e[r]=c.mapped,c.setIndex?.(r),c.setItem((()=>s))):i(e,s,r,l)}for(const t of a)o.get(t)?.dispose(),o.delete(t);return e}))};function i(e,t,r,i){Je((s=>{const[a,l]=Ze(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=Ze(r);c.setIndex=t,c.mapped=n(a,e)}else c.mapped=n(a);o.set(i,c),e[r]=c.mapped}))}}((()=>e.each),"function"==typeof t?t:e=>e[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function yV(e,t,n,r){const o=()=>{hB(fB(e)).forEach((e=>{e&&hB(fB(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),mB(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?nt(o):tt(o)}function vV(e,t,n){const r=new WeakMap,{observe:o,unobserve:i}=function(e,t){const n=new ResizeObserver(e);return lt(n.disconnect.bind(n)),{observe:e=>n.observe(e,t),unobserve:n.unobserve.bind(n)}}((e=>{for(const n of e){const{contentRect:e,target:o}=n,i=Math.round(e.width),s=Math.round(e.height),a=r.get(o);a&&a.width===i&&a.height===s||(t(e,o,n),r.set(o,{width:i,height:s}))}}),n);nt((t=>{const n=hB(fB(e)).filter(pB);return function(e,t,n,r){const o=e.length,i=t.length;let s,a,l=0;if(i)if(o){for(;l<i&&t[l]===e[l];l++);for(s of(t=t.slice(l),e=e.slice(l),t))e.includes(s)||r(s);for(a of e)t.includes(a)||n(a)}else for(;l<i;l++)r(t[l]);else for(;l<o;l++)n(e[l])}(n,t,o,i),n}),[])}var bV=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function xV(e){const t={};let n;for(;n=bV.exec(e);)t[n[1]]=n[2];return t}function wV(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=xV(e)}else"string"==typeof t&&(t=xV(t));return{...e,...t}}function SV(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function CV(e){return"[object String]"===Object.prototype.toString.call(e)}function kV(e){return t=>`${e()}-${t}`}function EV(e,t){return!!e&&(e===t||e.contains(t))}function _V(e,t=!1){const{activeElement:n}=jV(e);if(!n?.nodeName)return null;if(TV(n)&&n.contentDocument)return _V(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=jV(n).getElementById(e);if(t)return t}}return n}function jV(e){return e?e.ownerDocument||e:document}function TV(e){return"IFRAME"===e.tagName}var NV=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(NV||{});function PV(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function DV(){return PV(/^Mac/i)}function MV(){return PV(/^iPhone/i)||PV(/^iPad/i)||DV()&&navigator.maxTouchPoints>1}function AV(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function OV(e){return t=>{for(const n of e)AV(t,n)}}function RV(e){return DV()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function LV(e){if(e)if(function(){if(null==IV){IV=!1;try{document.createElement("div").focus({get preventScroll(){return IV=!0,!0}})}catch(PX){}}return IV}())e.focus({preventScroll:!0});else{const t=function(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}var IV=null;var FV=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],$V=[...FV,'[tabindex]:not([tabindex="-1"]):not([disabled])'],qV=FV.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",UV=$V.join(':not([hidden]):not([tabindex="-1"]),');function zV(e,t){const n=Array.from(e.querySelectorAll(qV)).filter(BV);return t&&BV(e)&&n.unshift(e),n.forEach(((e,t)=>{if(TV(e)&&e.contentDocument){const r=zV(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function BV(e){return VV(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function VV(e){return e.matches(qV)&&KV(e)}function KV(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||KV(e.parentElement,e))}function HV(e){for(;e&&!WV(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function WV(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function GV(){}function YV(e,t){return Ft(e,t)}var QV=new Map,XV=new Set;function JV(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=QV.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),QV.delete(t.target)),0===QV.size)){for(const e of XV)e();XV.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=QV.get(t.target);n||(n=new Set,QV.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function ZV(e,t){const n=eK(e,t,"left"),r=eK(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function eK(e,t,n){const r="left"===n?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}"undefined"!=typeof document&&("loading"!==document.readyState?JV():document.addEventListener("DOMContentLoaded",JV));var tK={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function nK(e){return t=>(e(t),()=>e(void 0))}function rK(e,t){const[n,r]=Ze(oK(t?.()));return nt((()=>{r(e()?.tagName.toLowerCase()||oK(t?.()))})),n}function oK(e){return CV(e)?e:void 0}function iK(e){const[t,n]=$t(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return At(kn,Ft(n,{get component(){return t.as}}))}var sK=["id","name","validationState","required","disabled","readOnly"];var aK=ft();function lK(){const e=ht(aK);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function cK(e){const t=lK(),n=YV({id:t.generateId("description")},e);return nt((()=>lt(t.registerDescription(n.id)))),At(iK,Ft({as:"div"},(()=>t.dataset()),n))}function uK(e){const t=lK(),n=YV({id:t.generateId("error-message")},e),[r,o]=$t(n,["forceMount"]),i=()=>"invalid"===t.validationState();return nt((()=>{i()&<(t.registerErrorMessage(o.id))})),At(Ht,{get when(){return r.forceMount||i()},get children(){return At(iK,Ft({as:"div"},(()=>t.dataset()),o))}})}function dK(e){let t;const n=lK(),r=YV({id:n.generateId("label")},e),[o,i]=$t(r,["ref"]),s=rK((()=>t),(()=>"label"));return nt((()=>lt(n.registerLabel(i.id)))),At(iK,Ft({as:"label",ref(e){const n=sV((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return rt((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function pK(e,t){nt(st(e,(e=>{if(null==e)return;const n=function(e){return function(e){return e.matches("textarea, input, select, button")}(e)?e.form:e.closest("form")}(e);null!=n&&(n.addEventListener("reset",t,{passive:!0}),lt((()=>{n.removeEventListener("reset",t)})))})))}function fK(e){const[t,n]=Ze(e.defaultValue?.()),r=rt((()=>void 0!==e.value?.())),o=rt((()=>r()?e.value?.():t()));return[o,t=>{it((()=>{const i=function(e,...t){return"function"==typeof e?e(...t):e}(t,o());return Object.is(i,o())||(r()||n(i),e.onChange?.(i)),i}))}]}function hK(e){const[t,n]=fK(e);return[()=>t()??!1,n]}var mK=Object.defineProperty,gK=(e,t)=>{for(var n in t)mK(e,n,{get:t[n],enumerable:!0})},yK=ft();function vK(){return ht(yK)}function bK(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function xK(e,t){const n=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,o])=>{const i=t.ref(),s=o.ref();return i===s?0:i&&s?bK(i,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(e);e!==n&&t(n)}function wK(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){nt((()=>{const n=setTimeout((()=>{xK(e(),t)}));lt((()=>clearTimeout(n)))}))}(e,t);let n=[];nt((()=>{const r=function(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return jV(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&xK(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}lt((()=>o.disconnect()))}))}function SK(e={}){const[t,n]=function(e){const[t,n]=fK(e);return[()=>t()??[],n]}({value:()=>fB(e.items),onChange:t=>e.onItemsChange?.(t)});wK(t,n);const r=e=>(n((t=>{const n=function(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const t=e[r]?.ref();if(t&&bK(t,n))return r+1}return 0}(t,e);return function(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}(t,e,n)})),()=>{n((t=>{const n=t.filter((t=>t.ref()!==e.ref()));return t.length===n.length?t:n}))});return{DomCollectionProvider:e=>At(yK.Provider,{value:{registerItem:r},get children(){return e.children}})}}function CK(e){const t=function(){const e=vK();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=YV({shouldRegisterItem:!0},e);nt((()=>{if(!n.shouldRegisterItem)return;lt(t.registerItem(n.getItem()))}))}function kK(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=CV(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=CV(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(CV(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return CV(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(CV(l)||"number"==typeof l)r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;else if(null!=a(l)){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const o=a(l)??[];if(o.length>0){const i=kK({dataSource:o,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...i),t+=i.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++;return r}function EK(e,t=[]){return rt((()=>{const n=kK({dataSource:fB(e.dataSource),getKey:fB(e.getKey),getTextValue:fB(e.getTextValue),getDisabled:fB(e.getDisabled),getSectionChildren:fB(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var _K=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),jK=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function TK(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return _K.has(t)}const t=e.split("-")[0];return jK.has(t)}(e)?"rtl":"ltr"}function NK(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:TK(e)}}var PK=NK(),DK=new Set;function MK(){PK=NK();for(const e of DK)e(PK)}var AK=ft();function OK(){const e=function(){const[e,t]=Ze(PK),n=rt((()=>e()));return at((()=>{0===DK.size&&window.addEventListener("languagechange",MK),DK.add(t),lt((()=>{DK.delete(t),0===DK.size&&window.removeEventListener("languagechange",MK)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return ht(AK)||e}var RK=new Map;var LK=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function IK(e){return DV()||MV()?e.altKey:e.ctrlKey}function FK(e){return DV()?e.metaKey:e.ctrlKey}function $K(e){return new LK(e)}function qK(e){const t=YV({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ze(!1),[o,i]=Ze(),s=rt((()=>{const e=fB(t.selectedKeys);return null!=e?$K(e):e})),a=rt((()=>{const e=fB(t.defaultSelectedKeys);return null!=e?$K(e):new LK})),[l,c]=function(e){const[t,n]=fK(e);return[()=>t()??new LK,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=Ze(fB(t.selectionBehavior));return nt((()=>{const e=l();"replace"===fB(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),nt((()=>{d(fB(t.selectionBehavior)??"toggle")})),{selectionMode:()=>fB(t.selectionMode),disallowEmptySelection:()=>fB(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!fB(t.allowDuplicateSelectionEvents)&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,l())||c(e)}}}function UK(e,t,n){const r=Ft({selectOnFocus:()=>"replace"===fB(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=OK();let s={top:0,left:0};yV((()=>fB(r.isVirtualized)?void 0:o()),"scroll",(()=>{const e=o();e&&(s={top:e.scrollTop,left:e.scrollLeft})}));const{typeSelectHandlers:a}=function(e){const[t,n]=Ze(""),[r,o]=Ze(-1);return{typeSelectHandlers:{onKeyDown:i=>{if(fB(e.isDisabled))return;const s=fB(e.keyboardDelegate),a=fB(e.selectionManager);if(!s.getKeyForSearch)return;const l=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(i.key);if(!l||i.ctrlKey||i.metaKey)return;" "===l&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n((e=>e+l)),u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c);null==u&&function(e){return e.split("").every((t=>t===e[0]))}(c)&&(c=c[0],u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c)),null!=u&&(a.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout((()=>n("")),500))}}}}({isDisabled:()=>fB(r.disallowTypeAhead),keyboardDelegate:()=>fB(r.keyboardDelegate),selectionManager:()=>fB(r.selectionManager)}),l=()=>fB(r.orientation)??"vertical",c=()=>{const e=fB(r.autoFocus);if(!e)return;const n=fB(r.selectionManager),o=fB(r.keyboardDelegate);let i;"first"===e&&(i=o.getFirstKey?.()),"last"===e&&(i=o.getLastKey?.());const s=n.selectedKeys();s.size&&(i=s.values().next().value),n.setFocused(!0),n.setFocusedKey(i);const a=t();a&&null==i&&!fB(r.shouldUseVirtualFocus)&&LV(a)};at((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),nt(st([o,()=>fB(r.isVirtualized),()=>fB(r.selectionManager).focusedKey()],(e=>{const[t,n,o]=e;if(n)o&&r.scrollToKey?.(o);else if(o&&t){const e=t.querySelector(`[data-key="${o}"]`);e&&ZV(t,e)}})));return{tabIndex:rt((()=>{if(!fB(r.shouldUseVirtualFocus))return null==fB(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{AV(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=fB(r.selectionManager),s=fB(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!IK(e)&&o.replaceSelection(t))},u=fB(r.keyboardDelegate),d=fB(r.shouldFocusWrap),p=o.focusedKey();switch(e.key){case"vertical"===l()?"ArrowDown":"ArrowRight":if(u.getKeyBelow){let t;e.preventDefault(),t=null!=p?u.getKeyBelow(p):u.getFirstKey?.(),null==t&&d&&(t=u.getFirstKey?.(p)),c(t)}break;case"vertical"===l()?"ArrowUp":"ArrowLeft":if(u.getKeyAbove){let t;e.preventDefault(),t=null!=p?u.getKeyAbove(p):u.getLastKey?.(),null==t&&d&&(t=u.getLastKey?.(p)),c(t)}break;case"vertical"===l()?"ArrowLeft":"ArrowUp":if(u.getKeyLeftOf){e.preventDefault();const t="rtl"===i();let n;n=null!=p?u.getKeyLeftOf(p):t?u.getFirstKey?.():u.getLastKey?.(),c(n)}break;case"vertical"===l()?"ArrowRight":"ArrowDown":if(u.getKeyRightOf){e.preventDefault();const t="rtl"===i();let n;n=null!=p?u.getKeyRightOf(p):t?u.getLastKey?.():u.getFirstKey?.(),c(n)}break;case"Home":if(u.getFirstKey){e.preventDefault();const t=u.getFirstKey(p,FK(e));null!=t&&(o.setFocusedKey(t),FK(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"End":if(u.getLastKey){e.preventDefault();const t=u.getLastKey(p,FK(e));null!=t&&(o.setFocusedKey(t),FK(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"PageDown":if(u.getKeyPageBelow&&null!=p){e.preventDefault();c(u.getKeyPageBelow(p))}break;case"PageUp":if(u.getKeyPageAbove&&null!=p){e.preventDefault();c(u.getKeyPageAbove(p))}break;case"a":FK(e)&&"multiple"===o.selectionMode()&&!0!==fB(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),fB(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!fB(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t){const n=t?.tabbable?UV:qV,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(n)&&KV(e)&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(r.currentNode=t.from),r}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&LV(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=fB(r.selectionManager),n=fB(r.keyboardDelegate),i=fB(r.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target))if(t.setFocused(!0),null==t.focusedKey()){const r=e=>{null!=e&&(t.setFocusedKey(e),i&&t.replaceSelection(e))},o=e.relatedTarget;o&&e.currentTarget.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey()??n.getLastKey?.()):r(t.firstSelectedKey()??n.getFirstKey?.())}else if(!fB(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(LV(n),ZV(e,n))}}},onFocusOut:e=>{const t=fB(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function zK(e,t){const n=()=>fB(e.selectionManager),r=()=>fB(e.key),o=()=>fB(e.shouldUseVirtualFocus),i=e=>{"none"!==n().selectionMode()&&("single"===n().selectionMode()?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):e?.shiftKey?n().extendSelection(r()):"toggle"===n().selectionBehavior()||FK(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>fB(e.disabled)||n().isDisabled(r()),a=()=>!s()&&n().canSelectItem(r());let l=null;const c=rt((()=>{if(!o()&&!s())return r()===n().focusedKey()?0:-1})),u=rt((()=>fB(e.virtualized)?void 0:r()));return nt(st([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],(([t,n,r,o,i])=>{t&&n===o&&i&&!r&&document.activeElement!==t&&(e.focus?e.focus():LV(t))}))),{isSelected:()=>n().isSelected(r()),isDisabled:s,allowsSelection:a,tabIndex:c,dataKey:u,onPointerDown:t=>{a()&&(l=t.pointerType,"mouse"!==t.pointerType||0!==t.button||fB(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&fB(e.shouldSelectOnPressUp)&&fB(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&(fB(e.shouldSelectOnPressUp)&&!fB(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(IK(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var BK=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(null==e||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if("none"===this.state.selectionMode())return!1;const t=this.getKey(e);return null!=t&&this.state.selectedKeys().has(t)}isEmpty(){return 0===this.state.selectedKeys().size}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every((t=>e.has(t)))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index<e.index)||(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index>e.index)||(e=n)}return e?.key}extendSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode())return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new LK(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?null!=n.index&&null!=r.index&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;null!=r;){const e=this.collection().getItem(r);if(e&&"item"===e.type&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?t&&"item"===t.type?t.key:null:e}toggleSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode()&&!this.isSelected(e))return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=new LK(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),this.disallowEmptySelection()&&0===n.size||this.state.setSelectedKeys(n)}replaceSelection(e){if("none"===this.selectionMode())return;const t=this.getKey(e);if(null==t)return;const n=this.canSelectItem(t)?new LK([t],t,t):new LK;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new LK;for(const n of e){const e=this.getKey(n);if(null!=e&&(t.add(e),"single"===this.selectionMode()))break}this.state.setSelectedKeys(t)}selectAll(){"multiple"===this.selectionMode()&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new LK)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode()&&("single"===this.selectionMode()?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior()||t&&"touch"===t.pointerType?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode())return!1;const t=this.collection().getItem(e);return null!=t&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(t=>{for(;null!=t;){if(this.canSelectItem(t)){const n=this.collection().getItem(t);if(!n)continue;"item"===n.type&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},VK=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(0===this.keyMap.size)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),"item"===o.type&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};var KK,HK=e=>"function"==typeof e?e():e,WK=e=>{const t=rt((()=>{const t=HK(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=Ze(HK(e.show)?"present":"hidden");let i="none";return nt((r=>{const s=HK(e.show);return it((()=>{if(r===s)return s;const e=i,a=n();if(s)o("present");else if("none"===a||"none"===t()?.display)o("hidden");else{o(!0===r&&e!==a?"hiding":"hidden")}})),s})),nt((()=>{const t=HK(e.element);if(!t)return;const s=e=>{e.target===t&&(i=n())},a=e=>{const i=n().includes(e.animationName);e.target===t&&i&&"hiding"===r()&&o("hidden")};t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),lt((()=>{t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}))})),{present:()=>"present"===r()||"hiding"===r(),state:r}},GK="data-kb-top-layer",YK=!1,QK=[];function XK(e){return QK.findIndex((t=>t.node===e))}function JK(){return QK.filter((e=>e.isPointerBlocking))}function ZK(){return JK().length>0}function eH(e){const t=XK([...JK()].slice(-1)[0]?.node);return XK(e)<t}var tH={layers:QK,isTopMostLayer:function(e){return QK[QK.length-1].node===e},hasPointerBlockingLayer:ZK,isBelowPointerBlockingLayer:eH,addLayer:function(e){QK.push(e)},removeLayer:function(e){const t=XK(e);t<0||QK.splice(t,1)},indexOf:XK,find:function(e){return QK[XK(e)]},assignPointerEventToLayers:function(){for(const{node:e}of QK)e.style.pointerEvents=eH(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(ZK()&&!YK){const t=jV(e);KK=document.body.style.pointerEvents,t.body.style.pointerEvents="none",YK=!0}},restoreBodyPointerEvents:function(e){if(ZK())return;const t=jV(e);t.body.style.pointerEvents=KK,0===t.body.style.length&&t.body.removeAttribute("style"),YK=!1}};gK({},{Button:()=>oH,Root:()=>rH});var nH=["button","color","file","image","reset","submit"];function rH(e){let t;const n=YV({type:"button"},e),[r,o]=$t(n,["ref","type","disabled"]),i=rK((()=>t),(()=>"button")),s=rt((()=>{const e=i();return null!=e&&function(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==nH.indexOf(e.type)}({tagName:e,type:r.type})})),a=rt((()=>"input"===i())),l=rt((()=>"a"===i()&&null!=t?.getAttribute("href")));return At(iK,Ft({as:"button",ref(e){const n=sV((e=>t=e),r.ref);"function"==typeof n&&n(e)},get type(){return s()||a()?r.type:void 0},get role(){return s()||l()?void 0:"button"},get tabIndex(){return s()||l()||r.disabled?void 0:0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!(s()||a()||!r.disabled)||void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var oH=rH,iH=["top","right","bottom","left"],sH=Math.min,aH=Math.max,lH=Math.round,cH=Math.floor,uH=e=>({x:e,y:e}),dH={left:"right",right:"left",bottom:"top",top:"bottom"},pH={start:"end",end:"start"};function fH(e,t,n){return aH(e,sH(t,n))}function hH(e,t){return"function"==typeof e?e(t):e}function mH(e){return e.split("-")[0]}function gH(e){return e.split("-")[1]}function yH(e){return"x"===e?"y":"x"}function vH(e){return"y"===e?"height":"width"}function bH(e){return["top","bottom"].includes(mH(e))?"y":"x"}function xH(e){return yH(bH(e))}function wH(e){return e.replace(/start|end/g,(e=>pH[e]))}function SH(e){return e.replace(/left|right|bottom|top/g,(e=>dH[e]))}function CH(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function kH(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function EH(e,t,n){let{reference:r,floating:o}=e;const i=bH(t),s=xH(t),a=vH(s),l=mH(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(gH(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1)}return f}async function _H(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=hH(t,e),h=CH(f),m=a[p?"floating"===d?"reference":"floating":d],g=kH(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=kH(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}function jH(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TH(e){return iH.some((t=>e[t]>=0))}function NH(e){return MH(e)?(e.nodeName||"").toLowerCase():"#document"}function PH(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function DH(e){var t;return null==(t=(MH(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function MH(e){return e instanceof Node||e instanceof PH(e).Node}function AH(e){return e instanceof Element||e instanceof PH(e).Element}function OH(e){return e instanceof HTMLElement||e instanceof PH(e).HTMLElement}function RH(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof PH(e).ShadowRoot)}function LH(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=zH(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function IH(e){return["table","td","th"].includes(NH(e))}function FH(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(PX){return!1}}))}function $H(e){const t=qH(),n=AH(e)?zH(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function qH(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function UH(e){return["html","body","#document"].includes(NH(e))}function zH(e){return PH(e).getComputedStyle(e)}function BH(e){return AH(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function VH(e){if("html"===NH(e))return e;const t=e.assignedSlot||e.parentNode||RH(e)&&e.host||DH(e);return RH(t)?t.host:t}function KH(e){const t=VH(e);return UH(t)?e.ownerDocument?e.ownerDocument.body:e.body:OH(t)&&LH(t)?t:KH(t)}function HH(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=KH(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=PH(o);return i?t.concat(s,s.visualViewport||[],LH(o)?o:[],s.frameElement&&n?HH(s.frameElement):[]):t.concat(o,HH(o,[],n))}function WH(e){const t=zH(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=OH(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=lH(n)!==i||lH(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function GH(e){return AH(e)?e:e.contextElement}function YH(e){const t=GH(e);if(!OH(t))return uH(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=WH(t);let s=(i?lH(n.width):n.width)/r,a=(i?lH(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var QH=uH(0);function XH(e){const t=PH(e);return qH()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:QH}function JH(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=GH(e);let s=uH(1);t&&(r?AH(r)&&(s=YH(r)):s=YH(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==PH(e))&&t}(i,n,r)?XH(i):uH(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=PH(i),t=r&&AH(r)?PH(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=YH(o),t=o.getBoundingClientRect(),r=zH(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=PH(o),o=n.frameElement}}return kH({width:u,height:d,x:l,y:c})}function ZH(e){return JH(DH(e)).left+BH(e).scrollLeft}function eW(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=PH(e),r=DH(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=qH();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=DH(e),n=BH(e),r=e.ownerDocument.body,o=aH(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=aH(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ZH(e);const a=-n.scrollTop;return"rtl"===zH(r).direction&&(s+=aH(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(DH(e));else if(AH(t))r=function(e,t){const n=JH(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=OH(e)?YH(e):uH(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=XH(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return kH(r)}function tW(e,t){const n=VH(e);return!(n===t||!AH(n)||UH(n))&&("fixed"===zH(n).position||tW(n,t))}function nW(e,t,n){const r=OH(t),o=DH(t),i="fixed"===n,s=JH(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=uH(0);if(r||!r&&!i)if(("body"!==NH(t)||LH(o))&&(a=BH(t)),r){const e=JH(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=ZH(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function rW(e){return"static"===zH(e).position}function oW(e,t){return OH(e)&&"fixed"!==zH(e).position?t?t(e):e.offsetParent:null}function iW(e,t){const n=PH(e);if(FH(e))return n;if(!OH(e)){let t=VH(e);for(;t&&!UH(t);){if(AH(t)&&!rW(t))return t;t=VH(t)}return n}let r=oW(e,t);for(;r&&IH(r)&&rW(r);)r=oW(r,t);return r&&UH(r)&&rW(r)&&!$H(r)?n:r||function(e){let t=VH(e);for(;OH(t)&&!UH(t);){if($H(t))return t;if(FH(t))return null;t=VH(t)}return null}(e)||n}var sW={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=DH(r),a=!!t&&FH(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=uH(1);const u=uH(0),d=OH(r);if((d||!d&&!i)&&(("body"!==NH(r)||LH(s))&&(l=BH(r)),OH(r))){const e=JH(r);c=YH(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:DH,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?FH(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=HH(e,[],!1).filter((e=>AH(e)&&"body"!==NH(e))),o=null;const i="fixed"===zH(e).position;let s=i?VH(e):e;for(;AH(s)&&!UH(s);){const t=zH(s),n=$H(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||LH(s)&&!n&&tW(e,s))?r=r.filter((e=>e!==s)):o=t,s=VH(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=eW(t,n,o);return e.top=aH(r.top,e.top),e.right=sH(r.right,e.right),e.bottom=sH(r.bottom,e.bottom),e.left=aH(r.left,e.left),e}),eW(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:iW,getElementRects:async function(e){const t=this.getOffsetParent||iW,n=this.getDimensions,r=await n(e.floating);return{reference:nW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=WH(e);return{width:t,height:n}},getScale:YH,isElement:AH,isRTL:function(e){return"rtl"===zH(e).direction}};function aW(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=GH(e),u=o||i?[...c?HH(c):[],...HH(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=DH(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f={rootMargin:-cH(u)+"px "+-cH(o.clientWidth-(c+d))+"px "+-cH(o.clientHeight-(u+p))+"px "+-cH(c)+"px",threshold:aH(0,sH(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(PX){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?JH(e):null;return l&&function t(){const r=JH(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}var lW=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=mH(n),a=gH(n),l="y"===bH(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=hH(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof h&&(f="end"===a?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},cW=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=hH(e,t),c={x:n,y:r},u=await _H(t,l),d=bH(mH(o)),p=yH(d);let f=c[p],h=c[d];if(i){f=fH(f+u["y"===p?"top":"left"],f,f-u["y"===p?"bottom":"right"])}if(s){h=fH(h+u["y"===d?"top":"left"],h,h-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},uW=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=hH(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=mH(o),v=bH(a),b=mH(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!m?[SH(a)]:function(e){const t=SH(e);return[wH(e),t,wH(t)]}(a)),S="none"!==h;!p&&S&&w.push(...function(e,t,n,r){const o=gH(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(mH(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(wH)))),i}(a,m,h,x));const C=[a,...w],k=await _H(t,g),E=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=gH(e),o=xH(e),i=vH(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=SH(s)),[s,SH(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(_=[..._,{placement:o,overflows:E}],!E.every((e=>e<=0))){var j,T;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(T=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=_.filter((e=>{if(S){const t=bH(e.placement);return t===v||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},dW=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=hH(e,t),l=await _H(t,a),c=mH(n),u=gH(n),d="y"===bH(n),{width:p,height:f}=r.floating;let h,m;"top"===c||"bottom"===c?(h=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,h="end"===u?"top":"bottom");const g=f-l.top-l.bottom,y=p-l.left-l.right,v=sH(f-l[h],g),b=sH(p-l[m],y),x=!t.middlewareData.shift;let w=v,S=b;if(d?S=u||x?sH(b,y):y:w=u||x?sH(v,g):g,x&&!u){const e=aH(l.left,0),t=aH(l.right,0),n=aH(l.top,0),r=aH(l.bottom,0);d?S=p-2*(0!==e||0!==t?e+t:aH(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:aH(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const C=await o.getDimensions(i.floating);return p!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},pW=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=hH(e,t);switch(r){case"referenceHidden":{const e=jH(await _H(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:TH(e)}}}case"escaped":{const e=jH(await _H(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:TH(e)}}}default:return{}}}}},fW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=hH(e,t)||{};if(null==c)return{};const d=CH(u),p={x:n,y:r},f=xH(o),h=vH(f),m=await s.getDimensions(c),g="y"===f,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[h]);const k=x/2-w/2,E=C/2-m[h]/2-1,_=sH(d[y],E),j=sH(d[v],E),T=_,N=C-m[h]-j,P=C/2-m[h]/2+k,D=fH(T,P,N),M=!l.arrow&&null!=gH(o)&&P!==D&&i.reference[h]/2-(P<T?_:j)-m[h]/2<0,A=M?P<T?P-T:P-N:0;return{[f]:p[f]+A,data:{[f]:D,centerOffset:P-D-A,...M&&{alignmentOffset:A}},reset:M}}}),hW=(e,t,n)=>{const r={platform:sW,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=EH(c,r,l),p=r,f={},h=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:y,data:v,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,f={...f,[n]:{...f[n],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=EH(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},mW=ft();function gW(){const e=ht(mW);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var yW=on('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),vW={top:180,right:-90,bottom:0,left:90};function bW(e){const t=gW(),n=YV({size:30},e),[r,o]=$t(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=Ze();return nt((()=>{const t=e();var r;t&&n((r=t,jV(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return At(iK,Ft({as:"div",ref(e){const n=sV(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return wV({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s()?.getPropertyValue("background-color")||"none",stroke:s()?.getPropertyValue(`border-${i()}-color`)||"none","stroke-width":a()},r.style)}},o,{get children(){const e=yW(),t=e.firstChild;return tt((()=>an(t,"transform",`rotate(${vW[i()]} 15 15) translate(0 2)`))),e}}))}function xW(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if("function"==typeof DOMRect)return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function wW(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var SW={top:"bottom",right:"left",bottom:"top",left:"right"};var CW=Object.assign((function(e){const t=YV({getAnchorRect:e=>e?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=Ze(),[o,i]=Ze(),[s,a]=Ze(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?xW(t):e?e.getBoundingClientRect():xW()}};var e,n},{direction:c}=OK();async function u(){const e=l(),r=n(),i=o();if(!e||!r)return;const s=(i?.clientHeight||0)/2,u="number"==typeof t.gutter?t.gutter+s:t.gutter??s;r.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),e.getBoundingClientRect();const d=[lW((({placement:e})=>{const n=!!e.split("-")[1];return{mainAxis:u,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}}))];if(!1!==t.flip){const e="string"==typeof t.flip?t.flip.split(" "):void 0;if(void 0!==e&&!e.every(wW))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(uW({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(cW({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(dW({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:o}){const i=Math.round(o.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty("--kb-popper-anchor-width",`${i}px`),r.style.setProperty("--kb-popper-content-available-width",`${e}px`),r.style.setProperty("--kb-popper-content-available-height",`${n}px`),t.sameWidth&&(r.style.width=`${i}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(pW({padding:t.detachedPadding})),i&&d.push(fW({element:i,padding:t.arrowPadding}));const p=await hW(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...sW,isRTL:()=>"rtl"===c()}});if(a(p.placement),t.onCurrentPlacementChange?.(p.placement),!r)return;r.style.setProperty("--kb-popper-content-transform-origin",function(e,t){const[n,r]=e.split("-"),o=SW[n];return r?"left"===n||"right"===n?`${o} ${"start"===r?"top":"bottom"}`:"start"===r?`${o} ${"rtl"===t?"right":"left"}`:`${o} ${"rtl"===t?"left":"right"}`:`${o} center`}(p.placement,c()));const f=Math.round(p.x),h=Math.round(p.y);let m;if(t.hideWhenDetached&&(m=p.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(r.style,{top:"0",left:"0",transform:`translate3d(${f}px, ${h}px, 0)`,visibility:m}),i&&p.middlewareData.arrow){const{x:e,y:t}=p.middlewareData.arrow,n=p.placement.split("-")[0];Object.assign(i.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}}return nt((()=>{const e=l(),t=n();if(!e||!t)return;lt(aW(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),nt((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),At(mW.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:bW,Context:mW,usePopperContext:gW,Positioner:function(e){const t=gW(),[n,r]=$t(e,["ref","style"]);return At(iK,Ft({as:"div",ref(e){const r=sV(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return wV({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var kW="interactOutside.pointerDownOutside",EW="interactOutside.focusOutside";var _W=ft();function jW(e){let t;const n=ht(_W),[r,o]=$t(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=GV;const o=()=>jV(t()),i=t=>e.onPointerDownOutside?.(t),s=t=>e.onFocusOutside?.(t),a=t=>e.onInteractOutside?.(t),l=n=>{const r=n.target;return r instanceof HTMLElement&&!r.closest(`[${GK}]`)&&!!EV(o(),r)&&!EV(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=OV([i,a]);r.addEventListener(kW,o,{once:!0});const s=new CustomEvent(kW,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||RV(e)&&0===e.button}});r.dispatchEvent(s)}"touch"===e.pointerType?(o().removeEventListener("click",n),r=n,o().addEventListener("click",n,{once:!0})):n()},u=e=>{const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=OV([s,a]);r.addEventListener(EW,o,{once:!0});const i=new CustomEvent(EW,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};nt((()=>{fB(e.isDisabled)||(n=window.setTimeout((()=>{o().addEventListener("pointerdown",c,!0)}),0),o().addEventListener("focusin",u,!0),lt((()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)})))}))}({shouldExcludeElement:e=>!!t&&(r.excludedElements?.some((t=>EV(t(),e)))||[...i].some((t=>EV(t,e)))),onPointerDownOutside:e=>{t&&!tH.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||tH.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},(()=>t)),function(e){const t=t=>{t.key===NV.Escape&&e.onEscapeKeyDown?.(t)};nt((()=>{if(fB(e.isDisabled))return;const n=e.ownerDocument?.()??jV();n.addEventListener("keydown",t),lt((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>jV(t),onEscapeKeyDown:e=>{t&&tH.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),at((()=>{if(!t)return;tH.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);tH.assignPointerEventToLayers(),tH.disableBodyPointerEvents(t),lt((()=>{t&&(tH.removeLayer(t),e?.(),tH.assignPointerEventToLayers(),tH.restoreBodyPointerEvents(t))}))})),nt(st([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=tH.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,tH.assignPointerEventToLayers()),t&&tH.disableBodyPointerEvents(e),lt((()=>{tH.restoreBodyPointerEvents(e)}))}),{defer:!0}));return At(_W.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return At(iK,Ft({as:"div",ref(e){const n=sV((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function TW(e={}){const[t,n]=hK({value:()=>fB(e.open),defaultValue:()=>!!fB(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var NW={};gK(NW,{Description:()=>cK,ErrorMessage:()=>uK,Item:()=>OW,ItemControl:()=>RW,ItemDescription:()=>LW,ItemIndicator:()=>IW,ItemInput:()=>FW,ItemLabel:()=>$W,Label:()=>qW,RadioGroup:()=>zW,Root:()=>UW});var PW=ft();function DW(){const e=ht(PW);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var MW=ft();function AW(){const e=ht(MW);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function OW(e){const t=lK(),n=DW(),r=YV({id:`${t.generateId("item")}-${zt()}`},e),[o,i]=$t(r,["value","disabled","onPointerDown"]),[s,a]=Ze(),[l,c]=Ze(),[u,d]=Ze(),[p,f]=Ze(),[h,m]=Ze(!1),g=rt((()=>n.isSelectedValue(o.value))),y=rt((()=>o.disabled||t.isDisabled()||!1)),v=e=>{AV(e,o.onPointerDown),h()&&e.preventDefault()},b=rt((()=>({...t.dataset(),"data-disabled":y()?"":void 0,"data-checked":g()?"":void 0}))),x={value:()=>o.value,dataset:b,isSelected:g,isDisabled:y,inputId:s,labelId:l,descriptionId:u,inputRef:p,select:()=>n.setSelectedValue(o.value),generateId:kV((()=>i.id)),registerInput:nK(a),registerLabel:nK(c),registerDescription:nK(d),setIsFocused:m,setInputRef:f};return At(MW.Provider,{value:x,get children(){return At(iK,Ft({as:"div",role:"group",onPointerDown:v},b,i))}})}function RW(e){const t=AW(),n=YV({id:t.generateId("control")},e),[r,o]=$t(n,["onClick","onKeyDown"]);return At(iK,Ft({as:"div",onClick:e=>{AV(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{AV(e,r.onKeyDown),e.key===NV.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function LW(e){const t=AW(),n=YV({id:t.generateId("description")},e);return nt((()=>lt(t.registerDescription(n.id)))),At(iK,Ft({as:"div"},(()=>t.dataset()),n))}function IW(e){const t=AW(),n=YV({id:t.generateId("indicator")},e),[r,o]=$t(n,["ref","forceMount"]),[i,s]=Ze(),{present:a}=WK({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return At(Ht,{get when(){return a()},get children(){return At(iK,Ft({as:"div",ref(e){const t=sV(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function FW(e){const t=lK(),n=DW(),r=AW(),o=YV({id:r.generateId("input")},e),[i,s]=$t(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=Ze(!1);return nt(st([()=>r.isSelected(),()=>r.value()],(e=>{if(!e[0]&&e[1]===r.value())return;l(!0);const t=r.inputRef();t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),{defer:!0})),nt((()=>lt(r.registerInput(s.id)))),At(iK,Ft({as:"input",ref(e){const t=sV(r.setInputRef,i.ref);"function"==typeof t&&t(e)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return wV({...tK},i.style)},get"aria-labelledby"(){return[i["aria-labelledby"],r.labelId(),null!=i["aria-labelledby"]&&null!=s["aria-label"]?s.id:void 0].filter(Boolean).join(" ")||void 0},get"aria-describedby"(){return[i["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0},onChange:e=>{if(AV(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{AV(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{AV(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function $W(e){const t=AW(),n=YV({id:t.generateId("label")},e);return nt((()=>lt(t.registerLabel(n.id)))),At(iK,Ft({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function qW(e){return At(dK,Ft({as:"span"},e))}function UW(e){let t;const n=YV({id:`radiogroup-${zt()}`,orientation:"vertical"},e),[r,o,i]=$t(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],sK),[s,a]=fK({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=YV({id:`form-control-${zt()}`},e),[n,r]=Ze(),[o,i]=Ze(),[s,a]=Ze(),[l,c]=Ze();return{formControlContext:{name:()=>fB(t.name)??fB(t.id),dataset:rt((()=>({"data-valid":"valid"===fB(t.validationState)?"":void 0,"data-invalid":"invalid"===fB(t.validationState)?"":void 0,"data-required":fB(t.required)?"":void 0,"data-disabled":fB(t.disabled)?"":void 0,"data-readonly":fB(t.readOnly)?"":void 0}))),validationState:()=>fB(t.validationState),isRequired:()=>fB(t.required),isDisabled:()=>fB(t.disabled),isReadOnly:()=>fB(t.readOnly),labelId:n,fieldId:o,descriptionId:s,errorMessageId:l,getAriaLabelledBy:(e,t,r)=>{const o=null!=r||null!=n();return[r,n(),o&&null!=t?e:void 0].filter(Boolean).join(" ")||void 0},getAriaDescribedBy:e=>[s(),l(),e].filter(Boolean).join(" ")||void 0,generateId:kV((()=>fB(t.id))),registerLabel:nK(r),registerField:nK(i),registerDescription:nK(a),registerErrorMessage:nK(c)}}}(o);pK((()=>t),(()=>a(r.defaultValue??"")));const c=()=>l.getAriaDescribedBy(r["aria-describedby"]),u=e=>e===s(),d={ariaDescribedBy:c,isSelectedValue:u,setSelectedValue:e=>{if(!l.isReadOnly()&&!l.isDisabled()&&(a(e),t))for(const n of t.querySelectorAll("[type='radio']")){n.checked=u(n.value)}}};return At(aK.Provider,{value:l,get children(){return At(PW.Provider,{value:d,get children(){return At(iK,Ft({as:"div",ref(e){const n=sV((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return fB(o.id)},get"aria-invalid"(){return"invalid"===l.validationState()||void 0},get"aria-required"(){return l.isRequired()||void 0},get"aria-disabled"(){return l.isDisabled()||void 0},get"aria-readonly"(){return l.isReadOnly()||void 0},get"aria-orientation"(){return r.orientation},get"aria-labelledby"(){return l.getAriaLabelledBy(fB(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var zW=Object.assign(UW,{Description:cK,ErrorMessage:uK,Item:OW,ItemControl:RW,ItemDescription:LW,ItemIndicator:IW,ItemInput:FW,ItemLabel:$W,Label:qW}),BW=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=null!=o?this.getItem(o):null;return o}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=null!=o?this.getItem(o):null;return o}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=null!=t?this.getKeyBelow(t):this.getFirstKey();for(;null!=r;){const t=this.collection().getItem(r);if(t){const o=t.textValue.slice(0,e.length);if(t.textValue&&0===n.compare(o,e))return r}r=this.getKeyBelow(r)}}};function VW(e,t,n){const r=function(e){const{locale:t}=OK(),n=rt((()=>t()+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"")));return rt((()=>{const r=n();let o;return RK.has(r)&&(o=RK.get(r)),o||(o=new Intl.Collator(t(),e),RK.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return UK({selectionManager:()=>fB(e.selectionManager),keyboardDelegate:rt((()=>{const n=fB(e.keyboardDelegate);return n||new BW(e.collection,t,r)})),autoFocus:()=>fB(e.autoFocus),deferAutoFocus:()=>fB(e.deferAutoFocus),shouldFocusWrap:()=>fB(e.shouldFocusWrap),disallowEmptySelection:()=>fB(e.disallowEmptySelection),selectOnFocus:()=>fB(e.selectOnFocus),disallowTypeAhead:()=>fB(e.disallowTypeAhead),shouldUseVirtualFocus:()=>fB(e.shouldUseVirtualFocus),allowsTabNavigation:()=>fB(e.allowsTabNavigation),isVirtualized:()=>fB(e.isVirtualized),scrollToKey:t=>fB(e.scrollToKey)?.(t),orientation:()=>fB(e.orientation)},t)}var KW="focusScope.autoFocusOnMount",HW="focusScope.autoFocusOnUnmount",WW={bubbles:!1,cancelable:!0},GW={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=SV(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=SV(this.stack,e),this.active()?.resume()}};function YW(e,t){const[n,r]=Ze(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>jV(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,tK),e},u=()=>{const e=t();return e?zV(e,!0).filter((e=>!e.hasAttribute("data-focus-trap"))):[]},d=()=>{const e=u();return e.length>0?e[0]:null};nt((()=>{const e=t();if(!e)return;GW.add(o);const n=_V(e);if(!EV(e,n)){const t=new CustomEvent(KW,WW);e.addEventListener(KW,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{LV(d()),_V(e)===n&&LV(e)}),0)}lt((()=>{e.removeEventListener(KW,s),setTimeout((()=>{const r=new CustomEvent(HW,WW);(()=>{const e=t();if(!e)return!1;const n=_V(e);return!!n&&!EV(e,n)&&VV(n)})()&&r.preventDefault(),e.addEventListener(HW,a),e.dispatchEvent(r),r.defaultPrevented||LV(n??l().body),e.removeEventListener(HW,a),GW.remove(o)}),0)}))})),nt((()=>{const r=t();if(!r||!fB(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${GK}]`)||(EV(r,t)?i=t:LV(i))},s=e=>{const t=e.relatedTarget??_V(r);t?.closest(`[${GK}]`)||EV(r,t)||LV(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),lt((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),nt((()=>{const r=t();if(!r||!fB(e.trapFocus)||n())return;const o=c();r.insertAdjacentElement("afterbegin",o);const i=c();function s(e){const t=d(),n=(()=>{const e=u();return e.length>0?e[e.length-1]:null})();LV(e.relatedTarget===t?n:t)}r.insertAdjacentElement("beforeend",i),o.addEventListener("focusin",s),i.addEventListener("focusin",s);const a=new MutationObserver((e=>{for(const t of e)t.previousSibling===i&&(i.remove(),r.insertAdjacentElement("beforeend",i)),t.nextSibling===o&&(o.remove(),r.insertAdjacentElement("afterbegin",o))}));a.observe(r,{childList:!0,subtree:!1}),lt((()=>{o.removeEventListener("focusin",s),i.removeEventListener("focusin",s),o.remove(),i.remove(),a.disconnect()}))}))}var QW="data-live-announcer";function XW(e){nt((()=>{fB(e.isDisabled)||lt(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${QW}], [${GK}]`))n.add(r);const t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(const t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),s=t(e);if(s===NodeFilter.FILTER_ACCEPT&&i(e),s!==NodeFilter.FILTER_REJECT){let e=o.nextNode();for(;null!=e;)i(e),e=o.nextNode()}},i=e=>{const t=JW.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),JW.set(e,t+1))};ZW.length&&ZW[ZW.length-1].disconnect();o(t);const s=new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some((e=>e.contains(t.target)))){for(const e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(const e of t.addedNodes)!(e instanceof HTMLElement||e instanceof SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.reactAriaTopLayer?e instanceof Element&&o(e):n.add(e)}}));s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return ZW.push(a),()=>{s.disconnect();for(const e of r){const t=JW.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),JW.delete(e)):JW.set(e,t-1)}a===ZW[ZW.length-1]?(ZW.pop(),ZW.length&&ZW[ZW.length-1].observe()):ZW.splice(ZW.indexOf(a),1)}}(fB(e.targets),fB(e.root)))}))}var JW=new WeakMap,ZW=[];var eG=new Map,tG=e=>{nt((()=>{const t=HK(e.style)??{},n=HK(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=eG.get(e.key);o?o.activeCount++:eG.set(e.key,{activeCount:1,originalStyles:r,properties:n.map((e=>e.key))}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);lt((()=>{const t=eG.get(e.key);if(t)if(1===t.activeCount){eG.delete(e.key);for(const[n,r]of Object.entries(t.originalStyles))e.element.style[n]=r;for(const n of t.properties)e.element.style.removeProperty(n);0===e.element.style.length&&e.element.removeAttribute("style"),e.cleanup?.()}else t.activeCount--}))}))},nG=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},rG=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[oG,iG]=Ze([]),sG=e=>[e.deltaX,e.deltaY],aG=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],lG=(e,t,n,r)=>{const o=null!==r&&cG(r,e),[i,s]=((e,t,n)=>{const r="x"===t&&"rtl"===window.getComputedStyle(e).direction?-1:1;let o=e,i=0,s=0,a=!1;do{const[e,l,c]=nG(o,t),u=c-e-r*l;0===l&&0===u||!rG(o,t)||(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]})(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1)&&!(n<0&&Math.abs(s)<1)},cG=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},uG=e=>{const t=Ft({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=zt();let r=[0,0],o=null,i=null;nt((()=>{HK(t.enabled)&&(iG((e=>[...e,n])),lt((()=>{iG((e=>e.filter((e=>e!==n))))})))})),nt((()=>{if(!HK(t.enabled)||!HK(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if(HK(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===HK(t.preventScrollbarShiftMode)?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${n}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${n}px)`,o.push({key:"--scrollbar-width",value:`${n}px`}));const i=window.scrollY,s=window.scrollX;tG({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{HK(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else tG({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),nt((()=>{var e;(e=n,oG().indexOf(e)===oG().length-1&&HK(t.enabled))&&(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),lt((()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)})))}));const s=e=>{r=aG(e),o=null,i=null},a=e=>{const n=e.target,r=HK(t.element),o=sG(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=lG(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!cG(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=HK(t.element),s=e.target;let a;if(2===e.touches.length)a=!HK(t.allowPinchZoom);else{if(null==o||null===i){const t=aG(e).map(((e,t)=>r[t]-e)),n=Math.abs(t[0])>Math.abs(t[1])?"x":"y";o=n,i="x"===n?t[0]:t[1]}if("range"===s.type)a=!1;else{const e=lG(s,o,i,n);a=!n||!cG(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},dG=ft();function pG(){return ht(dG)}function fG(){const e=pG();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var hG=ft();function mG(){const e=ht(hG);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var gG=ft();function yG(){const e=ht(gG);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function vG(e){let t;const n=yG(),r=fG(),o=YV({id:n.generateId(`item-${zt()}`)},e),[i,s]=$t(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=Ze(),[c,u]=Ze(),[d,p]=Ze(),f=()=>r.listState().selectionManager(),h=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};CK({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=zK({key:h,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),y=e=>{AV(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(LV(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},v=e=>{AV(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{AV(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(AV(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case"Enter":case" ":m()}},w=rt((()=>i.indeterminate?"mixed":null!=i.checked?i.checked:void 0)),S=rt((()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":f().focusedKey()===h()?"":void 0}))),C={isChecked:()=>i.checked,dataset:S,setLabelRef:p,generateId:kV((()=>s.id)),registerLabel:nK(l),registerDescription:nK(u)};return At(hG.Provider,{value:C,get children(){return At(iK,Ft({as:"div",ref(e){const n=sV((e=>t=e),i.ref);"function"==typeof n&&n(e)},get tabIndex(){return g.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return g.dataKey()},get onPointerDown(){return OV([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return OV([b,g.onPointerUp])},get onClick(){return OV([i.onClick,g.onClick])},get onKeyDown(){return OV([x,g.onKeyDown])},get onMouseDown(){return OV([i.onMouseDown,g.onMouseDown])},get onFocus(){return OV([i.onFocus,g.onFocus])},onPointerMove:y,onPointerLeave:v},S,s))}})}function bG(e){const t=YV({closeOnSelect:!1},e),[n,r]=$t(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=hK({value:()=>fB(e.isSelected),defaultValue:()=>!!fB(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{fB(e.isReadOnly)||fB(e.isDisabled)||n(t)},toggle:()=>{fB(e.isReadOnly)||fB(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return At(vG,Ft({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var xG=ft();function wG(){return ht(xG)}var SG={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>SG.next("ltr"===e?"rtl":"ltr",t)},CG=e=>"horizontal"===e?"ArrowDown":"ArrowRight",kG=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function EG(e){const t=yG(),n=fG(),r=wG(),{direction:o}=OK(),i=YV({id:t.generateId("trigger")},e),[s,a]=$t(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();void 0!==r&&(l=()=>t.value()??s.id,void 0===r.lastValue()&&r.setLastValue(l));const c=rK((()=>n.triggerRef()),(()=>"button")),u=rt((()=>"a"===c()&&null!=n.triggerRef()?.getAttribute("href")));nt(st((()=>r?.value()),(e=>{u()&&e===l()&&n.triggerRef()?.focus()})));const d=()=>{void 0!==r?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)};return nt((()=>lt(n.registerTriggerId(s.id)))),At(rH,Ft({ref(e){const t=sV(n.setTriggerRef,s.ref);"function"==typeof t&&t(e)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return rt((()=>!!n.isOpen()))()?n.contentId():void 0},get"data-highlighted"(){return void 0!==l()&&r?.value()===l()||void 0},get tabIndex(){return void 0!==r?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:e=>{AV(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{AV(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{AV(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(AV(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case CG(t.orientation()):e.stopPropagation(),e.preventDefault(),function(e){if(document.contains(e)){const t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let n=HV(e);for(;e&&n&&e!==t&&n!==t;)ZV(n,e),n=HV(e=n)}else{const{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:r,top:o}=e.getBoundingClientRect();(Math.abs(t-r)>1||Math.abs(n-o)>1)&&e.scrollIntoView?.({block:"nearest"})}}}(e.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case kG(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case SG.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case SG.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{AV(e,s.onFocus),void 0!==r&&"touch"!==e.currentTarget.dataset.pointerType&&r.setValue(l)},role:void 0!==r?"menuitem":void 0},(()=>n.dataset()),a))}var _G=ft();function jG(){return ht(_G)}function TG(e){let t;const n=yG(),r=fG(),o=wG(),i=jG(),{direction:s}=OK(),a=YV({id:n.generateId(`content-${zt()}`)},e),[l,c]=$t(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>null==r.parentMenuContext()&&void 0===o&&n.isModal(),p=VW({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>"horizontal"===n.orientation()?"vertical":"horizontal"},(()=>t));YW({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:e=>{void 0===o&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},(()=>t));const f=e=>{l.onEscapeKeyDown?.(e),o?.setAutoFocusMenu(!1),r.close(!0)},h=e=>{l.onFocusOutside?.(e),n.isModal()&&e.preventDefault()};nt((()=>lt(r.registerContentId(l.id))));const m={ref:sV((e=>{r.setContentRef(e),t=e}),l.ref),role:"menu",get id(){return l.id},get tabIndex(){return p.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:OV([l.onKeyDown,p.onKeyDown,e=>{if(EV(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case SG.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case SG.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:OV([l.onMouseDown,p.onMouseDown]),onFocusIn:OV([l.onFocusIn,p.onFocusIn]),onFocusOut:OV([l.onFocusOut,p.onFocusOut]),onPointerEnter:e=>{AV(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(AV(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;EV(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return At(Ht,{get when(){return r.contentPresent()},get children(){return At(Ht,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return At(iK,Ft({as:"div"},(()=>r.dataset()),m,c))},get children(){return At(CW.Positioner,{get children(){return At(jW,Ft({get disableOutsidePointerEvents(){return rt((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return wV({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:f,onFocusOutside:h,get onDismiss(){return r.close}},(()=>r.dataset()),m,c))}})}})}})}function NG(e){let t;const n=yG(),r=fG(),[o,i]=$t(e,["ref"]);return uG({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),At(TG,Ft({ref(e){const n=sV((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var PG=ft();function DG(e){const t=YV({id:yG().generateId(`group-${zt()}`)},e),[n,r]=Ze(),o={generateId:kV((()=>t.id)),registerLabelId:nK(r)};return At(PG.Provider,{value:o,get children(){return At(iK,Ft({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function MG(e){const t=function(){const e=ht(PG);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=YV({id:t.generateId("label")},e),[r,o]=$t(n,["id"]);return nt((()=>lt(t.registerLabelId(r.id)))),At(iK,Ft({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function AG(e){const t=fG();return At(iK,Ft({as:"span","aria-hidden":"true"},(()=>t.dataset()),YV({children:"▼"},e)))}function OG(e){return At(vG,Ft({role:"menuitem",closeOnSelect:!0},e))}function RG(e){const t=mG(),n=YV({id:t.generateId("description")},e),[r,o]=$t(n,["id"]);return nt((()=>lt(t.registerDescription(r.id)))),At(iK,Ft({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function LG(e){const t=mG(),n=YV({id:t.generateId("indicator")},e),[r,o]=$t(n,["forceMount"]);return At(Ht,{get when(){return r.forceMount||t.isChecked()},get children(){return At(iK,Ft({as:"div"},(()=>t.dataset()),o))}})}function IG(e){const t=mG(),n=YV({id:t.generateId("label")},e),[r,o]=$t(n,["ref","id"]);return nt((()=>lt(t.registerLabel(r.id)))),At(iK,Ft({as:"div",ref(e){const n=sV(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function FG(e){const t=fG();return At(Ht,{get when(){return t.contentPresent()},get children(){return At(Cn,e)}})}var $G=ft();function qG(e){const t=YV({id:yG().generateId(`radiogroup-${zt()}`)},e),[n,r]=$t(t,["value","defaultValue","onChange","disabled"]),[o,i]=fK({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return At($G.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return At(DG,r)}})}function UG(e){const t=function(){const e=ht($G);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=YV({closeOnSelect:!1},e),[r,o]=$t(n,["value","onSelect"]);return At(vG,Ft({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function zG(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top])}return i}function BG(e){const t=yG(),n=vK(),r=pG(),o=wG(),i=jG(),s=YV({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=$t(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[p,f]=Ze(),[h,m]=Ze(),[g,y]=Ze(),[v,b]=Ze(),[x,w]=Ze(!0),[S,C]=Ze(l.placement),[k,E]=Ze([]),[_,j]=Ze([]),{DomCollectionProvider:T}=SK({items:_,onItemsChange:j}),N=TW({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:P}=WK({show:()=>t.forceMount()||N.isOpen(),element:()=>v()??null}),D=function(e){const t=qK(e),n=EK({dataSource:()=>fB(e.dataSource),getKey:()=>fB(e.getKey),getTextValue:()=>fB(e.getTextValue),getDisabled:()=>fB(e.getDisabled),getSectionChildren:()=>fB(e.getSectionChildren),factory:t=>new VK(e.filter?e.filter(t):t)},[()=>e.filter]),r=new BK(n,t);return et((()=>{const e=t.focusedKey();null==e||n().getItem(e)||t.setFocusedKey(void 0)})),{collection:n,selectionManager:()=>r}}({selectionMode:"none",dataSource:_}),M=e=>{w(e),N.open()},A=(e=!1)=>{N.close(),e&&r&&r.close(!0)},O=()=>{const e=v();e&&(LV(e),D.selectionManager().setFocused(!0),D.selectionManager().setFocusedKey(void 0))},R=()=>{null!=i?setTimeout((()=>O())):O()},L=e=>{return d===u?.side&&(t=e,n=u?.area,!!n&&function(e,t){const[n,r]=e;let o=!1;for(let i=t.length,s=0,a=i-1;s<i;a=s++){const[e,l]=t[s],[c,u]=t[a],[,d]=t[0===a?i-1:a-1]||[0,0],p=(l-u)*(n-e)-(e-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===p)return!0;p>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===p)return!0;p<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r==l&&(n>=c&&n<=e||n>=e&&n<=c))return!0}return o}([t.clientX,t.clientY],n));var t,n};XW({isDisabled:()=>!(null==r&&N.isOpen()&&t.isModal()),targets:()=>[v(),...k()].filter(Boolean)}),nt((()=>{const e=v();if(!e||!r)return;const t=r.registerNestedMenu(e);lt((()=>{t()}))})),nt((()=>{void 0===r&&o?.registerMenu(t.value(),[v(),...k()])})),nt((()=>{void 0===r&&void 0!==o&&(o.value()===t.value()?(g()?.focus(),o.autoFocusMenu()&&M(!0)):A())})),nt((()=>{void 0===r&&void 0!==o&&N.isOpen()&&o.setValue(t.value())})),lt((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:rt((()=>({"data-expanded":N.isOpen()?"":void 0,"data-closed":N.isOpen()?void 0:""}))),isOpen:N.isOpen,contentPresent:P,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>D,parentMenuContext:()=>r,triggerRef:g,contentRef:v,triggerId:p,contentId:h,setTriggerRef:y,setContentRef:b,open:M,close:A,toggle:e=>{w(e),N.toggle()},focusContent:R,onItemEnter:e=>{L(e)&&e.preventDefault()},onItemLeave:e=>{L(e)||R()},onTriggerLeave:e=>{L(e)&&e.preventDefault()},setPointerDir:e=>d=e,setPointerGraceTimeoutId:e=>c=e,setPointerGraceIntent:e=>u=e,registerNestedMenu:e=>{E((t=>[...t,e]));const t=r?.registerNestedMenu(e);return()=>{E((t=>SV(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:nK(f),registerContentId:nK(m)};return At(T,{get children(){return At(dG.Provider,{value:I,get children(){return At(Ht,{when:void 0===i,get fallback(){return l.children},get children(){return At(CW,Ft({anchorRef:g,contentRef:v,onCurrentPlacementChange:C},l))}})}})}})}function VG(e){const{direction:t}=OK();return At(BG,Ft({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var KG=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function HG(e){const t=fG(),n=yG(),[r,o]=$t(e,["onFocusOutside","onKeyDown"]),{direction:i}=OK();return At(TG,Ft({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;EV(t.triggerRef(),n)||t.close()},onKeyDown:e=>{AV(e,r.onKeyDown);const o=EV(e.currentTarget,e.target),s=KG(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),LV(t.triggerRef()))}},o))}var WG=["Enter"," "],GG=(e,t)=>"ltr"===e?[...WG,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...WG,"horizontal"===t?"ArrowLeft":"ArrowUp"];function YG(e){let t;const n=yG(),r=fG(),o=YV({id:n.generateId(`sub-trigger-${zt()}`)},e),[i,s]=$t(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=OK(),u=()=>i.id,d=()=>{const e=r.parentMenuContext();if(null==e)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},p=zK({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{AV(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},h=e=>{AV(e,i.onKeyDown),e.repeat||i.disabled||GG(c(),n.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(r.listState().collection().getFirstKey()))};return nt((()=>{if(null==r.registerItemToParentDomCollection)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");lt(r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??t?.textContent??"",disabled:i.disabled??!1}))})),nt(st((()=>r.parentMenuContext()?.pointerGraceTimeoutId()),(e=>{lt((()=>{window.clearTimeout(e),r.parentMenuContext()?.setPointerGraceIntent(null)}))}))),nt((()=>lt(r.registerTriggerId(i.id)))),lt((()=>{l()})),At(iK,Ft({as:"div",ref(e){const n=sV((e=>{r.setTriggerRef(e),t=e}),i.ref);"function"==typeof n&&n(e)},get id(){return i.id},role:"menuitem",get tabIndex(){return p.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return rt((()=>!!r.isOpen()))()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return p.dataKey()},get"data-highlighted"(){return d().focusedKey()===u()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return OV([i.onPointerDown,p.onPointerDown])},get onPointerUp(){return OV([i.onPointerUp,p.onPointerUp])},get onClick(){return OV([f,p.onClick])},get onKeyDown(){return OV([h,p.onKeyDown])},get onMouseDown(){return OV([i.onMouseDown,p.onMouseDown])},get onFocus(){return OV([i.onFocus,p.onFocus])},onPointerMove:e=>{if(AV(e,i.onPointerMove),"mouse"!==e.pointerType)return;const t=r.parentMenuContext();t?.onItemEnter(e),e.defaultPrevented||(i.disabled?t?.onItemLeave(e):(r.isOpen()||a||(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout((()=>{r.open(!1),l()}),100)),t?.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),LV(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(AV(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:zG(r.currentPlacement(),e,n),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());const o=window.setTimeout((()=>{t?.setPointerGraceIntent(null)}),300);t?.setPointerGraceTimeoutId(o)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)}},(()=>r.dataset()),s))}function QG(e){const t=wG(),n=YV({id:`menu-${zt()}`,modal:!0},e),[r,o]=$t(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=TW({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:e=>r.onOpenChange?.(e)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:kV((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return At(gG.Provider,{value:s,get children(){return At(BG,Ft({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function XG(e){let t;const n=YV({orientation:"horizontal"},e),[r,o]=$t(n,["ref","orientation"]),i=rK((()=>t),(()=>"hr"));return At(iK,Ft({as:"hr",ref(e){const n=sV((e=>t=e),r.ref);"function"==typeof n&&n(e)},get role(){return"hr"!==i()?"separator":void 0},get"aria-orientation"(){return"vertical"===r.orientation?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}gK({},{Root:()=>XG,Separator:()=>JG});var JG=XG,ZG={};function eY(e){const t=yG(),n=fG(),[r,o]=$t(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return At(NG,Ft({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||LV(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function tY(e){return At(QG,YV({id:`dropdownmenu-${zt()}`},e))}gK(ZG,{Arrow:()=>bW,CheckboxItem:()=>bG,Content:()=>eY,DropdownMenu:()=>nY,Group:()=>DG,GroupLabel:()=>MG,Icon:()=>AG,Item:()=>OG,ItemDescription:()=>RG,ItemIndicator:()=>LG,ItemLabel:()=>IG,Portal:()=>FG,RadioGroup:()=>qG,RadioItem:()=>UG,Root:()=>tY,Separator:()=>XG,Sub:()=>VG,SubContent:()=>HG,SubTrigger:()=>YG,Trigger:()=>EG});var nY=Object.assign(tY,{Arrow:bW,CheckboxItem:bG,Content:eY,Group:DG,GroupLabel:MG,Icon:AG,Item:OG,ItemDescription:RG,ItemIndicator:LG,ItemLabel:IG,Portal:FG,RadioGroup:qG,RadioItem:UG,Separator:XG,Sub:VG,SubContent:HG,SubTrigger:YG,Trigger:EG}),rY={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},oY=on('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),iY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),sY=on('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),aY=on('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),lY=on('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),cY=on('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),uY=on('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dY=on('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),pY=on('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),fY=on('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),hY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),gY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),yY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),vY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),bY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),xY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),wY=on('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),SY=on('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),CY=on('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),kY=on('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),EY=on('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),_Y=on('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function jY(){return oY()}function TY(){return iY()}function NY(){return sY()}function PY(){return aY()}function DY(){return lY()}function MY(){return(e=lY()).style.setProperty("transform","rotate(90deg)"),e;var e}function AY(){return(e=lY()).style.setProperty("transform","rotate(-90deg)"),e;var e}function OY(){return cY()}function RY(){return uY()}function LY(){return dY()}function IY(){return pY()}function FY(){return fY()}function $Y(){return hY()}function qY(){return mY()}function UY(){return gY()}function zY(){return yY()}function BY(e){return t=vY(),n=t.firstChild,tt((()=>an(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function VY(){return bY()}function KY(){return xY()}function HY(e){return[At(Ht,{get when(){return e.checked},get children(){var t=vY(),n=t.firstChild;return tt((()=>an(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),At(Ht,{get when(){return!e.checked},get children(){var t=wY(),n=t.firstChild;return tt((()=>an(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function WY(){return SY()}function GY(){return CY()}function YY(){return kY()}function QY(){return EY()}function XY(){const e=zt();return t=_Y(),i=(o=(r=(n=t.firstChild).nextSibling).nextSibling).firstChild,a=(s=o.nextSibling).firstChild,u=(c=(l=s.nextSibling).nextSibling).firstChild,p=(d=c.nextSibling).firstChild,m=(h=(f=d.nextSibling).nextSibling).firstChild,y=(g=h.nextSibling).firstChild,x=(b=(v=g.nextSibling).nextSibling).firstChild,S=(w=b.nextSibling).firstChild,E=(k=(C=w.nextSibling).nextSibling).firstChild,j=(_=k.nextSibling).firstChild,P=(N=(T=_.nextSibling).nextSibling).firstChild,M=(D=N.nextSibling).firstChild,R=(O=(A=D.nextSibling).nextSibling).firstChild,I=(L=O.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,z=(U=F.nextSibling).firstChild,V=(B=U.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(K=B.nextSibling).firstChild).nextSibling).nextSibling.firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,ae=(se=K.nextSibling).firstChild,ce=(le=se.nextSibling).firstChild,pe=(de=(ue=le.nextSibling).firstChild).nextSibling,he=(fe=ue.nextSibling).firstChild,ge=(me=fe.nextSibling).firstChild,Re=(Oe=(Ae=(Me=(De=(Pe=(Ne=(Te=(je=(_e=(Ee=(ke=(Ce=(Se=(we=(xe=(be=(ve=(ye=me.nextSibling).firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,an(n,"id",`a-${e}`),an(r,"fill",`url(#a-${e})`),an(i,"id",`am-${e}`),an(s,"id",`b-${e}`),an(a,"filter",`url(#am-${e})`),an(l,"mask",`url(#b-${e})`),an(u,"id",`ah-${e}`),an(d,"id",`k-${e}`),an(p,"filter",`url(#ah-${e})`),an(f,"mask",`url(#k-${e})`),an(m,"id",`ae-${e}`),an(g,"id",`j-${e}`),an(y,"filter",`url(#ae-${e})`),an(v,"mask",`url(#j-${e})`),an(x,"id",`ai-${e}`),an(w,"id",`i-${e}`),an(S,"filter",`url(#ai-${e})`),an(C,"mask",`url(#i-${e})`),an(E,"id",`aj-${e}`),an(_,"id",`h-${e}`),an(j,"filter",`url(#aj-${e})`),an(T,"mask",`url(#h-${e})`),an(P,"id",`ag-${e}`),an(D,"id",`g-${e}`),an(M,"filter",`url(#ag-${e})`),an(A,"mask",`url(#g-${e})`),an(R,"id",`af-${e}`),an(L,"id",`f-${e}`),an(I,"filter",`url(#af-${e})`),an(F,"mask",`url(#f-${e})`),an($,"id",`m-${e}`),an(q,"fill",`url(#m-${e})`),an(z,"id",`ak-${e}`),an(B,"id",`e-${e}`),an(V,"filter",`url(#ak-${e})`),an(K,"mask",`url(#e-${e})`),an(H,"id",`n-${e}`),an(W,"fill",`url(#n-${e})`),an(G,"id",`r-${e}`),an(Y,"fill",`url(#r-${e})`),an(Q,"id",`s-${e}`),an(X,"fill",`url(#s-${e})`),an(J,"id",`q-${e}`),an(Z,"fill",`url(#q-${e})`),an(ee,"id",`p-${e}`),an(te,"fill",`url(#p-${e})`),an(ne,"id",`o-${e}`),an(re,"fill",`url(#o-${e})`),an(oe,"id",`l-${e}`),an(ie,"fill",`url(#l-${e})`),an(ae,"id",`al-${e}`),an(le,"id",`d-${e}`),an(ce,"filter",`url(#al-${e})`),an(ue,"mask",`url(#d-${e})`),an(de,"id",`u-${e}`),an(pe,"fill",`url(#u-${e})`),an(he,"id",`ad-${e}`),an(me,"id",`c-${e}`),an(ge,"filter",`url(#ad-${e})`),an(ye,"mask",`url(#c-${e})`),an(ve,"id",`t-${e}`),an(be,"fill",`url(#t-${e})`),an(xe,"id",`v-${e}`),an(we,"stroke",`url(#v-${e})`),an(Se,"id",`aa-${e}`),an(Ce,"stroke",`url(#aa-${e})`),an(ke,"id",`w-${e}`),an(Ee,"stroke",`url(#w-${e})`),an(_e,"id",`ac-${e}`),an(je,"stroke",`url(#ac-${e})`),an(Te,"id",`ab-${e}`),an(Ne,"stroke",`url(#ab-${e})`),an(Pe,"id",`y-${e}`),an(De,"stroke",`url(#y-${e})`),an(Me,"id",`x-${e}`),an(Ae,"stroke",`url(#x-${e})`),an(Oe,"id",`z-${e}`),an(Re,"stroke",`url(#z-${e})`),t;var t,n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,y,v,b,x,w,S,C,k,E,_,j,T,N,P,D,M,A,O,R,L,I,F,$,q,U,z,B,V,K,H,W,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,pe,fe,he,me,ge,ye,ve,be,xe,we,Se,Ce,ke,Ee,_e,je,Te,Ne,Pe,De,Me,Ae,Oe,Re}var JY=on('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),ZY=on('<button title="Copy object to clipboard">'),eQ=on('<button title="Remove all items"aria-label="Remove all items">'),tQ=on('<button title="Delete item"aria-label="Delete item">'),nQ=on('<button title="Toggle value"aria-label="Toggle value">'),rQ=on('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),oQ=on("<div>"),iQ=on("<div><button> <span></span> <span> "),sQ=on("<input>"),aQ=on("<span>"),lQ=on("<div><span>:"),cQ=on("<div><div><button> [<!>...<!>]");var uQ=e=>{const t=DB(),n=_B().shadowDOMTarget?nV.bind({target:_B().shadowDOMTarget}):nV,r=rt((()=>"dark"===t()?bQ(n):vQ(n)));return o=JY(),tt((()=>ln(o,oV(r().expander,n`
|
|
52
|
+
*/cD.exports="production"===process.env.NODE_ENV?function(){if(lD)return uD;lD=1;var e="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},t=n.useState,r=n.useEffect,o=n.useLayoutEffect,i=n.useDebugValue;function s(t){var n=t.getSnapshot;t=t.value;try{var r=n();return!e(t,r)}catch(o){return!0}}var a="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(e,n){var a=n(),l=t({inst:{value:a,getSnapshot:n}}),c=l[0].inst,u=l[1];return o((function(){c.value=a,c.getSnapshot=n,s(c)&&u({inst:c})}),[e,a,n]),r((function(){return s(c)&&u({inst:c}),e((function(){s(c)&&u({inst:c})}))}),[e]),i(a),a};return uD.useSyncExternalStore=void 0!==n.useSyncExternalStore?n.useSyncExternalStore:a,uD}():(dD||(dD=1,"production"!==process.env.NODE_ENV&&function(){function e(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!r(e,n)}catch(o){return!0}}"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var t=n,r="function"==typeof Object.is?Object.is:function(e,t){return e===t&&(0!==e||1/e==1/t)||e!=e&&t!=t},o=t.useState,i=t.useEffect,s=t.useLayoutEffect,a=t.useDebugValue,l=!1,c=!1,u="undefined"==typeof window||void 0===window.document||void 0===window.document.createElement?function(e,t){return t()}:function(n,u){l||void 0===t.startTransition||(l=!0);var d=u();if(!c){var p=u();r(d,p)||(c=!0)}var f=(p=o({inst:{value:d,getSnapshot:u}}))[0].inst,h=p[1];return s((function(){f.value=d,f.getSnapshot=u,e(f)&&h({inst:f})}),[n,d,u]),i((function(){return e(f)&&h({inst:f}),n((function(){e(f)&&h({inst:f})}))}),[n]),a(d),d};pD.useSyncExternalStore=void 0!==t.useSyncExternalStore?t.useSyncExternalStore:u,"undefined"!=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__&&"function"==typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),pD);var fD=cD.exports,hD='[cmdk-group=""]',mD='[cmdk-group-items=""]',gD='[cmdk-item=""]',yD=`${gD}:not([aria-disabled="true"])`,vD="cmdk-item-select",bD="data-value",xD=(e,t,n)=>aD(e,t,n),wD=i.createContext(void 0),SD=()=>i.useContext(wD),CD=i.createContext(void 0),kD=()=>i.useContext(CD),ED=i.createContext(void 0),_D=i.forwardRef(((e,t)=>{let n=qD((()=>{var t,n;return{search:"",value:null!=(n=null!=(t=e.value)?t:e.defaultValue)?n:"",filtered:{count:0,items:new Map,groups:new Set}}})),r=qD((()=>new Set)),o=qD((()=>new Map)),s=qD((()=>new Map)),a=qD((()=>new Set)),l=FD(e),{label:c,children:u,value:d,onValueChange:p,filter:f,shouldFilter:h,loop:m,disablePointerSelection:g=!1,vimBindings:y=!0,...v}=e,b=T_(),x=T_(),w=T_(),S=i.useRef(null),C=VD();$D((()=>{if(void 0!==d){let e=d.trim();n.current.value=e,k.emit()}}),[d]),$D((()=>{C(6,P)}),[]);let k=i.useMemo((()=>({subscribe:e=>(a.current.add(e),()=>a.current.delete(e)),snapshot:()=>n.current,setState:(e,t,r)=>{var o,i,s;if(!Object.is(n.current[e],t)){if(n.current[e]=t,"search"===e)N(),j(),C(1,T);else if("value"===e&&(r||C(5,P),void 0!==(null==(o=l.current)?void 0:o.value))){return void(null==(s=(i=l.current).onValueChange)||s.call(i,null!=t?t:""))}k.emit()}},emit:()=>{a.current.forEach((e=>e()))}})),[]),E=i.useMemo((()=>({value:(e,t,r)=>{var o;t!==(null==(o=s.current.get(e))?void 0:o.value)&&(s.current.set(e,{value:t,keywords:r}),n.current.filtered.items.set(e,_(t,r)),C(2,(()=>{j(),k.emit()})))},item:(e,t)=>(r.current.add(e),t&&(o.current.has(t)?o.current.get(t).add(e):o.current.set(t,new Set([e]))),C(3,(()=>{N(),j(),n.current.value||T(),k.emit()})),()=>{s.current.delete(e),r.current.delete(e),n.current.filtered.items.delete(e);let t=D();C(4,(()=>{N(),(null==t?void 0:t.getAttribute("id"))===e&&T(),k.emit()}))}),group:e=>(o.current.has(e)||o.current.set(e,new Set),()=>{s.current.delete(e),o.current.delete(e)}),filter:()=>l.current.shouldFilter,label:c||e["aria-label"],getDisablePointerSelection:()=>l.current.disablePointerSelection,listId:b,inputId:w,labelId:x,listInnerRef:S})),[]);function _(e,t){var r,o;let i=null!=(o=null==(r=l.current)?void 0:r.filter)?o:xD;return e?i(e,n.current.search,t):0}function j(){if(!n.current.search||!1===l.current.shouldFilter)return;let e=n.current.filtered.items,t=[];n.current.filtered.groups.forEach((n=>{let r=o.current.get(n),i=0;r.forEach((t=>{let n=e.get(t);i=Math.max(n,i)})),t.push([n,i])}));let r=S.current;M().sort(((t,n)=>{var r,o;let i=t.getAttribute("id"),s=n.getAttribute("id");return(null!=(r=e.get(s))?r:0)-(null!=(o=e.get(i))?o:0)})).forEach((e=>{let t=e.closest(mD);t?t.appendChild(e.parentElement===t?e:e.closest(`${mD} > *`)):r.appendChild(e.parentElement===r?e:e.closest(`${mD} > *`))})),t.sort(((e,t)=>t[1]-e[1])).forEach((e=>{var t;let n=null==(t=S.current)?void 0:t.querySelector(`${hD}[${bD}="${encodeURIComponent(e[0])}"]`);null==n||n.parentElement.appendChild(n)}))}function T(){let e=M().find((e=>"true"!==e.getAttribute("aria-disabled"))),t=null==e?void 0:e.getAttribute(bD);k.setState("value",t||void 0)}function N(){var e,t,i,a;if(!n.current.search||!1===l.current.shouldFilter)return void(n.current.filtered.count=r.current.size);n.current.filtered.groups=new Set;let c=0;for(let o of r.current){let r=_(null!=(t=null==(e=s.current.get(o))?void 0:e.value)?t:"",null!=(a=null==(i=s.current.get(o))?void 0:i.keywords)?a:[]);n.current.filtered.items.set(o,r),r>0&&c++}for(let[r,s]of o.current)for(let e of s)if(n.current.filtered.items.get(e)>0){n.current.filtered.groups.add(r);break}n.current.filtered.count=c}function P(){var e,t,n;let r=D();r&&((null==(e=r.parentElement)?void 0:e.firstChild)===r&&(null==(n=null==(t=r.closest(hD))?void 0:t.querySelector('[cmdk-group-heading=""]'))||n.scrollIntoView({block:"nearest"})),r.scrollIntoView({block:"nearest"}))}function D(){var e;return null==(e=S.current)?void 0:e.querySelector(`${gD}[aria-selected="true"]`)}function M(){var e;return Array.from((null==(e=S.current)?void 0:e.querySelectorAll(yD))||[])}function A(e){let t=M()[e];t&&k.setState("value",t.getAttribute(bD))}function O(e){var t;let n=D(),r=M(),o=r.findIndex((e=>e===n)),i=r[o+e];null!=(t=l.current)&&t.loop&&(i=o+e<0?r[r.length-1]:o+e===r.length?r[0]:r[o+e]),i&&k.setState("value",i.getAttribute(bD))}function R(e){let t,n=D(),r=null==n?void 0:n.closest(hD);for(;r&&!t;)r=e>0?LD(r,hD):ID(r,hD),t=null==r?void 0:r.querySelector(yD);t?k.setState("value",t.getAttribute(bD)):O(e)}let L=()=>A(M().length-1),I=e=>{e.preventDefault(),e.metaKey?L():e.altKey?R(1):O(1)},F=e=>{e.preventDefault(),e.metaKey?A(0):e.altKey?R(-1):O(-1)};return i.createElement(f_.div,{ref:t,tabIndex:-1,...v,"cmdk-root":"",onKeyDown:e=>{var t;if(null==(t=v.onKeyDown)||t.call(v,e),!e.defaultPrevented)switch(e.key){case"n":case"j":y&&e.ctrlKey&&I(e);break;case"ArrowDown":I(e);break;case"p":case"k":y&&e.ctrlKey&&F(e);break;case"ArrowUp":F(e);break;case"Home":e.preventDefault(),A(0);break;case"End":e.preventDefault(),L();break;case"Enter":if(!e.nativeEvent.isComposing&&229!==e.keyCode){e.preventDefault();let t=D();if(t){let e=new Event(vD);t.dispatchEvent(e)}}}}},i.createElement("label",{"cmdk-label":"",htmlFor:E.inputId,id:E.labelId,style:HD},c),KD(e,(e=>i.createElement(CD.Provider,{value:k},i.createElement(wD.Provider,{value:E},e)))))})),jD=i.forwardRef(((e,t)=>{var n,r;let o=T_(),s=i.useRef(null),a=i.useContext(ED),l=SD(),c=FD(e),u=null!=(r=null==(n=c.current)?void 0:n.forceMount)?r:null==a?void 0:a.forceMount;$D((()=>{if(!u)return l.item(o,null==a?void 0:a.id)}),[u]);let d=BD(o,s,[e.value,e.children,s],e.keywords),p=kD(),f=zD((e=>e.value&&e.value===d.current)),h=zD((e=>!(!u&&!1!==l.filter())||(!e.search||e.filtered.items.get(o)>0)));function m(){var e,t;g(),null==(t=(e=c.current).onSelect)||t.call(e,d.current)}function g(){p.setState("value",d.current,!0)}if(i.useEffect((()=>{let t=s.current;if(t&&!e.disabled)return t.addEventListener(vD,m),()=>t.removeEventListener(vD,m)}),[h,e.onSelect,e.disabled]),!h)return null;let{disabled:y,value:v,onSelect:b,forceMount:x,keywords:w,...S}=e;return i.createElement(f_.div,{ref:UD([s,t]),...S,id:o,"cmdk-item":"",role:"option","aria-disabled":!!y,"aria-selected":!!f,"data-disabled":!!y,"data-selected":!!f,onPointerMove:y||l.getDisablePointerSelection()?void 0:g,onClick:y?void 0:m},e.children)})),TD=i.forwardRef(((e,t)=>{let{heading:n,children:r,forceMount:o,...s}=e,a=T_(),l=i.useRef(null),c=i.useRef(null),u=T_(),d=SD(),p=zD((e=>!(!o&&!1!==d.filter())||(!e.search||e.filtered.groups.has(a))));$D((()=>d.group(a)),[]),BD(a,l,[e.value,e.heading,c]);let f=i.useMemo((()=>({id:a,forceMount:o})),[o]);return i.createElement(f_.div,{ref:UD([l,t]),...s,"cmdk-group":"",role:"presentation",hidden:!p||void 0},n&&i.createElement("div",{ref:c,"cmdk-group-heading":"","aria-hidden":!0,id:u},n),KD(e,(e=>i.createElement("div",{"cmdk-group-items":"",role:"group","aria-labelledby":n?u:void 0},i.createElement(ED.Provider,{value:f},e)))))})),ND=i.forwardRef(((e,t)=>{let{alwaysRender:n,...r}=e,o=i.useRef(null),s=zD((e=>!e.search));return n||s?i.createElement(f_.div,{ref:UD([o,t]),...r,"cmdk-separator":"",role:"separator"}):null})),PD=i.forwardRef(((e,t)=>{let{onValueChange:n,...r}=e,o=null!=e.value,s=kD(),a=zD((e=>e.search)),l=zD((e=>e.value)),c=SD(),u=i.useMemo((()=>{var e;let t=null==(e=c.listInnerRef.current)?void 0:e.querySelector(`${gD}[${bD}="${encodeURIComponent(l)}"]`);return null==t?void 0:t.getAttribute("id")}),[]);return i.useEffect((()=>{null!=e.value&&s.setState("search",e.value)}),[e.value]),i.createElement(f_.input,{ref:t,...r,"cmdk-input":"",autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list",role:"combobox","aria-expanded":!0,"aria-controls":c.listId,"aria-labelledby":c.labelId,"aria-activedescendant":u,id:c.inputId,type:"text",value:o?e.value:a,onChange:e=>{o||s.setState("search",e.target.value),null==n||n(e.target.value)}})})),DD=i.forwardRef(((e,t)=>{let{children:n,label:r="Suggestions",...o}=e,s=i.useRef(null),a=i.useRef(null),l=SD();return i.useEffect((()=>{if(a.current&&s.current){let e,t=a.current,n=s.current,r=new ResizeObserver((()=>{e=requestAnimationFrame((()=>{n.style.setProperty("--cmdk-list-height",t.offsetHeight.toFixed(1)+"px")}))}));return r.observe(t),()=>{cancelAnimationFrame(e),r.unobserve(t)}}}),[]),i.createElement(f_.div,{ref:UD([s,t]),...o,"cmdk-list":"",role:"listbox","aria-label":r,id:l.listId},KD(e,(e=>i.createElement("div",{ref:UD([a,l.listInnerRef]),"cmdk-list-sizer":""},e))))})),MD=i.forwardRef(((e,t)=>{let{open:n,onOpenChange:r,overlayClassName:o,contentClassName:s,container:a,...l}=e;return i.createElement(Tm,{open:n,onOpenChange:r},i.createElement(Nm,{container:a},i.createElement(Pm,{"cmdk-overlay":"",className:o}),i.createElement(Dm,{"aria-label":e.label,"cmdk-dialog":"",className:s},i.createElement(_D,{ref:t,...l}))))})),AD=i.forwardRef(((e,t)=>zD((e=>0===e.filtered.count))?i.createElement(f_.div,{ref:t,...e,"cmdk-empty":"",role:"presentation"}):null)),OD=i.forwardRef(((e,t)=>{let{progress:n,children:r,label:o="Loading...",...s}=e;return i.createElement(f_.div,{ref:t,...s,"cmdk-loading":"",role:"progressbar","aria-valuenow":n,"aria-valuemin":0,"aria-valuemax":100,"aria-label":o},KD(e,(e=>i.createElement("div",{"aria-hidden":!0},e))))})),RD=Object.assign(_D,{List:DD,Item:jD,Input:PD,Group:TD,Separator:ND,Dialog:MD,Empty:AD,Loading:OD});function LD(e,t){let n=e.nextElementSibling;for(;n;){if(n.matches(t))return n;n=n.nextElementSibling}}function ID(e,t){let n=e.previousElementSibling;for(;n;){if(n.matches(t))return n;n=n.previousElementSibling}}function FD(e){let t=i.useRef(e);return $D((()=>{t.current=e})),t}var $D="undefined"==typeof window?i.useEffect:i.useLayoutEffect;function qD(e){let t=i.useRef();return void 0===t.current&&(t.current=e()),t}function UD(e){return t=>{e.forEach((e=>{"function"==typeof e?e(t):null!=e&&(e.current=t)}))}}function zD(e){let t=kD(),n=()=>e(t.snapshot());return fD.useSyncExternalStore(t.subscribe,n,n)}function BD(e,t,n,r=[]){let o=i.useRef(),s=SD();return $D((()=>{var i;let a=(()=>{var e;for(let t of n){if("string"==typeof t)return t.trim();if("object"==typeof t&&"current"in t)return t.current?null==(e=t.current.textContent)?void 0:e.trim():o.current}})(),l=r.map((e=>e.trim()));s.value(e,a,l),null==(i=t.current)||i.setAttribute(bD,a),o.current=a})),o}var VD=()=>{let[e,t]=i.useState(),n=qD((()=>new Map));return $D((()=>{n.current.forEach((e=>e())),n.current=new Map}),[e]),(e,r)=>{n.current.set(e,r),t({})}};function KD({asChild:e,children:t},n){return e&&i.isValidElement(t)?i.cloneElement(function(e){let t=e.type;return"function"==typeof t?t(e.props):"render"in t?t.render(e.props):e}(t),{ref:t.ref},n(t.props.children)):n(t)}var HD={position:"absolute",width:"1px",height:"1px",padding:"0",margin:"-1px",overflow:"hidden",clip:"rect(0, 0, 0, 0)",whiteSpace:"nowrap",borderWidth:"0"};const WD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD,{ref:r,className:_d("flex h-full w-full flex-col overflow-hidden rounded-md bg-popover text-popover-foreground",e),...n})));WD.displayName=RD.displayName;const GD=i.forwardRef((({className:e,searchIcon:n,...r},o)=>t.jsxs("div",{className:"flex items-center border-b px-3",children:[n||t.jsx(xu,{className:"mr-2 h-4 w-4 shrink-0 opacity-50 "}),t.jsx(RD.Input,{ref:o,className:_d("flex h-10 w-full rounded-md bg-transparent py-3 text-sm outline-none placeholder:text-muted-foreground disabled:cursor-not-allowed disabled:opacity-50",e),...r})]})));GD.displayName=RD.Input.displayName;const YD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD.List,{ref:r,className:_d("max-h-[300px] overflow-y-auto overflow-x-hidden",e),...n})));YD.displayName=RD.List.displayName;const QD=i.forwardRef(((e,n)=>t.jsx(RD.Empty,{ref:n,className:"py-6 text-center text-sm",...e})));QD.displayName=RD.Empty.displayName;const XD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD.Group,{ref:r,className:_d("overflow-hidden p-1 text-foreground [&_[cmdk-group-heading]]:px-2 [&_[cmdk-group-heading]]:py-1.5 [&_[cmdk-group-heading]]:text-xs [&_[cmdk-group-heading]]:font-medium [&_[cmdk-group-heading]]:text-muted-foreground",e),...n})));XD.displayName=RD.Group.displayName;const JD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD.Separator,{ref:r,className:_d("-mx-1 h-px bg-border",e),...n})));JD.displayName=RD.Separator.displayName;const ZD=i.forwardRef((({className:e,...n},r)=>t.jsx(RD.Item,{ref:r,className:_d("relative flex cursor-pointer gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none data-[disabled=true]:pointer-events-none data-[disabled=true]:opacity-50 data-[selected=true]:bg-accent data-[selected=true]:text-accent-foreground [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",e),...n})));ZD.displayName=RD.Item.displayName;var eM,tM="dismissableLayer.update",nM="dismissableLayer.pointerDownOutside",rM="dismissableLayer.focusOutside",oM=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),iM=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(oM),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=uf(n,(e=>f(e))),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){aM(nM,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h),k=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){aM(rM,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return g_((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(eM=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),sM(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=eM)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),sM())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(tM,e),()=>document.removeEventListener(tM,e)}),[]),t.jsx(f_.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:i_(e.onFocusCapture,k.onFocusCapture),onBlurCapture:i_(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:i_(e.onPointerDownCapture,C.onPointerDownCapture)})}));iM.displayName="DismissableLayer";function sM(){const e=new CustomEvent(tM);document.dispatchEvent(e)}function aM(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?h_(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(oM),o=i.useRef(null),s=uf(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(f_.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var lM=0;function cM(){i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??uM()),document.body.insertAdjacentElement("beforeend",e[1]??uM()),lM++,()=>{1===lM&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),lM--}}),[])}function uM(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var dM="focusScope.autoFocusOnMount",pM="focusScope.autoFocusOnUnmount",fM={bubbles:!1,cancelable:!0},hM=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=m_(s),p=m_(a),f=i.useRef(null),h=uf(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:vM(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||vM(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&vM(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){bM.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(dM,fM);c.addEventListener(dM,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(vM(r,{select:t}),document.activeElement!==n)return}((e=mM(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&vM(c))}return()=>{c.removeEventListener(dM,d),setTimeout((()=>{const e=new CustomEvent(pM,fM);c.addEventListener(pM,p),c.dispatchEvent(e),e.defaultPrevented||vM(t??document.body,{select:!0}),c.removeEventListener(pM,p),bM.remove(m)}),0)}}var e}),[c,d,p,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=mM(e),n=gM(t,e),r=gM(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&vM(i,{select:!0})):(e.preventDefault(),r&&vM(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(f_.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})}));function mM(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function gM(e,t){for(const n of e)if(!yM(n,{upTo:t}))return n}function yM(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function vM(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}hM.displayName="FocusScope";var bM=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=xM(e,t),e.unshift(t)},remove(t){e=xM(e,t),e[0]?.resume()}}}();function xM(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var wM="Popover",[SM,CM]=s_(wM,[lT]),kM=lT(),[EM,_M]=SM(wM),jM=e=>{const{__scopePopover:n,children:r,open:o,defaultOpen:s,onOpenChange:a,modal:l=!1}=e,c=kM(n),u=i.useRef(null),[d,p]=i.useState(!1),[f=!1,h]=DT({prop:o,defaultProp:s,onChange:a});return t.jsx(kT,{...c,children:t.jsx(EM,{scope:n,contentId:T_(),triggerRef:u,open:f,onOpenChange:h,onOpenToggle:i.useCallback((()=>h((e=>!e))),[h]),hasCustomAnchor:d,onCustomAnchorAdd:i.useCallback((()=>p(!0)),[]),onCustomAnchorRemove:i.useCallback((()=>p(!1)),[]),modal:l,children:r})})};jM.displayName=wM;var TM="PopoverAnchor";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,s=_M(TM,r),a=kM(r),{onCustomAnchorAdd:l,onCustomAnchorRemove:c}=s;return i.useEffect((()=>(l(),()=>c())),[l,c]),t.jsx(ET,{...a,...o,ref:n})})).displayName=TM;var NM="PopoverTrigger",PM=i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=_M(NM,r),s=kM(r),a=uf(n,i.triggerRef),l=t.jsx(f_.button,{type:"button","aria-haspopup":"dialog","aria-expanded":i.open,"aria-controls":i.contentId,"data-state":UM(i.open),...o,ref:a,onClick:i_(e.onClick,i.onOpenToggle)});return i.hasCustomAnchor?l:t.jsx(ET,{asChild:!0,...s,children:l})}));PM.displayName=NM;var DM="PopoverPortal",[MM,AM]=SM(DM,{forceMount:void 0}),OM=e=>{const{__scopePopover:n,forceMount:r,children:o,container:i}=e,s=_M(DM,n);return t.jsx(MM,{scope:n,forceMount:r,children:t.jsx(NT,{present:r||s.open,children:t.jsx(TT,{asChild:!0,container:i,children:o})})})};OM.displayName=DM;var RM="PopoverContent",LM=i.forwardRef(((e,n)=>{const r=AM(RM,e.__scopePopover),{forceMount:o=r.forceMount,...i}=e,s=_M(RM,e.__scopePopover);return t.jsx(NT,{present:o||s.open,children:t.jsx(s.modal?IM:FM,{...i,ref:n})})}));LM.displayName=RM;var IM=i.forwardRef(((e,n)=>{const r=_M(RM,e.__scopePopover),o=i.useRef(null),s=uf(n,o),a=i.useRef(!1);return i.useEffect((()=>{const e=o.current;if(e)return Yh(e)}),[]),t.jsx(zh,{as:l_,allowPinchZoom:!0,children:t.jsx($M,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:i_(e.onCloseAutoFocus,(e=>{e.preventDefault(),a.current||r.triggerRef.current?.focus()})),onPointerDownOutside:i_(e.onPointerDownOutside,(e=>{const t=e.detail.originalEvent;a.current=2===t.button||0===t.button&&!0===t.ctrlKey}),{checkForDefaultPrevented:!1}),onFocusOutside:i_(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1})})})})),FM=i.forwardRef(((e,n)=>{const r=_M(RM,e.__scopePopover),o=i.useRef(!1),s=i.useRef(!1);return t.jsx($M,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:t=>{e.onCloseAutoFocus?.(t),t.defaultPrevented||(o.current||r.triggerRef.current?.focus(),t.preventDefault()),o.current=!1,s.current=!1},onInteractOutside:t=>{e.onInteractOutside?.(t),t.defaultPrevented||(o.current=!0,"pointerdown"===t.detail.originalEvent.type&&(s.current=!0));const n=t.target,i=r.triggerRef.current?.contains(n);i&&t.preventDefault(),"focusin"===t.detail.originalEvent.type&&s.current&&t.preventDefault()}})})),$M=i.forwardRef(((e,n)=>{const{__scopePopover:r,trapFocus:o,onOpenAutoFocus:i,onCloseAutoFocus:s,disableOutsidePointerEvents:a,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onInteractOutside:d,...p}=e,f=_M(RM,r),h=kM(r);return cM(),t.jsx(hM,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:i,onUnmountAutoFocus:s,children:t.jsx(iM,{asChild:!0,disableOutsidePointerEvents:a,onInteractOutside:d,onEscapeKeyDown:l,onPointerDownOutside:c,onFocusOutside:u,onDismiss:()=>f.onOpenChange(!1),children:t.jsx(_T,{"data-state":UM(f.open),role:"dialog",id:f.contentId,...h,...p,ref:n,style:{...p.style,"--radix-popover-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-popover-content-available-width":"var(--radix-popper-available-width)","--radix-popover-content-available-height":"var(--radix-popper-available-height)","--radix-popover-trigger-width":"var(--radix-popper-anchor-width)","--radix-popover-trigger-height":"var(--radix-popper-anchor-height)"}})})})})),qM="PopoverClose";i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=_M(qM,r);return t.jsx(f_.button,{type:"button",...o,ref:n,onClick:i_(e.onClick,(()=>i.onOpenChange(!1)))})})).displayName=qM;function UM(e){return e?"open":"closed"}i.forwardRef(((e,n)=>{const{__scopePopover:r,...o}=e,i=kM(r);return t.jsx(jT,{...i,...o,ref:n})})).displayName="PopoverArrow";var zM=OM,BM=LM;const VM=jM,KM=PM,HM=n.forwardRef((({className:e,align:n="center",sideOffset:r=4,...o},i)=>t.jsx(zM,{children:t.jsx(BM,{ref:i,align:n,sideOffset:r,className:_d("z-50 w-72 rounded-md border bg-popover p-4 text-popover-foreground shadow-md outline-none 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",e),...o})})));HM.displayName=BM.displayName;const WM=({options:e,value:n,onChange:r,placeholder:o})=>{const[s,a]=i.useState(!1);return t.jsxs(VM,{modal:!0,open:s,onOpenChange:a,children:[t.jsx(KM,{asChild:!0,children:t.jsxs(nk,{"aria-expanded":s,className:"w-[200px] overflow-hidden justify-between",variant:"outline",children:[n?e.find((e=>e.value===n))?.label:o,t.jsx(nu,{className:"ml-2 h-4 w-4 shrink-0 opacity-50"})]})}),t.jsx(HM,{className:"w-[200px] p-0",children:t.jsxs(WD,{children:[t.jsx(GD,{placeholder:`Search ${o.toLowerCase()}...`}),t.jsxs(YD,{children:[t.jsxs(QD,{children:["No ",o.toLowerCase()," found."]}),t.jsx(XD,{children:e.map((e=>t.jsxs(ZD,{value:e.value,onSelect:e=>{r(e===n?"":e),a(!1)},children:[t.jsx(Xc,{className:_d("mr-2 h-4 w-4",n===e.value?"opacity-100":"opacity-0")}),e.label]},e.id||e.value)))})]})]})})]})};function GM(e){return(GM="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)}function YM(e){if(null===e||!0===e||!1===e)return NaN;var t=Number(e);return isNaN(t)?t:t<0?Math.ceil(t):Math.floor(t)}function QM(e,t){if(t.length<e)throw new TypeError(e+" argument"+(e>1?"s":"")+" required, but only "+t.length+" present")}function XM(e){QM(1,arguments);var t=Object.prototype.toString.call(e);return e instanceof Date||"object"===GM(e)&&"[object Date]"===t?new Date(e.getTime()):"number"==typeof e||"[object Number]"===t?new Date(e):new Date(NaN)}function JM(e,t){QM(2,arguments);var n=XM(e),r=YM(t);return isNaN(r)?new Date(NaN):r?(n.setDate(n.getDate()+r),n):n}function ZM(e,t){QM(2,arguments);var n=XM(e),r=YM(t);if(isNaN(r))return new Date(NaN);if(!r)return n;var o=n.getDate(),i=new Date(n.getTime());return i.setMonth(n.getMonth()+r+1,0),o>=i.getDate()?i:(n.setFullYear(i.getFullYear(),i.getMonth(),o),n)}var eA={};function tA(){return eA}function nA(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=XM(e),f=p.getDay(),h=(f<d?7:0)+f-d;return p.setDate(p.getDate()-h),p.setHours(0,0,0,0),p}function rA(e){return QM(1,arguments),nA(e,{weekStartsOn:1})}function oA(e){QM(1,arguments);var t=function(e){QM(1,arguments);var t=XM(e),n=t.getFullYear(),r=new Date(0);r.setFullYear(n+1,0,4),r.setHours(0,0,0,0);var o=rA(r),i=new Date(0);i.setFullYear(n,0,4),i.setHours(0,0,0,0);var s=rA(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}(e),n=new Date(0);return n.setFullYear(t,0,4),n.setHours(0,0,0,0),rA(n)}function iA(e){var t=new Date(Date.UTC(e.getFullYear(),e.getMonth(),e.getDate(),e.getHours(),e.getMinutes(),e.getSeconds(),e.getMilliseconds()));return t.setUTCFullYear(e.getFullYear()),e.getTime()-t.getTime()}function sA(e){QM(1,arguments);var t=XM(e);return t.setHours(0,0,0,0),t}function aA(e,t){QM(2,arguments);var n=sA(e),r=sA(t),o=n.getTime()-iA(n),i=r.getTime()-iA(r);return Math.round((o-i)/864e5)}function lA(e,t){return QM(2,arguments),JM(e,7*YM(t))}function cA(e,t){return QM(2,arguments),ZM(e,12*YM(t))}function uA(e,t){QM(2,arguments);var n=sA(e),r=sA(t);return n.getTime()===r.getTime()}function dA(e){return QM(1,arguments),e instanceof Date||"object"===GM(e)&&"[object Date]"===Object.prototype.toString.call(e)}function pA(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return 12*(n.getFullYear()-r.getFullYear())+(n.getMonth()-r.getMonth())}function fA(e){QM(1,arguments);var t=XM(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(23,59,59,999),t}function hA(e){QM(1,arguments);var t=XM(e);return t.setDate(1),t.setHours(0,0,0,0),t}function mA(e){QM(1,arguments);var t=XM(e),n=new Date(0);return n.setFullYear(t.getFullYear(),0,1),n.setHours(0,0,0,0),n}function gA(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=XM(e),f=p.getDay(),h=6+(f<d?-7:0)-(f-d);return p.setDate(p.getDate()+h),p.setHours(23,59,59,999),p}function yA(e){return QM(1,arguments),gA(e,{weekStartsOn:1})}function vA(e,t){return QM(2,arguments),function(e,t){QM(2,arguments);var n=XM(e).getTime(),r=YM(t);return new Date(n+r)}(e,-YM(t))}function bA(e){QM(1,arguments);var t=XM(e),n=t.getUTCDay(),r=(n<1?7:0)+n-1;return t.setUTCDate(t.getUTCDate()-r),t.setUTCHours(0,0,0,0),t}function xA(e){QM(1,arguments);var t=XM(e),n=t.getUTCFullYear(),r=new Date(0);r.setUTCFullYear(n+1,0,4),r.setUTCHours(0,0,0,0);var o=bA(r),i=new Date(0);i.setUTCFullYear(n,0,4),i.setUTCHours(0,0,0,0);var s=bA(i);return t.getTime()>=o.getTime()?n+1:t.getTime()>=s.getTime()?n:n-1}function wA(e){QM(1,arguments);var t=XM(e),n=bA(t).getTime()-function(e){QM(1,arguments);var t=xA(e),n=new Date(0);return n.setUTCFullYear(t,0,4),n.setUTCHours(0,0,0,0),bA(n)}(t).getTime();return Math.round(n/6048e5)+1}function SA(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.weekStartsOn)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.weekStartsOn)&&void 0!==o?o:u.weekStartsOn)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.weekStartsOn)&&void 0!==n?n:0);if(!(d>=0&&d<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");var p=XM(e),f=p.getUTCDay(),h=(f<d?7:0)+f-d;return p.setUTCDate(p.getUTCDate()-h),p.setUTCHours(0,0,0,0),p}function CA(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=XM(e),d=u.getUTCFullYear(),p=tA(),f=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:p.firstWeekContainsDate)&&void 0!==r?r:null===(l=p.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setUTCFullYear(d+1,0,f),h.setUTCHours(0,0,0,0);var m=SA(h,t),g=new Date(0);g.setUTCFullYear(d,0,f),g.setUTCHours(0,0,0,0);var y=SA(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=y.getTime()?d:d-1}function kA(e,t){QM(1,arguments);var n=XM(e),r=SA(n,t).getTime()-function(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),p=CA(e,t),f=new Date(0);return f.setUTCFullYear(p,0,d),f.setUTCHours(0,0,0,0),SA(f,t)}(n,t).getTime();return Math.round(r/6048e5)+1}function EA(e,t){for(var n=e<0?"-":"",r=Math.abs(e).toString();r.length<t;)r="0"+r;return n+r}var _A=function(e,t){var n=e.getUTCFullYear(),r=n>0?n:1-n;return EA("yy"===t?r%100:r,t.length)},jA=function(e,t){var n=e.getUTCMonth();return"M"===t?String(n+1):EA(n+1,2)},TA=function(e,t){return EA(e.getUTCDate(),t.length)},NA=function(e,t){return EA(e.getUTCHours()%12||12,t.length)},PA=function(e,t){return EA(e.getUTCHours(),t.length)},DA=function(e,t){return EA(e.getUTCMinutes(),t.length)},MA=function(e,t){return EA(e.getUTCSeconds(),t.length)},AA=function(e,t){var n=t.length,r=e.getUTCMilliseconds();return EA(Math.floor(r*Math.pow(10,n-3)),t.length)},OA="midnight",RA="noon",LA="morning",IA="afternoon",FA="evening",$A="night",qA={G:function(e,t,n){var r=e.getUTCFullYear()>0?1:0;switch(t){case"G":case"GG":case"GGG":return n.era(r,{width:"abbreviated"});case"GGGGG":return n.era(r,{width:"narrow"});default:return n.era(r,{width:"wide"})}},y:function(e,t,n){if("yo"===t){var r=e.getUTCFullYear();return n.ordinalNumber(r>0?r:1-r,{unit:"year"})}return _A(e,t)},Y:function(e,t,n,r){var o=CA(e,r),i=o>0?o:1-o;return"YY"===t?EA(i%100,2):"Yo"===t?n.ordinalNumber(i,{unit:"year"}):EA(i,t.length)},R:function(e,t){return EA(xA(e),t.length)},u:function(e,t){return EA(e.getUTCFullYear(),t.length)},Q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"Q":return String(r);case"QQ":return EA(r,2);case"Qo":return n.ordinalNumber(r,{unit:"quarter"});case"QQQ":return n.quarter(r,{width:"abbreviated",context:"formatting"});case"QQQQQ":return n.quarter(r,{width:"narrow",context:"formatting"});default:return n.quarter(r,{width:"wide",context:"formatting"})}},q:function(e,t,n){var r=Math.ceil((e.getUTCMonth()+1)/3);switch(t){case"q":return String(r);case"qq":return EA(r,2);case"qo":return n.ordinalNumber(r,{unit:"quarter"});case"qqq":return n.quarter(r,{width:"abbreviated",context:"standalone"});case"qqqqq":return n.quarter(r,{width:"narrow",context:"standalone"});default:return n.quarter(r,{width:"wide",context:"standalone"})}},M:function(e,t,n){var r=e.getUTCMonth();switch(t){case"M":case"MM":return jA(e,t);case"Mo":return n.ordinalNumber(r+1,{unit:"month"});case"MMM":return n.month(r,{width:"abbreviated",context:"formatting"});case"MMMMM":return n.month(r,{width:"narrow",context:"formatting"});default:return n.month(r,{width:"wide",context:"formatting"})}},L:function(e,t,n){var r=e.getUTCMonth();switch(t){case"L":return String(r+1);case"LL":return EA(r+1,2);case"Lo":return n.ordinalNumber(r+1,{unit:"month"});case"LLL":return n.month(r,{width:"abbreviated",context:"standalone"});case"LLLLL":return n.month(r,{width:"narrow",context:"standalone"});default:return n.month(r,{width:"wide",context:"standalone"})}},w:function(e,t,n,r){var o=kA(e,r);return"wo"===t?n.ordinalNumber(o,{unit:"week"}):EA(o,t.length)},I:function(e,t,n){var r=wA(e);return"Io"===t?n.ordinalNumber(r,{unit:"week"}):EA(r,t.length)},d:function(e,t,n){return"do"===t?n.ordinalNumber(e.getUTCDate(),{unit:"date"}):TA(e,t)},D:function(e,t,n){var r=function(e){QM(1,arguments);var t=XM(e),n=t.getTime();t.setUTCMonth(0,1),t.setUTCHours(0,0,0,0);var r=t.getTime();return Math.floor((n-r)/864e5)+1}(e);return"Do"===t?n.ordinalNumber(r,{unit:"dayOfYear"}):EA(r,t.length)},E:function(e,t,n){var r=e.getUTCDay();switch(t){case"E":case"EE":case"EEE":return n.day(r,{width:"abbreviated",context:"formatting"});case"EEEEE":return n.day(r,{width:"narrow",context:"formatting"});case"EEEEEE":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},e:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"e":return String(i);case"ee":return EA(i,2);case"eo":return n.ordinalNumber(i,{unit:"day"});case"eee":return n.day(o,{width:"abbreviated",context:"formatting"});case"eeeee":return n.day(o,{width:"narrow",context:"formatting"});case"eeeeee":return n.day(o,{width:"short",context:"formatting"});default:return n.day(o,{width:"wide",context:"formatting"})}},c:function(e,t,n,r){var o=e.getUTCDay(),i=(o-r.weekStartsOn+8)%7||7;switch(t){case"c":return String(i);case"cc":return EA(i,t.length);case"co":return n.ordinalNumber(i,{unit:"day"});case"ccc":return n.day(o,{width:"abbreviated",context:"standalone"});case"ccccc":return n.day(o,{width:"narrow",context:"standalone"});case"cccccc":return n.day(o,{width:"short",context:"standalone"});default:return n.day(o,{width:"wide",context:"standalone"})}},i:function(e,t,n){var r=e.getUTCDay(),o=0===r?7:r;switch(t){case"i":return String(o);case"ii":return EA(o,t.length);case"io":return n.ordinalNumber(o,{unit:"day"});case"iii":return n.day(r,{width:"abbreviated",context:"formatting"});case"iiiii":return n.day(r,{width:"narrow",context:"formatting"});case"iiiiii":return n.day(r,{width:"short",context:"formatting"});default:return n.day(r,{width:"wide",context:"formatting"})}},a:function(e,t,n){var r=e.getUTCHours()/12>=1?"pm":"am";switch(t){case"a":case"aa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"aaa":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"aaaaa":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},b:function(e,t,n){var r,o=e.getUTCHours();switch(r=12===o?RA:0===o?OA:o/12>=1?"pm":"am",t){case"b":case"bb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"bbb":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"}).toLowerCase();case"bbbbb":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},B:function(e,t,n){var r,o=e.getUTCHours();switch(r=o>=17?FA:o>=12?IA:o>=4?LA:$A,t){case"B":case"BB":case"BBB":return n.dayPeriod(r,{width:"abbreviated",context:"formatting"});case"BBBBB":return n.dayPeriod(r,{width:"narrow",context:"formatting"});default:return n.dayPeriod(r,{width:"wide",context:"formatting"})}},h:function(e,t,n){if("ho"===t){var r=e.getUTCHours()%12;return 0===r&&(r=12),n.ordinalNumber(r,{unit:"hour"})}return NA(e,t)},H:function(e,t,n){return"Ho"===t?n.ordinalNumber(e.getUTCHours(),{unit:"hour"}):PA(e,t)},K:function(e,t,n){var r=e.getUTCHours()%12;return"Ko"===t?n.ordinalNumber(r,{unit:"hour"}):EA(r,t.length)},k:function(e,t,n){var r=e.getUTCHours();return 0===r&&(r=24),"ko"===t?n.ordinalNumber(r,{unit:"hour"}):EA(r,t.length)},m:function(e,t,n){return"mo"===t?n.ordinalNumber(e.getUTCMinutes(),{unit:"minute"}):DA(e,t)},s:function(e,t,n){return"so"===t?n.ordinalNumber(e.getUTCSeconds(),{unit:"second"}):MA(e,t)},S:function(e,t){return AA(e,t)},X:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();if(0===o)return"Z";switch(t){case"X":return zA(o);case"XXXX":case"XX":return BA(o);default:return BA(o,":")}},x:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"x":return zA(o);case"xxxx":case"xx":return BA(o);default:return BA(o,":")}},O:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"O":case"OO":case"OOO":return"GMT"+UA(o,":");default:return"GMT"+BA(o,":")}},z:function(e,t,n,r){var o=(r._originalDate||e).getTimezoneOffset();switch(t){case"z":case"zz":case"zzz":return"GMT"+UA(o,":");default:return"GMT"+BA(o,":")}},t:function(e,t,n,r){return EA(Math.floor((r._originalDate||e).getTime()/1e3),t.length)},T:function(e,t,n,r){return EA((r._originalDate||e).getTime(),t.length)}};function UA(e,t){var n=e>0?"-":"+",r=Math.abs(e),o=Math.floor(r/60),i=r%60;if(0===i)return n+String(o);var s=t;return n+String(o)+s+EA(i,2)}function zA(e,t){return e%60==0?(e>0?"-":"+")+EA(Math.abs(e)/60,2):BA(e,t)}function BA(e,t){var n=t||"",r=e>0?"-":"+",o=Math.abs(e);return r+EA(Math.floor(o/60),2)+n+EA(o%60,2)}var VA=function(e,t){switch(e){case"P":return t.date({width:"short"});case"PP":return t.date({width:"medium"});case"PPP":return t.date({width:"long"});default:return t.date({width:"full"})}},KA=function(e,t){switch(e){case"p":return t.time({width:"short"});case"pp":return t.time({width:"medium"});case"ppp":return t.time({width:"long"});default:return t.time({width:"full"})}},HA={p:KA,P:function(e,t){var n,r=e.match(/(P+)(p+)?/)||[],o=r[1],i=r[2];if(!i)return VA(e,t);switch(o){case"P":n=t.dateTime({width:"short"});break;case"PP":n=t.dateTime({width:"medium"});break;case"PPP":n=t.dateTime({width:"long"});break;default:n=t.dateTime({width:"full"})}return n.replace("{{date}}",VA(o,t)).replace("{{time}}",KA(i,t))}},WA=["D","DD"],GA=["YY","YYYY"];function YA(e,t,n){if("YYYY"===e)throw new RangeError("Use `yyyy` instead of `YYYY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("YY"===e)throw new RangeError("Use `yy` instead of `YY` (in `".concat(t,"`) for formatting years to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("D"===e)throw new RangeError("Use `d` instead of `D` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"));if("DD"===e)throw new RangeError("Use `dd` instead of `DD` (in `".concat(t,"`) for formatting days of the month to the input `").concat(n,"`; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md"))}var QA={lessThanXSeconds:{one:"less than a second",other:"less than {{count}} seconds"},xSeconds:{one:"1 second",other:"{{count}} seconds"},halfAMinute:"half a minute",lessThanXMinutes:{one:"less than a minute",other:"less than {{count}} minutes"},xMinutes:{one:"1 minute",other:"{{count}} minutes"},aboutXHours:{one:"about 1 hour",other:"about {{count}} hours"},xHours:{one:"1 hour",other:"{{count}} hours"},xDays:{one:"1 day",other:"{{count}} days"},aboutXWeeks:{one:"about 1 week",other:"about {{count}} weeks"},xWeeks:{one:"1 week",other:"{{count}} weeks"},aboutXMonths:{one:"about 1 month",other:"about {{count}} months"},xMonths:{one:"1 month",other:"{{count}} months"},aboutXYears:{one:"about 1 year",other:"about {{count}} years"},xYears:{one:"1 year",other:"{{count}} years"},overXYears:{one:"over 1 year",other:"over {{count}} years"},almostXYears:{one:"almost 1 year",other:"almost {{count}} years"}};function XA(e){return function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},n=t.width?String(t.width):e.defaultWidth;return e.formats[n]||e.formats[e.defaultWidth]}}var JA={date:XA({formats:{full:"EEEE, MMMM do, y",long:"MMMM do, y",medium:"MMM d, y",short:"MM/dd/yyyy"},defaultWidth:"full"}),time:XA({formats:{full:"h:mm:ss a zzzz",long:"h:mm:ss a z",medium:"h:mm:ss a",short:"h:mm a"},defaultWidth:"full"}),dateTime:XA({formats:{full:"{{date}} 'at' {{time}}",long:"{{date}} 'at' {{time}}",medium:"{{date}}, {{time}}",short:"{{date}}, {{time}}"},defaultWidth:"full"})},ZA={lastWeek:"'last' eeee 'at' p",yesterday:"'yesterday at' p",today:"'today at' p",tomorrow:"'tomorrow at' p",nextWeek:"eeee 'at' p",other:"P"};function eO(e){return function(t,n){var r;if("formatting"===(null!=n&&n.context?String(n.context):"standalone")&&e.formattingValues){var o=e.defaultFormattingWidth||e.defaultWidth,i=null!=n&&n.width?String(n.width):o;r=e.formattingValues[i]||e.formattingValues[o]}else{var s=e.defaultWidth,a=null!=n&&n.width?String(n.width):e.defaultWidth;r=e.values[a]||e.values[s]}return r[e.argumentCallback?e.argumentCallback(t):t]}}var tO={ordinalNumber:function(e,t){var n=Number(e),r=n%100;if(r>20||r<10)switch(r%10){case 1:return n+"st";case 2:return n+"nd";case 3:return n+"rd"}return n+"th"},era:eO({values:{narrow:["B","A"],abbreviated:["BC","AD"],wide:["Before Christ","Anno Domini"]},defaultWidth:"wide"}),quarter:eO({values:{narrow:["1","2","3","4"],abbreviated:["Q1","Q2","Q3","Q4"],wide:["1st quarter","2nd quarter","3rd quarter","4th quarter"]},defaultWidth:"wide",argumentCallback:function(e){return e-1}}),month:eO({values:{narrow:["J","F","M","A","M","J","J","A","S","O","N","D"],abbreviated:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],wide:["January","February","March","April","May","June","July","August","September","October","November","December"]},defaultWidth:"wide"}),day:eO({values:{narrow:["S","M","T","W","T","F","S"],short:["Su","Mo","Tu","We","Th","Fr","Sa"],abbreviated:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],wide:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},defaultWidth:"wide"}),dayPeriod:eO({values:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"morning",afternoon:"afternoon",evening:"evening",night:"night"}},defaultWidth:"wide",formattingValues:{narrow:{am:"a",pm:"p",midnight:"mi",noon:"n",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},abbreviated:{am:"AM",pm:"PM",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"},wide:{am:"a.m.",pm:"p.m.",midnight:"midnight",noon:"noon",morning:"in the morning",afternoon:"in the afternoon",evening:"in the evening",night:"at night"}},defaultFormattingWidth:"wide"})};function nO(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=n.width,o=t.match(r&&e.matchPatterns[r]||e.matchPatterns[e.defaultMatchWidth]);if(!o)return null;var i,s=o[0],a=r&&e.parsePatterns[r]||e.parsePatterns[e.defaultParseWidth],l=Array.isArray(a)?function(e,t){for(var n=0;n<e.length;n++)if(t(e[n]))return n;return}(a,(function(e){return e.test(s)})):function(e,t){for(var n in e)if(e.hasOwnProperty(n)&&t(e[n]))return n;return}(a,(function(e){return e.test(s)}));return i=e.valueCallback?e.valueCallback(l):l,{value:i=n.valueCallback?n.valueCallback(i):i,rest:t.slice(s.length)}}}var rO={ordinalNumber:function(e){return function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=t.match(e.matchPattern);if(!r)return null;var o=r[0],i=t.match(e.parsePattern);if(!i)return null;var s=e.valueCallback?e.valueCallback(i[0]):i[0];return{value:s=n.valueCallback?n.valueCallback(s):s,rest:t.slice(o.length)}}}({matchPattern:/^(\d+)(th|st|nd|rd)?/i,parsePattern:/\d+/i,valueCallback:function(e){return parseInt(e,10)}}),era:nO({matchPatterns:{narrow:/^(b|a)/i,abbreviated:/^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,wide:/^(before christ|before common era|anno domini|common era)/i},defaultMatchWidth:"wide",parsePatterns:{any:[/^b/i,/^(a|c)/i]},defaultParseWidth:"any"}),quarter:nO({matchPatterns:{narrow:/^[1234]/i,abbreviated:/^q[1234]/i,wide:/^[1234](th|st|nd|rd)? quarter/i},defaultMatchWidth:"wide",parsePatterns:{any:[/1/i,/2/i,/3/i,/4/i]},defaultParseWidth:"any",valueCallback:function(e){return e+1}}),month:nO({matchPatterns:{narrow:/^[jfmasond]/i,abbreviated:/^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,wide:/^(january|february|march|april|may|june|july|august|september|october|november|december)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^j/i,/^f/i,/^m/i,/^a/i,/^m/i,/^j/i,/^j/i,/^a/i,/^s/i,/^o/i,/^n/i,/^d/i],any:[/^ja/i,/^f/i,/^mar/i,/^ap/i,/^may/i,/^jun/i,/^jul/i,/^au/i,/^s/i,/^o/i,/^n/i,/^d/i]},defaultParseWidth:"any"}),day:nO({matchPatterns:{narrow:/^[smtwf]/i,short:/^(su|mo|tu|we|th|fr|sa)/i,abbreviated:/^(sun|mon|tue|wed|thu|fri|sat)/i,wide:/^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i},defaultMatchWidth:"wide",parsePatterns:{narrow:[/^s/i,/^m/i,/^t/i,/^w/i,/^t/i,/^f/i,/^s/i],any:[/^su/i,/^m/i,/^tu/i,/^w/i,/^th/i,/^f/i,/^sa/i]},defaultParseWidth:"any"}),dayPeriod:nO({matchPatterns:{narrow:/^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,any:/^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i},defaultMatchWidth:"any",parsePatterns:{any:{am:/^a/i,pm:/^p/i,midnight:/^mi/i,noon:/^no/i,morning:/morning/i,afternoon:/afternoon/i,evening:/evening/i,night:/night/i}},defaultParseWidth:"any"})},oO={code:"en-US",formatDistance:function(e,t,n){var r,o=QA[e];return r="string"==typeof o?o:1===t?o.one:o.other.replace("{{count}}",t.toString()),null!=n&&n.addSuffix?n.comparison&&n.comparison>0?"in "+r:r+" ago":r},formatLong:JA,formatRelative:function(e,t,n,r){return ZA[e]},localize:tO,match:rO,options:{weekStartsOn:0,firstWeekContainsDate:1}},iO=/[yYQqMLwIdDecihHKkms]o|(\w)\1*|''|'(''|[^'])+('|$)|./g,sO=/P+p+|P+|p+|''|'(''|[^'])+('|$)|./g,aO=/^'([^]*?)'?$/,lO=/''/g,cO=/[a-zA-Z]/;function uO(e,t,n){var r,o,i,s,a,l,c,u,d,p,f,h,m,g,y,v,b,x;QM(2,arguments);var w=String(t),S=tA(),C=null!==(r=null!==(o=null==n?void 0:n.locale)&&void 0!==o?o:S.locale)&&void 0!==r?r:oO,k=YM(null!==(i=null!==(s=null!==(a=null!==(l=null==n?void 0:n.firstWeekContainsDate)&&void 0!==l?l:null==n||null===(c=n.locale)||void 0===c||null===(u=c.options)||void 0===u?void 0:u.firstWeekContainsDate)&&void 0!==a?a:S.firstWeekContainsDate)&&void 0!==s?s:null===(d=S.locale)||void 0===d||null===(p=d.options)||void 0===p?void 0:p.firstWeekContainsDate)&&void 0!==i?i:1);if(!(k>=1&&k<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var E=YM(null!==(f=null!==(h=null!==(m=null!==(g=null==n?void 0:n.weekStartsOn)&&void 0!==g?g:null==n||null===(y=n.locale)||void 0===y||null===(v=y.options)||void 0===v?void 0:v.weekStartsOn)&&void 0!==m?m:S.weekStartsOn)&&void 0!==h?h:null===(b=S.locale)||void 0===b||null===(x=b.options)||void 0===x?void 0:x.weekStartsOn)&&void 0!==f?f:0);if(!(E>=0&&E<=6))throw new RangeError("weekStartsOn must be between 0 and 6 inclusively");if(!C.localize)throw new RangeError("locale must contain localize property");if(!C.formatLong)throw new RangeError("locale must contain formatLong property");var _=XM(e);if(!function(e){if(QM(1,arguments),!dA(e)&&"number"!=typeof e)return!1;var t=XM(e);return!isNaN(Number(t))}(_))throw new RangeError("Invalid time value");var j=vA(_,iA(_)),T={firstWeekContainsDate:k,weekStartsOn:E,locale:C,_originalDate:_};return w.match(sO).map((function(e){var t=e[0];return"p"===t||"P"===t?(0,HA[t])(e,C.formatLong):e})).join("").match(iO).map((function(r){if("''"===r)return"'";var o=r[0];if("'"===o)return function(e){var t=e.match(aO);if(!t)return e;return t[1].replace(lO,"'")}(r);var i=qA[o];if(i)return null!=n&&n.useAdditionalWeekYearTokens||-1===GA.indexOf(r)||YA(r,t,String(e)),null!=n&&n.useAdditionalDayOfYearTokens||!function(e){return-1!==WA.indexOf(e)}(r)||YA(r,t,String(e)),i(j,r,C.localize,T);if(o.match(cO))throw new RangeError("Format string contains an unescaped latin alphabet character `"+o+"`");return r})).join("")}function dO(e){return QM(1,arguments),Math.floor(function(e){return QM(1,arguments),XM(e).getTime()}(e)/1e3)}function pO(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=tA(),d=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:u.firstWeekContainsDate)&&void 0!==r?r:null===(l=u.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1),p=function(e,t){var n,r,o,i,s,a,l,c;QM(1,arguments);var u=XM(e),d=u.getFullYear(),p=tA(),f=YM(null!==(n=null!==(r=null!==(o=null!==(i=null==t?void 0:t.firstWeekContainsDate)&&void 0!==i?i:null==t||null===(s=t.locale)||void 0===s||null===(a=s.options)||void 0===a?void 0:a.firstWeekContainsDate)&&void 0!==o?o:p.firstWeekContainsDate)&&void 0!==r?r:null===(l=p.locale)||void 0===l||null===(c=l.options)||void 0===c?void 0:c.firstWeekContainsDate)&&void 0!==n?n:1);if(!(f>=1&&f<=7))throw new RangeError("firstWeekContainsDate must be between 1 and 7 inclusively");var h=new Date(0);h.setFullYear(d+1,0,f),h.setHours(0,0,0,0);var m=nA(h,t),g=new Date(0);g.setFullYear(d,0,f),g.setHours(0,0,0,0);var y=nA(g,t);return u.getTime()>=m.getTime()?d+1:u.getTime()>=y.getTime()?d:d-1}(e,t),f=new Date(0);return f.setFullYear(p,0,d),f.setHours(0,0,0,0),nA(f,t)}function fO(e,t){return QM(1,arguments),function(e,t,n){QM(2,arguments);var r=nA(e,n),o=nA(t,n),i=r.getTime()-iA(r),s=o.getTime()-iA(o);return Math.round((i-s)/6048e5)}(function(e){QM(1,arguments);var t=XM(e),n=t.getMonth();return t.setFullYear(t.getFullYear(),n+1,0),t.setHours(0,0,0,0),t}(e),hA(e),t)+1}function hO(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return n.getTime()>r.getTime()}function mO(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return n.getTime()<r.getTime()}function gO(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return n.getFullYear()===r.getFullYear()&&n.getMonth()===r.getMonth()}function yO(e,t){return QM(2,arguments),JM(e,-YM(t))}function vO(e,t){QM(2,arguments);var n=XM(e),r=YM(t),o=n.getFullYear(),i=n.getDate(),s=new Date(0);s.setFullYear(o,r,15),s.setHours(0,0,0,0);var a=function(e){QM(1,arguments);var t=XM(e),n=t.getFullYear(),r=t.getMonth(),o=new Date(0);return o.setFullYear(n,r+1,0),o.setHours(0,0,0,0),o.getDate()}(s);return n.setMonth(r,Math.min(i,a)),n}function bO(e,t){QM(2,arguments);var n=XM(e),r=YM(t);return isNaN(n.getTime())?new Date(NaN):(n.setFullYear(r),n)}var xO=function(){return xO=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e},xO.apply(this,arguments)};function wO(e,t,n){for(var r,o=0,i=t.length;o<i;o++)!r&&o in t||(r||(r=Array.prototype.slice.call(t,0,o)),r[o]=t[o]);return e.concat(r||Array.prototype.slice.call(t))}function SO(e){return"multiple"===e.mode}function CO(e){return"range"===e.mode}function kO(e){return"single"===e.mode}"function"==typeof SuppressedError&&SuppressedError;var EO={root:"rdp",multiple_months:"rdp-multiple_months",with_weeknumber:"rdp-with_weeknumber",vhidden:"rdp-vhidden",button_reset:"rdp-button_reset",button:"rdp-button",caption:"rdp-caption",caption_start:"rdp-caption_start",caption_end:"rdp-caption_end",caption_between:"rdp-caption_between",caption_label:"rdp-caption_label",caption_dropdowns:"rdp-caption_dropdowns",dropdown:"rdp-dropdown",dropdown_month:"rdp-dropdown_month",dropdown_year:"rdp-dropdown_year",dropdown_icon:"rdp-dropdown_icon",months:"rdp-months",month:"rdp-month",table:"rdp-table",tbody:"rdp-tbody",tfoot:"rdp-tfoot",head:"rdp-head",head_row:"rdp-head_row",head_cell:"rdp-head_cell",nav:"rdp-nav",nav_button:"rdp-nav_button",nav_button_previous:"rdp-nav_button_previous",nav_button_next:"rdp-nav_button_next",nav_icon:"rdp-nav_icon",row:"rdp-row",weeknumber:"rdp-weeknumber",cell:"rdp-cell",day:"rdp-day",day_today:"rdp-day_today",day_outside:"rdp-day_outside",day_selected:"rdp-day_selected",day_disabled:"rdp-day_disabled",day_hidden:"rdp-day_hidden",day_range_start:"rdp-day_range_start",day_range_end:"rdp-day_range_end",day_range_middle:"rdp-day_range_middle"};var _O=Object.freeze({__proto__:null,formatCaption:function(e,t){return uO(e,"LLLL y",t)},formatDay:function(e,t){return uO(e,"d",t)},formatMonthCaption:function(e,t){return uO(e,"LLLL",t)},formatWeekNumber:function(e){return"".concat(e)},formatWeekdayName:function(e,t){return uO(e,"cccccc",t)},formatYearCaption:function(e,t){return uO(e,"yyyy",t)}}),jO=Object.freeze({__proto__:null,labelDay:function(e,t,n){return uO(e,"do MMMM (EEEE)",n)},labelMonthDropdown:function(){return"Month: "},labelNext:function(){return"Go to next month"},labelPrevious:function(){return"Go to previous month"},labelWeekNumber:function(e){return"Week n. ".concat(e)},labelWeekday:function(e,t){return uO(e,"cccc",t)},labelYearDropdown:function(){return"Year: "}});var TO=n.createContext(void 0);function NO(e){var n,r,o=e.initialProps,i={captionLayout:"buttons",classNames:EO,formatters:_O,labels:jO,locale:oO,modifiersClassNames:{},modifiers:{},numberOfMonths:1,styles:{},today:new Date,mode:"default"},s=function(e){var t=e.fromYear,n=e.toYear,r=e.fromMonth,o=e.toMonth,i=e.fromDate,s=e.toDate;return r?i=hA(r):t&&(i=new Date(t,0,1)),o?s=fA(o):n&&(s=new Date(n,11,31)),{fromDate:i?sA(i):void 0,toDate:s?sA(s):void 0}}(o),a=s.fromDate,l=s.toDate,c=null!==(n=o.captionLayout)&&void 0!==n?n:i.captionLayout;"buttons"===c||a&&l||(c="buttons"),(kO(o)||SO(o)||CO(o))&&(r=o.onSelect);var u=xO(xO(xO({},i),o),{captionLayout:c,classNames:xO(xO({},i.classNames),o.classNames),components:xO({},o.components),formatters:xO(xO({},i.formatters),o.formatters),fromDate:a,labels:xO(xO({},i.labels),o.labels),mode:o.mode||i.mode,modifiers:xO(xO({},i.modifiers),o.modifiers),modifiersClassNames:xO(xO({},i.modifiersClassNames),o.modifiersClassNames),onSelect:r,styles:xO(xO({},i.styles),o.styles),toDate:l});return t.jsx(TO.Provider,{value:u,children:e.children})}function PO(){var e=n.useContext(TO);if(!e)throw new Error("useDayPicker must be used within a DayPickerProvider.");return e}function DO(e){var n=PO();return t.jsx("div",{className:n.classNames.caption_label,style:n.styles.caption_label,"aria-live":"polite",role:"presentation",id:e.id,children:(0,n.formatters.formatCaption)(e.displayMonth,{locale:n.locale})})}function MO(e){return t.jsx("svg",xO({width:"8px",height:"8px",viewBox:"0 0 120 120","data-testid":"iconDropdown"},e,{children:t.jsx("path",{d:"M4.22182541,48.2218254 C8.44222828,44.0014225 15.2388494,43.9273804 19.5496459,47.9996989 L19.7781746,48.2218254 L60,88.443 L100.221825,48.2218254 C104.442228,44.0014225 111.238849,43.9273804 115.549646,47.9996989 L115.778175,48.2218254 C119.998577,52.4422283 120.07262,59.2388494 116.000301,63.5496459 L115.778175,63.7781746 L67.7781746,111.778175 C63.5577717,115.998577 56.7611506,116.07262 52.4503541,112.000301 L52.2218254,111.778175 L4.22182541,63.7781746 C-0.0739418023,59.4824074 -0.0739418023,52.5175926 4.22182541,48.2218254 Z",fill:"currentColor",fillRule:"nonzero"})}))}function AO(e){var n,r,o=e.onChange,i=e.value,s=e.children,a=e.caption,l=e.className,c=e.style,u=PO(),d=null!==(r=null===(n=u.components)||void 0===n?void 0:n.IconDropdown)&&void 0!==r?r:MO;return t.jsxs("div",{className:l,style:c,children:[t.jsx("span",{className:u.classNames.vhidden,children:e["aria-label"]}),t.jsx("select",{name:e.name,"aria-label":e["aria-label"],className:u.classNames.dropdown,style:u.styles.dropdown,value:i,onChange:o,children:s}),t.jsxs("div",{className:u.classNames.caption_label,style:u.styles.caption_label,"aria-hidden":"true",children:[a,t.jsx(d,{className:u.classNames.dropdown_icon,style:u.styles.dropdown_icon})]})]})}function OO(e){var n,r=PO(),o=r.fromDate,i=r.toDate,s=r.styles,a=r.locale,l=r.formatters.formatMonthCaption,c=r.classNames,u=r.components,d=r.labels.labelMonthDropdown;if(!o)return t.jsx(t.Fragment,{});if(!i)return t.jsx(t.Fragment,{});var p=[];if(function(e,t){QM(2,arguments);var n=XM(e),r=XM(t);return n.getFullYear()===r.getFullYear()}(o,i))for(var f=hA(o),h=o.getMonth();h<=i.getMonth();h++)p.push(vO(f,h));else for(f=hA(new Date),h=0;h<=11;h++)p.push(vO(f,h));var m=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:AO;return t.jsx(m,{name:"months","aria-label":d(),className:c.dropdown_month,style:s.dropdown_month,onChange:function(t){var n=Number(t.target.value),r=vO(hA(e.displayMonth),n);e.onChange(r)},value:e.displayMonth.getMonth(),caption:l(e.displayMonth,{locale:a}),children:p.map((function(e){return t.jsx("option",{value:e.getMonth(),children:l(e,{locale:a})},e.getMonth())}))})}function RO(e){var n,r=e.displayMonth,o=PO(),i=o.fromDate,s=o.toDate,a=o.locale,l=o.styles,c=o.classNames,u=o.components,d=o.formatters.formatYearCaption,p=o.labels.labelYearDropdown,f=[];if(!i)return t.jsx(t.Fragment,{});if(!s)return t.jsx(t.Fragment,{});for(var h=i.getFullYear(),m=s.getFullYear(),g=h;g<=m;g++)f.push(bO(mA(new Date),g));var y=null!==(n=null==u?void 0:u.Dropdown)&&void 0!==n?n:AO;return t.jsx(y,{name:"years","aria-label":p(),className:c.dropdown_year,style:l.dropdown_year,onChange:function(t){var n=bO(hA(r),Number(t.target.value));e.onChange(n)},value:r.getFullYear(),caption:d(r,{locale:a}),children:f.map((function(e){return t.jsx("option",{value:e.getFullYear(),children:d(e,{locale:a})},e.getFullYear())}))})}function LO(){var e=PO(),t=function(e){var t=e.month||e.defaultMonth||e.today||new Date,n=e.toDate,r=e.fromDate,o=e.numberOfMonths,i=void 0===o?1:o;return n&&pA(n,t)<0&&(t=ZM(n,-1*(i-1))),r&&pA(t,r)<0&&(t=r),hA(t)}(e),r=function(e,t){var r=n.useState(e);return[void 0===t?r[0]:t,r[1]]}(t,e.month),o=r[1];return[r[0],function(t){var n;if(!e.disableNavigation){var r=hA(t);o(r),null===(n=e.onMonthChange)||void 0===n||n.call(e,r)}}]}var IO=n.createContext(void 0);function FO(e){var n=PO(),r=LO(),o=r[0],i=r[1],s=function(e,t){for(var n=t.reverseMonths,r=t.numberOfMonths,o=hA(e),i=pA(hA(ZM(o,r)),o),s=[],a=0;a<i;a++){var l=ZM(o,a);s.push(l)}return n&&(s=s.reverse()),s}(o,n),a=function(e,t){if(!t.disableNavigation){var n=t.toDate,r=t.numberOfMonths,o=void 0===r?1:r,i=t.pagedNavigation?o:1,s=hA(e);if(!n)return ZM(s,i);if(!(pA(n,e)<o))return ZM(s,i)}}(o,n),l=function(e,t){if(!t.disableNavigation){var n=t.fromDate,r=t.numberOfMonths,o=t.pagedNavigation?void 0===r?1:r:1,i=hA(e);if(!n)return ZM(i,-o);if(!(pA(i,n)<=0))return ZM(i,-o)}}(o,n),c=function(e){return s.some((function(t){return gO(e,t)}))};return t.jsx(IO.Provider,{value:{currentMonth:o,displayMonths:s,goToMonth:i,goToDate:function(e,t){c(e)||(t&&mO(e,t)?i(ZM(e,1+-1*n.numberOfMonths)):i(e))},previousMonth:l,nextMonth:a,isDateDisplayed:c},children:e.children})}function $O(){var e=n.useContext(IO);if(!e)throw new Error("useNavigation must be used within a NavigationProvider");return e}function qO(e){var n,r=PO(),o=r.classNames,i=r.styles,s=r.components,a=$O().goToMonth,l=function(t){a(ZM(t,e.displayIndex?-e.displayIndex:0))},c=null!==(n=null==s?void 0:s.CaptionLabel)&&void 0!==n?n:DO,u=t.jsx(c,{id:e.id,displayMonth:e.displayMonth});return t.jsxs("div",{className:o.caption_dropdowns,style:i.caption_dropdowns,children:[t.jsx("div",{className:o.vhidden,children:u}),t.jsx(OO,{onChange:l,displayMonth:e.displayMonth}),t.jsx(RO,{onChange:l,displayMonth:e.displayMonth})]})}function UO(e){return t.jsx("svg",xO({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M69.490332,3.34314575 C72.6145263,0.218951416 77.6798462,0.218951416 80.8040405,3.34314575 C83.8617626,6.40086786 83.9268205,11.3179931 80.9992143,14.4548388 L80.8040405,14.6568542 L35.461,60 L80.8040405,105.343146 C83.8617626,108.400868 83.9268205,113.317993 80.9992143,116.454839 L80.8040405,116.656854 C77.7463184,119.714576 72.8291931,119.779634 69.6923475,116.852028 L69.490332,116.656854 L18.490332,65.6568542 C15.4326099,62.5991321 15.367552,57.6820069 18.2951583,54.5451612 L18.490332,54.3431458 L69.490332,3.34314575 Z",fill:"currentColor",fillRule:"nonzero"})}))}function zO(e){return t.jsx("svg",xO({width:"16px",height:"16px",viewBox:"0 0 120 120"},e,{children:t.jsx("path",{d:"M49.8040405,3.34314575 C46.6798462,0.218951416 41.6145263,0.218951416 38.490332,3.34314575 C35.4326099,6.40086786 35.367552,11.3179931 38.2951583,14.4548388 L38.490332,14.6568542 L83.8333725,60 L38.490332,105.343146 C35.4326099,108.400868 35.367552,113.317993 38.2951583,116.454839 L38.490332,116.656854 C41.5480541,119.714576 46.4651794,119.779634 49.602025,116.852028 L49.8040405,116.656854 L100.804041,65.6568542 C103.861763,62.5991321 103.926821,57.6820069 100.999214,54.5451612 L100.804041,54.3431458 L49.8040405,3.34314575 Z",fill:"currentColor"})}))}var BO=n.forwardRef((function(e,n){var r=PO(),o=r.classNames,i=r.styles,s=[o.button_reset,o.button];e.className&&s.push(e.className);var a=s.join(" "),l=xO(xO({},i.button_reset),i.button);return e.style&&Object.assign(l,e.style),t.jsx("button",xO({},e,{ref:n,type:"button",className:a,style:l}))}));function VO(e){var n,r,o=PO(),i=o.dir,s=o.locale,a=o.classNames,l=o.styles,c=o.labels,u=c.labelPrevious,d=c.labelNext,p=o.components;if(!e.nextMonth&&!e.previousMonth)return t.jsx(t.Fragment,{});var f=u(e.previousMonth,{locale:s}),h=[a.nav_button,a.nav_button_previous].join(" "),m=d(e.nextMonth,{locale:s}),g=[a.nav_button,a.nav_button_next].join(" "),y=null!==(n=null==p?void 0:p.IconRight)&&void 0!==n?n:zO,v=null!==(r=null==p?void 0:p.IconLeft)&&void 0!==r?r:UO;return t.jsxs("div",{className:a.nav,style:l.nav,children:[!e.hidePrevious&&t.jsx(BO,{name:"previous-month","aria-label":f,className:h,style:l.nav_button_previous,disabled:!e.previousMonth,onClick:e.onPreviousClick,children:t.jsx("rtl"===i?y:v,{className:a.nav_icon,style:l.nav_icon})}),!e.hideNext&&t.jsx(BO,{name:"next-month","aria-label":m,className:g,style:l.nav_button_next,disabled:!e.nextMonth,onClick:e.onNextClick,children:t.jsx("rtl"===i?v:y,{className:a.nav_icon,style:l.nav_icon})})]})}function KO(e){var n=PO().numberOfMonths,r=$O(),o=r.previousMonth,i=r.nextMonth,s=r.goToMonth,a=r.displayMonths,l=a.findIndex((function(t){return gO(e.displayMonth,t)})),c=0===l,u=l===a.length-1;return t.jsx(VO,{displayMonth:e.displayMonth,hideNext:n>1&&(c||!u),hidePrevious:n>1&&(u||!c),nextMonth:i,previousMonth:o,onPreviousClick:function(){o&&s(o)},onNextClick:function(){i&&s(i)}})}function HO(e){var n,r,o=PO(),i=o.classNames,s=o.styles,a=o.captionLayout,l=o.components,c=null!==(n=null==l?void 0:l.CaptionLabel)&&void 0!==n?n:DO;return r=o.disableNavigation?t.jsx(c,{id:e.id,displayMonth:e.displayMonth}):"dropdown"===a?t.jsx(qO,{displayMonth:e.displayMonth,id:e.id}):t.jsxs(t.Fragment,"dropdown-buttons"===a?{children:[t.jsx(qO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id}),t.jsx(KO,{displayMonth:e.displayMonth,displayIndex:e.displayIndex,id:e.id})]}:{children:[t.jsx(c,{id:e.id,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(KO,{displayMonth:e.displayMonth,id:e.id})]}),t.jsx("div",{className:i.caption,style:s.caption,children:r})}function WO(e){var n=PO(),r=n.footer;return r?t.jsx("tfoot",{className:n.classNames.tfoot,style:n.styles.tfoot,children:t.jsx("tr",{children:t.jsx("td",{colSpan:8,children:r})})}):t.jsx(t.Fragment,{})}function GO(){var e=PO(),n=e.classNames,r=e.styles,o=e.showWeekNumber,i=e.locale,s=e.formatters.formatWeekdayName,a=e.labels.labelWeekday,l=function(e,t,n){for(var r=n?rA(new Date):nA(new Date,{locale:e,weekStartsOn:t}),o=[],i=0;i<7;i++){var s=JM(r,i);o.push(s)}return o}(i,e.weekStartsOn,e.ISOWeek);return t.jsxs("tr",{style:r.head_row,className:n.head_row,children:[o&&t.jsx("td",{style:r.head_cell,className:n.head_cell}),l.map((function(e,o){return t.jsx("th",{scope:"col",className:n.head_cell,style:r.head_cell,"aria-label":a(e,{locale:i}),children:s(e,{locale:i})},o)}))]})}function YO(){var e,n=PO(),r=n.components,o=null!==(e=null==r?void 0:r.HeadRow)&&void 0!==e?e:GO;return t.jsx("thead",{style:n.styles.head,className:n.classNames.head,children:t.jsx(o,{})})}function QO(e){var n=PO();return t.jsx(t.Fragment,{children:(0,n.formatters.formatDay)(e.date,{locale:n.locale})})}var XO=n.createContext(void 0);function JO(e){if(!SO(e.initialProps)){return t.jsx(XO.Provider,{value:{selected:void 0,modifiers:{disabled:[]}},children:e.children})}return t.jsx(ZO,{initialProps:e.initialProps,children:e.children})}function ZO(e){var n=e.initialProps,r=e.children,o=n.selected,i=n.min,s=n.max,a={disabled:[]};return o&&a.disabled.push((function(e){var t=s&&o.length>s-1,n=o.some((function(t){return uA(t,e)}));return Boolean(t&&!n)})),t.jsx(XO.Provider,{value:{selected:o,onDayClick:function(e,t,r){var a,l;if((null===(a=n.onDayClick)||void 0===a||a.call(n,e,t,r),!Boolean(t.selected&&i&&(null==o?void 0:o.length)===i))&&!Boolean(!t.selected&&s&&(null==o?void 0:o.length)===s)){var c=o?wO([],o):[];if(t.selected){var u=c.findIndex((function(t){return uA(e,t)}));c.splice(u,1)}else c.push(e);null===(l=n.onSelect)||void 0===l||l.call(n,c,e,t,r)}},modifiers:a},children:r})}function eR(){var e=n.useContext(XO);if(!e)throw new Error("useSelectMultiple must be used within a SelectMultipleProvider");return e}var tR,nR,rR=n.createContext(void 0);function oR(e){if(!CO(e.initialProps)){return t.jsx(rR.Provider,{value:{selected:void 0,modifiers:{range_start:[],range_end:[],range_middle:[],disabled:[]}},children:e.children})}return t.jsx(iR,{initialProps:e.initialProps,children:e.children})}function iR(e){var n=e.initialProps,r=e.children,o=n.selected,i=o||{},s=i.from,a=i.to,l=n.min,c=n.max,u={range_start:[],range_end:[],range_middle:[],disabled:[]};if(s?(u.range_start=[s],a?(u.range_end=[a],uA(s,a)||(u.range_middle=[{after:s,before:a}])):u.range_end=[s]):a&&(u.range_start=[a],u.range_end=[a]),l&&(s&&!a&&u.disabled.push({after:yO(s,l-1),before:JM(s,l-1)}),s&&a&&u.disabled.push({after:s,before:JM(s,l-1)}),!s&&a&&u.disabled.push({after:yO(a,l-1),before:JM(a,l-1)})),c){if(s&&!a&&(u.disabled.push({before:JM(s,1-c)}),u.disabled.push({after:JM(s,c-1)})),s&&a){var d=c-(aA(a,s)+1);u.disabled.push({before:yO(s,d)}),u.disabled.push({after:JM(a,d)})}!s&&a&&(u.disabled.push({before:JM(a,1-c)}),u.disabled.push({after:JM(a,c-1)}))}return t.jsx(rR.Provider,{value:{selected:o,onDayClick:function(e,t,r){var i,s;null===(i=n.onDayClick)||void 0===i||i.call(n,e,t,r);var a=function(e,t){var n=t||{},r=n.from,o=n.to;if(r&&o){if(uA(o,e)&&uA(r,e))return;if(uA(o,e))return{from:o,to:void 0};if(uA(r,e))return;return hO(r,e)?{from:e,to:o}:{from:r,to:e}}return o?hO(e,o)?{from:o,to:e}:{from:e,to:o}:r?mO(e,r)?{from:e,to:r}:{from:r,to:e}:{from:e,to:void 0}}(e,o);null===(s=n.onSelect)||void 0===s||s.call(n,a,e,t,r)},modifiers:u},children:r})}function sR(){var e=n.useContext(rR);if(!e)throw new Error("useSelectRange must be used within a SelectRangeProvider");return e}function aR(e){return Array.isArray(e)?wO([],e):void 0!==e?[e]:[]}(nR=tR||(tR={})).Outside="outside",nR.Disabled="disabled",nR.Selected="selected",nR.Hidden="hidden",nR.Today="today",nR.RangeStart="range_start",nR.RangeEnd="range_end",nR.RangeMiddle="range_middle";var lR=tR.Selected,cR=tR.Disabled,uR=tR.Hidden,dR=tR.Today,pR=tR.RangeEnd,fR=tR.RangeMiddle,hR=tR.RangeStart,mR=tR.Outside;var gR=n.createContext(void 0);function yR(e){var n=PO(),r=function(e,t,n){var r,o=((r={})[lR]=aR(e.selected),r[cR]=aR(e.disabled),r[uR]=aR(e.hidden),r[dR]=[e.today],r[pR]=[],r[fR]=[],r[hR]=[],r[mR]=[],r);return e.fromDate&&o[cR].push({before:e.fromDate}),e.toDate&&o[cR].push({after:e.toDate}),SO(e)?o[cR]=o[cR].concat(t.modifiers[cR]):CO(e)&&(o[cR]=o[cR].concat(n.modifiers[cR]),o[hR]=n.modifiers[hR],o[fR]=n.modifiers[fR],o[pR]=n.modifiers[pR]),o}(n,eR(),sR()),o=function(e){var t={};return Object.entries(e).forEach((function(e){t[e[0]]=aR(e[1])})),t}(n.modifiers),i=xO(xO({},r),o);return t.jsx(gR.Provider,{value:i,children:e.children})}function vR(){var e=n.useContext(gR);if(!e)throw new Error("useModifiers must be used within a ModifiersProvider");return e}function bR(e,t){return t.some((function(t){if("boolean"==typeof t)return t;if(dA(t))return uA(e,t);var n,r,o,i,s;if(function(e){return Array.isArray(e)&&e.every(dA)}(t))return t.includes(e);if(function(e){return Boolean(e&&"object"==typeof e&&"from"in e)}(t))return n=e,s=(r=t).to,(i=r.from)&&s?(aA(s,i)<0&&(i=(o=[s,i])[0],s=o[1]),aA(n,i)>=0&&aA(s,n)>=0):s?uA(s,n):!!i&&uA(i,n);if(function(e){return Boolean(e&&"object"==typeof e&&"dayOfWeek"in e)}(t))return t.dayOfWeek.includes(e.getDay());if(function(e){return Boolean(e&&"object"==typeof e&&"before"in e&&"after"in e)}(t)){var a=aA(t.before,e)>0,l=aA(t.after,e)<0;return hO(t.before,t.after)?l&&a:a||l}return function(e){return Boolean(e&&"object"==typeof e&&"after"in e)}(t)?aA(e,t.after)>0:function(e){return Boolean(e&&"object"==typeof e&&"before"in e)}(t)?aA(t.before,e)>0:"function"==typeof t&&t(e)}))}function xR(e,t,n){var r=Object.keys(t).reduce((function(n,r){return bR(e,t[r])&&n.push(r),n}),[]),o={};return r.forEach((function(e){return o[e]=!0})),n&&!gO(e,n)&&(o.outside=!0),o}function wR(e,t){var n=t.moveBy,r=t.direction,o=t.context,i=t.modifiers,s=t.retry,a=void 0===s?{count:0,lastFocused:e}:s,l=o.weekStartsOn,c=o.fromDate,u=o.toDate,d=o.locale,p={day:JM,week:lA,month:ZM,year:cA,startOfWeek:function(e){return o.ISOWeek?rA(e):nA(e,{locale:d,weekStartsOn:l})},endOfWeek:function(e){return o.ISOWeek?yA(e):gA(e,{locale:d,weekStartsOn:l})}}[n](e,"after"===r?1:-1);"before"===r&&c?p=function(e){var t,n;if(QM(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==GM(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=XM(e);(void 0===n||n<t||isNaN(Number(t)))&&(n=t)})),n||new Date(NaN)}([c,p]):"after"===r&&u&&(p=function(e){var t,n;if(QM(1,arguments),e&&"function"==typeof e.forEach)t=e;else{if("object"!==GM(e)||null===e)return new Date(NaN);t=Array.prototype.slice.call(e)}return t.forEach((function(e){var t=XM(e);(void 0===n||n>t||isNaN(t.getDate()))&&(n=t)})),n||new Date(NaN)}([u,p]));var f=!0;if(i){var h=xR(p,i);f=!h.disabled&&!h.hidden}return f?p:a.count>365?a.lastFocused:wR(p,{moveBy:n,direction:r,context:o,modifiers:i,retry:xO(xO({},a),{count:a.count+1})})}var SR=n.createContext(void 0);function CR(e){var r=$O(),o=vR(),i=n.useState(),s=i[0],a=i[1],l=n.useState(),c=l[0],u=l[1],d=function(e,t){for(var n,r,o=hA(e[0]),i=fA(e[e.length-1]),s=o;s<=i;){var a=xR(s,t);if(a.disabled||a.hidden)s=JM(s,1);else{if(a.selected)return s;a.today&&!r&&(r=s),n||(n=s),s=JM(s,1)}}return r||n}(r.displayMonths,o),p=(null!=s?s:c&&r.isDateDisplayed(c))?c:d,f=function(e){a(e)},h=PO(),m=function(e,t){if(s){var n=wR(s,{moveBy:e,direction:t,context:h,modifiers:o});uA(s,n)||(r.goToDate(n,s),f(n))}};return t.jsx(SR.Provider,{value:{focusedDay:s,focusTarget:p,blur:function(){u(s),a(void 0)},focus:f,focusDayAfter:function(){return m("day","after")},focusDayBefore:function(){return m("day","before")},focusWeekAfter:function(){return m("week","after")},focusWeekBefore:function(){return m("week","before")},focusMonthBefore:function(){return m("month","before")},focusMonthAfter:function(){return m("month","after")},focusYearBefore:function(){return m("year","before")},focusYearAfter:function(){return m("year","after")},focusStartOfWeek:function(){return m("startOfWeek","before")},focusEndOfWeek:function(){return m("endOfWeek","after")}},children:e.children})}function kR(){var e=n.useContext(SR);if(!e)throw new Error("useFocusContext must be used within a FocusProvider");return e}var ER=n.createContext(void 0);function _R(e){if(!kO(e.initialProps)){return t.jsx(ER.Provider,{value:{selected:void 0},children:e.children})}return t.jsx(jR,{initialProps:e.initialProps,children:e.children})}function jR(e){var n=e.initialProps;return t.jsx(ER.Provider,{value:{selected:n.selected,onDayClick:function(e,t,r){var o,i,s;null===(o=n.onDayClick)||void 0===o||o.call(n,e,t,r),!t.selected||n.required?null===(s=n.onSelect)||void 0===s||s.call(n,e,e,t,r):null===(i=n.onSelect)||void 0===i||i.call(n,void 0,e,t,r)}},children:e.children})}function TR(){var e=n.useContext(ER);if(!e)throw new Error("useSelectSingle must be used within a SelectSingleProvider");return e}function NR(e,t){var n=[e.classNames.day];return Object.keys(t).forEach((function(t){var r=e.modifiersClassNames[t];if(r)n.push(r);else if(function(e){return Object.values(tR).includes(e)}(t)){var o=e.classNames["day_".concat(t)];o&&n.push(o)}})),n}function PR(e,r,o){var i,s,a,l=PO(),c=kR(),u=function(e,t){return xR(e,vR(),t)}(e,r),d=function(e,t){var n=PO(),r=TR(),o=eR(),i=sR(),s=kR(),a=s.focusDayAfter,l=s.focusDayBefore,c=s.focusWeekAfter,u=s.focusWeekBefore,d=s.blur,p=s.focus,f=s.focusMonthBefore,h=s.focusMonthAfter,m=s.focusYearBefore,g=s.focusYearAfter,y=s.focusStartOfWeek,v=s.focusEndOfWeek;return{onClick:function(s){var a,l,c,u;kO(n)?null===(a=r.onDayClick)||void 0===a||a.call(r,e,t,s):SO(n)?null===(l=o.onDayClick)||void 0===l||l.call(o,e,t,s):CO(n)?null===(c=i.onDayClick)||void 0===c||c.call(i,e,t,s):null===(u=n.onDayClick)||void 0===u||u.call(n,e,t,s)},onFocus:function(r){var o;p(e),null===(o=n.onDayFocus)||void 0===o||o.call(n,e,t,r)},onBlur:function(r){var o;d(),null===(o=n.onDayBlur)||void 0===o||o.call(n,e,t,r)},onKeyDown:function(r){var o;switch(r.key){case"ArrowLeft":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?a():l();break;case"ArrowRight":r.preventDefault(),r.stopPropagation(),"rtl"===n.dir?l():a();break;case"ArrowDown":r.preventDefault(),r.stopPropagation(),c();break;case"ArrowUp":r.preventDefault(),r.stopPropagation(),u();break;case"PageUp":r.preventDefault(),r.stopPropagation(),r.shiftKey?m():f();break;case"PageDown":r.preventDefault(),r.stopPropagation(),r.shiftKey?g():h();break;case"Home":r.preventDefault(),r.stopPropagation(),y();break;case"End":r.preventDefault(),r.stopPropagation(),v()}null===(o=n.onDayKeyDown)||void 0===o||o.call(n,e,t,r)},onKeyUp:function(r){var o;null===(o=n.onDayKeyUp)||void 0===o||o.call(n,e,t,r)},onMouseEnter:function(r){var o;null===(o=n.onDayMouseEnter)||void 0===o||o.call(n,e,t,r)},onMouseLeave:function(r){var o;null===(o=n.onDayMouseLeave)||void 0===o||o.call(n,e,t,r)},onPointerEnter:function(r){var o;null===(o=n.onDayPointerEnter)||void 0===o||o.call(n,e,t,r)},onPointerLeave:function(r){var o;null===(o=n.onDayPointerLeave)||void 0===o||o.call(n,e,t,r)},onTouchCancel:function(r){var o;null===(o=n.onDayTouchCancel)||void 0===o||o.call(n,e,t,r)},onTouchEnd:function(r){var o;null===(o=n.onDayTouchEnd)||void 0===o||o.call(n,e,t,r)},onTouchMove:function(r){var o;null===(o=n.onDayTouchMove)||void 0===o||o.call(n,e,t,r)},onTouchStart:function(r){var o;null===(o=n.onDayTouchStart)||void 0===o||o.call(n,e,t,r)}}}(e,u),p=function(){var e=PO(),t=TR(),n=eR(),r=sR();return kO(e)?t.selected:SO(e)?n.selected:CO(e)?r.selected:void 0}(),f=Boolean(l.onDayClick||"default"!==l.mode);n.useEffect((function(){var t;u.outside||c.focusedDay&&f&&uA(c.focusedDay,e)&&(null===(t=o.current)||void 0===t||t.focus())}),[c.focusedDay,e,o,f,u.outside]);var h=NR(l,u).join(" "),m=function(e,t){var n=xO({},e.styles.day);return Object.keys(t).forEach((function(t){var r;n=xO(xO({},n),null===(r=e.modifiersStyles)||void 0===r?void 0:r[t])})),n}(l,u),g=Boolean(u.outside&&!l.showOutsideDays||u.hidden),y=null!==(a=null===(s=l.components)||void 0===s?void 0:s.DayContent)&&void 0!==a?a:QO,v={style:m,className:h,children:t.jsx(y,{date:e,displayMonth:r,activeModifiers:u}),role:"gridcell"},b=c.focusTarget&&uA(c.focusTarget,e)&&!u.outside,x=c.focusedDay&&uA(c.focusedDay,e),w=xO(xO(xO({},v),((i={disabled:u.disabled,role:"gridcell"})["aria-selected"]=u.selected,i.tabIndex=x||b?0:-1,i)),d);return{isButton:f,isHidden:g,activeModifiers:u,selectedDays:p,buttonProps:w,divProps:v}}function DR(e){var r=n.useRef(null),o=PR(e.date,e.displayMonth,r);return o.isHidden?t.jsx("div",{role:"gridcell"}):o.isButton?t.jsx(BO,xO({name:"day",ref:r},o.buttonProps)):t.jsx("div",xO({},o.divProps))}function MR(e){var n=e.number,r=e.dates,o=PO(),i=o.onWeekNumberClick,s=o.styles,a=o.classNames,l=o.locale,c=o.labels.labelWeekNumber,u=(0,o.formatters.formatWeekNumber)(Number(n),{locale:l});if(!i)return t.jsx("span",{className:a.weeknumber,style:s.weeknumber,children:u});var d=c(Number(n),{locale:l});return t.jsx(BO,{name:"week-number","aria-label":d,className:a.weeknumber,style:s.weeknumber,onClick:function(e){i(n,r,e)},children:u})}function AR(e){var n,r,o,i=PO(),s=i.styles,a=i.classNames,l=i.components,c=null!==(n=null==l?void 0:l.Day)&&void 0!==n?n:DR,u=null!==(r=null==l?void 0:l.WeekNumber)&&void 0!==r?r:MR;return i.showWeekNumber&&(o=t.jsx("td",{className:a.cell,style:s.cell,children:t.jsx(u,{number:e.weekNumber,dates:e.dates})})),t.jsxs("tr",{className:a.row,style:s.row,children:[o,e.dates.map((function(n){return t.jsx("td",{className:a.cell,style:s.cell,role:"presentation",children:t.jsx(c,{displayMonth:e.displayMonth,date:n})},dO(n))}))]})}function OR(e,t,n){for(var r=(null==n?void 0:n.ISOWeek)?yA(t):gA(t,n),o=(null==n?void 0:n.ISOWeek)?rA(e):nA(e,n),i=aA(r,o),s=[],a=0;a<=i;a++)s.push(JM(o,a));var l=s.reduce((function(e,t){var r=(null==n?void 0:n.ISOWeek)?function(e){QM(1,arguments);var t=XM(e),n=rA(t).getTime()-oA(t).getTime();return Math.round(n/6048e5)+1}(t):function(e,t){QM(1,arguments);var n=XM(e),r=nA(n,t).getTime()-pO(n,t).getTime();return Math.round(r/6048e5)+1}(t,n),o=e.find((function(e){return e.weekNumber===r}));return o?(o.dates.push(t),e):(e.push({weekNumber:r,dates:[t]}),e)}),[]);return l}function RR(e){var n,r,o,i=PO(),s=i.locale,a=i.classNames,l=i.styles,c=i.hideHead,u=i.components,d=i.weekStartsOn,p=i.firstWeekContainsDate,f=i.ISOWeek,h=function(e,t){var n=OR(hA(e),fA(e),t);if(null==t?void 0:t.useFixedWeeks){var r=fO(e,t);if(r<6){var o=n[n.length-1],i=o.dates[o.dates.length-1],s=lA(i,6-r),a=OR(lA(i,1),s,t);n.push.apply(n,a)}}return n}(e.displayMonth,{useFixedWeeks:Boolean(i.fixedWeeks),ISOWeek:f,locale:s,weekStartsOn:d,firstWeekContainsDate:p}),m=null!==(n=null==u?void 0:u.Head)&&void 0!==n?n:YO,g=null!==(r=null==u?void 0:u.Row)&&void 0!==r?r:AR,y=null!==(o=null==u?void 0:u.Footer)&&void 0!==o?o:WO;return t.jsxs("table",{id:e.id,className:a.table,style:l.table,role:"grid","aria-labelledby":e["aria-labelledby"],children:[!c&&t.jsx(m,{}),t.jsx("tbody",{className:a.tbody,style:l.tbody,children:h.map((function(n){return t.jsx(g,{displayMonth:e.displayMonth,dates:n.dates,weekNumber:n.weekNumber},n.weekNumber)}))}),t.jsx(y,{displayMonth:e.displayMonth})]})}var LR="undefined"!=typeof window&&window.document&&window.document.createElement?n.useLayoutEffect:n.useEffect,IR=!1,FR=0;function $R(){return"react-day-picker-".concat(++FR)}function qR(e){var r,o,i=PO(),s=i.dir,a=i.classNames,l=i.styles,c=i.components,u=$O().displayMonths,d=function(e){var t,r=null!=e?e:IR?$R():null,o=n.useState(r),i=o[0],s=o[1];return LR((function(){null===i&&s($R())}),[]),n.useEffect((function(){!1===IR&&(IR=!0)}),[]),null!==(t=null!=e?e:i)&&void 0!==t?t:void 0}(i.id?"".concat(i.id,"-").concat(e.displayIndex):void 0),p=i.id?"".concat(i.id,"-grid-").concat(e.displayIndex):void 0,f=[a.month],h=l.month,m=0===e.displayIndex,g=e.displayIndex===u.length-1,y=!m&&!g;"rtl"===s&&(g=(r=[m,g])[0],m=r[1]),m&&(f.push(a.caption_start),h=xO(xO({},h),l.caption_start)),g&&(f.push(a.caption_end),h=xO(xO({},h),l.caption_end)),y&&(f.push(a.caption_between),h=xO(xO({},h),l.caption_between));var v=null!==(o=null==c?void 0:c.Caption)&&void 0!==o?o:HO;return t.jsxs("div",{className:f.join(" "),style:h,children:[t.jsx(v,{id:d,displayMonth:e.displayMonth,displayIndex:e.displayIndex}),t.jsx(RR,{id:p,"aria-labelledby":d,displayMonth:e.displayMonth})]},e.displayIndex)}function UR(e){var n=PO();return t.jsx("div",{className:n.classNames.months,style:n.styles.months,children:e.children})}function zR(e){var r,o,i=e.initialProps,s=PO(),a=kR(),l=$O(),c=n.useState(!1),u=c[0],d=c[1];n.useEffect((function(){s.initialFocus&&a.focusTarget&&(u||(a.focus(a.focusTarget),d(!0)))}),[s.initialFocus,u,a.focus,a.focusTarget,a]);var p=[s.classNames.root,s.className];s.numberOfMonths>1&&p.push(s.classNames.multiple_months),s.showWeekNumber&&p.push(s.classNames.with_weeknumber);var f=xO(xO({},s.styles.root),s.style),h=Object.keys(i).filter((function(e){return e.startsWith("data-")})).reduce((function(e,t){var n;return xO(xO({},e),((n={})[t]=i[t],n))}),{}),m=null!==(o=null===(r=i.components)||void 0===r?void 0:r.Months)&&void 0!==o?o:UR;return t.jsx("div",xO({className:p.join(" "),style:f,dir:s.dir,id:s.id,nonce:i.nonce,title:i.title,lang:i.lang},h,{children:t.jsx(m,{children:l.displayMonths.map((function(e,n){return t.jsx(qR,{displayIndex:n,displayMonth:e},n)}))})}))}function BR(e){var n=e.children,r=function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]])}return n}(e,["children"]);return t.jsx(NO,{initialProps:r,children:t.jsx(FO,{children:t.jsx(_R,{initialProps:r,children:t.jsx(JO,{initialProps:r,children:t.jsx(oR,{initialProps:r,children:t.jsx(yR,{children:t.jsx(CR,{children:n})})})})})})})}function VR(e){return t.jsx(BR,xO({},e,{children:t.jsx(zR,{initialProps:e})}))}function KR({className:e,classNames:n,showOutsideDays:r=!0,...o}){return t.jsx(VR,{showOutsideDays:r,className:_d("p-3",e),classNames:{months:"flex flex-col sm:flex-row space-y-4 sm:space-x-4 sm:space-y-0",month:"space-y-4",caption:"flex justify-center pt-1 relative items-center",caption_label:"text-sm font-medium",nav:"space-x-1 flex items-center",nav_button:_d(tk({variant:"outline"}),"h-7 w-7 bg-transparent p-0 opacity-50 hover:opacity-100"),nav_button_previous:"absolute left-1",nav_button_next:"absolute right-1",table:"w-full border-collapse space-y-1",head_row:"flex",head_cell:"text-muted-foreground rounded-md w-8 font-normal text-[0.8rem]",row:"flex w-full mt-2",cell:_d("relative p-0 text-center text-sm focus-within:relative focus-within:z-20 [&:has([aria-selected])]:bg-accent [&:has([aria-selected].day-outside)]:bg-accent/50 [&:has([aria-selected].day-range-end)]:rounded-r-md","range"===o.mode?"[&:has(>.day-range-end)]:rounded-r-md [&:has(>.day-range-start)]:rounded-l-md first:[&:has([aria-selected])]:rounded-l-md last:[&:has([aria-selected])]:rounded-r-md":"[&:has([aria-selected])]:rounded-md"),day:_d(tk({variant:"ghost"}),"h-8 w-8 p-0 font-normal aria-selected:opacity-100"),day_range_start:"day-range-start",day_range_end:"day-range-end",day_selected:"bg-primary text-primary-foreground hover:bg-primary hover:text-primary-foreground focus:bg-primary focus:text-primary-foreground",day_today:"bg-accent text-accent-foreground",day_outside:"day-outside text-muted-foreground aria-selected:bg-accent/50 aria-selected:text-muted-foreground",day_disabled:"text-muted-foreground opacity-50",day_range_middle:"aria-selected:bg-accent aria-selected:text-accent-foreground",day_hidden:"invisible",...n},components:{IconLeft:()=>t.jsx(Zc,{className:"h-4 w-4"}),IconRight:()=>t.jsx(eu,{className:"h-4 w-4"})},...o})}KR.displayName="Calendar";var HR=i.forwardRef(((e,n)=>{const{children:r,...o}=e,s=i.Children.toArray(r),a=s.find(YR);if(a){const e=a.props.children,r=s.map((t=>t===a?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(WR,{...o,ref:n,children:i.isValidElement(e)?i.cloneElement(e,void 0,r):null})}return t.jsx(WR,{...o,ref:n,children:r})}));HR.displayName="Slot";var WR=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?cf(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));WR.displayName="SlotClone";var GR=({children:e})=>t.jsx(t.Fragment,{children:e});function YR(e){return i.isValidElement(e)&&e.type===GR}var QR=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","span","svg","ul"].reduce(((e,n)=>{const r=i.forwardRef(((e,r)=>{const{asChild:o,...i}=e,s=o?HR:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(s,{...i,ref:r})}));return r.displayName=`Primitive.${n}`,{...e,[n]:r}}),{}),XR="horizontal",JR=["horizontal","vertical"],ZR=i.forwardRef(((e,n)=>{const{decorative:r,orientation:o=XR,...i}=e,s=function(e){return JR.includes(e)}(o)?o:XR;return t.jsx(QR.div,{"data-orientation":s,...r?{role:"none"}:{"aria-orientation":"vertical"===s?s:void 0,role:"separator"},...i,ref:n})}));ZR.displayName="Separator";var eL=ZR;const tL=i.forwardRef((({className:e,orientation:n="horizontal",decorative:r=!0,...o},i)=>t.jsx(eL,{ref:i,decorative:r,orientation:n,className:_d("shrink-0 bg-border","horizontal"===n?"h-[1px] w-full":"h-full w-[1px]",e),...o})));tL.displayName=eL.displayName;const nL=Vc("m-1 transition ease-in-out delay-150 duration-300",{variants:{variant:{default:"border-foreground/10 text-foreground bg-card hover:bg-card/80",secondary:"border-foreground/10 bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground hover:bg-destructive/80",inverted:"inverted"}},defaultVariants:{variant:"default"}}),rL=i.forwardRef((({options:e,onValueChange:n,variant:r,placeholder:o="Select options",animation:s=0,maxCount:a=3,modalPopover:l=!0,className:c,extraCommandItems:u,searchPlaceholder:d="Search...",handleSearchInput:p,emptyMessage:f="No results found.",searchIcon:h=t.jsx(xu,{className:"h-4 w-4 mr-2"}),selectedValues:m,setSelectedValues:g,...y},v)=>{const[b,x]=i.useState(!1),[w,S]=i.useState(!1),C=e=>{const t=m.includes(e)?m.filter((t=>t!==e)):[...m,e];g(t),n(t)},k=()=>{g([]),n([])};return t.jsxs(VM,{open:b,onOpenChange:x,modal:l,children:[t.jsx(KM,{asChild:!0,children:t.jsx("button",{type:"button",ref:v,...y,onClick:()=>{x((e=>!e))},className:_d("flex w-full p-1 rounded-md border min-h-9 h-auto items-center justify-between bg-white hover:bg-gray-50 [&_svg]:pointer-events-auto data-[state=open]:bg-gray-50",c),children:t.jsxs("div",m.length>0?{className:"flex justify-between items-center w-full",children:[t.jsxs("div",{className:"flex flex-wrap items-center",children:[m.slice(0,a).map((n=>{const o=e.find((e=>e.value===n)),i=o?.icon;return t.jsxs(jP,{className:_d(w?"animate-bounce":"",nL({variant:r})),style:{animationDuration:`${s}s`},children:[i&&t.jsx(i,{className:"h-4 w-4 mr-2"}),o?.label,t.jsx(iu,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),C(n)}})]},n)})),m.length>a&&t.jsxs(jP,{className:_d("bg-transparent text-foreground border-foreground/1 hover:bg-transparent",w?"animate-bounce":"",nL({variant:r})),style:{animationDuration:`${s}s`},children:[`+ ${m.length-a} more`,t.jsx(iu,{className:"ml-2 h-4 w-4 cursor-pointer",onClick:e=>{e.stopPropagation(),(()=>{const e=m.slice(0,a);g(e),n(e)})()}})]})]}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Mu,{className:"h-4 mx-2 cursor-pointer text-muted-foreground",onClick:e=>{e.stopPropagation(),k()}}),t.jsx(tL,{orientation:"vertical",className:"flex min-h-6 h-full"}),t.jsx(Jc,{className:"h-4 mx-2 cursor-pointer text-muted-foreground"})]})]}:{className:"flex items-center justify-between w-full mx-auto",children:[t.jsx("span",{className:"text-sm text-muted-foreground mx-3",children:o}),t.jsx(Jc,{className:"h-4 cursor-pointer text-muted-foreground mx-2"})]})})}),t.jsx(HM,{className:"w-auto p-0 z-[1000]",align:"start",onEscapeKeyDown:()=>x(!1),children:t.jsxs(WD,{children:[t.jsx(GD,{searchIcon:h,placeholder:d,onKeyDown:e=>{if("Enter"===e.key)x(!0),p&&(p(e.currentTarget.value),x(!1));else if("Backspace"===e.key&&!e.currentTarget.value){const e=[...m];e.pop(),g(e),n(e)}}}),t.jsxs(YD,{children:[t.jsx(QD,{children:f}),t.jsxs(XD,{children:[t.jsxs(ZD,{onSelect:()=>{if(m.length===e.length)k();else{const t=e.map((e=>e.value));g(t),n(t)}},className:"cursor-pointer",children:[t.jsx("div",{className:_d("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",m.length===e.length?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(Xc,{className:"h-4 w-4"})}),t.jsx("span",{children:"(Select All)"})]},"all"),e.map((e=>{const n=m.includes(e.value);return t.jsxs(ZD,{onSelect:()=>C(e.value),className:"cursor-pointer",children:[t.jsx("div",{className:_d("mr-2 flex h-4 w-4 items-center justify-center rounded-sm border border-primary",n?"bg-primary text-primary-foreground":"opacity-50 [&_svg]:invisible"),children:t.jsx(Xc,{className:"h-4 w-4"})}),e.icon&&t.jsx(e.icon,{className:"mr-2 h-4 w-4 text-muted-foreground"}),t.jsx("span",{children:e.label})]},e.value)}))]}),t.jsx(JD,{}),t.jsx(XD,{children:t.jsxs("div",{className:"flex items-center justify-between",children:[m.length>0&&t.jsxs(t.Fragment,{children:[t.jsx(ZD,{onSelect:k,className:"flex-1 justify-center cursor-pointer",children:"Clear"}),t.jsx(tL,{orientation:"vertical",className:"flex min-h-6 h-full"})]}),t.jsx(ZD,{onSelect:()=>x(!1),className:"flex-1 justify-center cursor-pointer max-w-full",children:"Close"}),u&&u.map((e=>e(x)))]})})]})]})}),s>0&&m.length>0&&t.jsx(Du,{className:_d("cursor-pointer my-2 text-foreground bg-background w-3 h-3",w?"":"text-muted-foreground"),onClick:()=>S(!w)})]})}));function oL(e,[t,n]){return Math.min(n,Math.max(t,e))}function iL(e,t,{checkForDefaultPrevented:n=!0}={}){return function(r){if(e?.(r),!1===n||!r.defaultPrevented)return t?.(r)}}function sL(e,n=[]){let r=[];const o=()=>{const t=r.map((e=>i.createContext(e)));return function(n){const r=n?.[e]||t;return i.useMemo((()=>({[`__scope${e}`]:{...n,[e]:r}})),[n,r])}};return o.scopeName=e,[function(n,o){const s=i.createContext(o),a=r.length;r=[...r,o];const l=n=>{const{scope:r,children:o,...l}=n,c=r?.[e]?.[a]||s,u=i.useMemo((()=>l),Object.values(l));return t.jsx(c.Provider,{value:u,children:o})};return l.displayName=n+"Provider",[l,function(t,r){const l=i.useContext(r?.[e]?.[a]||s);if(l)return l;if(void 0!==o)return o;throw new Error(`\`${t}\` must be used within \`${n}\``)}]},aL(o,...n)]}function aL(...e){const t=e[0];if(1===e.length)return t;const n=()=>{const n=e.map((e=>({useScope:e(),scopeName:e.scopeName})));return function(e){const r=n.reduce(((t,{useScope:n,scopeName:r})=>({...t,...n(e)[`__scope${r}`]})),{});return i.useMemo((()=>({[`__scope${t.scopeName}`]:r})),[r])}};return n.scopeName=t.scopeName,n}function lL(e,t){if("function"==typeof e)return e(t);null!=e&&(e.current=t)}function cL(...e){return t=>{let n=!1;const r=e.map((e=>{const r=lL(e,t);return n||"function"!=typeof r||(n=!0),r}));if(n)return()=>{for(let t=0;t<r.length;t++){const n=r[t];"function"==typeof n?n():lL(e[t],null)}}}}function uL(...e){return i.useCallback(cL(...e),e)}function dL(e){const n=pL(e),r=i.forwardRef(((e,r)=>{const{children:o,...s}=e,a=i.Children.toArray(o),l=a.find(hL);if(l){const e=l.props.children,o=a.map((t=>t===l?i.Children.count(e)>1?i.Children.only(null):i.isValidElement(e)?e.props.children:null:t));return t.jsx(n,{...s,ref:r,children:i.isValidElement(e)?i.cloneElement(e,void 0,o):null})}return t.jsx(n,{...s,ref:r,children:o})}));return r.displayName=`${e}.Slot`,r}function pL(e){const t=i.forwardRef(((e,t)=>{const{children:n,...r}=e;if(i.isValidElement(n)){const e=function(e){let t=Object.getOwnPropertyDescriptor(e.props,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning;if(n)return e.ref;if(t=Object.getOwnPropertyDescriptor(e,"ref")?.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n)return e.props.ref;return e.props.ref||e.ref}(n),o=function(e,t){const n={...t};for(const r in t){const o=e[r],i=t[r];/^on[A-Z]/.test(r)?o&&i?n[r]=(...e)=>{i(...e),o(...e)}:o&&(n[r]=o):"style"===r?n[r]={...o,...i}:"className"===r&&(n[r]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(r,n.props);return n.type!==i.Fragment&&(o.ref=t?cL(t,e):e),i.cloneElement(n,o)}return i.Children.count(n)>1?i.Children.only(null):null}));return t.displayName=`${e}.SlotClone`,t}rL.displayName="MultiSelect";var fL=Symbol("radix.slottable");function hL(e){return i.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===fL}var mL=i.createContext(void 0);var gL=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce(((e,n)=>{const r=dL(`Primitive.${n}`),o=i.forwardRef(((e,o)=>{const{asChild:i,...s}=e,a=i?r:n;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),t.jsx(a,{...s,ref:o})}));return o.displayName=`Primitive.${n}`,{...e,[n]:o}}),{});function yL(e){const t=i.useRef(e);return i.useEffect((()=>{t.current=e})),i.useMemo((()=>(...e)=>t.current?.(...e)),[])}var vL,bL="dismissableLayer.update",xL="dismissableLayer.pointerDownOutside",wL="dismissableLayer.focusOutside",SL=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),CL=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(SL),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=uL(n,(e=>f(e))),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=yL(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){EL(xL,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h),k=function(e,t=globalThis?.document){const n=yL(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){EL(wL,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return function(e,t=globalThis?.document){const n=yL(e);i.useEffect((()=>{const e=e=>{"Escape"===e.key&&n(e)};return t.addEventListener("keydown",e,{capture:!0}),()=>t.removeEventListener("keydown",e,{capture:!0})}),[n,t])}((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(vL=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),kL(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=vL)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),kL())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(bL,e),()=>document.removeEventListener(bL,e)}),[]),t.jsx(gL.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:iL(e.onFocusCapture,k.onFocusCapture),onBlurCapture:iL(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:iL(e.onPointerDownCapture,C.onPointerDownCapture)})}));CL.displayName="DismissableLayer";function kL(){const e=new CustomEvent(bL);document.dispatchEvent(e)}function EL(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?function(e,t){e&&s.flushSync((()=>e.dispatchEvent(t)))}(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(SL),o=i.useRef(null),s=uL(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(gL.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var _L=0;function jL(){const e=document.createElement("span");return e.setAttribute("data-radix-focus-guard",""),e.tabIndex=0,e.style.outline="none",e.style.opacity="0",e.style.position="fixed",e.style.pointerEvents="none",e}var TL="focusScope.autoFocusOnMount",NL="focusScope.autoFocusOnUnmount",PL={bubbles:!1,cancelable:!0},DL=i.forwardRef(((e,n)=>{const{loop:r=!1,trapped:o=!1,onMountAutoFocus:s,onUnmountAutoFocus:a,...l}=e,[c,u]=i.useState(null),d=yL(s),p=yL(a),f=i.useRef(null),h=uL(n,(e=>u(e))),m=i.useRef({paused:!1,pause(){this.paused=!0},resume(){this.paused=!1}}).current;i.useEffect((()=>{if(o){let e=function(e){if(m.paused||!c)return;const t=e.target;c.contains(t)?f.current=t:RL(f.current,{select:!0})},t=function(e){if(m.paused||!c)return;const t=e.relatedTarget;null!==t&&(c.contains(t)||RL(f.current,{select:!0}))},n=function(e){if(document.activeElement===document.body)for(const t of e)t.removedNodes.length>0&&RL(c)};document.addEventListener("focusin",e),document.addEventListener("focusout",t);const r=new MutationObserver(n);return c&&r.observe(c,{childList:!0,subtree:!0}),()=>{document.removeEventListener("focusin",e),document.removeEventListener("focusout",t),r.disconnect()}}}),[o,c,m.paused]),i.useEffect((()=>{if(c){LL.add(m);const t=document.activeElement;if(!c.contains(t)){const n=new CustomEvent(TL,PL);c.addEventListener(TL,d),c.dispatchEvent(n),n.defaultPrevented||(!function(e,{select:t=!1}={}){const n=document.activeElement;for(const r of e)if(RL(r,{select:t}),document.activeElement!==n)return}((e=ML(c),e.filter((e=>"A"!==e.tagName))),{select:!0}),document.activeElement===t&&RL(c))}return()=>{c.removeEventListener(TL,d),setTimeout((()=>{const e=new CustomEvent(NL,PL);c.addEventListener(NL,p),c.dispatchEvent(e),e.defaultPrevented||RL(t??document.body,{select:!0}),c.removeEventListener(NL,p),LL.remove(m)}),0)}}var e}),[c,d,p,m]);const g=i.useCallback((e=>{if(!r&&!o)return;if(m.paused)return;const t=document.activeElement;if("Tab"===e.key&&!e.altKey&&!e.ctrlKey&&!e.metaKey&&t){const n=e.currentTarget,[o,i]=function(e){const t=ML(e),n=AL(t,e),r=AL(t.reverse(),e);return[n,r]}(n);o&&i?e.shiftKey||t!==i?e.shiftKey&&t===o&&(e.preventDefault(),r&&RL(i,{select:!0})):(e.preventDefault(),r&&RL(o,{select:!0})):t===n&&e.preventDefault()}}),[r,o,m.paused]);return t.jsx(gL.div,{tabIndex:-1,...l,ref:h,onKeyDown:g})}));function ML(e){const t=[],n=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>e.disabled||e.hidden||"INPUT"===e.tagName&&"hidden"===e.type?NodeFilter.FILTER_SKIP:e.tabIndex>=0?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});for(;n.nextNode();)t.push(n.currentNode);return t}function AL(e,t){for(const n of e)if(!OL(n,{upTo:t}))return n}function OL(e,{upTo:t}){if("hidden"===getComputedStyle(e).visibility)return!0;for(;e;){if(void 0!==t&&e===t)return!1;if("none"===getComputedStyle(e).display)return!0;e=e.parentElement}return!1}function RL(e,{select:t=!1}={}){if(e&&e.focus){const n=document.activeElement;e.focus({preventScroll:!0}),e!==n&&function(e){return e instanceof HTMLInputElement&&"select"in e}(e)&&t&&e.select()}}DL.displayName="FocusScope";var LL=function(){let e=[];return{add(t){const n=e[0];t!==n&&n?.pause(),e=IL(e,t),e.unshift(t)},remove(t){e=IL(e,t),e[0]?.resume()}}}();function IL(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}var FL=globalThis?.document?i.useLayoutEffect:()=>{},$L=i[" useId ".trim().toString()]||(()=>{}),qL=0;function UL(e){const[t,n]=i.useState($L());return FL((()=>{n((e=>e??String(qL++)))}),[e]),e||(t?`radix-${t}`:"")}var zL=i.forwardRef(((e,n)=>{const{children:r,width:o=10,height:i=5,...s}=e;return t.jsx(gL.svg,{...s,ref:n,width:o,height:i,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?r:t.jsx("polygon",{points:"0,0 30,0 15,10"})})}));zL.displayName="Arrow";var BL=zL;var VL="Popper",[KL,HL]=sL(VL),[WL,GL]=KL(VL),YL=e=>{const{__scopePopper:n,children:r}=e,[o,s]=i.useState(null);return t.jsx(WL,{scope:n,anchor:o,onAnchorChange:s,children:r})};YL.displayName=VL;var QL="PopperAnchor",XL=i.forwardRef(((e,n)=>{const{__scopePopper:r,virtualRef:o,...s}=e,a=GL(QL,r),l=i.useRef(null),c=uL(n,l);return i.useEffect((()=>{a.onAnchorChange(o?.current||l.current)})),o?null:t.jsx(gL.div,{...s,ref:c})}));XL.displayName=QL;var JL="PopperContent",[ZL,eI]=KL(JL),tI=i.forwardRef(((e,n)=>{const{__scopePopper:r,side:o="bottom",sideOffset:s=0,align:a="center",alignOffset:l=0,arrowPadding:c=0,avoidCollisions:u=!0,collisionBoundary:d=[],collisionPadding:p=0,sticky:f="partial",hideWhenDetached:h=!1,updatePositionStrategy:m="optimized",onPlaced:g,...y}=e,v=GL(JL,r),[b,x]=i.useState(null),w=uL(n,(e=>x(e))),[S,C]=i.useState(null),k=function(e){const[t,n]=i.useState(void 0);return FL((()=>{if(e){n({width:e.offsetWidth,height:e.offsetHeight});const t=new ResizeObserver((t=>{if(!Array.isArray(t))return;if(!t.length)return;const r=t[0];let o,i;if("borderBoxSize"in r){const e=r.borderBoxSize,t=Array.isArray(e)?e[0]:e;o=t.inlineSize,i=t.blockSize}else o=e.offsetWidth,i=e.offsetHeight;n({width:o,height:i})}));return t.observe(e,{box:"border-box"}),()=>t.unobserve(e)}n(void 0)}),[e]),t}(S),E=k?.width??0,_=k?.height??0,j=o+("center"!==a?"-"+a:""),T="number"==typeof p?p:{top:0,right:0,bottom:0,left:0,...p},N=Array.isArray(d)?d:[d],P=N.length>0,D={padding:T,boundary:N.filter(iI),altBoundary:P},{refs:M,floatingStyles:A,placement:O,isPositioned:R,middlewareData:L}=Gj({strategy:"fixed",placement:j,whileElementsMounted:(...e)=>Oj(...e,{animationFrame:"always"===m}),elements:{reference:v.anchor},middleware:[Qj({mainAxis:s+_,alignmentAxis:l}),u&&Xj({mainAxis:!0,crossAxis:!1,limiter:"partial"===f?Jj():void 0,...D}),u&&Zj({...D}),eT({...D,apply:({elements:e,rects:t,availableWidth:n,availableHeight:r})=>{const{width:o,height:i}=t.reference,s=e.floating.style;s.setProperty("--radix-popper-available-width",`${n}px`),s.setProperty("--radix-popper-available-height",`${r}px`),s.setProperty("--radix-popper-anchor-width",`${o}px`),s.setProperty("--radix-popper-anchor-height",`${i}px`)}}),S&&nT({element:S,padding:c}),sI({arrowWidth:E,arrowHeight:_}),h&&tT({strategy:"referenceHidden",...D})]}),[I,F]=aI(O),$=yL(g);FL((()=>{R&&$?.()}),[R,$]);const q=L.arrow?.x,U=L.arrow?.y,z=0!==L.arrow?.centerOffset,[B,V]=i.useState();return FL((()=>{b&&V(window.getComputedStyle(b).zIndex)}),[b]),t.jsx("div",{ref:M.setFloating,"data-radix-popper-content-wrapper":"",style:{...A,transform:R?A.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:B,"--radix-popper-transform-origin":[L.transformOrigin?.x,L.transformOrigin?.y].join(" "),...L.hide?.referenceHidden&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:t.jsx(ZL,{scope:r,placedSide:I,onArrowChange:C,arrowX:q,arrowY:U,shouldHideArrow:z,children:t.jsx(gL.div,{"data-side":I,"data-align":F,...y,ref:w,style:{...y.style,animation:R?void 0:"none"}})})})}));tI.displayName=JL;var nI="PopperArrow",rI={top:"bottom",right:"left",bottom:"top",left:"right"},oI=i.forwardRef((function(e,n){const{__scopePopper:r,...o}=e,i=eI(nI,r),s=rI[i.placedSide];return t.jsx("span",{ref:i.onArrowChange,style:{position:"absolute",left:i.arrowX,top:i.arrowY,[s]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[i.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[i.placedSide],visibility:i.shouldHideArrow?"hidden":void 0},children:t.jsx(BL,{...o,ref:n,style:{...o.style,display:"block"}})})}));function iI(e){return null!==e}oI.displayName=nI;var sI=e=>({name:"transformOrigin",options:e,fn(t){const{placement:n,rects:r,middlewareData:o}=t,i=0!==o.arrow?.centerOffset,s=i?0:e.arrowWidth,a=i?0:e.arrowHeight,[l,c]=aI(n),u={start:"0%",center:"50%",end:"100%"}[c],d=(o.arrow?.x??0)+s/2,p=(o.arrow?.y??0)+a/2;let f="",h="";return"bottom"===l?(f=i?u:`${d}px`,h=-a+"px"):"top"===l?(f=i?u:`${d}px`,h=`${r.floating.height+a}px`):"right"===l?(f=-a+"px",h=i?u:`${p}px`):"left"===l&&(f=`${r.floating.width+a}px`,h=i?u:`${p}px`),{data:{x:f,y:h}}}});function aI(e){const[t,n="center"]=e.split("-");return[t,n]}var lI=YL,cI=XL,uI=tI,dI=oI,pI=i.forwardRef(((e,n)=>{const{container:o,...s}=e,[a,l]=i.useState(!1);FL((()=>l(!0)),[]);const c=o||a&&globalThis?.document?.body;return c?r.createPortal(t.jsx(gL.div,{...s,ref:n}),c):null}));pI.displayName="Portal";var fI=i[" useInsertionEffect ".trim().toString()]||FL;function hI({prop:e,defaultProp:t,onChange:n=()=>{},caller:r}){const[o,s,a]=function({defaultProp:e,onChange:t}){const[n,r]=i.useState(e),o=i.useRef(n),s=i.useRef(t);return fI((()=>{s.current=t}),[t]),i.useEffect((()=>{o.current!==n&&(s.current?.(n),o.current=n)}),[n,o]),[n,r,s]}({defaultProp:t,onChange:n}),l=void 0!==e,c=l?e:o;{const t=i.useRef(void 0!==e);i.useEffect((()=>{const e=t.current;if(e!==l){}t.current=l}),[l,r])}const u=i.useCallback((t=>{if(l){const n=function(e){return"function"==typeof e}(t)?t(e):t;n!==e&&a.current?.(n)}else s(t)}),[l,e,s,a]);return[c,u]}var mI=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"});i.forwardRef(((e,n)=>t.jsx(gL.span,{...e,ref:n,style:{...mI,...e.style}}))).displayName="VisuallyHidden";var gI=[" ","Enter","ArrowUp","ArrowDown"],yI=[" ","Enter"],vI="Select",[bI,xI,wI]=function(e){const r=e+"CollectionProvider",[o,i]=sL(r),[s,a]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:o}=e,i=n.useRef(null),a=n.useRef(new Map).current;return t.jsx(s,{scope:r,itemMap:a,collectionRef:i,children:o})};l.displayName=r;const c=e+"CollectionSlot",u=dL(c),d=n.forwardRef(((e,n)=>{const{scope:r,children:o}=e,i=uL(n,a(c,r).collectionRef);return t.jsx(u,{ref:i,children:o})}));d.displayName=c;const p=e+"CollectionItemSlot",f="data-radix-collection-item",h=dL(p),m=n.forwardRef(((e,r)=>{const{scope:o,children:i,...s}=e,l=n.useRef(null),c=uL(r,l),u=a(p,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)}))),t.jsx(h,{[f]:"",ref:c,children:i})}));return m.displayName=p,[{Provider:l,Slot:d,ItemSlot:m},function(t){const r=a(e+"CollectionConsumer",t);return n.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${f}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},i]}(vI),[SI,CI]=sL(vI,[wI,HL]),kI=HL(),[EI,_I]=SI(vI),[jI,TI]=SI(vI),NI=e=>{const{__scopeSelect:n,children:r,open:o,defaultOpen:s,onOpenChange:a,value:l,defaultValue:c,onValueChange:u,dir:d,name:p,autoComplete:f,disabled:h,required:m,form:g}=e,y=kI(n),[v,b]=i.useState(null),[x,w]=i.useState(null),[S,C]=i.useState(!1),k=function(e){const t=i.useContext(mL);return e||t||"ltr"}(d),[E,_]=hI({prop:o,defaultProp:s??!1,onChange:a,caller:vI}),[j,T]=hI({prop:l,defaultProp:c,onChange:u,caller:vI}),N=i.useRef(null),P=!v||(g||!!v.closest("form")),[D,M]=i.useState(new Set),A=Array.from(D).map((e=>e.props.value)).join(";");return t.jsx(lI,{...y,children:t.jsxs(EI,{required:m,scope:n,trigger:v,onTriggerChange:b,valueNode:x,onValueNodeChange:w,valueNodeHasChildren:S,onValueNodeHasChildrenChange:C,contentId:UL(),value:j,onValueChange:T,open:E,onOpenChange:_,dir:k,triggerPointerDownPosRef:N,disabled:h,children:[t.jsx(bI.Provider,{scope:n,children:t.jsx(jI,{scope:e.__scopeSelect,onNativeOptionAdd:i.useCallback((e=>{M((t=>new Set(t).add(e)))}),[]),onNativeOptionRemove:i.useCallback((e=>{M((t=>{const n=new Set(t);return n.delete(e),n}))}),[]),children:r})}),P?t.jsxs(mF,{"aria-hidden":!0,required:m,tabIndex:-1,name:p,autoComplete:f,value:j,onChange:e=>T(e.target.value),disabled:h,form:g,children:[void 0===j?t.jsx("option",{value:""}):null,Array.from(D)]},A):null]})})};NI.displayName=vI;var PI="SelectTrigger",DI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,disabled:o=!1,...s}=e,a=kI(r),l=_I(PI,r),c=l.disabled||o,u=uL(n,l.onTriggerChange),d=xI(r),p=i.useRef("touch"),[f,h,m]=yF((e=>{const t=d().filter((e=>!e.disabled)),n=t.find((e=>e.value===l.value)),r=vF(t,e,n);void 0!==r&&l.onValueChange(r.value)})),g=e=>{c||(l.onOpenChange(!0),m()),e&&(l.triggerPointerDownPosRef.current={x:Math.round(e.pageX),y:Math.round(e.pageY)})};return t.jsx(cI,{asChild:!0,...a,children:t.jsx(gL.button,{type:"button",role:"combobox","aria-controls":l.contentId,"aria-expanded":l.open,"aria-required":l.required,"aria-autocomplete":"none",dir:l.dir,"data-state":l.open?"open":"closed",disabled:c,"data-disabled":c?"":void 0,"data-placeholder":gF(l.value)?"":void 0,...s,ref:u,onClick:iL(s.onClick,(e=>{e.currentTarget.focus(),"mouse"!==p.current&&g(e)})),onPointerDown:iL(s.onPointerDown,(e=>{p.current=e.pointerType;const t=e.target;t.hasPointerCapture(e.pointerId)&&t.releasePointerCapture(e.pointerId),0===e.button&&!1===e.ctrlKey&&"mouse"===e.pointerType&&(g(e),e.preventDefault())})),onKeyDown:iL(s.onKeyDown,(e=>{const t=""!==f.current;e.ctrlKey||e.altKey||e.metaKey||1!==e.key.length||h(e.key),t&&" "===e.key||gI.includes(e.key)&&(g(),e.preventDefault())}))})})}));DI.displayName=PI;var MI="SelectValue",AI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:i,children:s,placeholder:a="",...l}=e,c=_I(MI,r),{onValueNodeHasChildrenChange:u}=c,d=void 0!==s,p=uL(n,c.onValueNodeChange);return FL((()=>{u(d)}),[u,d]),t.jsx(gL.span,{...l,ref:p,style:{pointerEvents:"none"},children:gF(c.value)?t.jsx(t.Fragment,{children:a}):s})}));AI.displayName=MI;var OI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,children:o,...i}=e;return t.jsx(gL.span,{"aria-hidden":!0,...i,ref:n,children:o||"▼"})}));OI.displayName="SelectIcon";var RI=e=>t.jsx(pI,{asChild:!0,...e});RI.displayName="SelectPortal";var LI="SelectContent",II=i.forwardRef(((e,n)=>{const r=_I(LI,e.__scopeSelect),[o,a]=i.useState();if(FL((()=>{a(new DocumentFragment)}),[]),!r.open){const n=o;return n?s.createPortal(t.jsx($I,{scope:e.__scopeSelect,children:t.jsx(bI.Slot,{scope:e.__scopeSelect,children:t.jsx("div",{children:e.children})})}),n):null}return t.jsx(zI,{...e,ref:n})}));II.displayName=LI;var FI=10,[$I,qI]=SI(LI),UI=dL("SelectContent.RemoveScroll"),zI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,position:o="item-aligned",onCloseAutoFocus:s,onEscapeKeyDown:a,onPointerDownOutside:l,side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v,...b}=e,x=_I(LI,r),[w,S]=i.useState(null),[C,k]=i.useState(null),E=uL(n,(e=>S(e))),[_,j]=i.useState(null),[T,N]=i.useState(null),P=xI(r),[D,M]=i.useState(!1),A=i.useRef(!1);i.useEffect((()=>{if(w)return Yh(w)}),[w]),i.useEffect((()=>{const e=document.querySelectorAll("[data-radix-focus-guard]");return document.body.insertAdjacentElement("afterbegin",e[0]??jL()),document.body.insertAdjacentElement("beforeend",e[1]??jL()),_L++,()=>{1===_L&&document.querySelectorAll("[data-radix-focus-guard]").forEach((e=>e.remove())),_L--}}),[]);const O=i.useCallback((e=>{const[t,...n]=P().map((e=>e.ref.current)),[r]=n.slice(-1),o=document.activeElement;for(const i of e){if(i===o)return;if(i?.scrollIntoView({block:"nearest"}),i===t&&C&&(C.scrollTop=0),i===r&&C&&(C.scrollTop=C.scrollHeight),i?.focus(),document.activeElement!==o)return}}),[P,C]),R=i.useCallback((()=>O([_,w])),[O,_,w]);i.useEffect((()=>{D&&R()}),[D,R]);const{onOpenChange:L,triggerPointerDownPosRef:I}=x;i.useEffect((()=>{if(w){let e={x:0,y:0};const t=t=>{e={x:Math.abs(Math.round(t.pageX)-(I.current?.x??0)),y:Math.abs(Math.round(t.pageY)-(I.current?.y??0))}},n=n=>{e.x<=10&&e.y<=10?n.preventDefault():w.contains(n.target)||L(!1),document.removeEventListener("pointermove",t),I.current=null};return null!==I.current&&(document.addEventListener("pointermove",t),document.addEventListener("pointerup",n,{capture:!0,once:!0})),()=>{document.removeEventListener("pointermove",t),document.removeEventListener("pointerup",n,{capture:!0})}}}),[w,L,I]),i.useEffect((()=>{const e=()=>L(!1);return window.addEventListener("blur",e),window.addEventListener("resize",e),()=>{window.removeEventListener("blur",e),window.removeEventListener("resize",e)}}),[L]);const[F,$]=yF((e=>{const t=P().filter((e=>!e.disabled)),n=t.find((e=>e.ref.current===document.activeElement)),r=vF(t,e,n);r&&setTimeout((()=>r.ref.current.focus()))})),q=i.useCallback(((e,t,n)=>{const r=!A.current&&!n;(void 0!==x.value&&x.value===t||r)&&(j(e),r&&(A.current=!0))}),[x.value]),U=i.useCallback((()=>w?.focus()),[w]),z=i.useCallback(((e,t,n)=>{(void 0!==x.value&&x.value===t||!A.current&&!n)&&N(e)}),[x.value]),B="popper"===o?VI:BI,V=B===VI?{side:c,sideOffset:u,align:d,alignOffset:p,arrowPadding:f,collisionBoundary:h,collisionPadding:m,sticky:g,hideWhenDetached:y,avoidCollisions:v}:{};return t.jsx($I,{scope:r,content:w,viewport:C,onViewportChange:k,itemRefCallback:q,selectedItem:_,onItemLeave:U,itemTextRefCallback:z,focusSelectedItem:R,selectedItemText:T,position:o,isPositioned:D,searchRef:F,children:t.jsx(zh,{as:UI,allowPinchZoom:!0,children:t.jsx(DL,{asChild:!0,trapped:x.open,onMountAutoFocus:e=>{e.preventDefault()},onUnmountAutoFocus:iL(s,(e=>{x.trigger?.focus({preventScroll:!0}),e.preventDefault()})),children:t.jsx(CL,{asChild:!0,disableOutsidePointerEvents:!0,onEscapeKeyDown:a,onPointerDownOutside:l,onFocusOutside:e=>e.preventDefault(),onDismiss:()=>x.onOpenChange(!1),children:t.jsx(B,{role:"listbox",id:x.contentId,"data-state":x.open?"open":"closed",dir:x.dir,onContextMenu:e=>e.preventDefault(),...b,...V,onPlaced:()=>M(!0),ref:E,style:{display:"flex",flexDirection:"column",outline:"none",...b.style},onKeyDown:iL(b.onKeyDown,(e=>{const t=e.ctrlKey||e.altKey||e.metaKey;if("Tab"===e.key&&e.preventDefault(),t||1!==e.key.length||$(e.key),["ArrowUp","ArrowDown","Home","End"].includes(e.key)){let t=P().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=t.indexOf(e.target);t=t.slice(n+1)}setTimeout((()=>O(t))),e.preventDefault()}}))})})})})})}));zI.displayName="SelectContentImpl";var BI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onPlaced:o,...s}=e,a=_I(LI,r),l=qI(LI,r),[c,u]=i.useState(null),[d,p]=i.useState(null),f=uL(n,(e=>p(e))),h=xI(r),m=i.useRef(!1),g=i.useRef(!0),{viewport:y,selectedItem:v,selectedItemText:b,focusSelectedItem:x}=l,w=i.useCallback((()=>{if(a.trigger&&a.valueNode&&c&&d&&y&&v&&b){const e=a.trigger.getBoundingClientRect(),t=d.getBoundingClientRect(),n=a.valueNode.getBoundingClientRect(),r=b.getBoundingClientRect();if("rtl"!==a.dir){const o=n.left-(r.left-t.left),i=e.width+(e.left-o),s=Math.max(i,t.width),a=window.innerWidth-FI,l=oL(o,[FI,Math.max(FI,a-s)]);c.style.minWidth=i+"px",c.style.left=l+"px"}else{const o=window.innerWidth-n.right-(t.right-r.right),i=window.innerWidth-e.right-o,s=e.width+i,a=Math.max(s,t.width),l=window.innerWidth-FI,u=oL(o,[FI,Math.max(FI,l-a)]);c.style.minWidth=s+"px",c.style.right=u+"px"}const i=h(),s=window.innerHeight-2*FI,l=y.scrollHeight,u=window.getComputedStyle(d),p=parseInt(u.borderTopWidth,10),f=parseInt(u.paddingTop,10),g=parseInt(u.borderBottomWidth,10),x=p+f+l+parseInt(u.paddingBottom,10)+g,w=Math.min(5*v.offsetHeight,x),S=window.getComputedStyle(y),C=parseInt(S.paddingTop,10),k=parseInt(S.paddingBottom,10),E=e.top+e.height/2-FI,_=s-E,j=v.offsetHeight/2,T=p+f+(v.offsetTop+j),N=x-T;if(T<=E){const e=i.length>0&&v===i[i.length-1].ref.current;c.style.bottom="0px";const t=Math.max(_,j+(e?k:0)+(d.clientHeight-y.offsetTop-y.offsetHeight)+g);c.style.height=T+t+"px"}else{const e=i.length>0&&v===i[0].ref.current;c.style.top="0px";const t=Math.max(E,p+y.offsetTop+(e?C:0)+j);c.style.height=t+N+"px",y.scrollTop=T-E+y.offsetTop}c.style.margin=`${FI}px 0`,c.style.minHeight=w+"px",c.style.maxHeight=s+"px",o?.(),requestAnimationFrame((()=>m.current=!0))}}),[h,a.trigger,a.valueNode,c,d,y,v,b,a.dir,o]);FL((()=>w()),[w]);const[S,C]=i.useState();FL((()=>{d&&C(window.getComputedStyle(d).zIndex)}),[d]);const k=i.useCallback((e=>{e&&!0===g.current&&(w(),x?.(),g.current=!1)}),[w,x]);return t.jsx(KI,{scope:r,contentWrapper:c,shouldExpandOnScrollRef:m,onScrollButtonChange:k,children:t.jsx("div",{ref:u,style:{display:"flex",flexDirection:"column",position:"fixed",zIndex:S},children:t.jsx(gL.div,{...s,ref:f,style:{boxSizing:"border-box",maxHeight:"100%",...s.style}})})})}));BI.displayName="SelectItemAlignedPosition";var VI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,align:o="start",collisionPadding:i=FI,...s}=e,a=kI(r);return t.jsx(uI,{...a,...s,ref:n,align:o,collisionPadding:i,style:{boxSizing:"border-box",...s.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)"}})}));VI.displayName="SelectPopperPosition";var[KI,HI]=SI(LI,{}),WI="SelectViewport",GI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,nonce:o,...s}=e,a=qI(WI,r),l=HI(WI,r),c=uL(n,a.onViewportChange),u=i.useRef(0);return t.jsxs(t.Fragment,{children:[t.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:o}),t.jsx(bI.Slot,{scope:r,children:t.jsx(gL.div,{"data-radix-select-viewport":"",role:"presentation",...s,ref:c,style:{position:"relative",flex:1,overflow:"hidden auto",...s.style},onScroll:iL(s.onScroll,(e=>{const t=e.currentTarget,{contentWrapper:n,shouldExpandOnScrollRef:r}=l;if(r?.current&&n){const e=Math.abs(u.current-t.scrollTop);if(e>0){const r=window.innerHeight-2*FI,o=parseFloat(n.style.minHeight),i=parseFloat(n.style.height),s=Math.max(o,i);if(s<r){const o=s+e,i=Math.min(r,o),a=o-i;n.style.height=i+"px","0px"===n.style.bottom&&(t.scrollTop=a>0?a:0,n.style.justifyContent="flex-end")}}}u.current=t.scrollTop}))})})]})}));GI.displayName=WI;var YI="SelectGroup",[QI,XI]=SI(YI);i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=UL();return t.jsx(QI,{scope:r,id:i,children:t.jsx(gL.div,{role:"group","aria-labelledby":i,...o,ref:n})})})).displayName=YI;var JI="SelectLabel",ZI=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=XI(JI,r);return t.jsx(gL.div,{id:i.id,...o,ref:n})}));ZI.displayName=JI;var eF="SelectItem",[tF,nF]=SI(eF),rF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,value:o,disabled:s=!1,textValue:a,...l}=e,c=_I(eF,r),u=qI(eF,r),d=c.value===o,[p,f]=i.useState(a??""),[h,m]=i.useState(!1),g=uL(n,(e=>u.itemRefCallback?.(e,o,s))),y=UL(),v=i.useRef("touch"),b=()=>{s||(c.onValueChange(o),c.onOpenChange(!1))};if(""===o)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 t.jsx(tF,{scope:r,value:o,disabled:s,textId:y,isSelected:d,onItemTextChange:i.useCallback((e=>{f((t=>t||(e?.textContent??"").trim()))}),[]),children:t.jsx(bI.ItemSlot,{scope:r,value:o,disabled:s,textValue:p,children:t.jsx(gL.div,{role:"option","aria-labelledby":y,"data-highlighted":h?"":void 0,"aria-selected":d&&h,"data-state":d?"checked":"unchecked","aria-disabled":s||void 0,"data-disabled":s?"":void 0,tabIndex:s?void 0:-1,...l,ref:g,onFocus:iL(l.onFocus,(()=>m(!0))),onBlur:iL(l.onBlur,(()=>m(!1))),onClick:iL(l.onClick,(()=>{"mouse"!==v.current&&b()})),onPointerUp:iL(l.onPointerUp,(()=>{"mouse"===v.current&&b()})),onPointerDown:iL(l.onPointerDown,(e=>{v.current=e.pointerType})),onPointerMove:iL(l.onPointerMove,(e=>{v.current=e.pointerType,s?u.onItemLeave?.():"mouse"===v.current&&e.currentTarget.focus({preventScroll:!0})})),onPointerLeave:iL(l.onPointerLeave,(e=>{e.currentTarget===document.activeElement&&u.onItemLeave?.()})),onKeyDown:iL(l.onKeyDown,(e=>{""!==u.searchRef?.current&&" "===e.key||(yI.includes(e.key)&&b()," "===e.key&&e.preventDefault())}))})})})}));rF.displayName=eF;var oF="SelectItemText",iF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,className:o,style:a,...l}=e,c=_I(oF,r),u=qI(oF,r),d=nF(oF,r),p=TI(oF,r),[f,h]=i.useState(null),m=uL(n,(e=>h(e)),d.onItemTextChange,(e=>u.itemTextRefCallback?.(e,d.value,d.disabled))),g=f?.textContent,y=i.useMemo((()=>t.jsx("option",{value:d.value,disabled:d.disabled,children:g},d.value)),[d.disabled,d.value,g]),{onNativeOptionAdd:v,onNativeOptionRemove:b}=p;return FL((()=>(v(y),()=>b(y))),[v,b,y]),t.jsxs(t.Fragment,{children:[t.jsx(gL.span,{id:d.textId,...l,ref:m}),d.isSelected&&c.valueNode&&!c.valueNodeHasChildren?s.createPortal(l.children,c.valueNode):null]})}));iF.displayName=oF;var sF="SelectItemIndicator",aF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return nF(sF,r).isSelected?t.jsx(gL.span,{"aria-hidden":!0,...o,ref:n}):null}));aF.displayName=sF;var lF="SelectScrollUpButton",cF=i.forwardRef(((e,n)=>{const r=qI(lF,e.__scopeSelect),o=HI(lF,e.__scopeSelect),[s,a]=i.useState(!1),l=uL(n,o.onScrollButtonChange);return FL((()=>{if(r.viewport&&r.isPositioned){let e=function(){a(t.scrollTop>0)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(pF,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop-t.offsetHeight)}}):null}));cF.displayName=lF;var uF="SelectScrollDownButton",dF=i.forwardRef(((e,n)=>{const r=qI(uF,e.__scopeSelect),o=HI(uF,e.__scopeSelect),[s,a]=i.useState(!1),l=uL(n,o.onScrollButtonChange);return FL((()=>{if(r.viewport&&r.isPositioned){let e=function(){const e=t.scrollHeight-t.clientHeight,n=Math.ceil(t.scrollTop)<e;a(n)};const t=r.viewport;return e(),t.addEventListener("scroll",e),()=>t.removeEventListener("scroll",e)}}),[r.viewport,r.isPositioned]),s?t.jsx(pF,{...e,ref:l,onAutoScroll:()=>{const{viewport:e,selectedItem:t}=r;e&&t&&(e.scrollTop=e.scrollTop+t.offsetHeight)}}):null}));dF.displayName=uF;var pF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,onAutoScroll:o,...s}=e,a=qI("SelectScrollButton",r),l=i.useRef(null),c=xI(r),u=i.useCallback((()=>{null!==l.current&&(window.clearInterval(l.current),l.current=null)}),[]);return i.useEffect((()=>()=>u()),[u]),FL((()=>{const e=c().find((e=>e.ref.current===document.activeElement));e?.ref.current?.scrollIntoView({block:"nearest"})}),[c]),t.jsx(gL.div,{"aria-hidden":!0,...s,ref:n,style:{flexShrink:0,...s.style},onPointerDown:iL(s.onPointerDown,(()=>{null===l.current&&(l.current=window.setInterval(o,50))})),onPointerMove:iL(s.onPointerMove,(()=>{a.onItemLeave?.(),null===l.current&&(l.current=window.setInterval(o,50))})),onPointerLeave:iL(s.onPointerLeave,(()=>{u()}))})})),fF=i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e;return t.jsx(gL.div,{"aria-hidden":!0,...o,ref:n})}));fF.displayName="SelectSeparator";var hF="SelectArrow";i.forwardRef(((e,n)=>{const{__scopeSelect:r,...o}=e,i=kI(r),s=_I(hF,r),a=qI(hF,r);return s.open&&"popper"===a.position?t.jsx(dI,{...i,...o,ref:n}):null})).displayName=hF;var mF=i.forwardRef((({__scopeSelect:e,value:n,...r},o)=>{const s=i.useRef(null),a=uL(o,s),l=function(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}(n);return i.useEffect((()=>{const e=s.current;if(!e)return;const t=window.HTMLSelectElement.prototype,r=Object.getOwnPropertyDescriptor(t,"value").set;if(l!==n&&r){const t=new Event("change",{bubbles:!0});r.call(e,n),e.dispatchEvent(t)}}),[l,n]),t.jsx(gL.select,{...r,style:{...mI,...r.style},ref:a,defaultValue:n})}));function gF(e){return""===e||void 0===e}function yF(e){const t=yL(e),n=i.useRef(""),r=i.useRef(0),o=i.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]),s=i.useCallback((()=>{n.current="",window.clearTimeout(r.current)}),[]);return i.useEffect((()=>()=>window.clearTimeout(r.current)),[]),[n,o,s]}function vF(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0]))?t[0]:t,o=n?e.indexOf(n):-1;let i=(s=e,a=Math.max(o,0),s.map(((e,t)=>s[(a+t)%s.length])));var s,a;1===r.length&&(i=i.filter((e=>e!==n)));const l=i.find((e=>e.textValue.toLowerCase().startsWith(r.toLowerCase())));return l!==n?l:void 0}mF.displayName="SelectBubbleInput";var bF=DI,xF=OI,wF=RI,SF=II,CF=GI,kF=ZI,EF=rF,_F=iF,jF=aF,TF=cF,NF=dF,PF=fF;const DF=NI,MF=AI,AF=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(bF,{ref:o,className:_d("flex h-9 w-full items-center justify-between whitespace-nowrap rounded-md border border-input bg-border/10 px-3 py-2 text-sm shadow-sm ring-offset-background !placeholder:text-muted-foreground focus:outline-none focus:ring-1 focus:ring-ring disabled:cursor-not-allowed disabled:opacity-50 [&>span]:line-clamp-1",e),...r,children:[n,t.jsx(xF,{asChild:!0,children:t.jsx(Jc,{className:"h-4 w-4 opacity-50"})})]})));AF.displayName=bF.displayName;const OF=i.forwardRef((({className:e,...n},r)=>t.jsx(TF,{ref:r,className:_d("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(tu,{className:"h-4 w-4"})})));OF.displayName=TF.displayName;const RF=i.forwardRef((({className:e,...n},r)=>t.jsx(NF,{ref:r,className:_d("flex cursor-default items-center justify-center py-1",e),...n,children:t.jsx(Jc,{className:"h-4 w-4"})})));RF.displayName=NF.displayName;const LF=i.forwardRef((({className:e,children:n,position:r="popper",...o},i)=>t.jsx(wF,{children:t.jsxs(SF,{ref:i,className:_d("relative z-50 max-h-96 min-w-[8rem] overflow-hidden rounded-md border bg-popover text-popover-foreground 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","popper"===r&&"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:r,...o,children:[t.jsx(OF,{}),t.jsx(CF,{className:_d("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)]"),children:n}),t.jsx(RF,{})]})})));LF.displayName=SF.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(kF,{ref:r,className:_d("px-2 py-1.5 text-sm font-semibold text-muted-foreground",e),...n}))).displayName=kF.displayName;const IF=i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(EF,{ref:o,className:_d("relative flex w-full cursor-default select-none items-center rounded-sm py-1.5 pl-2 pr-8 text-sm outline-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute right-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(jF,{children:t.jsx(Xc,{className:"h-4 w-4"})})}),t.jsx(_F,{children:n})]})));IF.displayName=EF.displayName;function FF(e){const t=i.useRef({value:e,previous:e});return i.useMemo((()=>(t.current.value!==e&&(t.current.previous=t.current.value,t.current.value=e),t.current.previous)),[e])}i.forwardRef((({className:e,...n},r)=>t.jsx(PF,{ref:r,className:_d("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=PF.displayName;var $F="Switch",[qF,UF]=s_($F),[zF,BF]=qF($F),VF=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,name:o,checked:s,defaultChecked:a,required:l,disabled:c,value:u="on",onCheckedChange:d,form:p,...f}=e,[h,m]=i.useState(null),g=uf(n,(e=>m(e))),y=i.useRef(!1),v=!h||(p||!!h.closest("form")),[b=!1,x]=DT({prop:s,defaultProp:a,onChange:d});return t.jsxs(zF,{scope:r,checked:b,disabled:c,children:[t.jsx(f_.button,{type:"button",role:"switch","aria-checked":b,"aria-required":l,"data-state":GF(b),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:g,onClick:i_(e.onClick,(e=>{x((e=>!e)),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())}))}),v&&t.jsx(WF,{control:h,bubbles:!y.current,name:o,value:u,checked:b,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"}})]})}));VF.displayName=$F;var KF="SwitchThumb",HF=i.forwardRef(((e,n)=>{const{__scopeSwitch:r,...o}=e,i=BF(KF,r);return t.jsx(f_.span,{"data-state":GF(i.checked),"data-disabled":i.disabled?"":void 0,...o,ref:n})}));HF.displayName=KF;var WF=e=>{const{control:n,checked:r,bubbles:o=!0,...s}=e,a=i.useRef(null),l=FF(r),c=iT(n);return i.useEffect((()=>{const e=a.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(l!==r&&n){const t=new Event("click",{bubbles:o});n.call(e,r),e.dispatchEvent(t)}}),[l,r,o]),t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:r,...s,tabIndex:-1,ref:a,style:{...e.style,...c,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function GF(e){return e?"checked":"unchecked"}var YF=VF,QF=HF;const XF=i.forwardRef((({className:e,...n},r)=>t.jsx(YF,{className:_d("peer inline-flex h-5 w-9 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent shadow-sm transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input/50",e),...n,ref:r,children:t.jsx(QF,{className:_d("pointer-events-none block h-4 w-4 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-4 data-[state=unchecked]:translate-x-0")})})));XF.displayName=YF.displayName;var JF=(e=>(e.DAYS="days",e))(JF||{});const ZF=e=>!("number"!=typeof e.value||e.value<0)&&(e.unit===JF.DAYS&&(("before"===e.direction||"after"===e.direction)&&"relative"===e.type)),e$=({fieldType:e,operator:n,value:r,onChange:o,options:s,toast:a,metadata:l})=>{const c=r.length>0&&"object"==typeof r[0]&&"type"in r[0]&&"relative"===r[0].type,[u,d]=i.useState((e===RP.Date||e===RP.DateTime)&&r.length>0&&r[0]instanceof Date?r[0]:void 0),[p,f]=i.useState(c),[h,m]=i.useState(c?r[0]:{type:"relative",value:0,unit:JF.DAYS,direction:"before"});if(i.useEffect((()=>{n!==IP.EQUALS_MONTH_DAY&&n!==IP.EQUALS_MONTH_DAY_YEAR&&p&&(f(!1),o(u?[u]:[]))}),[n,p,u,o]),e===RP.String||e===RP.ReachResource||e===RP.Array)return n===IP.EXISTS?null:t.jsx(rL,{maxCount:2,options:(s||[]).map((e=>({label:e.displayName,value:e.id}))),value:r.map((e=>{const t=(s||[]).find((t=>t.id===String(e)||t.displayName===String(e)||t.id===t.displayName&&t.id===String(e)));return t?.id||String(e)})),onValueChange:e=>{o(e)},selectedValues:r.map((e=>{const t=(s||[]).find((t=>t.id===String(e)||t.displayName===String(e)||t.id===t.displayName&&t.id===String(e)));return t?.id||String(e)})),setSelectedValues:e=>{o(e)},searchPlaceholder:"Enter new value",emptyMessage:"Press enter to add new value",handleSearchInput:e=>{if(e.length>0){const t=(e=>{const{value:t,type:n}=e;switch(n){case RP.ReachResource:case RP.Array:case RP.String:return t.length>0;case RP.Number:return!isNaN(Number(t));case RP.Integer:return!isNaN(Number(t))&&Number(t)%1==0;case RP.Boolean:return"true"===t||"false"===t;case RP.Date:case RP.DateTime:return!isNaN(new Date(t).getTime());default:throw hk(n,RP)}})({value:e,type:l.type});t?o([...new Set([...r,e])]):a({title:"Invalid value",description:`Please enter a valid value for this field. The value must be a ${l.type} type`,variant:"destructive"})}}});if(e===RP.Date||e===RP.DateTime){const e=n===IP.EQUALS_MONTH_DAY||n===IP.EQUALS_MONTH_DAY_YEAR,r=e=>{ZF(e)?(m(e),p&&o([e])):a({title:"Invalid relative date",description:"Please enter a valid non-negative number of days.",variant:"destructive"})},i=e=>{e&&(e=>e instanceof Date?!isNaN(e.getTime()):"object"==typeof e&&"type"in e&&"relative"===e.type&&ZF(e))(e)?(d(e),o([e]),f(!1)):e||(d(void 0),o([]),f(!1))},s=e=>{f(e),o(e?[h]:u?[u]:[])};return t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsxs("div",{className:"min-h-[36px] flex items-center",children:[" ",(!p||!e)&&t.jsxs(VM,{modal:!0,children:[t.jsx(KM,{asChild:!0,children:t.jsxs(nk,{variant:"outline",className:_d("w-[200px] justify-start text-left font-normal h-9",!u&&"text-muted-foreground"),children:[t.jsx(Qc,{className:"mr-2 h-4 w-4"}),u?hP(u,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(HM,{className:"w-auto p-0",align:"start",children:t.jsx(KR,{mode:"single",selected:u,onSelect:i,initialFocus:!0})})]}),e&&p&&t.jsxs("div",{className:"flex items-center space-x-2",children:[t.jsx(mk,{type:"number",value:h.value,onChange:e=>{const t=parseInt(e.target.value,10),n=isNaN(t)||t<0?0:t;r({...h,value:n})},className:"w-20 h-9",min:"0","aria-label":"Relative days value"}),t.jsxs(DF,{value:h.direction,onValueChange:e=>{r({...h,direction:e})},children:[t.jsx(AF,{className:"w-[180px] h-9","aria-label":"Relative direction",children:t.jsx(MF,{placeholder:"Select direction..."})}),t.jsxs(LF,{children:[t.jsx(IF,{value:"before",children:"days before today"}),t.jsx(IF,{value:"after",children:"days after today"})]})]})]})]}),e&&t.jsxs("div",{className:"flex items-center space-x-1 pl-1",children:[t.jsx(XF,{id:"relative-date-switch",checked:p,onCheckedChange:s,"aria-label":"Toggle relative date input"}),t.jsx(XP,{htmlFor:"relative-date-switch",className:"text-xs font-normal text-muted-foreground cursor-pointer",children:"Relative"})]})]})}if(e===RP.Number||e===RP.Integer)return n===IP.EXISTS?null:t.jsx(mk,{type:"number",value:r.length>0?String(r[0]):"",onChange:e=>o([Number(e.target.value)]),className:"w-[200px]"});if(e===RP.Boolean){if(n===IP.EXISTS)return null;const e=r.length>0&&Boolean(r[0]);return t.jsx(XF,{checked:e,onCheckedChange:e=>o([e])})}return t.jsx(mk,{value:r.length>0?String(r[0]):"",onChange:e=>o([e.target.value]),className:"w-[200px]",disabled:!0})},t$=({condition:e,onUpdate:n,onDuplicate:r,onDelete:o,segmentsConditions:i})=>{const{toast:s}=wl(),a=(e=>{const t=i.conditions.find((t=>t.field===e));return t||null})(e.field)||{operators:[],type:RP.String,options:void 0,itemType:void 0},l=a.operators,c=a.type,u=i.conditions.map((e=>e.field)).map((e=>({value:e,label:ZP[e]||e})));return t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[t.jsx(WM,{options:u,value:e.field,onChange:t=>{const r=t,o=i.conditions.find((e=>e.field===r));if(!o)return;const s=o.operators.map((e=>({value:e,label:JP[e]||e,fieldType:o.type}))),a=s[0]?.value;let l=[];switch(o.type){case RP.Boolean:l=[!1];break;case RP.Number:l=[0];break;case RP.Date:case RP.DateTime:l=[new Date];break;case RP.String:l=o.options?.length?o.options.map((e=>e.displayName)):[];break;default:l=[]}n({...e,field:r,operator:a,value:l})},placeholder:"Select field"}),t.jsx(WM,{options:l.map((e=>({value:e,label:JP[e]||e}))),value:e.operator,onChange:t=>n({...e,operator:t}),placeholder:"Select operator"}),t.jsx("div",{className:"max-w-2xl w-full overflow-hidden",children:t.jsx(e$,{fieldType:c,operator:e.operator,options:"string"==typeof e.value[0]&&e.value[0]&&Array.isArray(a.options)?[...(a.options||[]).map((e=>({displayName:e.displayName,id:e.id}))),...e.value.filter((e=>!a.options?.some((t=>t.id===e||t.displayName===e)))).map((e=>({displayName:e,id:e})))]:a.options?.map((e=>({displayName:e.displayName,id:e.id}))),value:e.value,onChange:t=>n({...e,value:t}),toast:s,metadata:{field:e.field,type:c,itemType:a.itemType}})})]}),t.jsxs("div",{className:"flex items-center",children:[t.jsx(nk,{size:"icon",variant:"ghost",onClick:r,children:t.jsx(au,{className:"h-4 w-4"})}),t.jsx(nk,{size:"icon",variant:"ghost",onClick:o,children:t.jsx(Eu,{className:"h-4 w-4"})})]})]})},n$=({onSelectStyle:e})=>{const[r,o]=n.useState(null);return t.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 p-4 max-w-4xl mx-auto",children:[t.jsx(ik,{onClick:()=>{o("ai"),e("ai")},title:"Build with AI",subtitle:"Describe your audience in plain language and let AI create the conditions",icon:t.jsx("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:t.jsx("div",{className:"w-6 h-6 text-[hsl(var(--reach-primary))]",children:t.jsx(ku,{className:"w-full h-full"})})}),selected:"ai"===r}),t.jsx(ik,{onClick:()=>{o("manual"),e("manual")},title:"Build Manually",subtitle:`Create your ${Fp("engage:segment")} by configuring conditions directly`,icon:t.jsx("div",{className:"h-12 w-12 rounded-full bg-primary/10 flex items-center justify-center",children:t.jsx("div",{className:"w-6 h-6 text-[hsl(var(--reach-primary))]",children:t.jsx(Su,{className:"w-full h-full"})})}),selected:"manual"===r})]})},r$=({segmentId:e,setOpen:n,setTextToSegment:r,promptBuilderStyle:o,textToSegment:i})=>t.jsx("div",{children:t.jsx(qm,{className:"",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx(Um,{className:"text-3xl font-normal",children:e?`Edit ${Fp("engage:segment")}`:`Create ${Fp("engage:segment")}`}),t.jsxs("div",{className:"flex items-center gap-2",children:[!1===o&&!1===i&&t.jsx(lN,{children:t.jsxs(cN,{children:[t.jsx(uN,{asChild:!0,children:t.jsx(nk,{variant:"outline",size:"sm",onClick:()=>r(!0),children:t.jsx(ku,{className:"h-4 w-3"})})}),t.jsx(dN,{children:t.jsxs("p",{children:["Use AI to create ",Fp("engage:segment")," by describing them in natural language"]})})]})}),t.jsx(nk,{variant:"ghost",size:"icon",onClick:()=>{!0===i?r(!1):n(!1)},className:"h-8 w-8",children:t.jsx(Mu,{className:"h-4 w-4"})})]})]})})}),o$=({setTextToSegment:e,setSegment:r})=>{const[o,i]=n.useState(""),[s,l]=n.useState(!1),{toast:c}=wl();return t.jsxs("div",{className:"flex flex-col gap-6 p-4",children:[t.jsxs("div",{className:"space-y-2",children:[t.jsx("h3",{className:"text-lg font-semibold text-foreground",children:"Describe your audience"}),t.jsx("p",{className:"text-sm text-muted-foreground",children:"Describe the audience you want to target in plain language, and our AI will create the conditions for you."})]}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(ng,{children:[s&&t.jsx(JC,{children:t.jsx(XC,{})}),!s&&t.jsx(JC,{children:t.jsx(gk,{placeholder:"Describe your target audience...",className:"min-h-[120px] resize-none",value:o,onChange:e=>i(e.target.value)})})]}),t.jsx("div",{className:"flex justify-end gap-2",children:t.jsxs(nk,{onClick:async()=>{if(!o)return void c({title:"Please enter a description",description:"Please enter a description of your target audience",variant:"destructive"});l(!0);const t=await(async e=>(await Ee(`${a}/text-to-segment`,{method:"POST",body:JSON.stringify({text:e})})).data)(o);t.success&&t.conditions?(c({title:`${Fp("engage:segment")} conditions built successfully 🚀`,description:`Your ${Fp("engage:segment")} conditions have been built successfully`}),r(t.conditions)):c({title:`${Fp("engage:segment")} build failed`,description:"Please try again",variant:"destructive"}),e(!1),l(!1)},children:[t.jsx(ku,{className:"h-4 w-4"}),"Generate ",Fp("engage:segment")]})})]})]})};function i$({segmentId:e,setOpen:n,onSegmentUpdated:r}){const{toast:o}=wl(),s=void 0===e,[a,l]=i.useState(!1),[c,u]=i.useState({version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[]}),{segment:d,isLoading:p}=qP(e||""),{updateSegment:f}=UP(e),{createSegment:h,isCreating:m,segmentsConditions:g}=FP(),[y,v]=i.useState(!1),[b,x]=i.useState(!!s);i.useEffect((()=>{g&&u(d?{version:"1.0",id:d.id,name:d.name,description:d.description,logic:"AND",conditions:d.conditions}:{version:"1.0",id:"",name:"",description:"",logic:"AND",conditions:[{field:g.conditions[0].field,operator:g.conditions[0].operators[0],value:[]}]})}),[d,g]);const w=e=>e.value.some((e=>"object"==typeof e&&"type"in e&&"relative"===e.type));if(!g||p)return t.jsx("div",{className:"flex h-full items-center justify-center",children:t.jsx(XC,{})});return t.jsx(t.Fragment,{children:t.jsxs(ng,{children:[t.jsx(r$,{segmentId:e,setOpen:n,setTextToSegment:v,promptBuilderStyle:b,textToSegment:y},"segment-builder-header"),b?t.jsx(JC,{children:t.jsx(n$,{onSelectStyle:e=>{"ai"===e&&v(!0),x(!1)}})},"prompt-builder-style"):t.jsx(JC,{children:t.jsxs("div",{className:"flex flex-1 flex-col overflow-hidden",children:[t.jsx("div",{className:"flex flex-1 flex-col overflow-hidden px-8 py-2",children:t.jsx("div",{className:"flex flex-1 flex-col gap-4 overflow-visible",children:t.jsx(ng,{children:y?t.jsx(JC,{children:t.jsx(o$,{setTextToSegment:v,setSegment:e=>u({...c,conditions:e})})}):t.jsxs(JC,{children:[t.jsxs("div",{className:"mb-6 grid grid-cols-2 gap-2",children:[t.jsxs("div",{className:"grid gap-2",children:[t.jsx(XP,{className:"text-muted-foreground text-xs",children:"Name"}),t.jsx(mk,{placeholder:`${Fp("engage:segment")} name`,value:c.name,onChange:e=>u({...c,name:e.target.value})})]}),t.jsxs("div",{className:"grid gap-2",children:[t.jsx(XP,{className:"text-muted-foreground text-xs",children:"Description"}),t.jsx(mk,{placeholder:`${Fp("engage:segment")} description`,value:c.description,onChange:e=>u({...c,description:e.target.value})})]})]}),c.conditions.length>0&&t.jsx("div",{className:"flex-1 overflow-y-auto pb-8",children:t.jsx("div",{className:"grid",children:t.jsx(ng,{mode:"popLayout",children:c.conditions.map(((e,n)=>t.jsxs(qC.div,{initial:{opacity:0,x:-20},animate:{opacity:1,x:0},exit:{opacity:0,x:20},transition:{type:"spring",stiffness:300,damping:30,mass:.5},children:[n>0&&t.jsxs(qC.div,{className:"relative flex items-center gap-3 py-1",initial:{opacity:0},animate:{opacity:1},transition:{delay:.1},children:[t.jsx(qC.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}}),t.jsx(qC.span,{className:"text-muted-foreground text-xs",initial:{opacity:0},animate:{opacity:1},transition:{delay:.2},children:"AND"}),t.jsx(qC.div,{className:"h-px flex-1 bg-border",initial:{scaleX:0},animate:{scaleX:1},transition:{type:"spring",stiffness:300,damping:30,mass:.5}})]}),t.jsx(t$,{condition:e,onUpdate:e=>((e,t)=>{const n=[...c.conditions];n[e]=t,u({...c,conditions:n})})(n,e),segmentsConditions:g,onDuplicate:()=>(e=>{const t=[...c.conditions];t.splice(e+1,0,{...c.conditions[e]}),u({...c,conditions:t})})(n),onDelete:()=>(e=>{const t=c.conditions.filter(((t,n)=>n!==e));u({...c,conditions:t})})(n)})]},n)))})})})]})})})}),t.jsx("div",{className:"border-t px-8 py-4",children:t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs(nk,{variant:"secondary",onClick:()=>{u({...c,conditions:[...c.conditions,{field:g.conditions[0].field,operator:g.conditions[0].operators[0],value:[]}]})},children:[t.jsx(bu,{className:"h-4 w-4"}),"Add Condition"]}),t.jsxs("div",{className:"flex gap-2",children:[t.jsx(nk,{variant:"secondary",onClick:()=>n(!1),children:"Cancel"}),t.jsx(nk,{variant:"secondary",onClick:async()=>{if(!c.name||!c.description)return void o({title:"Name and description are required",description:"Please ensure all fields are filled out",variant:"destructive"});const{valid:t,error:i}=(e=>{for(const t of e){if(!t.field||!t.operator)return{valid:!1,error:"Please ensure all fields are filled out"};if(t.operator!==IP.EXISTS&&0===t.value.length)return{valid:!1,error:`Please ensure a value is selected for ${t.field}`};if(t.operator===IP.EXISTS&&t.value.length>0)return{valid:!1,error:"EXISTS operator can only be used with an empty array"};if(w(t)&&t.operator!==IP.EQUALS_MONTH_DAY&&t.operator!==IP.EQUALS_MONTH_DAY_YEAR)return{valid:!1,error:"Relative dates can only be used with the month and day or month, day, and year operator"}}return{valid:!0,error:void 0}})(c.conditions);if(t){l(!0);try{e&&d?f({name:c.name,description:c.description,conditions:c.conditions},{onSuccess:()=>{o({title:"Segment updated successfully"}),n(!1),r?.(c.id)},onError:()=>{o({title:"Error updating segment",description:"Please try again",variant:"destructive"}),r?.("error")}}):h({name:c.name,description:c.description,conditions:c.conditions},{onSuccess:()=>{o({title:"Segment created successfully"}),n(!1),r?.(c.id)},onError:()=>{o({title:"Error creating segment",description:"Please try again",variant:"destructive"}),r?.("error")}})}catch(s){o({title:"Error saving segment",description:"Please try again",variant:"destructive"}),r?.("error")}finally{l(!1)}}else o({title:"Conditions are invalid",description:i??"Please ensure all fields are filled out",variant:"destructive"})},disabled:a||m,children:a||m?t.jsxs(t.Fragment,{children:[t.jsx(du,{className:"mr-2 h-4 w-4 animate-spin"}),e?"Updating...":"Creating..."]}):e?"Update":"Create"})]})]})})]})},"manual-builder-style")]})})}function s$({open:e,setOpen:n,segmentId:r,onSegmentUpdated:o}){return t.jsx(Lm,{open:e,onOpenChange:n,children:t.jsxs($m,{className:"flex max-h-[86vh] flex-col gap-0 overflow-visible max-w-5xl w-full",hideCloseButton:!0,children:[t.jsxs(gf,{children:[t.jsxs(Um,{children:[Fp("engage:segment")," Builder"]}),t.jsxs(zm,{children:["Build a ",Fp("engage:segment")," to target your audience"]})]}),t.jsx(i$,{segmentId:r,setOpen:n,onSegmentUpdated:e=>{o?.(e),n(!1)}})]})})}const a$=()=>{const[e,r]=n.useState(""),{toast:o}=wl(),[i,s]=n.useState(!1),[a,l]=n.useState(null),c=e=>{const n={[LP.ALL_USERS]:{className:"bg-green-100 text-green-700",label:"All Users"},[LP.CUSTOM]:{className:"bg-purple-100 text-purple-700",label:"Custom"}},r=n[e]||n[LP.CUSTOM];return t.jsx(jP,{variant:"outline",className:`${r.className} font-medium`,children:r.label})};return t.jsxs("div",{className:"space-y-4",children:[t.jsx(s$,{open:i,setOpen:s,segmentId:a??void 0}),t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsxs("div",{className:"relative",children:[t.jsx(xu,{className:"absolute left-2.5 top-2.5 h-4 w-4 text-muted-foreground"}),t.jsx(mk,{placeholder:"Search segments...",value:e,onChange:e=>r(e.target.value),className:"focus-visible:ring-2 pl-9"})]}),t.jsx("div",{className:"ml-auto flex items-center gap-2"}),t.jsx("div",{className:"ml-auto flex items-center gap-2",children:t.jsxs(nk,{variant:"outline",onClick:()=>s(!0),children:[t.jsx(bu,{}),"Create New ",Fp("engage:segment")]})})]}),t.jsx(kP,{columns:[{header:"Name",accessorKey:"name",width:"50%",cell:(e,n)=>t.jsx("div",{className:"flex items-center gap-3",children:t.jsxs("div",{className:"flex flex-col",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("span",{className:"font-medium text-foreground",children:e}),c(n.type)]}),t.jsx("span",{className:"text-sm text-muted-foreground truncate max-w-[300px]",children:n.description})]})})},{header:"Users",accessorKey:"user_count",width:"25%",cell:e=>t.jsxs("div",{className:"text-muted-foreground",children:[e.toLocaleString()," ",1===e?"user":"users"]})},{header:"Modified",accessorKey:"user_count_updated_at",width:"25%",cell:e=>t.jsx("div",{className:"text-muted-foreground",children:e?gP(new Date(e),{addSuffix:!0}):"Not available"})}],fetchData:async({cursor:t,limit:n})=>{const r=await OP({cursor:t,limit:n,search:e||void 0});return{items:r.results,cursor:r.pagination.cursor??void 0}},itemsPerPage:5,emptyState:{icon:t.jsx("div",{className:"i-heroicons-user-group h-12 w-12 text-muted-foreground"}),title:"No Segments Found",description:"Create your first segment to get started."},onRowClick:e=>{e.type===LP.CUSTOM?(l(e.id),s(!0)):o({title:"This segment is not editable",description:"Only custom segments can be edited",variant:"destructive"})},className:"rounded-lg bg-white"})]})},l$=({iconDefinitions:e})=>{const r=bE(),o=ek(e),[i,s]=n.useState("automations"),a=[{id:"automations",label:`${Fp("engage:automation",{count:2})}`,content:t.jsx(AP,{onViewAutomation:e=>{r(`/automations/view-modal/${e}?showBackButton=true`)},iconDefinitions:o})},{id:"segments",label:`${Fp("engage:segment",{count:2})}`,content:t.jsx(a$,{})}];return t.jsxs("div",{className:"h-full container max-w-screen-xl mx-auto flex flex-col",children:[t.jsx(mN,{iconDefinitions:o}),t.jsx("div",{className:"flex-1",children:t.jsx(o_,{tabs:a,activeTab:i,onTabChange:e=>s(e)})})]})},c$=e=>{const t=me({queryKey:["communication-group",e],queryFn:()=>e?(async e=>(await Ee(`${u}/${e}`)).data)(e):null,enabled:!!e});return{communicationGroup:t.data,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},u$=()=>{const e=ae(),t=ge({mutationFn:({groupId:e,params:t})=>(async(e,t)=>(await Ee(`${u}/${e}`,{method:"PATCH",body:JSON.stringify(t)})).data)(e,t),onSuccess:()=>{e.invalidateQueries({queryKey:["communication-group"]})}});return{updateCommunicationGroup:t.mutate,isUpdating:t.isPending,updateError:t.error,isUpdateSuccess:t.isSuccess}},d$=e=>{const t=me({queryKey:["merge-fields",e],queryFn:()=>(async e=>{if(!e)return{mergeFields:[]};return(await Ee(`${u}/${e}/merge-fields`)).data})(e)});return{getMergeFields:t.data,isGetting:t.isPending,getError:t.error,isGetSuccess:t.isSuccess}},p$=()=>{const e=ge({mutationFn:({id:e,params:t})=>(async(e,t)=>(await Ee(`${u}/${e}/test`,{method:"POST",body:JSON.stringify(t)})).data)(e,t)});return{sendTestCommunication:e.mutate,isSending:e.isPending,sendError:e.error,isSendSuccess:e.isSuccess}};var f$=(e=>(e[e.SelectTrigger=0]="SelectTrigger",e[e.SelectAudience=1]="SelectAudience",e[e.SelectCommunication=2]="SelectCommunication",e[e.PreviewAndSchedule=3]="PreviewAndSchedule",e))(f$||{});const h$=(e,t)=>{const r=n.useRef(!0),[o,i]=n.useState(!1),{automation:s,isLoading:a,invalidateAutomation:l}=je(e),c=s,{updateAutomation:u,isUpdating:d}=Pe(e),p=c?.action_data?.find((e=>"send_communication"===e.action_type))?.action_metadata.communication_group_id,{communicationGroup:f,isGetting:h}=c$(p||void 0),{updateCommunicationGroup:m,isUpdating:g}=u$(),{estimatedMatchesStats:y}=(e=>{const{data:t}=$P({include_segments:e?.includeSegmentIds??[],exclude_segments:e?.excludeSegmentIds??[]}),r=n.useMemo((()=>t?.recipients?t.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[t?.recipients]);return{estimatedMatches:t,estimatedMatchesStats:r}})(c),[v,b]=n.useState(!1),[x,w]=n.useState(!1),S=n.useCallback((()=>{l()}),[l]);n.useEffect((()=>{w((a||d||h||v||g||o)&&r.current)}),[t,s,a,d,h,v,g,o]),n.useEffect((()=>()=>{r.current=!1}),[]);const C=n.useCallback((async e=>{if(!c)return{canMove:!1,errorMessage:"Automation not loaded"};try{return b(!0),await(async e=>{const{currentStep:t,automation:n,communicationGroup:r}=e;if(0===t)return{canMove:!0,errorMessage:null};if(1===t)return{canMove:n.includeSegmentIds.length>0,errorMessage:"Please ensure you have selected at least one segment"};if(2===t){const e=n.action_data?.find((e=>"send_communication"===e.action_type));if(!e)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};if(!r||!r.sms_channel_sender_id&&!r.email_channel_sender_id)return{canMove:!1,errorMessage:"Please ensure you have selected either a email communication or text communication"};if(r.email_channel_sender_id&&(!r.email_html_body||!r.email_subject))return{canMove:!1,errorMessage:"Please ensure you have a email body and subject"};if(r.sms_channel_sender_id&&!r.sms_message_body)return{canMove:!1,errorMessage:"Please ensure you have a sms message body"}}if(3===t){if(Ae(n.trigger_metadata)){const e=n.trigger_metadata;return{canMove:Boolean(e.scheduled_at&&new Date(e.scheduled_at)>new Date&&n.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id))),errorMessage:"Please ensure you have set a valid future date for your one-time automation"}}return{canMove:Boolean(n.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id))),errorMessage:null}}return{canMove:!0,errorMessage:null}})({currentStep:e,automation:c,communicationGroup:f})}finally{r.current&&b(!1)}}),[c,f]),k=n.useCallback((e=>{r.current&&i(e)}),[]);return{automation:c,updateAutomation:u,communicationGroup:f,updateCommunicationGroup:m,isLoading:x,setIsLoading:k,invalidateAutomation:S,validateStep:C,estimatedMatchesStats:y}},m$=()=>{const e=me({queryKey:["channel-senders"],queryFn:()=>(async()=>(await Ee(`${c}`,{method:"GET"})).data)()});return{channelSenders:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelSenders:e.refetch}},g$=()=>{const e=ae(),t=ge({mutationFn:e=>(async(e,t)=>(await Ee(`${c}/${t}`,{method:"PATCH",body:JSON.stringify(e)})).data)(e.toUpdate,e.id),onSuccess:()=>{e.invalidateQueries({queryKey:["channel-senders"]})}});return{updateChannelSender:t.mutate,isUpdating:t.isPending,updateError:t.error}},y$=e=>e.friendlyName||e.from||e.messageServiceSid||"Unknown Sender",v$=({type:e})=>t.jsxs("div",{className:"w-full h-full min-h-[300px] flex flex-col items-center justify-center bg-gradient-to-b from-gray-50 to-white p-8",children:[t.jsx("div",{className:"mb-4 text-gray-300",children:t.jsx("svg",{className:"w-16 h-16",fill:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{d:"M20 4H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm0 14H4V8l8 5 8-5v10zm-8-7L4 6h16l-8 5z"})})}),t.jsxs("p",{className:"text-gray-400 font-medium text-lg text-center mb-2",children:["No ","email"===e?"Email":"SMS"," Preview Available"]}),t.jsxs("p",{className:"text-gray-400 text-sm text-center",children:["Edit your ","email"===e?"Email":"SMS"," template to see a preview here"]})]}),b$=({html:e,height:n,width:r})=>t.jsx("div",{className:"w-full h-full min-h-[300px] bg-white rounded-lg border-0 overflow-hidden transition-all duration-300 ease-in-out flex items-center justify-center",children:e?t.jsx("iframe",{title:"Email Preview",srcDoc:e,className:"w-full transition-opacity duration-300 overflow-scroll h-full",style:{border:"none",backgroundColor:"white",height:n||"100%",width:r||"100%"}}):t.jsx(v$,{type:"email"})}),x$=({emailFromName:e,emailSubject:r,emailPreviewText:o,emailBody:i,emailBaseDomain:s})=>{const[a,l]=n.useState({width:0,height:0}),c=n.useRef(null);return n.useEffect((()=>{const e=()=>{c.current&&requestAnimationFrame((()=>{l({width:c.current?c.current.offsetWidth-100:0,height:c.current?c.current.offsetHeight-100:0})}))};return e(),window.addEventListener("resize",e),()=>window.removeEventListener("resize",e)}),[c]),t.jsxs("div",{className:"space-y-6 h-full",children:[t.jsxs("div",{className:"bg-gray-50 p-5 rounded-lg space-y-4 border border-gray-100",children:[t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e?`${e} <${s}>`:s})]}),t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Subject:"}),t.jsx("span",{className:"text-gray-800 font-medium",children:r})]}),o&&t.jsxs("div",{className:"flex items-start gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700 w-24",children:"Preview Text:"}),t.jsx("span",{className:"text-gray-600 italic",children:o})]})]}),t.jsx("div",{className:"border rounded-lg p-6 bg-white shadow-inner flex-1 h-full w-full items-center justify-center",ref:c,children:t.jsx(b$,{html:i,height:a.height,width:a.width})})]})},w$=({fromPhone:e,body:n})=>t.jsxs("div",{className:"max-w-sm mx-auto min-h-[400px] flex flex-col justify-center",children:[t.jsx("div",{className:"bg-gray-50 p-5 rounded-lg border border-gray-100 mb-6",children:t.jsxs("div",{className:"flex items-center gap-3",children:[t.jsx("span",{className:"font-medium text-gray-700",children:"From:"}),t.jsx("span",{className:"text-gray-800",children:e})]})}),t.jsx("div",{className:"border-4 border-gray-800 rounded-3xl p-1 bg-gray-800 shadow-xl mx-auto max-w-xs transform scale-[0.67] origin-top",children:t.jsx("div",{className:"bg-gray-100 rounded-2xl p-4 h-[500px] w-[280px] aspect-[9/16] overflow-y-auto",children:t.jsx("div",{className:"flex justify-end mb-4",children:t.jsx("div",{className:"bg-green-500 text-white rounded-2xl rounded-tr-sm py-3 px-4 max-w-[80%] shadow-sm whitespace-pre-wrap text-[1.5rem]",children:n})})})})]}),S$=({emailPreview:e,smsPreview:r,iconDefinitions:o})=>{const[i,s]=n.useState("email");return n.useEffect((()=>{e?s("email"):r&&s("sms")}),[e,r]),t.jsx(qC.div,{initial:{opacity:0,y:-20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.1},className:"w-full",children:t.jsxs("div",{className:"bg-gray-200 rounded-xl shadow-lg border border-gray-100 overflow-hidden",children:[t.jsxs("div",{className:"flex border-b border-gray-200 bg-white",children:[e&&t.jsxs(nk,{onClick:()=>s("email"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("email"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o?.EmailIcon&&t.jsx(o.EmailIcon,{className:"w-5 h-5 transition-colors duration-200 "+("email"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"Email Preview"})]}),"email"===i&&t.jsx(qC.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]}),r&&t.jsxs(nk,{onClick:()=>s("sms"),className:"flex-1 py-4 px-6 text-center relative !rounded-none transition-colors duration-200 "+("sms"===i?"text-white-600 hover:text-primary/80 hover:bg-gray-50":"text-primary bg-primary/5"),children:[t.jsxs("div",{className:"flex items-center justify-center gap-2",children:[o?.SmsIcon&&t.jsx(o.SmsIcon,{className:"w-5 h-5 transition-colors duration-200 "+("sms"===i?"text-white-600":"text-primary")}),t.jsx("span",{children:"SMS Preview"})]}),"sms"===i&&t.jsx(qC.div,{layoutId:"activeTab",className:"absolute bottom-0 left-0 right-0 h-[2px] bg-primary",initial:!1,transition:{type:"spring",stiffness:500,damping:30}})]})]}),t.jsx("div",{className:"p-6",children:t.jsxs(ng,{children:["email"===i&&e&&t.jsx(qC.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(x$,{emailBaseDomain:e.fromEmail,emailFromName:e.fromName,emailSubject:e.subject,emailPreviewText:e.previewText,emailBody:e.body})},"email"),"sms"===i&&r&&t.jsx(qC.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},className:"min-h-[400px] min-w-[500px]",children:t.jsx(w$,{fromPhone:r.fromPhone,body:r.companyName?`${r.companyName}:\n${r.body}`:r.body})},"sms")]})})]})})},C$=({iconDefinitions:e,isLoading:r,communicationGroup:o})=>{const{channelSenders:i}=m$(),[s,a]=n.useState(null),[l,c]=n.useState(null),[u,d]=n.useState(!1);return n.useEffect((()=>{if(o&&i){d(!0);try{const e=o.email_channel_sender_id,t=i.results.find((t=>t.id===e));t&&o.email_html_body&&o.email_subject&&a({emailHtml:o.email_html_body,emailSubject:o.email_subject,emailBaseDomain:t.channel_sender_metadata.baseDomain,emailFromName:t.channel_sender_metadata.emailFromName,emailFromEmail:`${t.channel_sender_metadata.userPart}@${t.channel_sender_metadata.baseDomain}`,emailPreviewText:o.email_preview_text});const n=o.sms_channel_sender_id,r=i.results.find((e=>e.id===n));r&&(r.channel_sender_metadata.from||r.channel_sender_metadata.messageServiceSid)&&o.sms_message_body&&c({fromPhone:y$(r.channel_sender_metadata),smsBody:o.sms_message_body,companyName:o.text_message_company_name})}finally{d(!1)}}else d(!1)}),[o,i]),u||r?t.jsx(XC,{text:["Fetching Automation","Finishing up"]}):t.jsx("div",{className:"p-6 bg-background",children:t.jsxs("div",s||l?{className:"space-y-4",children:[t.jsx(S$,{iconDefinitions:e,emailPreview:s&&s.emailFromEmail&&s.emailSubject&&s.emailHtml?{fromEmail:s?.emailFromEmail,fromName:s?.emailFromName??null,subject:s?.emailSubject,previewText:s?.emailPreviewText??null,body:s?.emailHtml}:null,smsPreview:l&&l.fromPhone&&l.smsBody?{fromPhone:l?.fromPhone,body:l?.smsBody,companyName:l?.companyName}:null}),t.jsx("div",{className:"text-center text-sm text-gray-500",children:t.jsx("p",{children:"These previews show exactly how your messages will appear to your customers"})})]}:{className:"py-12 flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-6",children:t.jsx("svg",{className:"w-16 h-16 text-gray-300",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:t.jsx("path",{d:"M19 11H5M19 11C20.1046 11 21 11.8954 21 13V19C21 20.1046 20.1046 21 19 21H5C3.89543 21 3 20.1046 3 19V13C3 11.8954 3.89543 11 5 11M19 11V9C19 7.89543 18.1046 7 17 7M5 11V9C5 7.89543 5.89543 7 7 7M7 7V5C7 3.89543 7.89543 3 9 3H15C16.1046 3 17 3.89543 17 5V7M7 7H17",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("h3",{className:"text-xl font-semibold text-gray-800 mb-2",children:"Automation Content Missing"}),t.jsx("p",{className:"text-gray-500 max-w-md",children:"Complete your automation setup to preview the content here. We'll guide you through each step. Start by clicking Actions in the top right, and then click Edit!"})]})})},k$=({automationId:e,iconDefinitions:n,automation:r,isLoading:o})=>{const{recipients:i,isLoading:s,fetchError:a}=Te(e),{isLoading:l}=De(e);if(s||l||o)return t.jsx(XC,{text:["Fetching Recipients","Finishing up"]});if(a)return t.jsxs("div",{children:["Error: ",a.message]});if(!i||0===i.recipients.length)return t.jsxs("div",{className:"flex flex-col items-center justify-center p-8 text-center",children:[t.jsx("div",{className:"mb-4",children:t.jsx(ZC.UserIcon,{className:"h-12 w-12 text-gray-400"})}),t.jsx("h3",{className:"mb-2 text-lg font-semibold text-gray-700",children:"No Recipients Found"}),t.jsx("p",{className:"text-gray-500",children:"This automation currently has no assigned recipients. Please update the include or exclude segments to add recipients."})]});const c="30%",u="35%",d="35%";return t.jsxs("div",{className:"relative bg-background",children:[t.jsx("div",{children:t.jsx(mN,{automationId:e,iconDefinitions:n,automation:r})}),t.jsx(tL,{className:"my-4"}),t.jsxs(vP,{children:[t.jsx(bP,{children:t.jsxs(wP,{children:[t.jsx(SP,{style:{width:c},children:"Name"}),t.jsx(SP,{style:{width:u},children:"Email"}),t.jsx(SP,{style:{width:d},children:"Phone"})]})}),t.jsx(xP,{children:i.recipients.map((e=>t.jsxs(wP,{className:"hover:bg-gray-50/50 transition-colors",children:[t.jsx(CP,{style:{width:c},children:e.first_name||e.last_name?`${e.first_name||""} ${e.last_name||""}`.trim():t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(CP,{style:{width:u},children:e.email||t.jsx("span",{className:"text-gray-400",children:"Not provided"})}),t.jsx(CP,{style:{width:d},children:e.phone||t.jsx("span",{className:"text-gray-400",children:"Not provided"})})]},e.reach_id)))})]})]})};function E$(e){const r=e+"CollectionProvider",[o,i]=s_(r),[s,a]=o(r,{collectionRef:{current:null},itemMap:new Map}),l=e=>{const{scope:r,children:o}=e,i=n.useRef(null),a=n.useRef(new Map).current;return t.jsx(s,{scope:r,itemMap:a,collectionRef:i,children:o})};l.displayName=r;const c=e+"CollectionSlot",u=n.forwardRef(((e,n)=>{const{scope:r,children:o}=e,i=uf(n,a(c,r).collectionRef);return t.jsx(l_,{ref:i,children:o})}));u.displayName=c;const d=e+"CollectionItemSlot",p="data-radix-collection-item",f=n.forwardRef(((e,r)=>{const{scope:o,children:i,...s}=e,l=n.useRef(null),c=uf(r,l),u=a(d,o);return n.useEffect((()=>(u.itemMap.set(l,{ref:l,...s}),()=>{u.itemMap.delete(l)}))),t.jsx(l_,{[p]:"",ref:c,children:i})}));return f.displayName=d,[{Provider:l,Slot:u,ItemSlot:f},function(t){const r=a(e+"CollectionConsumer",t);return n.useCallback((()=>{const e=r.collectionRef.current;if(!e)return[];const t=Array.from(e.querySelectorAll(`[${p}]`));return Array.from(r.itemMap.values()).sort(((e,n)=>t.indexOf(e.ref.current)-t.indexOf(n.ref.current)))}),[r.collectionRef,r.itemMap])},i]}var _$=i.createContext(void 0);function j$(e){const t=i.useContext(_$);return e||t||"ltr"}var T$,N$="dismissableLayer.update",P$="dismissableLayer.pointerDownOutside",D$="dismissableLayer.focusOutside",M$=i.createContext({layers:new Set,layersWithOutsidePointerEventsDisabled:new Set,branches:new Set}),A$=i.forwardRef(((e,n)=>{const{disableOutsidePointerEvents:r=!1,onEscapeKeyDown:o,onPointerDownOutside:s,onFocusOutside:a,onInteractOutside:l,onDismiss:c,...u}=e,d=i.useContext(M$),[p,f]=i.useState(null),h=p?.ownerDocument??globalThis?.document,[,m]=i.useState({}),g=uf(n,(e=>f(e))),y=Array.from(d.layers),[v]=[...d.layersWithOutsidePointerEventsDisabled].slice(-1),b=y.indexOf(v),x=p?y.indexOf(p):-1,w=d.layersWithOutsidePointerEventsDisabled.size>0,S=x>=b,C=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1),o=i.useRef((()=>{}));return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){let r=function(){R$(P$,n,i,{discrete:!0})};const i={originalEvent:e};"touch"===e.pointerType?(t.removeEventListener("click",o.current),o.current=r,t.addEventListener("click",o.current,{once:!0})):r()}else t.removeEventListener("click",o.current);r.current=!1},i=window.setTimeout((()=>{t.addEventListener("pointerdown",e)}),0);return()=>{window.clearTimeout(i),t.removeEventListener("pointerdown",e),t.removeEventListener("click",o.current)}}),[t,n]),{onPointerDownCapture:()=>r.current=!0}}((e=>{const t=e.target,n=[...d.branches].some((e=>e.contains(t)));S&&!n&&(s?.(e),l?.(e),e.defaultPrevented||c?.())}),h),k=function(e,t=globalThis?.document){const n=m_(e),r=i.useRef(!1);return i.useEffect((()=>{const e=e=>{if(e.target&&!r.current){R$(D$,n,{originalEvent:e},{discrete:!1})}};return t.addEventListener("focusin",e),()=>t.removeEventListener("focusin",e)}),[t,n]),{onFocusCapture:()=>r.current=!0,onBlurCapture:()=>r.current=!1}}((e=>{const t=e.target;[...d.branches].some((e=>e.contains(t)))||(a?.(e),l?.(e),e.defaultPrevented||c?.())}),h);return g_((e=>{x===d.layers.size-1&&(o?.(e),!e.defaultPrevented&&c&&(e.preventDefault(),c()))}),h),i.useEffect((()=>{if(p)return r&&(0===d.layersWithOutsidePointerEventsDisabled.size&&(T$=h.body.style.pointerEvents,h.body.style.pointerEvents="none"),d.layersWithOutsidePointerEventsDisabled.add(p)),d.layers.add(p),O$(),()=>{r&&1===d.layersWithOutsidePointerEventsDisabled.size&&(h.body.style.pointerEvents=T$)}}),[p,h,r,d]),i.useEffect((()=>()=>{p&&(d.layers.delete(p),d.layersWithOutsidePointerEventsDisabled.delete(p),O$())}),[p,d]),i.useEffect((()=>{const e=()=>m({});return document.addEventListener(N$,e),()=>document.removeEventListener(N$,e)}),[]),t.jsx(f_.div,{...u,ref:g,style:{pointerEvents:w?S?"auto":"none":void 0,...e.style},onFocusCapture:i_(e.onFocusCapture,k.onFocusCapture),onBlurCapture:i_(e.onBlurCapture,k.onBlurCapture),onPointerDownCapture:i_(e.onPointerDownCapture,C.onPointerDownCapture)})}));A$.displayName="DismissableLayer";function O$(){const e=new CustomEvent(N$);document.dispatchEvent(e)}function R$(e,t,n,{discrete:r}){const o=n.originalEvent.target,i=new CustomEvent(e,{bubbles:!1,cancelable:!0,detail:n});t&&o.addEventListener(e,t,{once:!0}),r?h_(o,i):o.dispatchEvent(i)}i.forwardRef(((e,n)=>{const r=i.useContext(M$),o=i.useRef(null),s=uf(n,o);return i.useEffect((()=>{const e=o.current;if(e)return r.branches.add(e),()=>{r.branches.delete(e)}}),[r.branches]),t.jsx(f_.div,{...e,ref:s})})).displayName="DismissableLayerBranch";var L$="rovingFocusGroup.onEntryFocus",I$={bubbles:!1,cancelable:!0},F$="RovingFocusGroup",[$$,q$,U$]=E$(F$),[z$,B$]=s_(F$,[U$]),[V$,K$]=z$(F$),H$=i.forwardRef(((e,n)=>t.jsx($$.Provider,{scope:e.__scopeRovingFocusGroup,children:t.jsx($$.Slot,{scope:e.__scopeRovingFocusGroup,children:t.jsx(W$,{...e,ref:n})})})));H$.displayName=F$;var W$=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,orientation:o,loop:s=!1,dir:a,currentTabStopId:l,defaultCurrentTabStopId:c,onCurrentTabStopIdChange:u,onEntryFocus:d,preventScrollOnEntryFocus:p=!1,...f}=e,h=i.useRef(null),m=uf(n,h),g=j$(a),[y=null,v]=DT({prop:l,defaultProp:c,onChange:u}),[b,x]=i.useState(!1),w=m_(d),S=q$(r),C=i.useRef(!1),[k,E]=i.useState(0);return i.useEffect((()=>{const e=h.current;if(e)return e.addEventListener(L$,w),()=>e.removeEventListener(L$,w)}),[w]),t.jsx(V$,{scope:r,orientation:o,dir:g,loop:s,currentTabStopId:y,onItemFocus:i.useCallback((e=>v(e)),[v]),onItemShiftTab:i.useCallback((()=>x(!0)),[]),onFocusableItemAdd:i.useCallback((()=>E((e=>e+1))),[]),onFocusableItemRemove:i.useCallback((()=>E((e=>e-1))),[]),children:t.jsx(f_.div,{tabIndex:b||0===k?-1:0,"data-orientation":o,...f,ref:m,style:{outline:"none",...e.style},onMouseDown:i_(e.onMouseDown,(()=>{C.current=!0})),onFocus:i_(e.onFocus,(e=>{if(e.target===e.currentTarget&&!C.current&&!b){const t=new CustomEvent(L$,I$);if(e.currentTarget.dispatchEvent(t),!t.defaultPrevented){const e=S().filter((e=>e.focusable));X$([e.find((e=>e.active)),e.find((e=>e.id===y)),...e].filter(Boolean).map((e=>e.ref.current)),p)}}C.current=!1})),onBlur:i_(e.onBlur,(()=>x(!1)))})})})),G$="RovingFocusGroupItem",Y$=i.forwardRef(((e,n)=>{const{__scopeRovingFocusGroup:r,focusable:o=!0,active:s=!1,tabStopId:a,...l}=e,c=T_(),u=a||c,d=K$(G$,r),p=d.currentTabStopId===u,f=q$(r),{onFocusableItemAdd:h,onFocusableItemRemove:m}=d;return i.useEffect((()=>{if(o)return h(),()=>m()}),[o,h,m]),t.jsx($$.ItemSlot,{scope:r,id:u,focusable:o,active:s,children:t.jsx(f_.span,{tabIndex:p?0:-1,"data-orientation":d.orientation,...l,ref:n,onMouseDown:i_(e.onMouseDown,(e=>{o?d.onItemFocus(u):e.preventDefault()})),onFocus:i_(e.onFocus,(()=>d.onItemFocus(u))),onKeyDown:i_(e.onKeyDown,(e=>{if("Tab"===e.key&&e.shiftKey)return void d.onItemShiftTab();if(e.target!==e.currentTarget)return;const t=function(e,t,n){const r=function(e,t){return"rtl"!==t?e:"ArrowLeft"===e?"ArrowRight":"ArrowRight"===e?"ArrowLeft":e}(e.key,n);return"vertical"===t&&["ArrowLeft","ArrowRight"].includes(r)||"horizontal"===t&&["ArrowUp","ArrowDown"].includes(r)?void 0:Q$[r]}(e,d.orientation,d.dir);if(void 0!==t){if(e.metaKey||e.ctrlKey||e.altKey||e.shiftKey)return;e.preventDefault();let o=f().filter((e=>e.focusable)).map((e=>e.ref.current));if("last"===t)o.reverse();else if("prev"===t||"next"===t){"prev"===t&&o.reverse();const i=o.indexOf(e.currentTarget);o=d.loop?(r=i+1,(n=o).map(((e,t)=>n[(r+t)%n.length]))):o.slice(i+1)}setTimeout((()=>X$(o)))}var n,r}))})})}));Y$.displayName=G$;var Q$={ArrowLeft:"prev",ArrowUp:"prev",ArrowRight:"next",ArrowDown:"next",PageUp:"first",Home:"first",PageDown:"last",End:"last"};function X$(e,t=!1){const n=document.activeElement;for(const r of e){if(r===n)return;if(r.focus({preventScroll:t}),document.activeElement!==n)return}}var J$=H$,Z$=Y$,eq=["Enter"," "],tq=["ArrowUp","PageDown","End"],nq=["ArrowDown","PageUp","Home",...tq],rq={ltr:[...eq,"ArrowRight"],rtl:[...eq,"ArrowLeft"]},oq={ltr:["ArrowLeft"],rtl:["ArrowRight"]},iq="Menu",[sq,aq,lq]=E$(iq),[cq,uq]=s_(iq,[lq,lT,B$]),dq=lT(),pq=B$(),[fq,hq]=cq(iq),[mq,gq]=cq(iq),yq=e=>{const{__scopeMenu:n,open:r=!1,children:o,dir:s,onOpenChange:a,modal:l=!0}=e,c=dq(n),[u,d]=i.useState(null),p=i.useRef(!1),f=m_(a),h=j$(s);return i.useEffect((()=>{const e=()=>{p.current=!0,document.addEventListener("pointerdown",t,{capture:!0,once:!0}),document.addEventListener("pointermove",t,{capture:!0,once:!0})},t=()=>p.current=!1;return document.addEventListener("keydown",e,{capture:!0}),()=>{document.removeEventListener("keydown",e,{capture:!0}),document.removeEventListener("pointerdown",t,{capture:!0}),document.removeEventListener("pointermove",t,{capture:!0})}}),[]),t.jsx(kT,{...c,children:t.jsx(fq,{scope:n,open:r,onOpenChange:f,content:u,onContentChange:d,children:t.jsx(mq,{scope:n,onClose:i.useCallback((()=>f(!1)),[f]),isUsingKeyboardRef:p,dir:h,modal:l,children:o})})})};yq.displayName=iq;var vq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=dq(r);return t.jsx(ET,{...i,...o,ref:n})}));vq.displayName="MenuAnchor";var bq="MenuPortal",[xq,wq]=cq(bq,{forceMount:void 0}),Sq=e=>{const{__scopeMenu:n,forceMount:r,children:o,container:i}=e,s=hq(bq,n);return t.jsx(xq,{scope:n,forceMount:r,children:t.jsx(NT,{present:r||s.open,children:t.jsx(TT,{asChild:!0,container:i,children:o})})})};Sq.displayName=bq;var Cq="MenuContent",[kq,Eq]=cq(Cq),_q=i.forwardRef(((e,n)=>{const r=wq(Cq,e.__scopeMenu),{forceMount:o=r.forceMount,...i}=e,s=hq(Cq,e.__scopeMenu),a=gq(Cq,e.__scopeMenu);return t.jsx(sq.Provider,{scope:e.__scopeMenu,children:t.jsx(NT,{present:o||s.open,children:t.jsx(sq.Slot,{scope:e.__scopeMenu,children:t.jsx(a.modal?jq:Tq,{...i,ref:n})})})})})),jq=i.forwardRef(((e,n)=>{const r=hq(Cq,e.__scopeMenu),o=i.useRef(null),s=uf(n,o);return i.useEffect((()=>{const e=o.current;if(e)return Yh(e)}),[]),t.jsx(Nq,{...e,ref:s,trapFocus:r.open,disableOutsidePointerEvents:r.open,disableOutsideScroll:!0,onFocusOutside:i_(e.onFocusOutside,(e=>e.preventDefault()),{checkForDefaultPrevented:!1}),onDismiss:()=>r.onOpenChange(!1)})})),Tq=i.forwardRef(((e,n)=>{const r=hq(Cq,e.__scopeMenu);return t.jsx(Nq,{...e,ref:n,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>r.onOpenChange(!1)})})),Nq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,loop:o=!1,trapFocus:s,onOpenAutoFocus:a,onCloseAutoFocus:l,disableOutsidePointerEvents:c,onEntryFocus:u,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,disableOutsideScroll:g,...y}=e,v=hq(Cq,r),b=gq(Cq,r),x=dq(r),w=pq(r),S=aq(r),[C,k]=i.useState(null),E=i.useRef(null),_=uf(n,E,v.onContentChange),j=i.useRef(0),T=i.useRef(""),N=i.useRef(0),P=i.useRef(null),D=i.useRef("right"),M=i.useRef(0),A=g?zh:i.Fragment,O=g?{as:l_,allowPinchZoom:!0}:void 0,R=e=>{const t=T.current+e,n=S().filter((e=>!e.disabled)),r=document.activeElement,o=n.find((e=>e.ref.current===r))?.textValue,i=function(e,t,n){const r=t.length>1&&Array.from(t).every((e=>e===t[0])),o=r?t[0]:t,i=n?e.indexOf(n):-1;let s=(a=e,l=Math.max(i,0),a.map(((e,t)=>a[(l+t)%a.length])));var a,l;1===o.length&&(s=s.filter((e=>e!==n)));const c=s.find((e=>e.toLowerCase().startsWith(o.toLowerCase())));return c!==n?c:void 0}(n.map((e=>e.textValue)),t,o),s=n.find((e=>e.textValue===i))?.ref.current;!function e(t){T.current=t,window.clearTimeout(j.current),""!==t&&(j.current=window.setTimeout((()=>e("")),1e3))}(t),s&&setTimeout((()=>s.focus()))};i.useEffect((()=>()=>window.clearTimeout(j.current)),[]),cM();const L=i.useCallback((e=>D.current===P.current?.side&&function(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return function(e,t){const{x:n,y:r}=e;let o=!1;for(let i=0,s=t.length-1;i<t.length;s=i++){const e=t[i].x,a=t[i].y,l=t[s].y;a>r!=l>r&&n<(t[s].x-e)*(r-a)/(l-a)+e&&(o=!o)}return o}(n,t)}(e,P.current?.area)),[]);return t.jsx(kq,{scope:r,searchRef:T,onItemEnter:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),onItemLeave:i.useCallback((e=>{L(e)||(E.current?.focus(),k(null))}),[L]),onTriggerLeave:i.useCallback((e=>{L(e)&&e.preventDefault()}),[L]),pointerGraceTimerRef:N,onPointerGraceIntentChange:i.useCallback((e=>{P.current=e}),[]),children:t.jsx(A,{...O,children:t.jsx(hM,{asChild:!0,trapped:s,onMountAutoFocus:i_(a,(e=>{e.preventDefault(),E.current?.focus({preventScroll:!0})})),onUnmountAutoFocus:l,children:t.jsx(A$,{asChild:!0,disableOutsidePointerEvents:c,onEscapeKeyDown:d,onPointerDownOutside:p,onFocusOutside:f,onInteractOutside:h,onDismiss:m,children:t.jsx(J$,{asChild:!0,...w,dir:b.dir,orientation:"vertical",loop:o,currentTabStopId:C,onCurrentTabStopIdChange:k,onEntryFocus:i_(u,(e=>{b.isUsingKeyboardRef.current||e.preventDefault()})),preventScrollOnEntryFocus:!0,children:t.jsx(_T,{role:"menu","aria-orientation":"vertical","data-state":tU(v.open),"data-radix-menu-content":"",dir:b.dir,...x,...y,ref:_,style:{outline:"none",...y.style},onKeyDown:i_(y.onKeyDown,(e=>{const t=e.target.closest("[data-radix-menu-content]")===e.currentTarget,n=e.ctrlKey||e.altKey||e.metaKey,r=1===e.key.length;t&&("Tab"===e.key&&e.preventDefault(),!n&&r&&R(e.key));if(e.target!==E.current)return;if(!nq.includes(e.key))return;e.preventDefault();const o=S().filter((e=>!e.disabled)).map((e=>e.ref.current));tq.includes(e.key)&&o.reverse(),function(e){const t=document.activeElement;for(const n of e){if(n===t)return;if(n.focus(),document.activeElement!==t)return}}(o)})),onBlur:i_(e.onBlur,(e=>{e.currentTarget.contains(e.target)||(window.clearTimeout(j.current),T.current="")})),onPointerMove:i_(e.onPointerMove,oU((e=>{const t=M.current!==e.clientX;if(e.currentTarget.contains(e.target)&&t){D.current=e.clientX>M.current?"right":"left",M.current=e.clientX}})))})})})})})})}));_q.displayName=Cq;var Pq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(f_.div,{role:"group",...o,ref:n})}));Pq.displayName="MenuGroup";var Dq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(f_.div,{...o,ref:n})}));Dq.displayName="MenuLabel";var Mq="MenuItem",Aq="menu.itemSelect",Oq=i.forwardRef(((e,n)=>{const{disabled:r=!1,onSelect:o,...s}=e,a=i.useRef(null),l=gq(Mq,e.__scopeMenu),c=Eq(Mq,e.__scopeMenu),u=uf(n,a),d=i.useRef(!1);return t.jsx(Rq,{...s,ref:u,disabled:r,onClick:i_(e.onClick,(()=>{const e=a.current;if(!r&&e){const t=new CustomEvent(Aq,{bubbles:!0,cancelable:!0});e.addEventListener(Aq,(e=>o?.(e)),{once:!0}),h_(e,t),t.defaultPrevented?d.current=!1:l.onClose()}})),onPointerDown:t=>{e.onPointerDown?.(t),d.current=!0},onPointerUp:i_(e.onPointerUp,(e=>{d.current||e.currentTarget?.click()})),onKeyDown:i_(e.onKeyDown,(e=>{r||""!==c.searchRef.current&&" "===e.key||eq.includes(e.key)&&(e.currentTarget.click(),e.preventDefault())}))})}));Oq.displayName=Mq;var Rq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,disabled:o=!1,textValue:s,...a}=e,l=Eq(Mq,r),c=pq(r),u=i.useRef(null),d=uf(n,u),[p,f]=i.useState(!1),[h,m]=i.useState("");return i.useEffect((()=>{const e=u.current;e&&m((e.textContent??"").trim())}),[a.children]),t.jsx(sq.ItemSlot,{scope:r,disabled:o,textValue:s??h,children:t.jsx(Z$,{asChild:!0,...c,focusable:!o,children:t.jsx(f_.div,{role:"menuitem","data-highlighted":p?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...a,ref:d,onPointerMove:i_(e.onPointerMove,oU((e=>{if(o)l.onItemLeave(e);else if(l.onItemEnter(e),!e.defaultPrevented){e.currentTarget.focus({preventScroll:!0})}}))),onPointerLeave:i_(e.onPointerLeave,oU((e=>l.onItemLeave(e)))),onFocus:i_(e.onFocus,(()=>f(!0))),onBlur:i_(e.onBlur,(()=>f(!1)))})})})})),Lq=i.forwardRef(((e,n)=>{const{checked:r=!1,onCheckedChange:o,...i}=e;return t.jsx(Vq,{scope:e.__scopeMenu,checked:r,children:t.jsx(Oq,{role:"menuitemcheckbox","aria-checked":nU(r)?"mixed":r,...i,ref:n,"data-state":rU(r),onSelect:i_(i.onSelect,(()=>o?.(!!nU(r)||!r)),{checkForDefaultPrevented:!1})})})}));Lq.displayName="MenuCheckboxItem";var Iq="MenuRadioGroup",[Fq,$q]=cq(Iq,{value:void 0,onValueChange:()=>{}}),qq=i.forwardRef(((e,n)=>{const{value:r,onValueChange:o,...i}=e,s=m_(o);return t.jsx(Fq,{scope:e.__scopeMenu,value:r,onValueChange:s,children:t.jsx(Pq,{...i,ref:n})})}));qq.displayName=Iq;var Uq="MenuRadioItem",zq=i.forwardRef(((e,n)=>{const{value:r,...o}=e,i=$q(Uq,e.__scopeMenu),s=r===i.value;return t.jsx(Vq,{scope:e.__scopeMenu,checked:s,children:t.jsx(Oq,{role:"menuitemradio","aria-checked":s,...o,ref:n,"data-state":rU(s),onSelect:i_(o.onSelect,(()=>i.onValueChange?.(r)),{checkForDefaultPrevented:!1})})})}));zq.displayName=Uq;var Bq="MenuItemIndicator",[Vq,Kq]=cq(Bq,{checked:!1}),Hq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,forceMount:o,...i}=e,s=Kq(Bq,r);return t.jsx(NT,{present:o||nU(s.checked)||!0===s.checked,children:t.jsx(f_.span,{...i,ref:n,"data-state":rU(s.checked)})})}));Hq.displayName=Bq;var Wq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e;return t.jsx(f_.div,{role:"separator","aria-orientation":"horizontal",...o,ref:n})}));Wq.displayName="MenuSeparator";var Gq=i.forwardRef(((e,n)=>{const{__scopeMenu:r,...o}=e,i=dq(r);return t.jsx(jT,{...i,...o,ref:n})}));Gq.displayName="MenuArrow";var[Yq,Qq]=cq("MenuSub"),Xq="MenuSubTrigger",Jq=i.forwardRef(((e,n)=>{const r=hq(Xq,e.__scopeMenu),o=gq(Xq,e.__scopeMenu),s=Qq(Xq,e.__scopeMenu),a=Eq(Xq,e.__scopeMenu),l=i.useRef(null),{pointerGraceTimerRef:c,onPointerGraceIntentChange:u}=a,d={__scopeMenu:e.__scopeMenu},p=i.useCallback((()=>{l.current&&window.clearTimeout(l.current),l.current=null}),[]);return i.useEffect((()=>p),[p]),i.useEffect((()=>{const e=c.current;return()=>{window.clearTimeout(e),u(null)}}),[c,u]),t.jsx(vq,{asChild:!0,...d,children:t.jsx(Rq,{id:s.triggerId,"aria-haspopup":"menu","aria-expanded":r.open,"aria-controls":s.contentId,"data-state":tU(r.open),...e,ref:cf(n,s.onTriggerChange),onClick:t=>{e.onClick?.(t),e.disabled||t.defaultPrevented||(t.currentTarget.focus(),r.open||r.onOpenChange(!0))},onPointerMove:i_(e.onPointerMove,oU((t=>{a.onItemEnter(t),t.defaultPrevented||e.disabled||r.open||l.current||(a.onPointerGraceIntentChange(null),l.current=window.setTimeout((()=>{r.onOpenChange(!0),p()}),100))}))),onPointerLeave:i_(e.onPointerLeave,oU((e=>{p();const t=r.content?.getBoundingClientRect();if(t){const n=r.content?.dataset.side,o="right"===n,i=t[o?"left":"right"],s=t[o?"right":"left"];a.onPointerGraceIntentChange({area:[{x:e.clientX+(o?-5:5),y:e.clientY},{x:i,y:t.top},{x:s,y:t.top},{x:s,y:t.bottom},{x:i,y:t.bottom}],side:n}),window.clearTimeout(c.current),c.current=window.setTimeout((()=>a.onPointerGraceIntentChange(null)),300)}else{if(a.onTriggerLeave(e),e.defaultPrevented)return;a.onPointerGraceIntentChange(null)}}))),onKeyDown:i_(e.onKeyDown,(t=>{e.disabled||""!==a.searchRef.current&&" "===t.key||rq[o.dir].includes(t.key)&&(r.onOpenChange(!0),r.content?.focus(),t.preventDefault())}))})})}));Jq.displayName=Xq;var Zq="MenuSubContent",eU=i.forwardRef(((e,n)=>{const r=wq(Cq,e.__scopeMenu),{forceMount:o=r.forceMount,...s}=e,a=hq(Cq,e.__scopeMenu),l=gq(Cq,e.__scopeMenu),c=Qq(Zq,e.__scopeMenu),u=i.useRef(null),d=uf(n,u);return t.jsx(sq.Provider,{scope:e.__scopeMenu,children:t.jsx(NT,{present:o||a.open,children:t.jsx(sq.Slot,{scope:e.__scopeMenu,children:t.jsx(Nq,{id:c.contentId,"aria-labelledby":c.triggerId,...s,ref:d,align:"start",side:"rtl"===l.dir?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:e=>{l.isUsingKeyboardRef.current&&u.current?.focus(),e.preventDefault()},onCloseAutoFocus:e=>e.preventDefault(),onFocusOutside:i_(e.onFocusOutside,(e=>{e.target!==c.trigger&&a.onOpenChange(!1)})),onEscapeKeyDown:i_(e.onEscapeKeyDown,(e=>{l.onClose(),e.preventDefault()})),onKeyDown:i_(e.onKeyDown,(e=>{const t=e.currentTarget.contains(e.target),n=oq[l.dir].includes(e.key);t&&n&&(a.onOpenChange(!1),c.trigger?.focus(),e.preventDefault())}))})})})})}));function tU(e){return e?"open":"closed"}function nU(e){return"indeterminate"===e}function rU(e){return nU(e)?"indeterminate":e?"checked":"unchecked"}function oU(e){return t=>"mouse"===t.pointerType?e(t):void 0}eU.displayName=Zq;var iU=yq,sU=vq,aU=Sq,lU=_q,cU=Pq,uU=Dq,dU=Oq,pU=Lq,fU=qq,hU=zq,mU=Hq,gU=Wq,yU=Gq,vU=Jq,bU=eU,xU="DropdownMenu",[wU,SU]=s_(xU,[uq]),CU=uq(),[kU,EU]=wU(xU),_U=e=>{const{__scopeDropdownMenu:n,children:r,dir:o,open:s,defaultOpen:a,onOpenChange:l,modal:c=!0}=e,u=CU(n),d=i.useRef(null),[p=!1,f]=DT({prop:s,defaultProp:a,onChange:l});return t.jsx(kU,{scope:n,triggerId:T_(),triggerRef:d,contentId:T_(),open:p,onOpenChange:f,onOpenToggle:i.useCallback((()=>f((e=>!e))),[f]),modal:c,children:t.jsx(iU,{...u,open:p,onOpenChange:f,dir:o,modal:c,children:r})})};_U.displayName=xU;var jU="DropdownMenuTrigger",TU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,disabled:o=!1,...i}=e,s=EU(jU,r),a=CU(r);return t.jsx(sU,{asChild:!0,...a,children:t.jsx(f_.button,{type:"button",id:s.triggerId,"aria-haspopup":"menu","aria-expanded":s.open,"aria-controls":s.open?s.contentId:void 0,"data-state":s.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...i,ref:cf(n,s.triggerRef),onPointerDown:i_(e.onPointerDown,(e=>{o||0!==e.button||!1!==e.ctrlKey||(s.onOpenToggle(),s.open||e.preventDefault())})),onKeyDown:i_(e.onKeyDown,(e=>{o||(["Enter"," "].includes(e.key)&&s.onOpenToggle(),"ArrowDown"===e.key&&s.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(e.key)&&e.preventDefault())}))})})}));TU.displayName=jU;var NU=e=>{const{__scopeDropdownMenu:n,...r}=e,o=CU(n);return t.jsx(aU,{...o,...r})};NU.displayName="DropdownMenuPortal";var PU="DropdownMenuContent",DU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,s=EU(PU,r),a=CU(r),l=i.useRef(!1);return t.jsx(lU,{id:s.contentId,"aria-labelledby":s.triggerId,...a,...o,ref:n,onCloseAutoFocus:i_(e.onCloseAutoFocus,(e=>{l.current||s.triggerRef.current?.focus(),l.current=!1,e.preventDefault()})),onInteractOutside:i_(e.onInteractOutside,(e=>{const t=e.detail.originalEvent;s.modal&&!(2===t.button||0===t.button&&!0===t.ctrlKey)||(l.current=!0)})),style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));DU.displayName=PU;i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(cU,{...i,...o,ref:n})})).displayName="DropdownMenuGroup";var MU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(uU,{...i,...o,ref:n})}));MU.displayName="DropdownMenuLabel";var AU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(dU,{...i,...o,ref:n})}));AU.displayName="DropdownMenuItem";var OU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(pU,{...i,...o,ref:n})}));OU.displayName="DropdownMenuCheckboxItem";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(fU,{...i,...o,ref:n})})).displayName="DropdownMenuRadioGroup";var RU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(hU,{...i,...o,ref:n})}));RU.displayName="DropdownMenuRadioItem";var LU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(mU,{...i,...o,ref:n})}));LU.displayName="DropdownMenuItemIndicator";var IU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(gU,{...i,...o,ref:n})}));IU.displayName="DropdownMenuSeparator";i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(yU,{...i,...o,ref:n})})).displayName="DropdownMenuArrow";var FU=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(vU,{...i,...o,ref:n})}));FU.displayName="DropdownMenuSubTrigger";var $U=i.forwardRef(((e,n)=>{const{__scopeDropdownMenu:r,...o}=e,i=CU(r);return t.jsx(bU,{...i,...o,ref:n,style:{...e.style,"--radix-dropdown-menu-content-transform-origin":"var(--radix-popper-transform-origin)","--radix-dropdown-menu-content-available-width":"var(--radix-popper-available-width)","--radix-dropdown-menu-content-available-height":"var(--radix-popper-available-height)","--radix-dropdown-menu-trigger-width":"var(--radix-popper-anchor-width)","--radix-dropdown-menu-trigger-height":"var(--radix-popper-anchor-height)"}})}));$U.displayName="DropdownMenuSubContent";var qU=NU,UU=DU,zU=MU,BU=AU,VU=OU,KU=RU,HU=LU,WU=IU,GU=FU,YU=$U;const QU=_U,XU=TU;i.forwardRef((({className:e,inset:n,children:r,...o},i)=>t.jsxs(GU,{ref:i,className:_d("flex cursor-default gap-2 select-none items-center rounded-sm px-2 py-1.5 text-sm outline-none focus:bg-accent data-[state=open]:bg-accent [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",n&&"pl-8",e),...o,children:[r,t.jsx(eu,{className:"ml-auto"})]}))).displayName=GU.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(YU,{ref:r,className:_d("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground shadow-lg 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",e),...n}))).displayName=YU.displayName;const JU=i.forwardRef((({className:e,sideOffset:n=4,...r},o)=>t.jsx(qU,{children:t.jsx(UU,{ref:o,sideOffset:n,className:_d("z-50 min-w-[8rem] overflow-hidden rounded-md border bg-popover p-1 text-popover-foreground 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",e),...r})})));JU.displayName=UU.displayName;const ZU=i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(BU,{ref:o,className:_d("relative flex cursor-default select-none items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&>svg]:size-4 [&>svg]:shrink-0",n&&"pl-8",e),...r})));ZU.displayName=BU.displayName;i.forwardRef((({className:e,children:n,checked:r,...o},i)=>t.jsxs(VU,{ref:i,className:_d("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),checked:r,...o,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(HU,{children:t.jsx(Xc,{className:"h-4 w-4"})})}),n]}))).displayName=VU.displayName;i.forwardRef((({className:e,children:n,...r},o)=>t.jsxs(KU,{ref:o,className:_d("relative flex cursor-default select-none items-center rounded-sm py-1.5 pl-8 pr-2 text-sm outline-none transition-colors focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50",e),...r,children:[t.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:t.jsx(HU,{children:t.jsx(su,{className:"h-2 w-2 fill-current"})})}),n]}))).displayName=KU.displayName;i.forwardRef((({className:e,inset:n,...r},o)=>t.jsx(zU,{ref:o,className:_d("px-2 py-1.5 text-sm font-semibold",n&&"pl-8",e),...r}))).displayName=zU.displayName;i.forwardRef((({className:e,...n},r)=>t.jsx(WU,{ref:r,className:_d("-mx-1 my-1 h-px bg-muted",e),...n}))).displayName=WU.displayName;const ez="reach-styles-module__stepIndicatorContainer___FoKXB",tz="reach-styles-module__iconContainer___Ki-1n",nz="reach-styles-module__checkIcon___-krUS",rz="reach-styles-module__minusIcon___r5cKs",oz="reach-styles-module__minusIconActive___-4JHM",iz="reach-styles-module__minusIconInactive___JtvVB",sz="reach-styles-module__label___tiCMA",az="reach-styles-module__labelActive___EXydD",lz="reach-styles-module__labelInactive___g-J3r",cz=({label:e,isCompleted:n,isActive:r,onClick:o})=>t.jsxs(o?"button":"div",{className:ez,onClick:o,children:[t.jsx("div",n?{className:tz,children:t.jsx(Xc,{className:nz})}:{className:tz,children:t.jsx(yu,{className:_d(rz,r?oz:iz)})}),t.jsx("span",{className:_d(sz,r?az:lz),children:e})]}),uz=e=>{const{mergeFieldName:t}=e;return`{{${t}}}`},dz=(e,t)=>{const[r,o]=n.useState(e);return n.useEffect((()=>{const n=setTimeout((()=>{o(e)}),t);return()=>clearTimeout(n)}),[e,t]),r},pz=()=>{const e=me({queryKey:["channel-accounts"],queryFn:()=>(async()=>(await Ee("/channel/accounts",{method:"GET"})).data)()});return{channelAccounts:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchChannelAccounts:e.refetch}};var fz=(e=>(e.REACH_MANAGED="reach-managed",e.TWILLIO="twillio",e))(fz||{});const hz=()=>t.jsxs("div",{className:"p-6 overflow-y-auto",children:[t.jsxs("div",{className:"mb-8 text-center",children:[t.jsx("h2",{className:"text-2xl font-semibold mb-2",children:"Email Editor Help Center"}),t.jsx("p",{className:"text-gray-500",children:"Learn how to use our email editor's powerful features"})]}),t.jsxs("div",{className:"space-y-4 max-w-xl mx-auto",children:[t.jsx("h3",{className:"text-lg font-medium",children:"Using Dynamic Content"}),t.jsxs("div",{className:"relative rounded-lg overflow-hidden bg-gray-50",children:[t.jsx("img",{src:"https://cdn.embedreach.com/assets/engage/merge-tags-demo.gif",alt:"Merge Tags Demo",className:"w-full shadow-lg max-w-md mx-auto"}),t.jsx("div",{className:"absolute bottom-0 left-0 right-0 bg-gradient-to-t from-black/50 to-transparent p-4",children:t.jsx("p",{className:"text-white text-sm",children:"Demonstration: Adding merge tags to personalize your emails"})})]}),t.jsx("div",{className:"px-2",children:t.jsx(ik,{onClick:()=>{},title:"Dynamic Content",subtitle:"Dynamic content is a way to insert dynamic content into your email such as the customer's name, email, or other details.",icon:t.jsx(hu,{}),selected:!0})})]})]}),mz=({type:e})=>t.jsxs("div",{className:"flex items-start space-x-2 text-sm text-gray-600",children:[t.jsx("svg",{className:"w-5 h-5 text-amber-500 flex-shrink-0 mt-0.5",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:t.jsx("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2",d:"M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"})}),t.jsxs("span",{children:["Please configure at least one ",e," sender before editing the template"]})]}),gz=({containerRef:e,stripoDialogDimensions:n,showSaving:r})=>t.jsxs("div",{className:"w-full h-full flex flex-col items-center justify-center",children:[t.jsx("div",{id:"externalSystemContainer",className:"flex items-center px-4 py-2"}),r&&t.jsx("div",{className:"absolute top-0 left-0 w-full h-full bg-black/50 flex items-center justify-center z-50",children:t.jsx(XC,{textColor:"white",text:["Saving..."]})}),t.jsx("div",{id:"stripoEditorContainer",ref:e,style:{width:n.width-75,height:n.height-75},className:"overflow-auto z-10"})]}),yz="UiEditorScript",vz=e=>new Promise(((t,n)=>{const r=()=>{window.UIEditor&&(window.UIEditor.initEditor(e.container,{metadata:{emailId:e.emailId,userId:e.businessId},html:e.html,css:e.css,locale:"en",onTokenRefreshRequest:e=>{Promise.resolve().then((async()=>{try{const{token:t}=await(async()=>(await Ee(`${d}/token`)).data)();e(t)}catch(t){}}))},messageSettingsEnabled:!1,conditionsEnabled:!1,syncModulesEnabled:!1,notifications:{info:console.info,error:console.error,warn:console.warn,success:console.log},mergeTags:e.mergeFields}),t(void 0))};if(document.getElementById(yz))r();else{const e=document.createElement("script");e.id=yz,e.type="module",e.src="https://plugins.stripo.email/resources/uieditor/latest/UIEditor.js",e.onload=()=>{window.UIEditor?r():n(new Error("UIEditor not found after script load"))},e.onerror=e=>{n(e)},document.head.appendChild(e)}})),bz=({automation:e,setShowStripoEditor:r,saveClicked:o,setSaveClicked:i,stripoDialogDimensions:s,setCommunicationGroupId:a,mergeFieldsResponse:l})=>{const c=n.useRef(!1),u=n.useRef(null),{data:d,isLoading:p}=QC(e.id),{data:f,isLoading:h}=(()=>{const e=ae();return{...me({queryKey:GC.editorData(),queryFn:YC,...xe}),invalidateEditorData:()=>e.invalidateQueries({queryKey:GC.editorData()})}})(),[m,g]=n.useState(!1),[y,v]=n.useState(!1),{updateCommunicationGroup:b}=u$();return n.useEffect((()=>{if(o&&window.UIEditor&&d?.communicationGroupId&&window.StripoEditorApi?.actionsApi){a(d.communicationGroupId);window.StripoEditorApi.actionsApi.compileEmail({callback:function(e,t){e||(b({groupId:d.communicationGroupId,params:{email_html_body:t}}),v(!0))},minimize:!0,mergeTags:[],forseAmp:!1,resetDataSavedFlag:!1,disableLineHeightsReplace:!0});window.StripoEditorApi.actionsApi.save((function(e){e||g(!0)}))}}),[o,u,i,r,d,b,a]),n.useEffect((()=>{(async()=>{m&&y&&(window.UIEditor&&window.UIEditor.removeEditor(),i(!1),g(!1),v(!1),r(!1))})()}),[m,y,r,i]),n.useEffect((()=>{f?.businessId&&u.current&&d&&(c.current||(vz({emailId:d.communicationGroupId,html:d.html||"<div></div>",css:d.css||"",container:u.current,businessId:f.businessId,mergeFields:l.mergeFields||[]}).catch((e=>{})),c.current=!0))}),[f,l,d]),t.jsx("div",p||h||!f||!d?{className:"w-full h-full flex flex-col items-center justify-center",children:t.jsx(XC,{text:["Loading editor..."]})}:{className:"w-full h-full flex flex-col",children:t.jsx(gz,{containerRef:u,stripoDialogDimensions:s,showSaving:o})})},xz=({automation:e,mergeFieldsResponse:r,communicationGroup:o,updateCommunicationGroup:i})=>{const[s,a]=n.useState(!1),[l,c]=n.useState(o.email_channel_sender_id||null),[u,d]=n.useState(o.email_subject||null),[p,f]=n.useState(o.email_preview_text||null),[h,m]=n.useState(o.email_html_body||null),[g,y]=n.useState(!1),[v,b]=n.useState(!1),[x,w]=n.useState(""),[S,C]=n.useState(""),[k,E]=n.useState(null),{refetchAutomation:_}=je(e.id),[j,T]=n.useState(!1),N=n.useRef(!0),[P,D]=n.useState(!0),[M,A]=n.useState(!1),O=dz(u,500),R=dz(p,500),L=dz(x,500),I=dz(S,500),{channelSenders:F}=m$(),{channelAccounts:$}=pz(),{updateChannelSender:q}=g$(),U=n.useMemo((()=>F?.results?.filter((e=>e.channel_sender_metadata.userPart))?.flatMap((e=>{const t=$?.results?.find((t=>t.id===e.channel_account_id));return t&&t.channel_account_metadata.type===fz.REACH_MANAGED?[{channel_sender_id:e.id,full_domain:`${e.channel_sender_metadata.userPart}@${e.channel_sender_metadata.baseDomain}`}]:[]}))||[]),[F?.results,$?.results]),[z,B]=n.useState({width:0,height:0}),V=n.useMemo((()=>({width:800,height:400})),[]),K=n.useRef(null);return n.useEffect((()=>{const e=setTimeout((()=>{N.current=!1}),500);return()=>clearTimeout(e)}),[]),n.useEffect((()=>{o.email_html_body&&m(o.email_html_body)}),[o.email_html_body,_]),n.useEffect((()=>{if(s){const e=setTimeout((()=>{a(!1)}),2e3);return()=>clearTimeout(e)}}),[s]),n.useEffect((()=>{const e=()=>{B({width:window.innerWidth,height:window.innerHeight})};return e(),window.addEventListener("resize",e),()=>{window.removeEventListener("resize",e)}}),[]),n.useEffect((()=>{if(!N.current&&l&&O&&h&&o.id){a(!0);(async()=>{try{i({groupId:o.id,params:{email_channel_sender_id:l,email_html_body:h,email_subject:O,...R&&{email_preview_text:R}}})}catch(e){}finally{a(!1)}})()}}),[l,O,R,h,o.id,i]),n.useEffect((()=>{if(F?.results&&l){const e=F.results.find((e=>e.id===l));e&&(w(e.channel_sender_metadata.emailFromName),M&&!P||C(e.channel_sender_metadata.emailReplyTo),D(!1))}}),[F?.results,l,M,P]),n.useEffect((()=>{if(F?.results&&!l){const e=F.results.filter((e=>e.channel_sender_metadata.userPart));if(e[0]){const t=e[0];c(t.id),i({groupId:o.id,params:{email_channel_sender_id:t.id}})}}}),[F?.results,l,o.id,i]),n.useEffect((()=>{if(!N.current&&L&&l){a(!0);(async()=>{try{const e=F?.results?.find((e=>e.id===l));e&&await q({id:l,toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailFromName:L}}})}catch(e){}finally{a(!1)}})()}}),[L,F?.results,l,q]),n.useEffect((()=>{if(I){const e=/^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(I);E(e?null:"Please enter a valid email address")}else E(null)}),[I]),n.useEffect((()=>{if(!N.current&&I&&l&&!k){a(!0);(async()=>{try{const e=F?.results?.find((e=>e.id===l));e&&await q({id:l,toUpdate:{channel_sender_metadata:{...e.channel_sender_metadata,emailReplyTo:I}}})}catch(e){}finally{a(!1)}})()}}),[I,F?.results,l,q,k]),n.useEffect((()=>{!1===g&&o.id&&_()}),[g,o.id,_]),$&&F?t.jsxs("div",{className:"relative",children:[t.jsx(Lm,{open:j,onOpenChange:T,children:t.jsxs($m,{className:"max-h-[86vh] gap-0 overflow-visible max-w-3xl w-full h-full",children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Email Preview Help"}),t.jsx(zm,{children:"Learn more about the email preview and how to use it to create your email."})]}),t.jsx(hz,{})]})}),t.jsx(Lm,{open:g,onOpenChange:y,children:t.jsxs($m,{className:"min-w-[100vw] min-h-[100vh]",hideCloseButton:!0,children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Email Editor"}),t.jsx(zm,{children:"Learn more about the email editor and how to use it to create your email."})]}),t.jsxs("div",{className:"w-full h-full",children:[t.jsxs("div",{className:"flex justify-between items-center p-1 border-b",children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsx("h2",{className:"text-lg font-medium",children:"Email Editor"}),t.jsx(pN,{title:"Click to learn more about email template ",onClick:()=>T(!0)})]}),t.jsx("button",{onClick:()=>b(!0),className:"text-sm bg-black text-white px-3 py-1 rounded",children:"Save"})]}),t.jsx("div",{className:" w-full",children:t.jsx(bz,{showStripoEditor:g,automation:e,setShowStripoEditor:y,saveClicked:v,setSaveClicked:b,stripoDialogDimensions:z,mergeFieldsResponse:r,setCommunicationGroupId:()=>{}})})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(XP,{children:"From Email"}),t.jsxs(DF,{onValueChange:e=>{c(e),D(!0),A(!1)},value:l??void 0,disabled:s,children:[t.jsx(AF,{children:t.jsx(MF,{placeholder:"Select email",children:l?U?.find((e=>e.channel_sender_id===l))?.full_domain:""})}),t.jsx(LF,{children:U?.map((e=>t.jsx(IF,{value:e.channel_sender_id,children:e.full_domain},e.channel_sender_id)))})]})]}),t.jsxs("div",{children:[t.jsx(XP,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["From Name",t.jsx(pN,{title:"This will be the friendly name of the sender that the customer will see in the inbox",alertText:"Changes to the sender name will be applied across all emails using this address"})]})}),t.jsx(mk,{placeholder:"Enter from name",value:x??"",onChange:e=>w(e.target.value),disabled:s||!l||P})]}),t.jsxs("div",{children:[t.jsx(XP,{children:t.jsxs("div",{className:"flex items-center gap-2 py-1",children:["Reply To Email",t.jsx(pN,{title:"This will be the email address that customer can reply to on the email",alertText:"Changes to the reply to email will be applied across all emails using this address"})]})}),t.jsx(mk,{placeholder:"Enter reply to email",value:S??"",onChange:e=>{C(e.target.value),A(!0)},disabled:s||!l||P}),k&&t.jsx("p",{className:"text-sm text-red-500 mt-1",children:k})]}),t.jsxs("div",{children:[t.jsx(XP,{children:"Subject"}),t.jsx(mk,{placeholder:"Enter email subject",value:u??"",onChange:e=>d(e.target.value),disabled:s||P})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(XP,{children:"Preview Text"}),t.jsx(pN,{title:"This text will be used for the preview text of the email in the inbox"})]}),t.jsx(mk,{placeholder:"Enter preview text",value:p??"",onChange:e=>f(e.target.value),disabled:s||P})]})]}),t.jsxs("div",{className:"border rounded-lg p-4 h-full flex flex-col",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsxs("div",{children:[t.jsx(nk,{onClick:()=>y(!0),className:"text-sm px-3 py-1 rounded",disabled:s||0===(U?.length??0),children:"Edit"}),0===(U?.length??0)&&t.jsx("div",{className:"relative inline-block",children:t.jsx("div",{className:"absolute right-0 top-full mt-2 w-64 p-3 bg-white border rounded-lg shadow-lg z-10",children:t.jsx(mz,{type:"email"})})})]})]}),t.jsx("div",{className:"flex-1 w-full overflow-auto",ref:K,style:{height:"400px"},children:t.jsx(b$,{html:h??"",height:V.height,width:V.width})})]})]})]}):t.jsx("div",{className:"flex justify-center items-center flex-1 h-full bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",children:t.jsx(XC,{text:["Fetching Email Preview..."]})})};var wz="Checkbox",[Sz,Cz]=s_(wz),[kz,Ez]=Sz(wz),_z=i.forwardRef(((e,n)=>{const{__scopeCheckbox:r,name:o,checked:s,defaultChecked:a,required:l,disabled:c,value:u="on",onCheckedChange:d,form:p,...f}=e,[h,m]=i.useState(null),g=uf(n,(e=>m(e))),y=i.useRef(!1),v=!h||(p||!!h.closest("form")),[b=!1,x]=DT({prop:s,defaultProp:a,onChange:d}),w=i.useRef(b);return i.useEffect((()=>{const e=h?.form;if(e){const t=()=>x(w.current);return e.addEventListener("reset",t),()=>e.removeEventListener("reset",t)}}),[h,x]),t.jsxs(kz,{scope:r,state:b,disabled:c,children:[t.jsx(f_.button,{type:"button",role:"checkbox","aria-checked":Pz(b)?"mixed":b,"aria-required":l,"data-state":Dz(b),"data-disabled":c?"":void 0,disabled:c,value:u,...f,ref:g,onKeyDown:i_(e.onKeyDown,(e=>{"Enter"===e.key&&e.preventDefault()})),onClick:i_(e.onClick,(e=>{x((e=>!!Pz(e)||!e)),v&&(y.current=e.isPropagationStopped(),y.current||e.stopPropagation())}))}),v&&t.jsx(Nz,{control:h,bubbles:!y.current,name:o,value:u,checked:b,required:l,disabled:c,form:p,style:{transform:"translateX(-100%)"},defaultChecked:!Pz(a)&&a})]})}));_z.displayName=wz;var jz="CheckboxIndicator",Tz=i.forwardRef(((e,n)=>{const{__scopeCheckbox:r,forceMount:o,...i}=e,s=Ez(jz,r);return t.jsx(NT,{present:o||Pz(s.state)||!0===s.state,children:t.jsx(f_.span,{"data-state":Dz(s.state),"data-disabled":s.disabled?"":void 0,...i,ref:n,style:{pointerEvents:"none",...e.style}})})}));Tz.displayName=jz;var Nz=e=>{const{control:n,checked:r,bubbles:o=!0,defaultChecked:s,...a}=e,l=i.useRef(null),c=FF(r),u=iT(n);i.useEffect((()=>{const e=l.current,t=window.HTMLInputElement.prototype,n=Object.getOwnPropertyDescriptor(t,"checked").set;if(c!==r&&n){const t=new Event("click",{bubbles:o});e.indeterminate=Pz(r),n.call(e,!Pz(r)&&r),e.dispatchEvent(t)}}),[c,r,o]);const d=i.useRef(!Pz(r)&&r);return t.jsx("input",{type:"checkbox","aria-hidden":!0,defaultChecked:s??d.current,...a,tabIndex:-1,ref:l,style:{...e.style,...u,position:"absolute",pointerEvents:"none",opacity:0,margin:0}})};function Pz(e){return"indeterminate"===e}function Dz(e){return Pz(e)?"indeterminate":e?"checked":"unchecked"}var Mz=_z,Az=Tz;const Oz=({selectedChannels:e,setSelectedChannels:n,iconDefinitions:r})=>{const{toast:o}=wl(),i=[{label:"Email",value:"email",icon:r.EmailIcon,checked:e.includes("email")},{label:"SMS",value:"sms",icon:r.SmsIcon,checked:e.includes("sms")}];return t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx("h3",{className:"text-xl",children:"Message Types"}),t.jsx("p",{className:"text-gray-600 mb-2 text-sm",children:"Select the channels you want to use in this automation"})]}),t.jsx("div",{className:"w-full grid grid-cols-2 gap-3",children:i.map((r=>t.jsxs(Mz,{checked:r.checked,onCheckedChange:()=>{"email"===r.value?e.includes("email")?e.includes("sms")?n(["sms"]):o({title:"Cant Remove Email",description:"At least one channel is required for an automation",variant:"destructive"}):n([...e,"email"]):e.includes("sms")?e.includes("email")?n(["email"]):o({title:"Cant Remove SMS",description:"At least one channel is required for an automation",variant:"destructive"}):n([...e,"sms"])},className:"relative ring-[1px] ring-border rounded-lg px-4 py-3 text-start text-muted-foreground data-[state=checked]:ring-2 data-[state=checked]:ring-primary data-[state=checked]:text-primary",children:[t.jsx(r.icon,{className:"mb-3",size:20}),t.jsx("span",{className:"font-medium tracking-tight",children:r.label}),t.jsx(Az,{className:"absolute top-2 right-2",children:t.jsx(ou,{className:"fill-primary text-primary-foreground"})})]},r.value)))})]})},Rz=async()=>(await Ee("/businesses/me")).data,Lz=["me"],Iz=({automation:e,iconDefinitions:r,mergeFieldsResponse:o})=>{const[i,s]=n.useState(!1),a=n.useCallback((()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return t?.action_metadata.communication_group_id}),[e.action_data]),[l,c]=n.useState(""),[u,d]=n.useState(null),[p,f]=n.useState(!1),[h,m]=n.useState(null),[g,y]=n.useState(null),[v,b]=n.useState(!1),{channelSenders:x}=m$(),{data:w,isLoading:S}=me({queryKey:Lz,queryFn:Rz,...xe}),{channelAccounts:C}=pz(),{updateCommunicationGroup:k}=u$(),{communicationGroup:E}=c$(a()??void 0),_=n.useRef(null),j=dz(g,1e3),T=dz(u,1e3),N=dz(h,1e3),P=e=>D?.find((t=>t.id===e))?.channel_sender_metadata.friendlyName??D?.find((t=>t.id===e))?.channel_sender_metadata.from??e;n.useEffect((()=>{if(null!==T&&null!==j&&!i){s(!0);const e=a();e&&k({groupId:e,params:{sms_channel_sender_id:T,sms_message_body:j,text_message_company_name:N}}),s(!1)}}),[T,j,N,i,k,a]),n.useEffect((()=>{E&&(d(E.sms_channel_sender_id),y(E.sms_message_body),E.text_message_company_name&&m(E.text_message_company_name))}),[E]);if(n.useEffect((()=>{if(void 0!==x&&!u){const e=x.results.filter((e=>e.channel_sender_metadata.from));e?.[0]&&(d(e[0].id),E?.id&&k({groupId:E.id,params:{sms_channel_sender_id:e[0].id}}))}}),[x,u,E?.id,k]),n.useEffect((()=>{h||!w?.name||p||(f(!0),m(w.name))}),[h,w?.name,p]),!C||!x||S)return t.jsx("div",{children:t.jsx(XC,{text:["Loading..."]})});const D=x.results.filter((e=>e.channel_sender_metadata.from||e.channel_sender_metadata.messageServiceSid));return t.jsxs("div",{children:[t.jsx(Lm,{open:v,onOpenChange:b,children:t.jsxs($m,{children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"SMS Editor"}),t.jsx(zm,{children:"Learn more about the SMS editor and how to use it to create your SMS."})]}),t.jsxs("div",{className:"",children:[t.jsx(gk,{ref:_,className:"min-h-[300px]",placeholder:"Text message content...",value:g??"",onChange:e=>{y(e.target.value)},maxLength:1600-(h?.length||0)}),t.jsxs("div",{className:"mt-2 flex items-center justify-end gap-2",children:[t.jsxs(DF,{value:l,onValueChange:e=>{const t=_.current,n=g||"",r=t?.selectionStart??n.length,o=t?.selectionEnd??n.length,i=n.slice(0,r)+e+n.slice(o);y(i),c(""),setTimeout((()=>{const n=r+e.length;t?.focus(),t?.setSelectionRange(n,n)}),0)},children:[t.jsx(AF,{className:"w-[50px]",children:t.jsx(r.MergeField,{className:"w-4 h-4"})}),t.jsx(LF,{children:o?.mergeFields?.map((e=>e.entries.map((e=>t.jsx(IF,{value:e.value,children:e.label},e.value))))).flat()})]}),t.jsx(pN,{title:"Dynamic content is a way to insert dynamic content into your messages such as the customer's name, email, or other details."})]}),t.jsxs("div",{className:"flex justify-end mt-2 text-sm transition-colors duration-300 "+(g&&g.length>1400?g.length>=1600?"text-red-500":"text-amber-500":"text-gray-500"),children:[g?g.length:0,"/",1600-(h?.length||0)," ","characters"]})]})]})}),t.jsxs("div",{className:"grid grid-cols-2 gap-6",children:[t.jsxs("div",{className:"space-y-4",children:[t.jsxs("div",{children:[t.jsx(XP,{children:"From Number"}),t.jsxs(DF,{onValueChange:e=>{d(e)},value:u??void 0,children:[t.jsx(AF,{children:t.jsx(MF,{placeholder:"Select number",children:u?P(u):"Select number"})}),t.jsx(LF,{children:D?.map((e=>t.jsx(IF,{value:e.id,children:e.channel_sender_metadata.friendlyName??e.channel_sender_metadata.from??"Select number"},e.id)))})]})]}),t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2 py-1",children:[t.jsx(XP,{children:"Company Name"}),t.jsx(pN,{title:"Adding your company name can help customers identify who they are talking to"})]}),t.jsx(mk,{placeholder:"Enter company name",value:h??"",onChange:e=>{m(e.target.value??null)},disabled:!u})]})]}),t.jsxs("div",{className:"border rounded-lg p-4",children:[t.jsxs("div",{className:"flex justify-between items-center mb-4",children:[t.jsx("h3",{className:"font-medium",children:"Preview"}),t.jsx("div",{children:t.jsx(nk,{onClick:()=>b(!0),className:"text-sm px-3 py-1 rounded ",disabled:0===(D?.length??0),children:"Edit"})})]}),t.jsx("div",{children:u?t.jsx(t.Fragment,{children:u&&g?t.jsx(w$,{fromPhone:P(u),body:h?`${h}:\n${g}`:g}):t.jsx(v$,{type:"sms"})}):t.jsx(mz,{type:"sms"})})]})]})]})},Fz=({automation:e,iconDefinitions:r,getExtraMergeFields:o,communicationGroup:i,updateAutomation:s,updateCommunicationGroup:a})=>{const[l,c]=n.useState(null),u=n.useRef(null),{toast:d}=wl(),{getMergeFields:p,isGetting:f}=d$(i?.id??void 0),[h,m]=n.useState(void 0);n.useEffect((()=>{const e=i?.id;e&&l&&(l.includes("email")||a({groupId:e,params:{email_channel_sender_id:null}}),l.includes("sms")||a({groupId:e,params:{sms_channel_sender_id:null}}))}),[l,a,i]),n.useEffect((()=>{const e=i?.id;e||l||c(["email"])}),[e,i,l]);const g=n.useCallback((e=>{const t=[];e.email_channel_sender_id&&t.push("email"),e.sms_channel_sender_id&&t.push("sms"),0===t.length&&t.push("email"),c(t)}),[]);return n.useEffect((()=>{i&&!l&&g(i)}),[i,g,l]),n.useEffect((()=>{f||void 0===h&&(o?o().then((e=>{if(i?.id){g(i);const t=new Set((i.extra_merge_fields||[]).map((e=>e.templateName))),n=e.filter((e=>!t.has(e.templateName)));i.extra_merge_fields&&n.length>0&&d({title:"Oops!",description:"Check your merge fields, it looks like some are missing!",variant:"destructive"}),a({groupId:i?.id,params:{extra_merge_fields:e}})}const t={mergeFields:[...p?.mergeFields||[],...e.map((e=>({category:"Extra Fields Passed In",entries:[{label:e.displayName||"Untitled Field",value:uz({mergeFieldName:e.templateName||""})}]})))]},n={mergeFields:Object.values(t.mergeFields.reduce(((t,n)=>{if("Extra Fields"===n.category||"Extra Fields Passed In"===n.category){const r="Extra Fields";t[r]||(t[r]={category:r,entries:[]});const o=n.entries.map((t=>{const n=e?.find((e=>uz({mergeFieldName:e.templateName})===t.value));return{...t,label:n?.displayName||t.label}})),i=new Set(t[r].entries.map((e=>e.value))),s=o.filter((e=>!i.has(e.value)));t[r].entries=[...t[r].entries,...s]}else if(t[n.category]){const e=new Set(t[n.category].entries.map((e=>e.value))),r=n.entries.filter((t=>!e.has(t.value)));t[n.category].entries=[...t[n.category].entries,...r]}else t[n.category]=n;return t}),{}))};m(n)})):(i?.id&&null!==i.extra_merge_fields&&a({groupId:i?.id,params:{extra_merge_fields:null}}),m(p)))}),[o,a,i,d,f,p,h,g]),l&&!f&&h?t.jsxs("div",{className:"flex flex-col gap-4 flex-shrink-0",children:[t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",children:t.jsx(Oz,{selectedChannels:l,setSelectedChannels:c,iconDefinitions:r})}),l.includes("email")&&t.jsxs("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",ref:u,children:[t.jsx("h4",{className:"text-xl",children:"Email Campaign"}),t.jsx(xz,{automation:e,iconDefinitions:r,updateAutomation:s,communicationGroup:i,updateCommunicationGroup:a,mergeFieldsResponse:h})]}),l.includes("sms")&&t.jsxs("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",children:[t.jsx("h4",{className:"text-xl",children:"SMS Campaign"}),t.jsx(Iz,{automation:e,iconDefinitions:r,mergeFieldsResponse:h})]})]}):t.jsx("div",{className:"flex justify-center items-center flex-1 h-full bg-white rounded-2xl w-full border border-gray-200 p-6 space-y-4 relative",children:t.jsx(XC,{text:["Fetching Content..."]})})},$z="reach-styles-module__header___-izE2",qz="reach-styles-module__title___n1hA9",Uz="reach-styles-module__description___EvXM-",zz="reach-styles-module__content___okv68",Bz="reach-styles-module__footer___YA4U4",Vz=Vc("reach-styles-module__base___zJcoE",{variants:{variant:{default:"reach-styles-module__default___88Q0d",destructive:"reach-styles-module__destructive___5EWhN",outline:"reach-styles-module__outline___gj9sC",secondary:"reach-styles-module__secondary___cN5Wj"}},defaultVariants:{variant:"default"}}),Kz=i.forwardRef((({className:e,variant:n,...r},o)=>t.jsx("div",{ref:o,className:_d(Vz({variant:n}),e),...r})));Kz.displayName="Card";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d($z,e),...n}))).displayName="CardHeader";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(qz,e),...n}))).displayName="CardTitle";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(Uz,e),...n}))).displayName="CardDescription";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(zz,e),...n}))).displayName="CardContent";i.forwardRef((({className:e,...n},r)=>t.jsx("div",{ref:r,className:_d(Bz,e),...n}))).displayName="CardFooter";const Hz=({iconDefinitions:e,includeSegments:r,excludeSegments:o,title:i="Estimated Matches",subtitle:s})=>{const{data:a,isLoading:l,refetchCount:c}=$P({include_segments:r,exclude_segments:o});n.useEffect((()=>{c()}),[r,o]);const u=n.useMemo((()=>a?.recipients?a.recipients.reduce(((e,t)=>({emails:e.emails+(t.email?1:0),phones:e.phones+(t.phone?1:0)})),{emails:0,phones:0}):{emails:0,phones:0}),[a?.recipients]);return t.jsxs("div",{className:"w-full p-4",children:[t.jsxs("div",{className:"mb-4 md:mb-6",children:[t.jsx("h3",{className:"text-xl font-semibold text-gray-900",children:i}),s&&t.jsx("p",{className:"mt-1 text-sm text-gray-500",children:s})]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[30rem]:grid-cols-3 gap-2 md:gap-3 mb-4 md:mb-6",children:[t.jsx(qC.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsx("div",{className:"hidden @[200px]/card:block bg-blue-100/50 rounded-xl p-2.5",children:t.jsx(e.UserIcon,{className:"w-5 h-5 text-blue-600"})}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Total Matches"}),t.jsx("p",{className:"text-xl font-semibold text-gray-900 truncate",children:l?t.jsx("span",{className:"animate-pulse",children:"..."}):a?.count?.toLocaleString()??0})]})]})}),t.jsx(qC.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(qC.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-blue-100/50 text-blue-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.emails/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Email Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.emails}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.emails?"contact":"contacts"})]})]})]})}),t.jsx(qC.div,{layout:!0,transition:{duration:.2},className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl p-4 border border-gray-100",children:t.jsxs("div",{className:"@container/card grid grid-cols-[auto,1fr] items-center gap-3",children:[t.jsxs(qC.div,{layout:!0,initial:{scale:.9},animate:{scale:1},className:"hidden @[200px]/card:block bg-green-100/50 text-green-700 px-2 sm:px-3 py-1 sm:py-1.5 rounded-lg font-medium text-[10px] sm:text-sm w-[48px] sm:w-[56px] text-center",children:[Math.round(u.phones/(a?.count||1)*100),"%"]}),t.jsxs("div",{className:"min-w-0",children:[t.jsx("p",{className:"text-sm text-gray-500",children:"Phone Reach"}),t.jsxs("div",{className:"flex items-baseline gap-2",children:[t.jsx("p",{className:"text-xl font-semibold text-gray-900",children:u.phones}),t.jsx("p",{className:"text-sm text-gray-500 hidden @[250px]/card:inline",children:1===u.phones?"contact":"contacts"})]})]})]})})]})}),!l&&a?.recipients&&t.jsx("div",{className:"bg-gray-50/50 backdrop-blur-sm rounded-2xl border border-gray-100 overflow-hidden",children:t.jsx("div",{className:"max-h-[240px] overflow-y-auto",children:t.jsxs("table",{className:"w-full",children:[t.jsx("thead",{className:"sticky top-0 bg-gray-100/90 backdrop-blur-sm",children:t.jsxs("tr",{children:[t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Name"}),t.jsx("th",{className:"px-3 sm:px-4 py-3 text-left text-xs font-medium text-gray-500 uppercase tracking-wide",children:"Contact"})]})}),t.jsx("tbody",{className:"divide-y divide-gray-200/50",children:a.recipients.map(((e,n)=>t.jsxs("tr",{className:"hover:bg-white/50 transition-colors",children:[t.jsxs("td",{className:"px-3 sm:px-4 py-3 text-sm text-gray-900",children:[e.first_name," ",e.last_name]}),t.jsx("td",{className:"px-3 sm:px-4 py-3",children:t.jsxs("div",{className:"flex flex-wrap gap-1.5 sm:gap-2",children:[e.email&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-blue-100/50 text-blue-700 rounded-lg",children:"Email"}),e.phone&&t.jsx("span",{className:"px-2 sm:px-2.5 py-1 text-xs font-medium bg-green-100/50 text-green-700 rounded-lg",children:"Phone"})]})})]},n)))})]})})})]})},Wz=({data:e,placeholder:n,searchPlaceholder:r,noResultsMessage:o,value:s,setValue:a})=>{const[l,c]=i.useState(!1);return t.jsxs(VM,{open:l,onOpenChange:c,modal:!0,children:[t.jsx(KM,{asChild:!0,children:t.jsxs(nk,{variant:"outline",role:"combobox","aria-expanded":l,className:"w-[200px] justify-between",children:[s?e.find((e=>e.value===s))?.label:n,t.jsx(nu,{className:"opacity-50"})]})}),t.jsx(HM,{className:"w-[200px] p-0",children:t.jsxs(WD,{children:[t.jsx(GD,{placeholder:r,className:"h-9"}),t.jsxs(YD,{children:[t.jsx(QD,{children:o}),t.jsx(XD,{children:e.map((e=>t.jsxs(ZD,{value:e.value,onSelect:e=>{a(e===s?"":e),c(!1)},children:[e.label,t.jsx(Xc,{className:_d("ml-auto",s===e.value?"opacity-100":"opacity-0")})]},e.value)))})]})]})})]})},Gz=({automation:e})=>{const r=()=>Ae(e.trigger_metadata)&&e.trigger_metadata.scheduled_at?new Date(e.trigger_metadata.scheduled_at):jN(new Date,15),[o,s]=i.useState(r()),[a,l]=i.useState(r()<new Date?"Please select a time in the future":null),[c,u]=i.useState(hP(o,"HH:mm")),{updateAutomation:d}=Pe(e.id),[p,f]=i.useState(Ae(e.trigger_metadata)&&e.trigger_metadata.timezone?e.trigger_metadata.timezone:Intl.DateTimeFormat().resolvedOptions().timeZone),h=Intl.supportedValuesOf("timeZone").map((e=>({label:e,value:e}))),m=e=>{const t=jN(new Date,15);new Date(e.toLocaleString("en-US",{timeZone:p}))<new Date(t.toLocaleString("en-US",{timeZone:p}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(e))};return n.useEffect((()=>{const e=new Date(o.toLocaleString("en-US",{timeZone:p})),t=-e.getTimezoneOffset(),n=Math.floor(Math.abs(t)/60).toString().padStart(2,"0"),r=(Math.abs(t)%60).toString().padStart(2,"0"),i=t>=0?"+":"-",s=`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,"0")}-${String(e.getDate()).padStart(2,"0")}T${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}:00${i}${n}:${r}`;d({trigger:{trigger_type:Me.ONE_TIME,scheduled_at:s,timezone:p}})}),[o,p,d,e.id]),t.jsxs("div",{className:"flex flex-col items-center justify-center h-full",children:[t.jsxs("div",{className:"flex flex-col sm:flex-row gap-2 w-full ",children:[t.jsxs(VM,{children:[t.jsx(KM,{asChild:!0,children:t.jsxs(nk,{variant:"outline",className:_d("w-full sm:w-[280px] justify-start text-left font-normal",!o&&"text-muted-foreground"),children:[t.jsx(Qc,{className:"mr-2 h-4 w-4"}),o?hP(o,"PPP"):t.jsx("span",{children:"Pick a date"})]})}),t.jsx(HM,{className:"w-auto p-0",children:t.jsx(KR,{mode:"single",selected:o,onSelect:e=>{if(!e)return;const[t,n]=c.split(":").map(Number);e.setHours(t,n),m(e)},disabled:e=>{const t=new Date;return t.setHours(0,0,0,0),e<t},initialFocus:!0})})]}),t.jsx("input",{type:"time",value:c,onChange:e=>{if(u(e.target.value),o&&e.target.value){const[t,n]=e.target.value.split(":").map(Number),r=new Date(o);r.setHours(t,n),m(r)}},className:_d("flex h-9 w-full sm:w-[150px] rounded-md border border-input bg-background px-3 py-2 text-sm ring-offset-background","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",a&&"border-red-500")}),t.jsx(Wz,{data:h,placeholder:"Select timezone...",searchPlaceholder:"Search timezone...",noResultsMessage:"No timezone found",value:p,setValue:e=>{const t=new Date(o.toLocaleString("en-US",{timeZone:e})),n=jN(new Date,15);t<new Date(n.toLocaleString("en-US",{timeZone:e}))?l("Please select a time at least 15 minutes in the future"):(l(null),s(t),f(e))}})]}),a&&t.jsxs("p",{className:"text-destructive text-sm mt-2 flex items-center",children:[t.jsx("span",{className:"mr-2",children:"⚠️"}),a]})]})},Yz=({iconDefinitions:e,automation:r,updateAutomation:o})=>{const[i,s]=n.useState(null);return t.jsx("div",{className:"@container",children:t.jsx(qC.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.5,delay:.2},className:"w-full",children:t.jsxs("div",{className:"flex @[1000px]:flex-row flex-col gap-8 items-center",children:[t.jsxs("div",{className:"flex-1 w-full",children:[t.jsxs("div",{className:"grid grid-cols-1 @[480px]:grid-cols-2 gap-4",children:[t.jsx(ik,{selected:"sendNow"===i,title:"Send Now",subtitle:"Campaign will begin sending in 5 minutes",icon:t.jsx(e.SendButton,{}),onClick:()=>{s("sendNow"),o({trigger:{trigger_type:Me.ONE_TIME,scheduled_at:new Date(Date.now()+3e5).toISOString()}})}}),t.jsx(ik,{selected:"schedule"===i,title:"Schedule",subtitle:"Choose date and time",icon:t.jsx(e.ScheduleButton,{}),onClick:()=>s("schedule")})]}),t.jsx(ng,{children:"schedule"===i&&t.jsx(qC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3},className:"overflow-hidden mt-8",children:t.jsx("div",{className:"bg-gray-50 rounded-xl p-5 border border-gray-100 flex items-center justify-center",children:t.jsx(Gz,{automation:r})})})})]}),Ae(r.trigger_metadata)&&r.trigger_metadata.scheduled_at&&t.jsxs(qC.div,{initial:{opacity:0,y:10,scale:.98},animate:{opacity:1,y:0,scale:1},transition:{duration:.6,ease:[.23,1,.32,1],delay:.1},className:"@[1000px]:w-80 max-w-md w-full shrink-0 h-fit p-4 bg-blue-50 rounded-xl border border-blue-100 backdrop-blur-sm",children:[t.jsx(qC.p,{initial:{opacity:0},animate:{opacity:.8},transition:{delay:.3,duration:.4},className:"text-sm font-medium text-gray-700",children:"Currently scheduled for:"}),t.jsx(qC.p,{initial:{opacity:0},animate:{opacity:1},transition:{delay:.4,duration:.4},className:"text-md font-bold text-gray-800",children:new Date(r.trigger_metadata.scheduled_at).toLocaleString("en-US",{weekday:"long",month:"long",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit",hour12:!0,timeZoneName:"short",timeZone:r.trigger_metadata.timezone||void 0})})]})]})})})},Qz=({automation:e,iconDefinitions:r,isLoading:o,communicationGroup:i,updateAutomation:s})=>{const{updateAutomation:a}=Pe(e.id),l=s||(e=>a(e)),{channelSenders:c}=m$(),{channelAccounts:u}=pz(),[d,p]=n.useState(null),[f,h]=n.useState(null),[m,g]=n.useState(null),[y,v]=n.useState(null);return n.useEffect((()=>{c&&g(c),u&&v(u)}),[c,u]),n.useEffect((()=>{if(i&&m&&y){const e=i.email_channel_sender_id,t=i.sms_channel_sender_id,n=m.results.find((t=>t.id===e)),r=m.results.find((e=>e.id===t));if(n&&i.email_subject&&i.email_html_body){const e=n.channel_sender_metadata?.userPart,t=y.results.find((e=>e.id===n.channel_account_id));if(t)switch(t.channel_account_metadata.type){case fz.REACH_MANAGED:p({fromEmail:`${e}@${t.channel_account_metadata.baseDomain}.embedreach.com`,fromName:n.channel_sender_metadata.emailFromName,subject:i.email_subject,previewText:i.email_preview_text,body:i.email_html_body});break;case fz.TWILLIO:break;default:throw hk(t.channel_account_metadata.type,fz)}}r&&i.sms_message_body&&h({fromPhone:y$(r.channel_sender_metadata),body:i.sms_message_body,companyName:i.text_message_company_name})}}),[i,m,y]),o?t.jsx(XC,{text:["Loading..."]}):d||f?t.jsxs("div",{className:"w-full",children:[t.jsxs("div",{className:"flex gap-4 w-full",children:[t.jsx(S$,{emailPreview:d,smsPreview:f,iconDefinitions:r}),t.jsx(Hz,{subtitle:"Estimated recipient count may vary at time of delivery",iconDefinitions:r,includeSegments:e.includeSegmentIds,excludeSegments:e.excludeSegmentIds})]}),e.trigger_type===Me.ONE_TIME&&t.jsx(Kz,{className:"p-4 shadow-sm border-none mt-4",children:t.jsx(Yz,{automation:e,iconDefinitions:r,updateAutomation:l})})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx("div",{children:"No preview data Please complete previous steps"})})},Xz=({iconDefinitions:e,onSelectionChange:r,defaultValue:o="all"})=>{const[i,s]=n.useState(o),a=e=>{s(e),r?.(e)};return t.jsxs("div",{className:"grid grid-cols-2 gap-4",children:[t.jsx(ik,{onClick:()=>a("all"),title:`All ${Fp("engage:user",{count:2})}`,subtitle:"Send to everyone",icon:t.jsx(e.UsersIcon,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"all"===i}),t.jsx(ik,{onClick:()=>a("segments"),title:`Select ${Fp("engage:user",{count:2})}`,subtitle:"Choose from segments",icon:t.jsx(e.UserEdit,{className:"w-5 h-5 mb-2 text-gray-600"}),selected:"segments"===i})]})},Jz=({segments:e,allSegments:r,onAddSegment:o,onRemoveSegment:i,setOpenCreateSegmentDialog:s,iconDefinitions:a})=>{const[l,c]=n.useState([]),u=r.map((e=>({label:e.name,value:e.id})));return n.useEffect((()=>{c(e)}),[e]),t.jsx("div",{children:t.jsx(rL,{selectedValues:l,setSelectedValues:c,options:u,defaultValue:e,onValueChange:t=>{const n=t.filter((t=>!e.includes(t))),r=e.filter((e=>!t.includes(e)));n.forEach(o),r.forEach(i)},placeholder:"Select segments",maxCount:5,extraCommandItems:[e=>t.jsxs(ZD,{onSelect:()=>{e(!1),s(!0)},className:"cursor-pointer",children:[t.jsx(a.PlusIcon,{className:"w-4 h-4"}),"New"]},"new-segment")]})})},Zz=({iconDefinitions:e,includedSegments:r,excludedSegments:o,handleAddSegment:i,handleRemoveSegment:s,setOpenCreateSegmentDialog:a,segments:l,defaultIsExcludeOpen:c=!1})=>{const[u,d]=n.useState(c);return t.jsxs("div",{children:[t.jsx(Jz,{segments:r,allSegments:l?.results||[],onAddSegment:e=>i(e,"include"),onRemoveSegment:e=>s(e,"include"),setOpenCreateSegmentDialog:a,iconDefinitions:e}),t.jsx("div",{className:"border-t border-gray-200 my-8"}),t.jsxs("div",{className:"space-y-4",children:[t.jsxs(nk,{onClick:()=>d(!u),className:"flex items-center gap-1 transition-colors",size:"sm",children:[t.jsx(qC.div,{animate:{rotate:u?180:0},transition:{duration:.2},children:t.jsx(e.DropdownMenuTrigger,{className:"w-5 h-5"})}),t.jsx("span",{children:"Don't send to"})]}),t.jsx(ng,{children:u&&t.jsx(qC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.2,ease:"easeInOut"},style:{},children:t.jsx(Jz,{segments:o,allSegments:l?.results||[],onAddSegment:e=>i(e,"exclude"),onRemoveSegment:e=>s(e,"exclude"),setOpenCreateSegmentDialog:a,iconDefinitions:e})})})]})]})},eB=({iconDefinitions:e,automation:r})=>{const[o,i]=n.useState(!1),[s,a]=n.useState(!1),{segments:l,isLoading:c}=(()=>{const e=me({queryKey:["segments"],queryFn:()=>OP()});return{segments:e.data,isFetching:e.isFetching,isLoading:e.isLoading,fetchError:e.error,refetchSegments:e.refetch}})(),{updateAutomation:u}=Pe(r.id),[d,p]=n.useState(r.includeSegmentIds||[]),[f,h]=n.useState(r.excludeSegmentIds||[]),m=1===d.length&&0===f.length&&void 0!==l?.results?.find((e=>e.type===LP.ALL_USERS&&e.id===d[0])),[g,y]=n.useState(m?"all":"segments");n.useEffect((()=>{(JSON.stringify(r.includeSegmentIds)!==JSON.stringify(d)||JSON.stringify(r.excludeSegmentIds)!==JSON.stringify(f))&&u({include_segments:d,exclude_segments:f})}),[d,f,r.includeSegmentIds,r.excludeSegmentIds,u,r.id]);const v=n.useCallback((()=>l?.results?.find((e=>e.type===LP.ALL_USERS))),[l]);return n.useEffect((()=>{if("all"===g&&l){const e=v();e&&p([e.id]),h([])}}),[g,l,v]),n.useEffect((()=>{if(!s&&l){if(0===r.includeSegmentIds.length&&0===r.excludeSegmentIds.length){y("all");const e=v();return e&&u({include_segments:[e.id],exclude_segments:[]}),void a(!0)}y(m?"all":"segments"),a(!0)}}),[g,d.length,f.length,l,s,m,v,u,r.includeSegmentIds,r.excludeSegmentIds,r.id]),!c&&l&&s?t.jsxs("div",{className:"flex justify-center items-center gap-4",children:[t.jsx(Lm,{open:o,modal:!0,onOpenChange:i,children:t.jsxs($m,{hideCloseButton:!0,children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Create Segment"}),t.jsx(zm,{children:"Create a new segment to use in your automation."})]}),t.jsx(s$,{open:o,setOpen:i})]})}),t.jsxs(qC.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},className:"flex flex-col items-center justify-center flex-1 flex-shrink-0",children:[t.jsx(Xz,{iconDefinitions:e,onSelectionChange:e=>{y(e)},defaultValue:g}),t.jsx(ng,{children:"segments"===g&&t.jsx(qC.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},transition:{duration:.3,ease:"easeInOut"},className:"w-full pt-4",children:t.jsx(Zz,{iconDefinitions:e,includedSegments:d,excludedSegments:f,handleAddSegment:(e,t)=>{"include"===t?p((t=>[...t,e])):h((t=>[...t,e]))},handleRemoveSegment:(e,t)=>{"include"===t?p((t=>t.filter((t=>t!==e)))):h((t=>t.filter((t=>t!==e))))},setOpenCreateSegmentDialog:i,segments:l,defaultIsExcludeOpen:r.excludeSegmentIds?.length>0})})})]}),t.jsx(qC.div,{initial:{opacity:0,x:20},animate:{opacity:1,x:0},transition:{delay:.2},className:" rounded-lg flex flex-col justify-start h-full shadow-sm flex-1 flex-shrink-0",children:t.jsx(Hz,{iconDefinitions:e,includeSegments:d,excludeSegments:f,title:"Estimated Matches",subtitle:"The number of recipients will update in real-time as you add or remove lists."})})]}):t.jsx("div",{children:t.jsx(XC,{text:["Fetching segments","Finishing up"]})})},tB=({title:e,subtitle:n,content:r,className:o})=>t.jsxs("div",{className:Rm("flex flex-col gap-4 w-full p-6",o),children:[t.jsxs("div",{children:[t.jsx("h2",{className:"text-2xl font-semibold",children:e}),n&&t.jsx("p",{className:"text-gray-600 mt-1",children:n})]}),t.jsx("div",{className:"bg-white rounded-2xl w-full border border-gray-200 p-6 relative",children:r})]}),nB={hidden:{opacity:0},visible:{opacity:1,transition:{duration:.5,staggerChildren:.1}}},rB={hidden:{opacity:0,y:10},visible:{opacity:1,y:0,transition:{type:"spring",stiffness:300,damping:24}}},oB=({automation:e})=>t.jsx("div",e.name?{className:"w-full flex justify-center flex-wrap gap-4",children:t.jsxs(qC.div,{className:"bg-white rounded-2xl shadow-sm border border-gray-100 p-6 max-w-lg",variants:nB,initial:"hidden",animate:"visible",children:[t.jsxs("div",{className:"flex items-start gap-4",children:[t.jsx(qC.div,{className:"h-12 w-12 rounded-full bg-blue-50 flex items-center justify-center shrink-0",variants:rB,animate:{scale:[1,1.05,1]},transition:{repeat:1/0,repeatType:"reverse",duration:2},children:t.jsx(Au,{className:"text-primary"})}),t.jsx("div",{children:t.jsx(qC.h2,{className:"text-2xl font-semibold text-primary group",variants:rB,children:e.name})})]}),t.jsx(qC.div,{className:"mt-6 bg-muted rounded-xl p-4",variants:rB,custom:2,children:t.jsx("p",{className:"text-muted-foreground text-sm leading-relaxed",children:e.description})})]})}:{className:"flex items-center justify-center min-h-[200px]",children:t.jsx(XC,{})}),iB=({iconDefinitions:e,handleBack:n,handleNext:r,backText:o,nextText:i,backDisabled:s,nextDisabled:a,hideBack:l,thirdOptionText:c,thirdOptionOnClick:u})=>t.jsxs("div",{className:"flex gap-4 py-2",children:[!l&&t.jsxs(nk,{onClick:n,disabled:s,variant:"secondary",className:_d("flex items-center gap-2",s&&"opacity-50 cursor-not-allowed"),children:[t.jsx(e.BackButton,{}),t.jsx("span",{children:o})]}),c&&u&&t.jsx(nk,{onClick:u,variant:"secondary",className:"flex items-center gap-2",children:t.jsx("span",{children:c})}),t.jsxs(nk,{onClick:r,disabled:a,className:_d("flex items-center gap-2 --reach-destructive",a&&"opacity-50 cursor-not-allowed"),children:[t.jsx("span",{children:i}),t.jsx(e.NextButton,{})]})]}),sB=({automation:e,updateAutomation:r,communicationGroup:o,updateCommunicationGroup:i,iconDefinitions:s,setOpenEditAutomationPopup:a,logoUrl:l,getExtraMergeFields:c,onBeforeSchedule:u,estimatedMatchesStats:d,isLoading:p,validateCanGoToNextStep:f,setIsLoading:h})=>{const{toast:m}=wl(),[g,y]=n.useState(e.trigger_type===Me.TRIGGER_BASED?f$.SelectTrigger:f$.SelectAudience),[v,b]=n.useState(!1),x=(({automation:e,updateAutomation:n,communicationGroup:r,updateCommunicationGroup:o,iconDefinitions:i,getExtraMergeFields:s,handleSaveAsDraft:a,isLoading:l})=>e?[...e.trigger_type===Me.TRIGGER_BASED?[{id:"trigger",title:"Trigger",isValid:()=>!0,step:f$.SelectTrigger,content:t.jsx(tB,{title:"Trigger",content:t.jsx(oB,{iconDefinitions:i,automation:e})},"trigger"),footerConfig:{backText:"Cancel",nextText:"Next",hideBack:!0,backDisabled:!0,nextDisabled:()=>!1}}]:[],{id:"audience",title:"Audience",step:f$.SelectAudience,isValid:()=>e.includeSegmentIds.length>0,content:t.jsx(tB,{title:"Choose Audience",content:t.jsx(eB,{iconDefinitions:i,automation:e})},"audience"),footerConfig:{backText:"Back",nextText:"Next",hideBack:e.trigger_type===Me.ONE_TIME,backDisabled:!1,nextDisabled:()=>!1}},{id:"content",title:"Content",step:f$.SelectCommunication,isValid:()=>{const t=e.action_data?.find((e=>"send_communication"===e.action_type));return!(!t||!t.action_metadata.communication_group_id||!r||!r.sms_channel_sender_id&&!r.email_channel_sender_id||!(!r.email_channel_sender_id||r.email_html_body&&r.email_subject)||r.sms_channel_sender_id&&!r.sms_message_body)},content:t.jsxs("div",{className:"flex flex-col gap-4 w-full p-6 rounded-xl bg-gray-100 flex-1 h-full",children:[t.jsx("h2",{className:"text-2xl font-semibold",children:"Edit Content"}),t.jsx(Fz,{automation:e,updateAutomation:n,communicationGroup:r,updateCommunicationGroup:o,iconDefinitions:i,getExtraMergeFields:s})]},"content"),footerConfig:{backText:"Back",nextText:"Next",hideBack:!1,backDisabled:!1,nextDisabled:()=>!1}},{id:"send",title:"Send",step:f$.PreviewAndSchedule,isValid:()=>Boolean(e.trigger_metadata?.trigger_type===Me.ONE_TIME&&e.trigger_metadata?.scheduled_at&&new Date(e.trigger_metadata.scheduled_at)>new Date&&e.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id))),content:t.jsx(tB,{className:"flex-1",title:"Preview and Schedule",content:t.jsx(Qz,{automation:e,iconDefinitions:i,isLoading:l,communicationGroup:r})},"send"),footerConfig:{backText:"Back",nextText:e.trigger_metadata?.trigger_type===Me.ONE_TIME?"Schedule":"Start",hideBack:!1,backDisabled:!1,nextDisabled:()=>e.trigger_metadata?.trigger_type===Me.ONE_TIME&&!(e.trigger_metadata?.scheduled_at&&new Date(e.trigger_metadata?.scheduled_at)>new Date&&Boolean(e.action_data?.some((e=>"send_communication"===e.action_type&&e.action_metadata.communication_group_id)))),thirdOptionText:"Save as Draft",thirdOptionOnClick:a}}]:[])({automation:e,iconDefinitions:s,getExtraMergeFields:c,handleSaveAsDraft:()=>{h(!0),r({status:Oe.DRAFT}),a(!1),m({title:"Automation saved as draft",description:"You can continue editing it later"}),h(!1)},isLoading:p,communicationGroup:o,updateAutomation:r,updateCommunicationGroup:i});if(p)return t.jsx("div",{className:"flex-1 flex flex-col @container justify-center items-center h-[500px]",children:t.jsx(XC,{text:["Fetching Automation data","Finishing up"]})});const w=async()=>{const{canMove:t,errorMessage:n}=await f({currentStep:g,automation:e,communicationGroup:o});t?g===f$.PreviewAndSchedule?await(async()=>{if(u)try{const e=await u({estimatedEmailRecipients:d.emails,estimatedSmsRecipients:d.phones});!0===e?(h(!0),r({status:Oe.ACTIVE}),a(!1),m({title:"Automation scheduled!"}),h(!1)):m({title:"Oops!",description:e,variant:"destructive"})}catch(e){m({title:"Oops!",description:"An error occurred while checking scheduling conditions",variant:"destructive"})}else h(!0),r({status:Oe.ACTIVE}),a(!1),m({title:"Automation scheduled!"}),h(!1)})():y(g+1):m({title:"Oops!",description:n,variant:"destructive"})},S=()=>{g>f$.SelectTrigger&&y(g-1)};return t.jsxs("div",{className:"flex-1 flex flex-col @container",children:[t.jsxs("header",{className:"w-full flex items-center gap-4 h-16 px-6",children:[t.jsx(nk,{onClick:()=>a(!1),size:"icon",variant:"ghost",children:t.jsx(Zc,{className:"w-4 h-4"})}),l&&t.jsx("div",{className:"flex-shrink-0",children:t.jsx("img",{src:l,alt:"Logo",className:"w-6 h-6"})}),t.jsx("h1",{className:"text-xl font-bold leading-none",children:e.name}),t.jsxs("div",{className:"flex items-center gap-4",children:[t.jsx(jP,{variant:e.status===Oe.ACTIVE?"default":e.status===Oe.DRAFT?"secondary":"outline",children:e.status===Oe.ACTIVE?"Active":e.status===Oe.DRAFT?"Draft":"Inactive"}),t.jsxs("span",{className:"text-xs text-gray-500",children:["Last modified"," ",e?.updated_at?gP(new Date(e.updated_at))+" ago":"N/A"]})]})]}),t.jsxs("main",{className:"flex gap-4 flex-1",children:[t.jsx("div",{className:"hidden @[1000px]:block",children:t.jsx("nav",{className:"space-y-0 w-50 self-start pr-6 pl-8 pt-4 ",children:x.map((n=>t.jsx("div",{className:`\n rounded-md transition-colors\n ${n.step===g?"bg-[var(--reach-secondary)] text-[var(--reach-primary-foreground)] font-medium":n.step<g?"text-muted-foreground hover:bg-muted":"text-muted-foreground/60"}\n `,children:t.jsx(cz,{label:n.title,isActive:n.step===g,isCompleted:n.isValid(),onClick:async()=>{if(!v)if(n.step>g){const{canMove:t,errorMessage:r}=await(async t=>{if(t<=g)return{canMove:!0,errorMessage:null};b(!0);try{for(let n=g;n<t;n++){const{canMove:t,errorMessage:r}=await f({currentStep:n,automation:e,communicationGroup:o});if(!t)return{canMove:t,errorMessage:r}}return{canMove:!0,errorMessage:null}}finally{b(!1)}})(n.step);t?y(n.step):r&&m({title:"Cannot navigate to this step",description:r,variant:"destructive"})}else y(n.step)}})},n.step)))})}),t.jsx("section",{className:"flex-1 mr-6 w-full relative rounded-xl bg-gray-100 ml-6 @[1000px]:ml-0",children:t.jsx("div",{className:"absolute overflow-y-auto top-0 left-0 right-0 bottom-0 flex-1 h-full flex-col flex",children:t.jsx(ng,{children:t.jsx(JC,{className:"pt-0 h-full",children:x.find((e=>e.step===g))?.content},g)})})})]}),t.jsx("footer",{className:"w-full flex justify-end shadow-md z-10 items-center h-16 px-6",children:t.jsx(iB,{iconDefinitions:s,handleBack:S,handleNext:w,hideBack:x.find((e=>e.step===g))?.footerConfig.hideBack??!1,backText:x.find((e=>e.step===g))?.footerConfig.backText??"Back",nextText:x.find((e=>e.step===g))?.footerConfig.nextText??"Next",backDisabled:x.find((e=>e.step===g))?.footerConfig.backDisabled??!1,nextDisabled:x.find((e=>e.step===g))?.footerConfig.nextDisabled()??!1,thirdOptionText:x.find((e=>e.step===g))?.footerConfig.thirdOptionText??void 0,thirdOptionOnClick:x.find((e=>e.step===g))?.footerConfig.thirdOptionOnClick??void 0})})]})},aB=e=>/^[^\s@.]+(?:\.[^\s@.]+)*@[^\s@.]+(?:\.[^\s@.]+)+$/.test(e),lB=e=>{if(!/^[0-9\s()+.-]+$/.test(e))return!1;const t=e.replace(/\D/g,"");return e.startsWith("+")?t.length>=10&&t.length<=15:10===t.length||!(11!==t.length||!t.startsWith("1"))},cB=({automation:e,type:r,setOpenSendPreviewPopup:o,iconDefinitions:i})=>{const[s,a]=n.useState(""),[l,c]=n.useState(""),[u,d]=n.useState(null),[p,f]=n.useState(!1),{sendTestCommunication:h,sendError:m,isSendSuccess:g}=p$(),{toast:y}=wl(),v=e.action_data?.find((e=>"send_communication"===e.action_type)),b=v?.action_metadata.communication_group_id,{communicationGroup:x,isGetting:w}=c$(b??void 0),S=n.useCallback((()=>{if(!b)return Promise.resolve(null);if(!x)return Promise.reject(new Error("Communication group not loaded"));switch(r){case"email":return Promise.resolve(x.email_channel_sender_id);case"sms":return Promise.resolve(x.sms_channel_sender_id);default:return Promise.reject(new Error(`Unsupported type: ${r}`))}}),[x,r,b]);n.useEffect((()=>{(async()=>{try{const e=await S();d(e)}catch(e){d(null)}finally{f(!0)}})()}),[S]),n.useEffect((()=>{g&&(y({title:"Success",description:`Preview ${"email"===r?"email":"SMS"} sent successfully!`}),o(!1))}),[g,r,o,y]),n.useEffect((()=>{m&&(y({title:"Error",description:`Failed to send preview: ${m.message}`,variant:"destructive"}),o(!1))}),[m,y,o]);return!p||w?t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsx(XC,{text:["Fetching sender id","Finishing up"]})}):u?t.jsxs("div",{className:"",children:[t.jsxs("h3",{className:"text-xl font-semibold text-gray-900 mb-4",children:["Send Preview ","email"===r?"Email":"SMS"]}),t.jsx(mk,{type:"email"===r?"email":"tel",placeholder:"email"===r?"Enter email address":"Enter phone number",value:s,onChange:e=>{a(e.target.value),c("")},className:"w-full px-3 py-3 border border-gray-300 rounded-lg text-base mb-4 \n focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent\n placeholder-gray-400"}),l&&t.jsx("p",{className:"text-red-500 text-sm mb-4 -mt-2",children:l}),t.jsx(nk,{onClick:()=>{if(!("email"===r?aB(s):lB(s)))return void c("Please enter a valid "+("email"===r?"email address":"phone number"));if(!u)return void c("No sender found, please update the automation first!");const t=e.action_data?.find((e=>"send_communication"===e.action_type)),n=t?.action_metadata.communication_group_id;if(!n)return Promise.resolve(null);h({id:n,params:"email"===r?{email_address:s}:{phone_number:s}})},disabled:!s,className:"w-full bg-blue-600 text-white py-3 px-6 rounded-lg font-medium\n hover:bg-blue-700 transition-colors duration-200\n disabled:bg-gray-400 disabled:cursor-not-allowed",children:"Send Preview"})]}):t.jsx("div",{className:"flex justify-center items-center h-full",children:t.jsxs("div",{className:"text-center flex flex-col justify-center items-center gap-2",children:[t.jsx(i.AlertCircleIcon,{className:"h-12 w-12 text-gray-400 mb-4"}),t.jsx("h3",{className:"text-lg font-semibold text-gray-700 mb-2",children:"No sender found"}),t.jsx("p",{className:"text-gray-500",children:"Please update the automation to include a sender for this type"})]})})},uB=n.memo((({automation:e,updateAutomation:r,communicationGroup:o,updateCommunicationGroup:i,isLoading:s,setIsLoading:a,iconDefinitions:c,autoOpenEditPopup:u,logoUrl:d,getExtraMergeFields:p,onDuplicationCreated:f,onBeforeSchedule:h,invalidateAutomation:m,estimatedMatchesStats:g,validateStep:y,showBackButton:v=!1})=>{const[b,x]=n.useState(!1),[w,S]=n.useState(!1),[C,k]=n.useState(!1),[E,_]=n.useState(!1),j=ek(c),T=bE(),{toast:N}=wl();n.useEffect((()=>{u&&x(!0)}),[u]);const P=()=>{r({status:Oe.DEACTIVATED}),k(!1)},D=()=>{r({status:Oe.DRAFT})},M=async()=>{const{id:t}=await(async e=>(await Ee(`${l}`,{method:"POST",body:JSON.stringify({duplicate:!0,source_id:e})})).data)(e.id);t?(f&&f(t),N({title:"Automation duplicated!",description:"The automation has been duplicated"})):N({title:"Error duplicating automation",description:"Please try again"})},A=async e=>y(e.currentStep),O=()=>t.jsxs(QU,{modal:!1,children:[t.jsx(XU,{asChild:!0,children:t.jsxs(nk,{children:["Actions",t.jsx(j.DropdownMenuTrigger,{className:"ml-2 h-4 w-4"})]})}),t.jsxs(JU,{children:[e.status===Oe.DRAFT&&t.jsx(ZU,{onClick:()=>x(!0),children:"Edit"}),e.status===Oe.ACTIVE&&t.jsx(ZU,{onClick:D,children:"Convert to Draft"}),e.status!==Oe.COMPLETED&&e.status!==Oe.FAILED&&e.status!==Oe.DEACTIVATED&&t.jsx(ZU,{onClick:()=>k(!0),children:"Cancel"}),t.jsx(ZU,{onClick:()=>S(!0),children:"Send Preview SMS"}),t.jsx(ZU,{onClick:()=>_(!0),children:"Send Preview Email"}),t.jsx(ZU,{onClick:M,children:"Duplicate"})]})]});return t.jsxs(t.Fragment,{children:[t.jsx(Lm,{open:b,onOpenChange:e=>{!0===b&&!1===e&&setTimeout((()=>{m()}),0),x(e)},children:t.jsxs($m,{className:"max-w-7xl w-full overflow-hidden p-0 h-full max-h-[calc(100dvh-10dvh)]",hideCloseButton:!0,children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Edit Automation"}),t.jsx(zm,{children:"Edit the automation to change the content, schedule, and other details."})]}),t.jsx(sB,{automation:e,updateAutomation:r,communicationGroup:o,updateCommunicationGroup:i,isLoading:s,setIsLoading:a,iconDefinitions:j,setOpenEditAutomationPopup:x,logoUrl:d,getExtraMergeFields:p,onBeforeSchedule:h,estimatedMatchesStats:g,validateCanGoToNextStep:A})]})}),t.jsx(Lm,{open:C,onOpenChange:k,children:t.jsxs($m,{className:"sm:max-w-[425px]",children:[t.jsx(Um,{className:"text-xl font-semibold",children:"Cancel Automation"}),t.jsx(zm,{className:"text-gray-600 mt-2 text-center",children:"Are you sure you want to cancel this automation? This action cannot be undone."}),t.jsxs("div",{className:"flex justify-center gap-3 mt-6",children:[t.jsx(nk,{variant:"outline",onClick:()=>k(!1),children:"Keep Running"}),t.jsx(nk,{variant:"destructive",onClick:P,children:"Yes, Cancel Automation"})]})]})}),t.jsx(Lm,{open:w,onOpenChange:S,children:t.jsxs($m,{children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Send Preview SMS"}),t.jsx(zm,{children:"Send a preview SMS to the automation."})]}),t.jsx(cB,{automation:e,type:"sms",setOpenSendPreviewPopup:S,iconDefinitions:j})]})}),t.jsx(Lm,{open:E,onOpenChange:_,children:t.jsxs($m,{children:[t.jsxs(gf,{children:[t.jsx(Um,{children:"Send Preview Email"}),t.jsx(zm,{children:"Send a preview email to the automation."})]}),t.jsx(cB,{automation:e,type:"email",setOpenSendPreviewPopup:_,iconDefinitions:j})]})}),t.jsxs("div",{className:"p-6 border-b border-gray-200 bg-background",children:[v?t.jsx("div",{className:"flex justify-between items-start mb-4",children:t.jsx("div",{children:t.jsx(nk,{onClick:()=>T(-1),children:"Back"})})}):null,t.jsxs("div",{className:"flex justify-between items-start mb-4",children:[t.jsxs("div",{children:[t.jsxs("div",{className:"flex items-center gap-2",children:[t.jsxs("h1",{className:"text-2xl font-semibold mb-1",children:[e.name," "]}),t.jsx(TP,{status:e.status})]}),t.jsxs("div",{className:"text-sm text-gray-600",children:["View and edit this ",Fp("engage:automation")]})]}),O()]}),t.jsx("div",{className:"@container",children:t.jsxs("div",{className:"grid grid-cols-1 @[750px]:grid-cols-2 gap-6",children:[t.jsxs("div",{className:"",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Name"}),t.jsx("div",{className:"font-medium truncate",children:e.name})]}),e.description&&t.jsxs("div",{className:"",children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Description"}),t.jsx("div",{className:"font-medium whitespace-pre-wrap",children:e.description})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Date Created"}),t.jsx("div",{className:"font-medium",children:hP(new Date(e.created_at),"h:mma MM/dd/yy")})]}),t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Sales"}),t.jsx("div",{className:"font-medium",children:yP(e.derived_revenue)})]}),e.trigger_type===Me.ONE_TIME&&Ae(e.trigger_metadata)&&t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Type"}),t.jsx("div",{className:"font-medium",children:"One Time"})]}),e.trigger_type===Me.TRIGGER_BASED&&(R=e.trigger_metadata,"trigger_based"===R?.trigger_type)&&t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-muted-foreground",children:"Type"}),t.jsx("div",{className:"font-medium",children:"Trigger Based"})]}),e.trigger_type===Me.ONE_TIME&&Ae(e.trigger_metadata)&&t.jsx("div",{className:"col-span-1 @[400px]:col-span-2",children:t.jsx("div",{className:"border-t border-gray-200"})}),e.trigger_type===Me.ONE_TIME&&Ae(e.trigger_metadata)&&e.trigger_metadata.scheduled_at&&t.jsxs("div",{children:[t.jsx("div",{className:"text-sm text-gray-600",children:"Scheduled For"}),t.jsx("div",{className:"font-medium",children:hP(new Date(e.trigger_metadata.scheduled_at),"h:mma MM/dd/yy")})]})]})})]})]});var R})),dB=({iconDefinitions:e,autoOpenEditPopup:r,automationId:o,showBackButton:s=!1,logoUrl:a,getExtraMergeFields:l,onDuplicationCreated:c,onBeforeSchedule:u})=>{const d=function(){let{matches:e}=i.useContext(fE),t=e[e.length-1];return t?t.params:{}}(),[p]=t_(),f=ek(e),[h,m]=n.useState("content"),g=o||d?.automationId||p.get("automationId")||"",y=r||p.get("autoOpenEditPopup"),v="true"===p.get("showBackButton")||s,{automation:b,updateAutomation:x,communicationGroup:w,updateCommunicationGroup:S,isLoading:C,setIsLoading:k,invalidateAutomation:E,validateStep:_,estimatedMatchesStats:j}=h$(g);return b&&w?t.jsxs("div",{className:"bg-background",children:[t.jsx(uB,{automation:b,updateAutomation:x,communicationGroup:w,updateCommunicationGroup:S,isLoading:C,setIsLoading:k,iconDefinitions:f,autoOpenEditPopup:y,showBackButton:v,logoUrl:a,getExtraMergeFields:l,onDuplicationCreated:c,onBeforeSchedule:u,invalidateAutomation:E,estimatedMatchesStats:j,validateStep:_}),t.jsx(o_,{tabs:[{id:"content",label:"Content",content:t.jsx(C$,{iconDefinitions:f,isLoading:C,communicationGroup:w})},{id:"recipients",label:"Recipients",content:t.jsx(k$,{automationId:b.id,iconDefinitions:f,automation:b,isLoading:C})}],activeTab:h,onTabChange:m,tabsLocation:"left"})]}):t.jsx("div",{className:"flex h-screen items-center justify-center",children:t.jsx(XC,{text:["Fetching Automation data","Finishing up"]})})};Object.values(Object.assign({}));var pB=e=>null!=e;var fB=e=>"function"!=typeof e||e.length?e:e(),hB=e=>Array.isArray(e)?e:e?[e]:[];var mB=lt;var gB,yB=function(e){const[t,n]=Ze(),r=e?.throw?(e,t)=>{throw n(e instanceof Error?e:new Error(t)),e}:(e,t)=>{n(e instanceof Error?e:new Error(t))},o=e?.api?Array.isArray(e.api)?e.api:[e.api]:[globalThis.localStorage].filter(Boolean),i=e?.prefix?`${e.prefix}.`:"",s=new Map,a=new Proxy({},{get(t,n){let a=s.get(n);a||(a=Ze(void 0,{equals:!1}),s.set(n,a)),a[0]();const l=o.reduce(((e,t)=>{if(null!==e||!t)return e;try{return t.getItem(`${i}${n}`)}catch(DX){return r(DX,`Error reading ${i}${n} from ${t.name}`),null}}),null);return null!==l&&e?.deserializer?e.deserializer(l,n,e.options):l}});return!1!==e?.sync&&at((()=>{const e=e=>{let t=!1;o.forEach((n=>{try{n!==e.storageArea&&e.key&&e.newValue!==n.getItem(e.key)&&(e.newValue?n.setItem(e.key,e.newValue):n.removeItem(e.key),t=!0)}catch(DX){r(DX,`Error synching api ${n.name} from storage event (${e.key}=${e.newValue})`)}})),t&&e.key&&s.get(e.key)?.[1]()};"addEventListener"in globalThis?(globalThis.addEventListener("storage",e),lt((()=>globalThis.removeEventListener("storage",e)))):(o.forEach((t=>t.addEventListener?.("storage",e))),lt((()=>o.forEach((t=>t.removeEventListener?.("storage",e))))))})),[a,(t,n,a)=>{const l=e?.serializer?e.serializer(n,t,a??e.options):n,c=`${i}${t}`;o.forEach((e=>{try{e.getItem(c)!==l&&e.setItem(c,l)}catch(DX){r(DX,`Error setting ${i}${t} to ${l} in ${e.name}`)}}));const u=s.get(t);u&&u[1]()},{clear:()=>o.forEach((e=>{try{e.clear()}catch(DX){r(DX,`Error clearing ${e.name}`)}})),error:t,remove:e=>o.forEach((t=>{try{t.removeItem(`${i}${e}`)}catch(DX){r(DX,`Error removing ${i}${e} from ${t.name}`)}})),toJSON:()=>{const t={},n=(n,r)=>{if(!t.hasOwnProperty(n)){const o=r&&e?.deserializer?e.deserializer(r,n,e.options):r;o&&(t[n]=o)}};return o.forEach((e=>{if("function"==typeof e.getAll){let t;try{t=e.getAll()}catch(DX){r(DX,`Error getting all values from in ${e.name}`)}for(const e of t)n(e,t[e])}else{let o,i=0;try{for(;o=e.key(i++);)t.hasOwnProperty(o)||n(o,e.getItem(o))}catch(DX){r(DX,`Error getting all values from ${e.name}`)}}})),t}}]},vB=e=>{if(!e)return"";let t="";for(const n in e){if(!e.hasOwnProperty(n))continue;const r=e[n];t+=r instanceof Date?`; ${n}=${r.toUTCString()}`:"boolean"==typeof r?`; ${n}`:`; ${n}=${r}`}return t},bB=("function"==typeof(gB={_cookies:[globalThis.document,"cookie"],getItem:e=>bB._cookies[0][bB._cookies[1]].match("(^|;)\\s*"+e+"\\s*=\\s*([^;]+)")?.pop()??null,setItem:(e,t,n)=>{const r=bB.getItem(e);bB._cookies[0][bB._cookies[1]]=`${e}=${t}${vB(n)}`;const o=Object.assign(new Event("storage"),{key:e,oldValue:r,newValue:t,url:globalThis.document.URL,storageArea:bB});window.dispatchEvent(o)},removeItem:e=>{bB._cookies[0][bB._cookies[1]]=`${e}=deleted${vB({expires:new Date(0)})}`},key:e=>{let t=null,n=0;return bB._cookies[0][bB._cookies[1]].replace(/(?:^|;)\s*(.+?)\s*=\s*[^;]+/g,((r,o)=>(!t&&o&&n++===e&&(t=o),""))),t},get length(){let e=0;return bB._cookies[0][bB._cookies[1]].replace(/(?:^|;)\s*.+?\s*=\s*[^;]+/g,(t=>(e+=t?1:0,""))),e}}).clear||(gB.clear=()=>{let e;for(;e=gB.key(0);)gB.removeItem(e)}),gB),xB=796,wB="bottom",SB="system",CB=Object.keys(wr)[0],kB=Object.keys(kr)[0],EB=ft({client:void 0,onlineManager:void 0,queryFlavor:"",version:"",shadowDOMTarget:void 0});function _B(){return ht(EB)}var jB=ft(void 0),TB=e=>{const[t,n]=Ze(null),r=()=>{const e=t();null!=e&&(e.close(),n(null))},o=(r,o)=>{if(null!=t())return;const i=window.open("","TSQD-Devtools-Panel",`width=${r},height=${o},popup`);if(!i)throw new Error("Failed to open popup. Please allow popups for this site to view the devtools in picture-in-picture mode.");i.document.head.innerHTML="",i.document.body.innerHTML="",function(e=window.document){if(e[nn]){for(let t of e[nn].keys())e.removeEventListener(t,yn);delete e[nn]}}(i.document),i.document.title="TanStack Query Devtools",i.document.body.style.margin="0",i.addEventListener("pagehide",(()=>{e.setLocalStore("pip_open","false"),n(null)})),[...(_B().shadowDOMTarget||document).styleSheets].forEach((e=>{try{const t=[...e.cssRules].map((e=>e.cssText)).join(""),n=document.createElement("style"),r=e.ownerNode;let o="";r&&"id"in r&&(o=r.id),o&&n.setAttribute("id",o),n.textContent=t,i.document.head.appendChild(n)}catch(PX){const n=document.createElement("link");if(null==e.href)return;n.rel="stylesheet",n.type=e.type,n.media=e.media.toString(),n.href=e.href,i.document.head.appendChild(n)}})),sn(["focusin","focusout","pointermove","keydown","pointerdown","pointerup","click","mousedown","input"],i.document),e.setLocalStore("pip_open","true"),n(i)};nt((()=>{"true"!==(e.localStore.pip_open??"false")||e.disabled||o(Number(window.innerWidth),Number(e.localStore.height||500))})),nt((()=>{const e=(_B().shadowDOMTarget||document).querySelector("#_goober"),n=t();if(e&&n){const t=new MutationObserver((()=>{const t=(_B().shadowDOMTarget||n.document).querySelector("#_goober");t&&(t.textContent=e.textContent)}));t.observe(e,{childList:!0,subtree:!0,characterDataOldValue:!0}),lt((()=>{t.disconnect()}))}}));const i=rt((()=>({pipWindow:t(),requestPipWindow:o,closePipWindow:r,disabled:e.disabled??!1})));return At(jB.Provider,{value:i,get children(){return e.children}})},NB=()=>rt((()=>{const e=ht(jB);if(!e)throw new Error("usePiPWindow must be used within a PiPProvider");return e()})),PB=ft((()=>"dark"));function DB(){return ht(PB)}var MB={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","Ấ":"A","Ắ":"A","Ẳ":"A","Ẵ":"A","Ặ":"A","Æ":"AE","Ầ":"A","Ằ":"A","Ȃ":"A","Ç":"C","Ḉ":"C","È":"E","É":"E","Ê":"E","Ë":"E","Ế":"E","Ḗ":"E","Ề":"E","Ḕ":"E","Ḝ":"E","Ȇ":"E","Ì":"I","Í":"I","Î":"I","Ï":"I","Ḯ":"I","Ȋ":"I","Ð":"D","Ñ":"N","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","Ố":"O","Ṍ":"O","Ṓ":"O","Ȏ":"O","Ù":"U","Ú":"U","Û":"U","Ü":"U","Ý":"Y","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","ấ":"a","ắ":"a","ẳ":"a","ẵ":"a","ặ":"a","æ":"ae","ầ":"a","ằ":"a","ȃ":"a","ç":"c","ḉ":"c","è":"e","é":"e","ê":"e","ë":"e","ế":"e","ḗ":"e","ề":"e","ḕ":"e","ḝ":"e","ȇ":"e","ì":"i","í":"i","î":"i","ï":"i","ḯ":"i","ȋ":"i","ð":"d","ñ":"n","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","ố":"o","ṍ":"o","ṓ":"o","ȏ":"o","ù":"u","ú":"u","û":"u","ü":"u","ý":"y","ÿ":"y","Ā":"A","ā":"a","Ă":"A","ă":"a","Ą":"A","ą":"a","Ć":"C","ć":"c","Ĉ":"C","ĉ":"c","Ċ":"C","ċ":"c","Č":"C","č":"c","C̆":"C","c̆":"c","Ď":"D","ď":"d","Đ":"D","đ":"d","Ē":"E","ē":"e","Ĕ":"E","ĕ":"e","Ė":"E","ė":"e","Ę":"E","ę":"e","Ě":"E","ě":"e","Ĝ":"G","Ǵ":"G","ĝ":"g","ǵ":"g","Ğ":"G","ğ":"g","Ġ":"G","ġ":"g","Ģ":"G","ģ":"g","Ĥ":"H","ĥ":"h","Ħ":"H","ħ":"h","Ḫ":"H","ḫ":"h","Ĩ":"I","ĩ":"i","Ī":"I","ī":"i","Ĭ":"I","ĭ":"i","Į":"I","į":"i","İ":"I","ı":"i","IJ":"IJ","ij":"ij","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","Ḱ":"K","ḱ":"k","K̆":"K","k̆":"k","Ĺ":"L","ĺ":"l","Ļ":"L","ļ":"l","Ľ":"L","ľ":"l","Ŀ":"L","ŀ":"l","Ł":"l","ł":"l","Ḿ":"M","ḿ":"m","M̆":"M","m̆":"m","Ń":"N","ń":"n","Ņ":"N","ņ":"n","Ň":"N","ň":"n","ʼn":"n","N̆":"N","n̆":"n","Ō":"O","ō":"o","Ŏ":"O","ŏ":"o","Ő":"O","ő":"o","Œ":"OE","œ":"oe","P̆":"P","p̆":"p","Ŕ":"R","ŕ":"r","Ŗ":"R","ŗ":"r","Ř":"R","ř":"r","R̆":"R","r̆":"r","Ȓ":"R","ȓ":"r","Ś":"S","ś":"s","Ŝ":"S","ŝ":"s","Ş":"S","Ș":"S","ș":"s","ş":"s","Š":"S","š":"s","Ţ":"T","ţ":"t","ț":"t","Ț":"T","Ť":"T","ť":"t","Ŧ":"T","ŧ":"t","T̆":"T","t̆":"t","Ũ":"U","ũ":"u","Ū":"U","ū":"u","Ŭ":"U","ŭ":"u","Ů":"U","ů":"u","Ű":"U","ű":"u","Ų":"U","ų":"u","Ȗ":"U","ȗ":"u","V̆":"V","v̆":"v","Ŵ":"W","ŵ":"w","Ẃ":"W","ẃ":"w","X̆":"X","x̆":"x","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Y̆":"Y","y̆":"y","Ź":"Z","ź":"z","Ż":"Z","ż":"z","Ž":"Z","ž":"z","ſ":"s","ƒ":"f","Ơ":"O","ơ":"o","Ư":"U","ư":"u","Ǎ":"A","ǎ":"a","Ǐ":"I","ǐ":"i","Ǒ":"O","ǒ":"o","Ǔ":"U","ǔ":"u","Ǖ":"U","ǖ":"u","Ǘ":"U","ǘ":"u","Ǚ":"U","ǚ":"u","Ǜ":"U","ǜ":"u","Ứ":"U","ứ":"u","Ṹ":"U","ṹ":"u","Ǻ":"A","ǻ":"a","Ǽ":"AE","ǽ":"ae","Ǿ":"O","ǿ":"o","Þ":"TH","þ":"th","Ṕ":"P","ṕ":"p","Ṥ":"S","ṥ":"s","X́":"X","x́":"x","Ѓ":"Г","ѓ":"г","Ќ":"К","ќ":"к","A̋":"A","a̋":"a","E̋":"E","e̋":"e","I̋":"I","i̋":"i","Ǹ":"N","ǹ":"n","Ồ":"O","ồ":"o","Ṑ":"O","ṑ":"o","Ừ":"U","ừ":"u","Ẁ":"W","ẁ":"w","Ỳ":"Y","ỳ":"y","Ȁ":"A","ȁ":"a","Ȅ":"E","ȅ":"e","Ȉ":"I","ȉ":"i","Ȍ":"O","ȍ":"o","Ȑ":"R","ȑ":"r","Ȕ":"U","ȕ":"u","B̌":"B","b̌":"b","Č̣":"C","č̣":"c","Ê̌":"E","ê̌":"e","F̌":"F","f̌":"f","Ǧ":"G","ǧ":"g","Ȟ":"H","ȟ":"h","J̌":"J","ǰ":"j","Ǩ":"K","ǩ":"k","M̌":"M","m̌":"m","P̌":"P","p̌":"p","Q̌":"Q","q̌":"q","Ř̩":"R","ř̩":"r","Ṧ":"S","ṧ":"s","V̌":"V","v̌":"v","W̌":"W","w̌":"w","X̌":"X","x̌":"x","Y̌":"Y","y̌":"y","A̧":"A","a̧":"a","B̧":"B","b̧":"b","Ḑ":"D","ḑ":"d","Ȩ":"E","ȩ":"e","Ɛ̧":"E","ɛ̧":"e","Ḩ":"H","ḩ":"h","I̧":"I","i̧":"i","Ɨ̧":"I","ɨ̧":"i","M̧":"M","m̧":"m","O̧":"O","o̧":"o","Q̧":"Q","q̧":"q","U̧":"U","u̧":"u","X̧":"X","x̧":"x","Z̧":"Z","z̧":"z"},AB=Object.keys(MB).join("|"),OB=new RegExp(AB,"g");var RB=7,LB=6,IB=5,FB=4,$B=3,qB=2,UB=1,zB=0;function BB(e,t,n){var r;if((n=n||{}).threshold=null!=(r=n.threshold)?r:UB,!n.accessors){const r=VB(e,t,n);return{rankedValue:e,rank:r,accessorIndex:-1,accessorThreshold:n.threshold,passed:r>=n.threshold}}const o=function(e,t){const n=[];for(let r=0,o=t.length;r<o;r++){const o=t[r],i=GB(o),s=HB(e,o);for(let e=0,t=s.length;e<t;e++)n.push({itemValue:s[e],attributes:i})}return n}(e,n.accessors),i={rankedValue:e,rank:zB,accessorIndex:-1,accessorThreshold:n.threshold,passed:!1};for(let s=0;s<o.length;s++){const e=o[s];let r=VB(e.itemValue,t,n);const{minRanking:a,maxRanking:l,threshold:c=n.threshold}=e.attributes;r<a&&r>=UB?r=a:r>l&&(r=l),r=Math.min(r,l),r>=c&&r>i.rank&&(i.rank=r,i.passed=!0,i.accessorIndex=s,i.accessorThreshold=c,i.rankedValue=e.itemValue)}return i}function VB(e,t,n){return e=KB(e,n),(t=KB(t,n)).length>e.length?zB:e===t?RB:(e=e.toLowerCase())===(t=t.toLowerCase())?LB:e.startsWith(t)?IB:e.includes(` ${t}`)?FB:e.includes(t)?$B:1===t.length?zB:function(e){let t="";return e.split(" ").forEach((e=>{e.split("-").forEach((e=>{t+=e.substr(0,1)}))})),t}(e).includes(t)?qB:function(e,t){let n=0,r=0;function o(e,t,r){for(let o=r,i=t.length;o<i;o++){if(t[o]===e)return n+=1,o+1}return-1}function i(e){return UB+n/t.length*(1/e)}const s=o(t[0],e,0);if(s<0)return zB;r=s;for(let a=1,l=t.length;a<l;a++){r=o(t[a],e,r);if(!(r>-1))return zB}return i(r-s)}(e,t)}function KB(e,t){let{keepDiacritics:n}=t;return e=`${e}`,n||(e=e.replace(OB,(e=>MB[e]))),e}function HB(e,t){let n=t;"object"==typeof t&&(n=t.accessor);const r=n(e);return null==r?[]:Array.isArray(r)?r:[String(r)]}var WB={maxRanking:1/0,minRanking:-1/0};function GB(e){return"function"==typeof e?WB:{...WB,...e}}var YB={data:""},QB=/(?:([\u0080-\uFFFF\w-%@]+) *:? *([^{;]+?);|([^;}{]*?) *{)|(}\s*)/g,XB=/\/\*[^]*?\*\/| +/g,JB=/\n+/g,ZB=(e,t)=>{let n="",r="",o="";for(let i in e){let s=e[i];"@"==i[0]?"i"==i[1]?n=i+" "+s+";":r+="f"==i[1]?ZB(s,i):i+"{"+ZB(s,"k"==i[1]?"":t)+"}":"object"==typeof s?r+=ZB(s,t?t.replace(/([^,])+/g,(e=>i.replace(/([^,]*:\S+\([^)]*\))|([^,])+/g,(t=>/&/.test(t)?t.replace(/&/g,e):e?e+" "+t:t)))):i):null!=s&&(i=/^--/.test(i)?i:i.replace(/[A-Z]/g,"-$&").toLowerCase(),o+=ZB.p?ZB.p(i,s):i+":"+s+";")}return n+(t&&o?t+"{"+o+"}":o)+r},eV={},tV=e=>{if("object"==typeof e){let t="";for(let n in e)t+=n+tV(e[n]);return t}return e};function nV(e){let t=this||{},n=e.call?e(t.p):e;return((e,t,n,r,o)=>{let i=tV(e),s=eV[i]||(eV[i]=(e=>{let t=0,n=11;for(;t<e.length;)n=101*n+e.charCodeAt(t++)>>>0;return"go"+n})(i));if(!eV[s]){let t=i!==e?e:(e=>{let t,n,r=[{}];for(;t=QB.exec(e.replace(XB,""));)t[4]?r.shift():t[3]?(n=t[3].replace(JB," ").trim(),r.unshift(r[0][n]=r[0][n]||{})):r[0][t[1]]=t[2].replace(JB," ").trim();return r[0]})(e);eV[s]=ZB(o?{["@keyframes "+s]:t}:t,n?"":"."+s)}let a=n&&eV.g?eV.g:null;return n&&(eV.g=eV[s]),l=eV[s],c=t,u=r,(d=a)?c.data=c.data.replace(d,l):-1===c.data.indexOf(l)&&(c.data=u?l+c.data:c.data+l),s;var l,c,u,d})(n.unshift?n.raw?((e,t,n)=>e.reduce(((e,r,o)=>{let i=t[o];if(i&&i.call){let e=i(n),t=e&&e.props&&e.props.className||/^go/.test(e)&&e;i=t?"."+t:e&&"object"==typeof e?e.props?"":ZB(e,""):!1===e?"":e}return e+r+(null==i?"":i)}),""))(n,[].slice.call(arguments,1),t.p):n.reduce(((e,n)=>Object.assign(e,n&&n.call?n(t.p):n)),{}):n,(r=t.target,"object"==typeof window?((r?r.querySelector("#_goober"):window._goober)||Object.assign((r||document.head).appendChild(document.createElement("style")),{innerHTML:" ",id:"_goober"})).firstChild:r||YB),t.g,t.o,t.k);var r}function rV(e){var t,n,r="";if("string"==typeof e||"number"==typeof e)r+=e;else if("object"==typeof e)if(Array.isArray(e)){var o=e.length;for(t=0;t<o;t++)e[t]&&(n=rV(e[t]))&&(r&&(r+=" "),r+=n)}else for(n in e)e[n]&&(r&&(r+=" "),r+=n);return r}function oV(){for(var e,t,n=0,r="",o=arguments.length;n<o;n++)(e=arguments[n])&&(t=rV(e))&&(r&&(r+=" "),r+=t);return r}function iV(e,t){const n=it(e),{onChange:r}=t;let o=new Set(t.appear?void 0:n);const i=new WeakSet,[s,a]=Ze([],{equals:!1}),[l]=[dt,ut],c=e=>{a((t=>(t.push.apply(t,e),t)));for(const t of e)i.delete(t)},u=(e,t,n)=>e.splice(n,0,t);return rt((t=>{const n=s(),a=e();if(it(l))return l(),t;if(n.length){const e=t.filter((e=>!n.includes(e)));return n.length=0,r({list:e,added:[],removed:[],unchanged:e,finishRemoved:c}),e}return it((()=>{const e=new Set(a),n=a.slice(),s=[],l=[],d=[];for(const t of a)(o.has(t)?d:s).push(t);let p=!s.length;for(let r=0;r<t.length;r++){const o=t[r];e.has(o)||(i.has(o)||(l.push(o),i.add(o)),u(n,o,r)),p&&o!==n[r]&&(p=!1)}return!l.length&&p?t:(r({list:n,added:s,removed:l,unchanged:d,finishRemoved:c}),o=e,n)}))}),t.appear?[]:n.slice())}function sV(...e){return t=e,(...e)=>{for(const n of t)n&&n(...e)};var t}nV.bind({g:1}),nV.bind({k:1});var aV=e=>e instanceof Element;function lV(e,t){if(t(e))return e;if("function"==typeof e&&!e.length)return lV(e(),t);if(Array.isArray(e)){const n=[];for(const r of e){const e=lV(r,t);e&&(Array.isArray(e)?n.push.apply(n,e):n.push(e))}return n.length?n:null}return null}function cV(e,t=aV,n=aV){const r=rt(e),o=rt((()=>lV(r(),t)));return o.toArray=()=>{const e=o();return Array.isArray(e)?e:e?[e]:[]},o}function uV(e){requestAnimationFrame((()=>requestAnimationFrame(e)))}function dV(e,t,n,r){const{onBeforeEnter:o,onEnter:i,onAfterEnter:s}=t;function a(t){t&&t.target!==n||(n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.enterActive),n.classList.remove(...e.enterTo),s?.(n))}o?.(n),n.classList.add(...e.enter),n.classList.add(...e.enterActive),queueMicrotask((()=>{if(!n.parentNode)return r?.();i?.(n,(()=>a()))})),uV((()=>{n.classList.remove(...e.enter),n.classList.add(...e.enterTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}function pV(e,t,n,r){const{onBeforeExit:o,onExit:i,onAfterExit:s}=t;if(!n.parentNode)return r?.();function a(t){t&&t.target!==n||(r?.(),n.removeEventListener("transitionend",a),n.removeEventListener("animationend",a),n.classList.remove(...e.exitActive),n.classList.remove(...e.exitTo),s?.(n))}o?.(n),n.classList.add(...e.exit),n.classList.add(...e.exitActive),i?.(n,(()=>a())),uV((()=>{n.classList.remove(...e.exit),n.classList.add(...e.exitTo),(!i||i.length<2)&&(n.addEventListener("transitionend",a),n.addEventListener("animationend",a))}))}var fV=e=>{const t=function(e){return rt((()=>{const t=e.name||"s";return{enterActive:(e.enterActiveClass||t+"-enter-active").split(" "),enter:(e.enterClass||t+"-enter").split(" "),enterTo:(e.enterToClass||t+"-enter-to").split(" "),exitActive:(e.exitActiveClass||t+"-exit-active").split(" "),exit:(e.exitClass||t+"-exit").split(" "),exitTo:(e.exitToClass||t+"-exit-to").split(" "),move:(e.moveClass||t+"-move").split(" ")}}))}(e);return iV(cV((()=>e.children)).toArray,{appear:e.appear,onChange({added:n,removed:r,finishRemoved:o,list:i}){const s=t();for(const t of n)dV(s,e,t);const a=[];for(const e of i)e.isConnected&&(e instanceof HTMLElement||e instanceof SVGElement)&&a.push({el:e,rect:e.getBoundingClientRect()});queueMicrotask((()=>{const e=[];for(const{el:t,rect:n}of a)if(t.isConnected){const r=t.getBoundingClientRect(),o=n.left-r.left,i=n.top-r.top;(o||i)&&(t.style.transform=`translate(${o}px, ${i}px)`,t.style.transitionDuration="0s",e.push(t))}document;for(const t of e){let e=function(n){(n.target===t||/transform$/.test(n.propertyName))&&(t.removeEventListener("transitionend",e),t.classList.remove(...s.move))};t.classList.add(...s.move),t.style.transform=t.style.transitionDuration="",t.addEventListener("transitionend",e)}}));for(const t of r)pV(s,e,t,(()=>o([t])))}})},hV=Symbol("fallback");function mV(e){for(const t of e)t.dispose()}function gV(e){const{by:t}=e;return rt(function(e,t,n,r={}){const o=new Map;return lt((()=>mV(o.values()))),()=>{const n=e()||[];return it((()=>{if(!n.length)return mV(o.values()),o.clear(),r.fallback?[Je((e=>(o.set(hV,{dispose:e}),r.fallback())))]:[];const e=new Array(n.length),s=o.get(hV);if(!o.size||s){s?.dispose(),o.delete(hV);for(let r=0;r<n.length;r++){const o=n[r];i(e,o,r,t(o,r))}return e}const a=new Set(o.keys());for(let r=0;r<n.length;r++){const s=n[r],l=t(s,r);a.delete(l);const c=o.get(l);c?(e[r]=c.mapped,c.setIndex?.(r),c.setItem((()=>s))):i(e,s,r,l)}for(const t of a)o.get(t)?.dispose(),o.delete(t);return e}))};function i(e,t,r,i){Je((s=>{const[a,l]=Ze(t),c={setItem:l,dispose:s};if(n.length>1){const[e,t]=Ze(r);c.setIndex=t,c.mapped=n(a,e)}else c.mapped=n(a);o.set(i,c),e[r]=c.mapped}))}}((()=>e.each),"function"==typeof t?t:e=>e[t],e.children,"fallback"in e?{fallback:()=>e.fallback}:void 0))}function yV(e,t,n,r){const o=()=>{hB(fB(e)).forEach((e=>{e&&hB(fB(t)).forEach((t=>function(e,t,n,r){return e.addEventListener(t,n,r),mB(e.removeEventListener.bind(e,t,n,r))}(e,t,n,r)))}))};"function"==typeof e?nt(o):tt(o)}function vV(e,t,n){const r=new WeakMap,{observe:o,unobserve:i}=function(e,t){const n=new ResizeObserver(e);return lt(n.disconnect.bind(n)),{observe:e=>n.observe(e,t),unobserve:n.unobserve.bind(n)}}((e=>{for(const n of e){const{contentRect:e,target:o}=n,i=Math.round(e.width),s=Math.round(e.height),a=r.get(o);a&&a.width===i&&a.height===s||(t(e,o,n),r.set(o,{width:i,height:s}))}}),n);nt((t=>{const n=hB(fB(e)).filter(pB);return function(e,t,n,r){const o=e.length,i=t.length;let s,a,l=0;if(i)if(o){for(;l<i&&t[l]===e[l];l++);for(s of(t=t.slice(l),e=e.slice(l),t))e.includes(s)||r(s);for(a of e)t.includes(a)||n(a)}else for(;l<i;l++)r(t[l]);else for(;l<o;l++)n(e[l])}(n,t,o,i),n}),[])}var bV=/((?:--)?(?:\w+-?)+)\s*:\s*([^;]*)/g;function xV(e){const t={};let n;for(;n=bV.exec(e);)t[n[1]]=n[2];return t}function wV(e,t){if("string"==typeof e){if("string"==typeof t)return`${e};${t}`;e=xV(e)}else"string"==typeof t&&(t=xV(t));return{...e,...t}}function SV(e,t){const n=[...e],r=n.indexOf(t);return-1!==r&&n.splice(r,1),n}function CV(e){return"[object String]"===Object.prototype.toString.call(e)}function kV(e){return t=>`${e()}-${t}`}function EV(e,t){return!!e&&(e===t||e.contains(t))}function _V(e,t=!1){const{activeElement:n}=jV(e);if(!n?.nodeName)return null;if(TV(n)&&n.contentDocument)return _V(n.contentDocument.body,t);if(t){const e=n.getAttribute("aria-activedescendant");if(e){const t=jV(n).getElementById(e);if(t)return t}}return n}function jV(e){return e?e.ownerDocument||e:document}function TV(e){return"IFRAME"===e.tagName}var NV=(e=>(e.Escape="Escape",e.Enter="Enter",e.Tab="Tab",e.Space=" ",e.ArrowDown="ArrowDown",e.ArrowLeft="ArrowLeft",e.ArrowRight="ArrowRight",e.ArrowUp="ArrowUp",e.End="End",e.Home="Home",e.PageDown="PageDown",e.PageUp="PageUp",e))(NV||{});function PV(e){return"undefined"!=typeof window&&null!=window.navigator&&e.test(window.navigator.userAgentData?.platform||window.navigator.platform)}function DV(){return PV(/^Mac/i)}function MV(){return PV(/^iPhone/i)||PV(/^iPad/i)||DV()&&navigator.maxTouchPoints>1}function AV(e,t){return t&&("function"==typeof t?t(e):t[0](t[1],e)),e?.defaultPrevented}function OV(e){return t=>{for(const n of e)AV(t,n)}}function RV(e){return DV()?e.metaKey&&!e.ctrlKey:e.ctrlKey&&!e.metaKey}function LV(e){if(e)if(function(){if(null==IV){IV=!1;try{document.createElement("div").focus({get preventScroll(){return IV=!0,!0}})}catch(PX){}}return IV}())e.focus({preventScroll:!0});else{const t=function(e){let t=e.parentNode;const n=[],r=document.scrollingElement||document.documentElement;for(;t instanceof HTMLElement&&t!==r;)(t.offsetHeight<t.scrollHeight||t.offsetWidth<t.scrollWidth)&&n.push({element:t,scrollTop:t.scrollTop,scrollLeft:t.scrollLeft}),t=t.parentNode;r instanceof HTMLElement&&n.push({element:r,scrollTop:r.scrollTop,scrollLeft:r.scrollLeft});return n}(e);e.focus(),function(e){for(const{element:t,scrollTop:n,scrollLeft:r}of e)t.scrollTop=n,t.scrollLeft=r}(t)}}var IV=null;var FV=["input:not([type='hidden']):not([disabled])","select:not([disabled])","textarea:not([disabled])","button:not([disabled])","a[href]","area[href]","[tabindex]","iframe","object","embed","audio[controls]","video[controls]","[contenteditable]:not([contenteditable='false'])"],$V=[...FV,'[tabindex]:not([tabindex="-1"]):not([disabled])'],qV=FV.join(":not([hidden]),")+",[tabindex]:not([disabled]):not([hidden])",UV=$V.join(':not([hidden]):not([tabindex="-1"]),');function zV(e,t){const n=Array.from(e.querySelectorAll(qV)).filter(BV);return t&&BV(e)&&n.unshift(e),n.forEach(((e,t)=>{if(TV(e)&&e.contentDocument){const r=zV(e.contentDocument.body,!1);n.splice(t,1,...r)}})),n}function BV(e){return VV(e)&&!function(e){const t=parseInt(e.getAttribute("tabindex")||"0",10);return t<0}(e)}function VV(e){return e.matches(qV)&&KV(e)}function KV(e,t){return"#comment"!==e.nodeName&&function(e){if(!(e instanceof HTMLElement||e instanceof SVGElement))return!1;const{display:t,visibility:n}=e.style;let r="none"!==t&&"hidden"!==n&&"collapse"!==n;if(r){if(!e.ownerDocument.defaultView)return r;const{getComputedStyle:t}=e.ownerDocument.defaultView,{display:n,visibility:o}=t(e);r="none"!==n&&"hidden"!==o&&"collapse"!==o}return r}(e)&&function(e,t){return!e.hasAttribute("hidden")&&("DETAILS"!==e.nodeName||!t||"SUMMARY"===t.nodeName||e.hasAttribute("open"))}(e,t)&&(!e.parentElement||KV(e.parentElement,e))}function HV(e){for(;e&&!WV(e);)e=e.parentElement;return e||document.scrollingElement||document.documentElement}function WV(e){const t=window.getComputedStyle(e);return/(auto|scroll)/.test(t.overflow+t.overflowX+t.overflowY)}function GV(){}function YV(e,t){return Ft(e,t)}var QV=new Map,XV=new Set;function JV(){if("undefined"==typeof window)return;const e=t=>{if(!t.target)return;const n=QV.get(t.target);if(n&&(n.delete(t.propertyName),0===n.size&&(t.target.removeEventListener("transitioncancel",e),QV.delete(t.target)),0===QV.size)){for(const e of XV)e();XV.clear()}};document.body.addEventListener("transitionrun",(t=>{if(!t.target)return;let n=QV.get(t.target);n||(n=new Set,QV.set(t.target,n),t.target.addEventListener("transitioncancel",e)),n.add(t.propertyName)})),document.body.addEventListener("transitionend",e)}function ZV(e,t){const n=eK(e,t,"left"),r=eK(e,t,"top"),o=t.offsetWidth,i=t.offsetHeight;let s=e.scrollLeft,a=e.scrollTop;const l=s+e.offsetWidth,c=a+e.offsetHeight;n<=s?s=n:n+o>l&&(s+=n+o-l),r<=a?a=r:r+i>c&&(a+=r+i-c),e.scrollLeft=s,e.scrollTop=a}function eK(e,t,n){const r="left"===n?"offsetLeft":"offsetTop";let o=0;for(;t.offsetParent&&(o+=t[r],t.offsetParent!==e);){if(t.offsetParent.contains(e)){o-=e[r];break}t=t.offsetParent}return o}"undefined"!=typeof document&&("loading"!==document.readyState?JV():document.addEventListener("DOMContentLoaded",JV));var tK={border:"0",clip:"rect(0 0 0 0)","clip-path":"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:"0",position:"absolute",width:"1px","white-space":"nowrap"};function nK(e){return t=>(e(t),()=>e(void 0))}function rK(e,t){const[n,r]=Ze(oK(t?.()));return nt((()=>{r(e()?.tagName.toLowerCase()||oK(t?.()))})),n}function oK(e){return CV(e)?e:void 0}function iK(e){const[t,n]=$t(e,["as"]);if(!t.as)throw new Error("[kobalte]: Polymorphic is missing the required `as` prop.");return At(kn,Ft(n,{get component(){return t.as}}))}var sK=["id","name","validationState","required","disabled","readOnly"];var aK=ft();function lK(){const e=ht(aK);if(void 0===e)throw new Error("[kobalte]: `useFormControlContext` must be used within a `FormControlContext.Provider` component");return e}function cK(e){const t=lK(),n=YV({id:t.generateId("description")},e);return nt((()=>lt(t.registerDescription(n.id)))),At(iK,Ft({as:"div"},(()=>t.dataset()),n))}function uK(e){const t=lK(),n=YV({id:t.generateId("error-message")},e),[r,o]=$t(n,["forceMount"]),i=()=>"invalid"===t.validationState();return nt((()=>{i()&<(t.registerErrorMessage(o.id))})),At(Ht,{get when(){return r.forceMount||i()},get children(){return At(iK,Ft({as:"div"},(()=>t.dataset()),o))}})}function dK(e){let t;const n=lK(),r=YV({id:n.generateId("label")},e),[o,i]=$t(r,["ref"]),s=rK((()=>t),(()=>"label"));return nt((()=>lt(n.registerLabel(i.id)))),At(iK,Ft({as:"label",ref(e){const n=sV((e=>t=e),o.ref);"function"==typeof n&&n(e)},get for(){return rt((()=>"label"===s()))()?n.fieldId():void 0}},(()=>n.dataset()),i))}function pK(e,t){nt(st(e,(e=>{if(null==e)return;const n=function(e){return function(e){return e.matches("textarea, input, select, button")}(e)?e.form:e.closest("form")}(e);null!=n&&(n.addEventListener("reset",t,{passive:!0}),lt((()=>{n.removeEventListener("reset",t)})))})))}function fK(e){const[t,n]=Ze(e.defaultValue?.()),r=rt((()=>void 0!==e.value?.())),o=rt((()=>r()?e.value?.():t()));return[o,t=>{it((()=>{const i=function(e,...t){return"function"==typeof e?e(...t):e}(t,o());return Object.is(i,o())||(r()||n(i),e.onChange?.(i)),i}))}]}function hK(e){const[t,n]=fK(e);return[()=>t()??!1,n]}var mK=Object.defineProperty,gK=(e,t)=>{for(var n in t)mK(e,n,{get:t[n],enumerable:!0})},yK=ft();function vK(){return ht(yK)}function bK(e,t){return Boolean(t.compareDocumentPosition(e)&Node.DOCUMENT_POSITION_PRECEDING)}function xK(e,t){const n=function(e){const t=e.map(((e,t)=>[t,e]));let n=!1;return t.sort((([e,t],[r,o])=>{const i=t.ref(),s=o.ref();return i===s?0:i&&s?bK(i,s)?(e>r&&(n=!0),-1):(e<r&&(n=!0),1):0})),n?t.map((([e,t])=>t)):e}(e);e!==n&&t(n)}function wK(e,t){if("function"!=typeof IntersectionObserver)return void function(e,t){nt((()=>{const n=setTimeout((()=>{xK(e(),t)}));lt((()=>clearTimeout(n)))}))}(e,t);let n=[];nt((()=>{const r=function(e){const t=e[0],n=e[e.length-1]?.ref();let r=t?.ref()?.parentElement;for(;r;){if(n&&r.contains(n))return r;r=r.parentElement}return jV(r).body}(e()),o=new IntersectionObserver((()=>{const r=!!n.length;n=e(),r&&xK(e(),t)}),{root:r});for(const t of e()){const e=t.ref();e&&o.observe(e)}lt((()=>o.disconnect()))}))}function SK(e={}){const[t,n]=function(e){const[t,n]=fK(e);return[()=>t()??[],n]}({value:()=>fB(e.items),onChange:t=>e.onItemsChange?.(t)});wK(t,n);const r=e=>(n((t=>{const n=function(e,t){const n=t.ref();if(!n)return-1;let r=e.length;if(!r)return-1;for(;r--;){const t=e[r]?.ref();if(t&&bK(t,n))return r+1}return 0}(t,e);return function(e,t,n=-1){return n in e?[...e.slice(0,n),t,...e.slice(n)]:[...e,t]}(t,e,n)})),()=>{n((t=>{const n=t.filter((t=>t.ref()!==e.ref()));return t.length===n.length?t:n}))});return{DomCollectionProvider:e=>At(yK.Provider,{value:{registerItem:r},get children(){return e.children}})}}function CK(e){const t=function(){const e=vK();if(void 0===e)throw new Error("[kobalte]: `useDomCollectionContext` must be used within a `DomCollectionProvider` component");return e}(),n=YV({shouldRegisterItem:!0},e);nt((()=>{if(!n.shouldRegisterItem)return;lt(t.registerItem(n.getItem()))}))}function kK(e){let t=e.startIndex??0;const n=e.startLevel??0,r=[],o=t=>{if(null==t)return"";const n=e.getKey??"key",r=CV(n)?t[n]:n(t);return null!=r?String(r):""},i=t=>{if(null==t)return"";const n=e.getTextValue??"textValue",r=CV(n)?t[n]:n(t);return null!=r?String(r):""},s=t=>{if(null==t)return!1;const n=e.getDisabled??"disabled";return(CV(n)?t[n]:n(t))??!1},a=t=>{if(null!=t)return CV(e.getSectionChildren)?t[e.getSectionChildren]:e.getSectionChildren?.(t)};for(const l of e.dataSource)if(CV(l)||"number"==typeof l)r.push({type:"item",rawValue:l,key:String(l),textValue:String(l),disabled:s(l),level:n,index:t}),t++;else if(null!=a(l)){r.push({type:"section",rawValue:l,key:"",textValue:"",disabled:!1,level:n,index:t}),t++;const o=a(l)??[];if(o.length>0){const i=kK({dataSource:o,getKey:e.getKey,getTextValue:e.getTextValue,getDisabled:e.getDisabled,getSectionChildren:e.getSectionChildren,startIndex:t,startLevel:n+1});r.push(...i),t+=i.length}}else r.push({type:"item",rawValue:l,key:o(l),textValue:i(l),disabled:s(l),level:n,index:t}),t++;return r}function EK(e,t=[]){return rt((()=>{const n=kK({dataSource:fB(e.dataSource),getKey:fB(e.getKey),getTextValue:fB(e.getTextValue),getDisabled:fB(e.getDisabled),getSectionChildren:fB(e.getSectionChildren)});for(let e=0;e<t.length;e++)t[e]();return e.factory(n)}))}var _K=new Set(["Avst","Arab","Armi","Syrc","Samr","Mand","Thaa","Mend","Nkoo","Adlm","Rohg","Hebr"]),jK=new Set(["ae","ar","arc","bcc","bqi","ckb","dv","fa","glk","he","ku","mzn","nqo","pnb","ps","sd","ug","ur","yi"]);function TK(e){return function(e){if(Intl.Locale){const t=new Intl.Locale(e).maximize().script??"";return _K.has(t)}const t=e.split("-")[0];return jK.has(t)}(e)?"rtl":"ltr"}function NK(){let e="undefined"!=typeof navigator&&(navigator.language||navigator.userLanguage)||"en-US";return{locale:e,direction:TK(e)}}var PK=NK(),DK=new Set;function MK(){PK=NK();for(const e of DK)e(PK)}var AK=ft();function OK(){const e=function(){const[e,t]=Ze(PK),n=rt((()=>e()));return at((()=>{0===DK.size&&window.addEventListener("languagechange",MK),DK.add(t),lt((()=>{DK.delete(t),0===DK.size&&window.removeEventListener("languagechange",MK)}))})),{locale:()=>n().locale,direction:()=>n().direction}}();return ht(AK)||e}var RK=new Map;var LK=class e extends Set{anchorKey;currentKey;constructor(t,n,r){super(t),t instanceof e?(this.anchorKey=n||t.anchorKey,this.currentKey=r||t.currentKey):(this.anchorKey=n,this.currentKey=r)}};function IK(e){return DV()||MV()?e.altKey:e.ctrlKey}function FK(e){return DV()?e.metaKey:e.ctrlKey}function $K(e){return new LK(e)}function qK(e){const t=YV({selectionMode:"none",selectionBehavior:"toggle"},e),[n,r]=Ze(!1),[o,i]=Ze(),s=rt((()=>{const e=fB(t.selectedKeys);return null!=e?$K(e):e})),a=rt((()=>{const e=fB(t.defaultSelectedKeys);return null!=e?$K(e):new LK})),[l,c]=function(e){const[t,n]=fK(e);return[()=>t()??new LK,n]}({value:s,defaultValue:a,onChange:e=>t.onSelectionChange?.(e)}),[u,d]=Ze(fB(t.selectionBehavior));return nt((()=>{const e=l();"replace"===fB(t.selectionBehavior)&&"toggle"===u()&&"object"==typeof e&&0===e.size&&d("replace")})),nt((()=>{d(fB(t.selectionBehavior)??"toggle")})),{selectionMode:()=>fB(t.selectionMode),disallowEmptySelection:()=>fB(t.disallowEmptySelection)??!1,selectionBehavior:u,setSelectionBehavior:d,isFocused:n,setFocused:r,focusedKey:o,setFocusedKey:i,selectedKeys:l,setSelectedKeys:e=>{!fB(t.allowDuplicateSelectionEvents)&&function(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}(e,l())||c(e)}}}function UK(e,t,n){const r=Ft({selectOnFocus:()=>"replace"===fB(e.selectionManager).selectionBehavior()},e),o=()=>t(),{direction:i}=OK();let s={top:0,left:0};yV((()=>fB(r.isVirtualized)?void 0:o()),"scroll",(()=>{const e=o();e&&(s={top:e.scrollTop,left:e.scrollLeft})}));const{typeSelectHandlers:a}=function(e){const[t,n]=Ze(""),[r,o]=Ze(-1);return{typeSelectHandlers:{onKeyDown:i=>{if(fB(e.isDisabled))return;const s=fB(e.keyboardDelegate),a=fB(e.selectionManager);if(!s.getKeyForSearch)return;const l=function(e){return 1!==e.length&&/^[A-Z]/i.test(e)?"":e}(i.key);if(!l||i.ctrlKey||i.metaKey)return;" "===l&&t().trim().length>0&&(i.preventDefault(),i.stopPropagation());let c=n((e=>e+l)),u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c);null==u&&function(e){return e.split("").every((t=>t===e[0]))}(c)&&(c=c[0],u=s.getKeyForSearch(c,a.focusedKey())??s.getKeyForSearch(c)),null!=u&&(a.setFocusedKey(u),e.onTypeSelect?.(u)),clearTimeout(r()),o(window.setTimeout((()=>n("")),500))}}}}({isDisabled:()=>fB(r.disallowTypeAhead),keyboardDelegate:()=>fB(r.keyboardDelegate),selectionManager:()=>fB(r.selectionManager)}),l=()=>fB(r.orientation)??"vertical",c=()=>{const e=fB(r.autoFocus);if(!e)return;const n=fB(r.selectionManager),o=fB(r.keyboardDelegate);let i;"first"===e&&(i=o.getFirstKey?.()),"last"===e&&(i=o.getLastKey?.());const s=n.selectedKeys();s.size&&(i=s.values().next().value),n.setFocused(!0),n.setFocusedKey(i);const a=t();a&&null==i&&!fB(r.shouldUseVirtualFocus)&&LV(a)};at((()=>{r.deferAutoFocus?setTimeout(c,0):c()})),nt(st([o,()=>fB(r.isVirtualized),()=>fB(r.selectionManager).focusedKey()],(e=>{const[t,n,o]=e;if(n)o&&r.scrollToKey?.(o);else if(o&&t){const e=t.querySelector(`[data-key="${o}"]`);e&&ZV(t,e)}})));return{tabIndex:rt((()=>{if(!fB(r.shouldUseVirtualFocus))return null==fB(r.selectionManager).focusedKey()?0:-1})),onKeyDown:e=>{AV(e,a.onKeyDown),e.altKey&&"Tab"===e.key&&e.preventDefault();const n=t();if(!n?.contains(e.target))return;const o=fB(r.selectionManager),s=fB(r.selectOnFocus),c=t=>{null!=t&&(o.setFocusedKey(t),e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&!IK(e)&&o.replaceSelection(t))},u=fB(r.keyboardDelegate),d=fB(r.shouldFocusWrap),p=o.focusedKey();switch(e.key){case"vertical"===l()?"ArrowDown":"ArrowRight":if(u.getKeyBelow){let t;e.preventDefault(),t=null!=p?u.getKeyBelow(p):u.getFirstKey?.(),null==t&&d&&(t=u.getFirstKey?.(p)),c(t)}break;case"vertical"===l()?"ArrowUp":"ArrowLeft":if(u.getKeyAbove){let t;e.preventDefault(),t=null!=p?u.getKeyAbove(p):u.getLastKey?.(),null==t&&d&&(t=u.getLastKey?.(p)),c(t)}break;case"vertical"===l()?"ArrowLeft":"ArrowUp":if(u.getKeyLeftOf){e.preventDefault();const t="rtl"===i();let n;n=null!=p?u.getKeyLeftOf(p):t?u.getFirstKey?.():u.getLastKey?.(),c(n)}break;case"vertical"===l()?"ArrowRight":"ArrowDown":if(u.getKeyRightOf){e.preventDefault();const t="rtl"===i();let n;n=null!=p?u.getKeyRightOf(p):t?u.getLastKey?.():u.getFirstKey?.(),c(n)}break;case"Home":if(u.getFirstKey){e.preventDefault();const t=u.getFirstKey(p,FK(e));null!=t&&(o.setFocusedKey(t),FK(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"End":if(u.getLastKey){e.preventDefault();const t=u.getLastKey(p,FK(e));null!=t&&(o.setFocusedKey(t),FK(e)&&e.shiftKey&&"multiple"===o.selectionMode()?o.extendSelection(t):s&&o.replaceSelection(t))}break;case"PageDown":if(u.getKeyPageBelow&&null!=p){e.preventDefault();c(u.getKeyPageBelow(p))}break;case"PageUp":if(u.getKeyPageAbove&&null!=p){e.preventDefault();c(u.getKeyPageAbove(p))}break;case"a":FK(e)&&"multiple"===o.selectionMode()&&!0!==fB(r.disallowSelectAll)&&(e.preventDefault(),o.selectAll());break;case"Escape":e.defaultPrevented||(e.preventDefault(),fB(r.disallowEmptySelection)||o.clearSelection());break;case"Tab":if(!fB(r.allowsTabNavigation)){if(e.shiftKey)n.focus();else{const e=function(e,t){const n=t?.tabbable?UV:qV,r=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:e=>t?.from?.contains(e)?NodeFilter.FILTER_REJECT:e.matches(n)&&KV(e)&&(!t?.accept||t.accept(e))?NodeFilter.FILTER_ACCEPT:NodeFilter.FILTER_SKIP});return t?.from&&(r.currentNode=t.from),r}(n,{tabbable:!0});let t,r;do{r=e.lastChild(),r&&(t=r)}while(r);t&&!t.contains(document.activeElement)&&LV(t)}break}}},onMouseDown:e=>{o()===e.target&&e.preventDefault()},onFocusIn:e=>{const t=fB(r.selectionManager),n=fB(r.keyboardDelegate),i=fB(r.selectOnFocus);if(t.isFocused())e.currentTarget.contains(e.target)||t.setFocused(!1);else if(e.currentTarget.contains(e.target))if(t.setFocused(!0),null==t.focusedKey()){const r=e=>{null!=e&&(t.setFocusedKey(e),i&&t.replaceSelection(e))},o=e.relatedTarget;o&&e.currentTarget.compareDocumentPosition(o)&Node.DOCUMENT_POSITION_FOLLOWING?r(t.lastSelectedKey()??n.getLastKey?.()):r(t.firstSelectedKey()??n.getFirstKey?.())}else if(!fB(r.isVirtualized)){const e=o();if(e){e.scrollTop=s.top,e.scrollLeft=s.left;const n=e.querySelector(`[data-key="${t.focusedKey()}"]`);n&&(LV(n),ZV(e,n))}}},onFocusOut:e=>{const t=fB(r.selectionManager);e.currentTarget.contains(e.relatedTarget)||t.setFocused(!1)}}}function zK(e,t){const n=()=>fB(e.selectionManager),r=()=>fB(e.key),o=()=>fB(e.shouldUseVirtualFocus),i=e=>{"none"!==n().selectionMode()&&("single"===n().selectionMode()?n().isSelected(r())&&!n().disallowEmptySelection()?n().toggleSelection(r()):n().replaceSelection(r()):e?.shiftKey?n().extendSelection(r()):"toggle"===n().selectionBehavior()||FK(e)||"pointerType"in e&&"touch"===e.pointerType?n().toggleSelection(r()):n().replaceSelection(r()))},s=()=>fB(e.disabled)||n().isDisabled(r()),a=()=>!s()&&n().canSelectItem(r());let l=null;const c=rt((()=>{if(!o()&&!s())return r()===n().focusedKey()?0:-1})),u=rt((()=>fB(e.virtualized)?void 0:r()));return nt(st([t,r,o,()=>n().focusedKey(),()=>n().isFocused()],(([t,n,r,o,i])=>{t&&n===o&&i&&!r&&document.activeElement!==t&&(e.focus?e.focus():LV(t))}))),{isSelected:()=>n().isSelected(r()),isDisabled:s,allowsSelection:a,tabIndex:c,dataKey:u,onPointerDown:t=>{a()&&(l=t.pointerType,"mouse"!==t.pointerType||0!==t.button||fB(e.shouldSelectOnPressUp)||i(t))},onPointerUp:t=>{a()&&"mouse"===t.pointerType&&0===t.button&&fB(e.shouldSelectOnPressUp)&&fB(e.allowsDifferentPressOrigin)&&i(t)},onClick:t=>{a()&&(fB(e.shouldSelectOnPressUp)&&!fB(e.allowsDifferentPressOrigin)||"mouse"!==l)&&i(t)},onKeyDown:e=>{a()&&["Enter"," "].includes(e.key)&&(IK(e)?n().toggleSelection(r()):i(e))},onMouseDown:e=>{s()&&e.preventDefault()},onFocus:e=>{const i=t();o()||s()||!i||e.target===i&&n().setFocusedKey(r())}}}var BK=class{collection;state;constructor(e,t){this.collection=e,this.state=t}selectionMode(){return this.state.selectionMode()}disallowEmptySelection(){return this.state.disallowEmptySelection()}selectionBehavior(){return this.state.selectionBehavior()}setSelectionBehavior(e){this.state.setSelectionBehavior(e)}isFocused(){return this.state.isFocused()}setFocused(e){this.state.setFocused(e)}focusedKey(){return this.state.focusedKey()}setFocusedKey(e){(null==e||this.collection().getItem(e))&&this.state.setFocusedKey(e)}selectedKeys(){return this.state.selectedKeys()}isSelected(e){if("none"===this.state.selectionMode())return!1;const t=this.getKey(e);return null!=t&&this.state.selectedKeys().has(t)}isEmpty(){return 0===this.state.selectedKeys().size}isSelectAll(){if(this.isEmpty())return!1;const e=this.state.selectedKeys();return this.getAllSelectableKeys().every((t=>e.has(t)))}firstSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index<e.index)||(e=n)}return e?.key}lastSelectedKey(){let e;for(const t of this.state.selectedKeys()){const n=this.collection().getItem(t);e&&!(null!=n?.index&&null!=e?.index&&n.index>e.index)||(e=n)}return e?.key}extendSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode())return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=this.state.selectedKeys(),r=n.anchorKey||t,o=new LK(n,r,t);for(const i of this.getKeyRange(r,n.currentKey||t))o.delete(i);for(const i of this.getKeyRange(t,r))this.canSelectItem(i)&&o.add(i);this.state.setSelectedKeys(o)}getKeyRange(e,t){const n=this.collection().getItem(e),r=this.collection().getItem(t);return n&&r?null!=n.index&&null!=r.index&&n.index<=r.index?this.getKeyRangeInternal(e,t):this.getKeyRangeInternal(t,e):[]}getKeyRangeInternal(e,t){const n=[];let r=e;for(;null!=r;){const e=this.collection().getItem(r);if(e&&"item"===e.type&&n.push(r),r===t)return n;r=this.collection().getKeyAfter(r)}return[]}getKey(e){const t=this.collection().getItem(e);return t?t&&"item"===t.type?t.key:null:e}toggleSelection(e){if("none"===this.selectionMode())return;if("single"===this.selectionMode()&&!this.isSelected(e))return void this.replaceSelection(e);const t=this.getKey(e);if(null==t)return;const n=new LK(this.state.selectedKeys());n.has(t)?n.delete(t):this.canSelectItem(t)&&(n.add(t),n.anchorKey=t,n.currentKey=t),this.disallowEmptySelection()&&0===n.size||this.state.setSelectedKeys(n)}replaceSelection(e){if("none"===this.selectionMode())return;const t=this.getKey(e);if(null==t)return;const n=this.canSelectItem(t)?new LK([t],t,t):new LK;this.state.setSelectedKeys(n)}setSelectedKeys(e){if("none"===this.selectionMode())return;const t=new LK;for(const n of e){const e=this.getKey(n);if(null!=e&&(t.add(e),"single"===this.selectionMode()))break}this.state.setSelectedKeys(t)}selectAll(){"multiple"===this.selectionMode()&&this.state.setSelectedKeys(new Set(this.getAllSelectableKeys()))}clearSelection(){const e=this.state.selectedKeys();!this.disallowEmptySelection()&&e.size>0&&this.state.setSelectedKeys(new LK)}toggleSelectAll(){this.isSelectAll()?this.clearSelection():this.selectAll()}select(e,t){"none"!==this.selectionMode()&&("single"===this.selectionMode()?this.isSelected(e)&&!this.disallowEmptySelection()?this.toggleSelection(e):this.replaceSelection(e):"toggle"===this.selectionBehavior()||t&&"touch"===t.pointerType?this.toggleSelection(e):this.replaceSelection(e))}isSelectionEqual(e){if(e===this.state.selectedKeys())return!0;const t=this.selectedKeys();if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;for(const n of t)if(!e.has(n))return!1;return!0}canSelectItem(e){if("none"===this.state.selectionMode())return!1;const t=this.collection().getItem(e);return null!=t&&!t.disabled}isDisabled(e){const t=this.collection().getItem(e);return!t||t.disabled}getAllSelectableKeys(){const e=[];return(t=>{for(;null!=t;){if(this.canSelectItem(t)){const n=this.collection().getItem(t);if(!n)continue;"item"===n.type&&e.push(t)}t=this.collection().getKeyAfter(t)}})(this.collection().getFirstKey()),e}},VK=class{keyMap=new Map;iterable;firstKey;lastKey;constructor(e){this.iterable=e;for(const r of e)this.keyMap.set(r.key,r);if(0===this.keyMap.size)return;let t,n=0;for(const[r,o]of this.keyMap)t?(t.nextKey=r,o.prevKey=t.key):(this.firstKey=r,o.prevKey=void 0),"item"===o.type&&(o.index=n++),t=o,t.nextKey=void 0;this.lastKey=t.key}*[Symbol.iterator](){yield*this.iterable}getSize(){return this.keyMap.size}getKeys(){return this.keyMap.keys()}getKeyBefore(e){return this.keyMap.get(e)?.prevKey}getKeyAfter(e){return this.keyMap.get(e)?.nextKey}getFirstKey(){return this.firstKey}getLastKey(){return this.lastKey}getItem(e){return this.keyMap.get(e)}at(e){const t=[...this.getKeys()];return this.getItem(t[e])}};var KK,HK=e=>"function"==typeof e?e():e,WK=e=>{const t=rt((()=>{const t=HK(e.element);if(t)return getComputedStyle(t)})),n=()=>t()?.animationName??"none",[r,o]=Ze(HK(e.show)?"present":"hidden");let i="none";return nt((r=>{const s=HK(e.show);return it((()=>{if(r===s)return s;const e=i,a=n();if(s)o("present");else if("none"===a||"none"===t()?.display)o("hidden");else{o(!0===r&&e!==a?"hiding":"hidden")}})),s})),nt((()=>{const t=HK(e.element);if(!t)return;const s=e=>{e.target===t&&(i=n())},a=e=>{const i=n().includes(e.animationName);e.target===t&&i&&"hiding"===r()&&o("hidden")};t.addEventListener("animationstart",s),t.addEventListener("animationcancel",a),t.addEventListener("animationend",a),lt((()=>{t.removeEventListener("animationstart",s),t.removeEventListener("animationcancel",a),t.removeEventListener("animationend",a)}))})),{present:()=>"present"===r()||"hiding"===r(),state:r}},GK="data-kb-top-layer",YK=!1,QK=[];function XK(e){return QK.findIndex((t=>t.node===e))}function JK(){return QK.filter((e=>e.isPointerBlocking))}function ZK(){return JK().length>0}function eH(e){const t=XK([...JK()].slice(-1)[0]?.node);return XK(e)<t}var tH={layers:QK,isTopMostLayer:function(e){return QK[QK.length-1].node===e},hasPointerBlockingLayer:ZK,isBelowPointerBlockingLayer:eH,addLayer:function(e){QK.push(e)},removeLayer:function(e){const t=XK(e);t<0||QK.splice(t,1)},indexOf:XK,find:function(e){return QK[XK(e)]},assignPointerEventToLayers:function(){for(const{node:e}of QK)e.style.pointerEvents=eH(e)?"none":"auto"},disableBodyPointerEvents:function(e){if(ZK()&&!YK){const t=jV(e);KK=document.body.style.pointerEvents,t.body.style.pointerEvents="none",YK=!0}},restoreBodyPointerEvents:function(e){if(ZK())return;const t=jV(e);t.body.style.pointerEvents=KK,0===t.body.style.length&&t.body.removeAttribute("style"),YK=!1}};gK({},{Button:()=>oH,Root:()=>rH});var nH=["button","color","file","image","reset","submit"];function rH(e){let t;const n=YV({type:"button"},e),[r,o]=$t(n,["ref","type","disabled"]),i=rK((()=>t),(()=>"button")),s=rt((()=>{const e=i();return null!=e&&function(e){const t=e.tagName.toLowerCase();return"button"===t||!("input"!==t||!e.type)&&-1!==nH.indexOf(e.type)}({tagName:e,type:r.type})})),a=rt((()=>"input"===i())),l=rt((()=>"a"===i()&&null!=t?.getAttribute("href")));return At(iK,Ft({as:"button",ref(e){const n=sV((e=>t=e),r.ref);"function"==typeof n&&n(e)},get type(){return s()||a()?r.type:void 0},get role(){return s()||l()?void 0:"button"},get tabIndex(){return s()||l()||r.disabled?void 0:0},get disabled(){return s()||a()?r.disabled:void 0},get"aria-disabled"(){return!(s()||a()||!r.disabled)||void 0},get"data-disabled"(){return r.disabled?"":void 0}},o))}var oH=rH,iH=["top","right","bottom","left"],sH=Math.min,aH=Math.max,lH=Math.round,cH=Math.floor,uH=e=>({x:e,y:e}),dH={left:"right",right:"left",bottom:"top",top:"bottom"},pH={start:"end",end:"start"};function fH(e,t,n){return aH(e,sH(t,n))}function hH(e,t){return"function"==typeof e?e(t):e}function mH(e){return e.split("-")[0]}function gH(e){return e.split("-")[1]}function yH(e){return"x"===e?"y":"x"}function vH(e){return"y"===e?"height":"width"}function bH(e){return["top","bottom"].includes(mH(e))?"y":"x"}function xH(e){return yH(bH(e))}function wH(e){return e.replace(/start|end/g,(e=>pH[e]))}function SH(e){return e.replace(/left|right|bottom|top/g,(e=>dH[e]))}function CH(e){return"number"!=typeof e?function(e){return{top:0,right:0,bottom:0,left:0,...e}}(e):{top:e,right:e,bottom:e,left:e}}function kH(e){const{x:t,y:n,width:r,height:o}=e;return{width:r,height:o,top:n,left:t,right:t+r,bottom:n+o,x:t,y:n}}function EH(e,t,n){let{reference:r,floating:o}=e;const i=bH(t),s=xH(t),a=vH(s),l=mH(t),c="y"===i,u=r.x+r.width/2-o.width/2,d=r.y+r.height/2-o.height/2,p=r[a]/2-o[a]/2;let f;switch(l){case"top":f={x:u,y:r.y-o.height};break;case"bottom":f={x:u,y:r.y+r.height};break;case"right":f={x:r.x+r.width,y:d};break;case"left":f={x:r.x-o.width,y:d};break;default:f={x:r.x,y:r.y}}switch(gH(t)){case"start":f[s]-=p*(n&&c?-1:1);break;case"end":f[s]+=p*(n&&c?-1:1)}return f}async function _H(e,t){var n;void 0===t&&(t={});const{x:r,y:o,platform:i,rects:s,elements:a,strategy:l}=e,{boundary:c="clippingAncestors",rootBoundary:u="viewport",elementContext:d="floating",altBoundary:p=!1,padding:f=0}=hH(t,e),h=CH(f),m=a[p?"floating"===d?"reference":"floating":d],g=kH(await i.getClippingRect({element:null==(n=await(null==i.isElement?void 0:i.isElement(m)))||n?m:m.contextElement||await(null==i.getDocumentElement?void 0:i.getDocumentElement(a.floating)),boundary:c,rootBoundary:u,strategy:l})),y="floating"===d?{x:r,y:o,width:s.floating.width,height:s.floating.height}:s.reference,v=await(null==i.getOffsetParent?void 0:i.getOffsetParent(a.floating)),b=await(null==i.isElement?void 0:i.isElement(v))&&await(null==i.getScale?void 0:i.getScale(v))||{x:1,y:1},x=kH(i.convertOffsetParentRelativeRectToViewportRelativeRect?await i.convertOffsetParentRelativeRectToViewportRelativeRect({elements:a,rect:y,offsetParent:v,strategy:l}):y);return{top:(g.top-x.top+h.top)/b.y,bottom:(x.bottom-g.bottom+h.bottom)/b.y,left:(g.left-x.left+h.left)/b.x,right:(x.right-g.right+h.right)/b.x}}function jH(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function TH(e){return iH.some((t=>e[t]>=0))}function NH(e){return MH(e)?(e.nodeName||"").toLowerCase():"#document"}function PH(e){var t;return(null==e||null==(t=e.ownerDocument)?void 0:t.defaultView)||window}function DH(e){var t;return null==(t=(MH(e)?e.ownerDocument:e.document)||window.document)?void 0:t.documentElement}function MH(e){return e instanceof Node||e instanceof PH(e).Node}function AH(e){return e instanceof Element||e instanceof PH(e).Element}function OH(e){return e instanceof HTMLElement||e instanceof PH(e).HTMLElement}function RH(e){return"undefined"!=typeof ShadowRoot&&(e instanceof ShadowRoot||e instanceof PH(e).ShadowRoot)}function LH(e){const{overflow:t,overflowX:n,overflowY:r,display:o}=zH(e);return/auto|scroll|overlay|hidden|clip/.test(t+r+n)&&!["inline","contents"].includes(o)}function IH(e){return["table","td","th"].includes(NH(e))}function FH(e){return[":popover-open",":modal"].some((t=>{try{return e.matches(t)}catch(PX){return!1}}))}function $H(e){const t=qH(),n=AH(e)?zH(e):e;return"none"!==n.transform||"none"!==n.perspective||!!n.containerType&&"normal"!==n.containerType||!t&&!!n.backdropFilter&&"none"!==n.backdropFilter||!t&&!!n.filter&&"none"!==n.filter||["transform","perspective","filter"].some((e=>(n.willChange||"").includes(e)))||["paint","layout","strict","content"].some((e=>(n.contain||"").includes(e)))}function qH(){return!("undefined"==typeof CSS||!CSS.supports)&&CSS.supports("-webkit-backdrop-filter","none")}function UH(e){return["html","body","#document"].includes(NH(e))}function zH(e){return PH(e).getComputedStyle(e)}function BH(e){return AH(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function VH(e){if("html"===NH(e))return e;const t=e.assignedSlot||e.parentNode||RH(e)&&e.host||DH(e);return RH(t)?t.host:t}function KH(e){const t=VH(e);return UH(t)?e.ownerDocument?e.ownerDocument.body:e.body:OH(t)&&LH(t)?t:KH(t)}function HH(e,t,n){var r;void 0===t&&(t=[]),void 0===n&&(n=!0);const o=KH(e),i=o===(null==(r=e.ownerDocument)?void 0:r.body),s=PH(o);return i?t.concat(s,s.visualViewport||[],LH(o)?o:[],s.frameElement&&n?HH(s.frameElement):[]):t.concat(o,HH(o,[],n))}function WH(e){const t=zH(e);let n=parseFloat(t.width)||0,r=parseFloat(t.height)||0;const o=OH(e),i=o?e.offsetWidth:n,s=o?e.offsetHeight:r,a=lH(n)!==i||lH(r)!==s;return a&&(n=i,r=s),{width:n,height:r,$:a}}function GH(e){return AH(e)?e:e.contextElement}function YH(e){const t=GH(e);if(!OH(t))return uH(1);const n=t.getBoundingClientRect(),{width:r,height:o,$:i}=WH(t);let s=(i?lH(n.width):n.width)/r,a=(i?lH(n.height):n.height)/o;return s&&Number.isFinite(s)||(s=1),a&&Number.isFinite(a)||(a=1),{x:s,y:a}}var QH=uH(0);function XH(e){const t=PH(e);return qH()&&t.visualViewport?{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}:QH}function JH(e,t,n,r){void 0===t&&(t=!1),void 0===n&&(n=!1);const o=e.getBoundingClientRect(),i=GH(e);let s=uH(1);t&&(r?AH(r)&&(s=YH(r)):s=YH(e));const a=function(e,t,n){return void 0===t&&(t=!1),!(!n||t&&n!==PH(e))&&t}(i,n,r)?XH(i):uH(0);let l=(o.left+a.x)/s.x,c=(o.top+a.y)/s.y,u=o.width/s.x,d=o.height/s.y;if(i){const e=PH(i),t=r&&AH(r)?PH(r):r;let n=e,o=n.frameElement;for(;o&&r&&t!==n;){const e=YH(o),t=o.getBoundingClientRect(),r=zH(o),i=t.left+(o.clientLeft+parseFloat(r.paddingLeft))*e.x,s=t.top+(o.clientTop+parseFloat(r.paddingTop))*e.y;l*=e.x,c*=e.y,u*=e.x,d*=e.y,l+=i,c+=s,n=PH(o),o=n.frameElement}}return kH({width:u,height:d,x:l,y:c})}function ZH(e){return JH(DH(e)).left+BH(e).scrollLeft}function eW(e,t,n){let r;if("viewport"===t)r=function(e,t){const n=PH(e),r=DH(e),o=n.visualViewport;let i=r.clientWidth,s=r.clientHeight,a=0,l=0;if(o){i=o.width,s=o.height;const e=qH();(!e||e&&"fixed"===t)&&(a=o.offsetLeft,l=o.offsetTop)}return{width:i,height:s,x:a,y:l}}(e,n);else if("document"===t)r=function(e){const t=DH(e),n=BH(e),r=e.ownerDocument.body,o=aH(t.scrollWidth,t.clientWidth,r.scrollWidth,r.clientWidth),i=aH(t.scrollHeight,t.clientHeight,r.scrollHeight,r.clientHeight);let s=-n.scrollLeft+ZH(e);const a=-n.scrollTop;return"rtl"===zH(r).direction&&(s+=aH(t.clientWidth,r.clientWidth)-o),{width:o,height:i,x:s,y:a}}(DH(e));else if(AH(t))r=function(e,t){const n=JH(e,!0,"fixed"===t),r=n.top+e.clientTop,o=n.left+e.clientLeft,i=OH(e)?YH(e):uH(1);return{width:e.clientWidth*i.x,height:e.clientHeight*i.y,x:o*i.x,y:r*i.y}}(t,n);else{const n=XH(e);r={...t,x:t.x-n.x,y:t.y-n.y}}return kH(r)}function tW(e,t){const n=VH(e);return!(n===t||!AH(n)||UH(n))&&("fixed"===zH(n).position||tW(n,t))}function nW(e,t,n){const r=OH(t),o=DH(t),i="fixed"===n,s=JH(e,!0,i,t);let a={scrollLeft:0,scrollTop:0};const l=uH(0);if(r||!r&&!i)if(("body"!==NH(t)||LH(o))&&(a=BH(t)),r){const e=JH(t,!0,i,t);l.x=e.x+t.clientLeft,l.y=e.y+t.clientTop}else o&&(l.x=ZH(o));return{x:s.left+a.scrollLeft-l.x,y:s.top+a.scrollTop-l.y,width:s.width,height:s.height}}function rW(e){return"static"===zH(e).position}function oW(e,t){return OH(e)&&"fixed"!==zH(e).position?t?t(e):e.offsetParent:null}function iW(e,t){const n=PH(e);if(FH(e))return n;if(!OH(e)){let t=VH(e);for(;t&&!UH(t);){if(AH(t)&&!rW(t))return t;t=VH(t)}return n}let r=oW(e,t);for(;r&&IH(r)&&rW(r);)r=oW(r,t);return r&&UH(r)&&rW(r)&&!$H(r)?n:r||function(e){let t=VH(e);for(;OH(t)&&!UH(t);){if($H(t))return t;if(FH(t))return null;t=VH(t)}return null}(e)||n}var sW={convertOffsetParentRelativeRectToViewportRelativeRect:function(e){let{elements:t,rect:n,offsetParent:r,strategy:o}=e;const i="fixed"===o,s=DH(r),a=!!t&&FH(t.floating);if(r===s||a&&i)return n;let l={scrollLeft:0,scrollTop:0},c=uH(1);const u=uH(0),d=OH(r);if((d||!d&&!i)&&(("body"!==NH(r)||LH(s))&&(l=BH(r)),OH(r))){const e=JH(r);c=YH(r),u.x=e.x+r.clientLeft,u.y=e.y+r.clientTop}return{width:n.width*c.x,height:n.height*c.y,x:n.x*c.x-l.scrollLeft*c.x+u.x,y:n.y*c.y-l.scrollTop*c.y+u.y}},getDocumentElement:DH,getClippingRect:function(e){let{element:t,boundary:n,rootBoundary:r,strategy:o}=e;const i=[..."clippingAncestors"===n?FH(t)?[]:function(e,t){const n=t.get(e);if(n)return n;let r=HH(e,[],!1).filter((e=>AH(e)&&"body"!==NH(e))),o=null;const i="fixed"===zH(e).position;let s=i?VH(e):e;for(;AH(s)&&!UH(s);){const t=zH(s),n=$H(s);n||"fixed"!==t.position||(o=null),(i?!n&&!o:!n&&"static"===t.position&&o&&["absolute","fixed"].includes(o.position)||LH(s)&&!n&&tW(e,s))?r=r.filter((e=>e!==s)):o=t,s=VH(s)}return t.set(e,r),r}(t,this._c):[].concat(n),r],s=i.reduce(((e,n)=>{const r=eW(t,n,o);return e.top=aH(r.top,e.top),e.right=sH(r.right,e.right),e.bottom=sH(r.bottom,e.bottom),e.left=aH(r.left,e.left),e}),eW(t,i[0],o));return{width:s.right-s.left,height:s.bottom-s.top,x:s.left,y:s.top}},getOffsetParent:iW,getElementRects:async function(e){const t=this.getOffsetParent||iW,n=this.getDimensions,r=await n(e.floating);return{reference:nW(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:r.width,height:r.height}}},getClientRects:function(e){return Array.from(e.getClientRects())},getDimensions:function(e){const{width:t,height:n}=WH(e);return{width:t,height:n}},getScale:YH,isElement:AH,isRTL:function(e){return"rtl"===zH(e).direction}};function aW(e,t,n,r){void 0===r&&(r={});const{ancestorScroll:o=!0,ancestorResize:i=!0,elementResize:s="function"==typeof ResizeObserver,layoutShift:a="function"==typeof IntersectionObserver,animationFrame:l=!1}=r,c=GH(e),u=o||i?[...c?HH(c):[],...HH(t)]:[];u.forEach((e=>{o&&e.addEventListener("scroll",n,{passive:!0}),i&&e.addEventListener("resize",n)}));const d=c&&a?function(e,t){let n,r=null;const o=DH(e);function i(){var e;clearTimeout(n),null==(e=r)||e.disconnect(),r=null}return function s(a,l){void 0===a&&(a=!1),void 0===l&&(l=1),i();const{left:c,top:u,width:d,height:p}=e.getBoundingClientRect();if(a||t(),!d||!p)return;const f={rootMargin:-cH(u)+"px "+-cH(o.clientWidth-(c+d))+"px "+-cH(o.clientHeight-(u+p))+"px "+-cH(c)+"px",threshold:aH(0,sH(1,l))||1};let h=!0;function m(e){const t=e[0].intersectionRatio;if(t!==l){if(!h)return s();t?s(!1,t):n=setTimeout((()=>{s(!1,1e-7)}),1e3)}h=!1}try{r=new IntersectionObserver(m,{...f,root:o.ownerDocument})}catch(PX){r=new IntersectionObserver(m,f)}r.observe(e)}(!0),i}(c,n):null;let p,f=-1,h=null;s&&(h=new ResizeObserver((e=>{let[r]=e;r&&r.target===c&&h&&(h.unobserve(t),cancelAnimationFrame(f),f=requestAnimationFrame((()=>{var e;null==(e=h)||e.observe(t)}))),n()})),c&&!l&&h.observe(c),h.observe(t));let m=l?JH(e):null;return l&&function t(){const r=JH(e);!m||r.x===m.x&&r.y===m.y&&r.width===m.width&&r.height===m.height||n();m=r,p=requestAnimationFrame(t)}(),n(),()=>{var e;u.forEach((e=>{o&&e.removeEventListener("scroll",n),i&&e.removeEventListener("resize",n)})),null==d||d(),null==(e=h)||e.disconnect(),h=null,l&&cancelAnimationFrame(p)}}var lW=function(e){return void 0===e&&(e=0),{name:"offset",options:e,async fn(t){var n,r;const{x:o,y:i,placement:s,middlewareData:a}=t,l=await async function(e,t){const{placement:n,platform:r,elements:o}=e,i=await(null==r.isRTL?void 0:r.isRTL(o.floating)),s=mH(n),a=gH(n),l="y"===bH(n),c=["left","top"].includes(s)?-1:1,u=i&&l?-1:1,d=hH(t,e);let{mainAxis:p,crossAxis:f,alignmentAxis:h}="number"==typeof d?{mainAxis:d,crossAxis:0,alignmentAxis:null}:{mainAxis:0,crossAxis:0,alignmentAxis:null,...d};return a&&"number"==typeof h&&(f="end"===a?-1*h:h),l?{x:f*u,y:p*c}:{x:p*c,y:f*u}}(t,e);return s===(null==(n=a.offset)?void 0:n.placement)&&null!=(r=a.arrow)&&r.alignmentOffset?{}:{x:o+l.x,y:i+l.y,data:{...l,placement:s}}}}},cW=function(e){return void 0===e&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:r,placement:o}=t,{mainAxis:i=!0,crossAxis:s=!1,limiter:a={fn:e=>{let{x:t,y:n}=e;return{x:t,y:n}}},...l}=hH(e,t),c={x:n,y:r},u=await _H(t,l),d=bH(mH(o)),p=yH(d);let f=c[p],h=c[d];if(i){f=fH(f+u["y"===p?"top":"left"],f,f-u["y"===p?"bottom":"right"])}if(s){h=fH(h+u["y"===d?"top":"left"],h,h-u["y"===d?"bottom":"right"])}const m=a.fn({...t,[p]:f,[d]:h});return{...m,data:{x:m.x-n,y:m.y-r}}}}},uW=function(e){return void 0===e&&(e={}),{name:"flip",options:e,async fn(t){var n,r;const{placement:o,middlewareData:i,rects:s,initialPlacement:a,platform:l,elements:c}=t,{mainAxis:u=!0,crossAxis:d=!0,fallbackPlacements:p,fallbackStrategy:f="bestFit",fallbackAxisSideDirection:h="none",flipAlignment:m=!0,...g}=hH(e,t);if(null!=(n=i.arrow)&&n.alignmentOffset)return{};const y=mH(o),v=bH(a),b=mH(a)===a,x=await(null==l.isRTL?void 0:l.isRTL(c.floating)),w=p||(b||!m?[SH(a)]:function(e){const t=SH(e);return[wH(e),t,wH(t)]}(a)),S="none"!==h;!p&&S&&w.push(...function(e,t,n,r){const o=gH(e);let i=function(e,t,n){const r=["left","right"],o=["right","left"],i=["top","bottom"],s=["bottom","top"];switch(e){case"top":case"bottom":return n?t?o:r:t?r:o;case"left":case"right":return t?i:s;default:return[]}}(mH(e),"start"===n,r);return o&&(i=i.map((e=>e+"-"+o)),t&&(i=i.concat(i.map(wH)))),i}(a,m,h,x));const C=[a,...w],k=await _H(t,g),E=[];let _=(null==(r=i.flip)?void 0:r.overflows)||[];if(u&&E.push(k[y]),d){const e=function(e,t,n){void 0===n&&(n=!1);const r=gH(e),o=xH(e),i=vH(o);let s="x"===o?r===(n?"end":"start")?"right":"left":"start"===r?"bottom":"top";return t.reference[i]>t.floating[i]&&(s=SH(s)),[s,SH(s)]}(o,s,x);E.push(k[e[0]],k[e[1]])}if(_=[..._,{placement:o,overflows:E}],!E.every((e=>e<=0))){var j,T;const e=((null==(j=i.flip)?void 0:j.index)||0)+1,t=C[e];if(t)return{data:{index:e,overflows:_},reset:{placement:t}};let n=null==(T=_.filter((e=>e.overflows[0]<=0)).sort(((e,t)=>e.overflows[1]-t.overflows[1]))[0])?void 0:T.placement;if(!n)switch(f){case"bestFit":{var N;const e=null==(N=_.filter((e=>{if(S){const t=bH(e.placement);return t===v||"y"===t}return!0})).map((e=>[e.placement,e.overflows.filter((e=>e>0)).reduce(((e,t)=>e+t),0)])).sort(((e,t)=>e[1]-t[1]))[0])?void 0:N[0];e&&(n=e);break}case"initialPlacement":n=a}if(o!==n)return{reset:{placement:n}}}return{}}}},dW=function(e){return void 0===e&&(e={}),{name:"size",options:e,async fn(t){const{placement:n,rects:r,platform:o,elements:i}=t,{apply:s=()=>{},...a}=hH(e,t),l=await _H(t,a),c=mH(n),u=gH(n),d="y"===bH(n),{width:p,height:f}=r.floating;let h,m;"top"===c||"bottom"===c?(h=c,m=u===(await(null==o.isRTL?void 0:o.isRTL(i.floating))?"start":"end")?"left":"right"):(m=c,h="end"===u?"top":"bottom");const g=f-l.top-l.bottom,y=p-l.left-l.right,v=sH(f-l[h],g),b=sH(p-l[m],y),x=!t.middlewareData.shift;let w=v,S=b;if(d?S=u||x?sH(b,y):y:w=u||x?sH(v,g):g,x&&!u){const e=aH(l.left,0),t=aH(l.right,0),n=aH(l.top,0),r=aH(l.bottom,0);d?S=p-2*(0!==e||0!==t?e+t:aH(l.left,l.right)):w=f-2*(0!==n||0!==r?n+r:aH(l.top,l.bottom))}await s({...t,availableWidth:S,availableHeight:w});const C=await o.getDimensions(i.floating);return p!==C.width||f!==C.height?{reset:{rects:!0}}:{}}}},pW=function(e){return void 0===e&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:r="referenceHidden",...o}=hH(e,t);switch(r){case"referenceHidden":{const e=jH(await _H(t,{...o,elementContext:"reference"}),n.reference);return{data:{referenceHiddenOffsets:e,referenceHidden:TH(e)}}}case"escaped":{const e=jH(await _H(t,{...o,altBoundary:!0}),n.floating);return{data:{escapedOffsets:e,escaped:TH(e)}}}default:return{}}}}},fW=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:r,placement:o,rects:i,platform:s,elements:a,middlewareData:l}=t,{element:c,padding:u=0}=hH(e,t)||{};if(null==c)return{};const d=CH(u),p={x:n,y:r},f=xH(o),h=vH(f),m=await s.getDimensions(c),g="y"===f,y=g?"top":"left",v=g?"bottom":"right",b=g?"clientHeight":"clientWidth",x=i.reference[h]+i.reference[f]-p[f]-i.floating[h],w=p[f]-i.reference[f],S=await(null==s.getOffsetParent?void 0:s.getOffsetParent(c));let C=S?S[b]:0;C&&await(null==s.isElement?void 0:s.isElement(S))||(C=a.floating[b]||i.floating[h]);const k=x/2-w/2,E=C/2-m[h]/2-1,_=sH(d[y],E),j=sH(d[v],E),T=_,N=C-m[h]-j,P=C/2-m[h]/2+k,D=fH(T,P,N),M=!l.arrow&&null!=gH(o)&&P!==D&&i.reference[h]/2-(P<T?_:j)-m[h]/2<0,A=M?P<T?P-T:P-N:0;return{[f]:p[f]+A,data:{[f]:D,centerOffset:P-D-A,...M&&{alignmentOffset:A}},reset:M}}}),hW=(e,t,n)=>{const r={platform:sW,...n},o={...r.platform,_c:new Map};return(async(e,t,n)=>{const{placement:r="bottom",strategy:o="absolute",middleware:i=[],platform:s}=n,a=i.filter(Boolean),l=await(null==s.isRTL?void 0:s.isRTL(t));let c=await s.getElementRects({reference:e,floating:t,strategy:o}),{x:u,y:d}=EH(c,r,l),p=r,f={},h=0;for(let m=0;m<a.length;m++){const{name:n,fn:i}=a[m],{x:g,y:y,data:v,reset:b}=await i({x:u,y:d,initialPlacement:r,placement:p,strategy:o,middlewareData:f,rects:c,platform:s,elements:{reference:e,floating:t}});u=null!=g?g:u,d=null!=y?y:d,f={...f,[n]:{...f[n],...v}},b&&h<=50&&(h++,"object"==typeof b&&(b.placement&&(p=b.placement),b.rects&&(c=!0===b.rects?await s.getElementRects({reference:e,floating:t,strategy:o}):b.rects),({x:u,y:d}=EH(c,p,l))),m=-1)}return{x:u,y:d,placement:p,strategy:o,middlewareData:f}})(e,t,{...r,platform:o})},mW=ft();function gW(){const e=ht(mW);if(void 0===e)throw new Error("[kobalte]: `usePopperContext` must be used within a `Popper` component");return e}var yW=on('<svg display="block" viewBox="0 0 30 30" style="transform:scale(1.02)"><g><path fill="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z"></path><path stroke="none" d="M23,27.8c1.1,1.2,3.4,2.2,5,2.2h2H0h2c1.7,0,3.9-1,5-2.2l6.6-7.2c0.7-0.8,2-0.8,2.7,0L23,27.8L23,27.8z">'),vW={top:180,right:-90,bottom:0,left:90};function bW(e){const t=gW(),n=YV({size:30},e),[r,o]=$t(n,["ref","style","size"]),i=()=>t.currentPlacement().split("-")[0],s=function(e){const[t,n]=Ze();return nt((()=>{const t=e();var r;t&&n((r=t,jV(r).defaultView||window).getComputedStyle(t))})),t}(t.contentRef),a=()=>2*Number.parseInt(s()?.getPropertyValue(`border-${i()}-width`)||"0px")*(30/r.size);return At(iK,Ft({as:"div",ref(e){const n=sV(t.setArrowRef,r.ref);"function"==typeof n&&n(e)},"aria-hidden":"true",get style(){return wV({position:"absolute","font-size":`${r.size}px`,width:"1em",height:"1em","pointer-events":"none",fill:s()?.getPropertyValue("background-color")||"none",stroke:s()?.getPropertyValue(`border-${i()}-color`)||"none","stroke-width":a()},r.style)}},o,{get children(){const e=yW(),t=e.firstChild;return tt((()=>an(t,"transform",`rotate(${vW[i()]} 15 15) translate(0 2)`))),e}}))}function xW(e){const{x:t=0,y:n=0,width:r=0,height:o=0}=e??{};if("function"==typeof DOMRect)return new DOMRect(t,n,r,o);const i={x:t,y:n,width:r,height:o,top:n,right:t+r,bottom:n+o,left:t};return{...i,toJSON:()=>i}}function wW(e){return/^(?:top|bottom|left|right)(?:-(?:start|end))?$/.test(e)}var SW={top:"bottom",right:"left",bottom:"top",left:"right"};var CW=Object.assign((function(e){const t=YV({getAnchorRect:e=>e?.getBoundingClientRect(),placement:"bottom",gutter:0,shift:0,flip:!0,slide:!0,overlap:!1,sameWidth:!1,fitViewport:!1,hideWhenDetached:!1,detachedPadding:0,arrowPadding:4,overflowPadding:8},e),[n,r]=Ze(),[o,i]=Ze(),[s,a]=Ze(t.placement),l=()=>{return e=t.anchorRef?.(),n=t.getAnchorRect,{contextElement:e,getBoundingClientRect:()=>{const t=n(e);return t?xW(t):e?e.getBoundingClientRect():xW()}};var e,n},{direction:c}=OK();async function u(){const e=l(),r=n(),i=o();if(!e||!r)return;const s=(i?.clientHeight||0)/2,u="number"==typeof t.gutter?t.gutter+s:t.gutter??s;r.style.setProperty("--kb-popper-content-overflow-padding",`${t.overflowPadding}px`),e.getBoundingClientRect();const d=[lW((({placement:e})=>{const n=!!e.split("-")[1];return{mainAxis:u,crossAxis:n?void 0:t.shift,alignmentAxis:t.shift}}))];if(!1!==t.flip){const e="string"==typeof t.flip?t.flip.split(" "):void 0;if(void 0!==e&&!e.every(wW))throw new Error("`flip` expects a spaced-delimited list of placements");d.push(uW({padding:t.overflowPadding,fallbackPlacements:e}))}(t.slide||t.overlap)&&d.push(cW({mainAxis:t.slide,crossAxis:t.overlap,padding:t.overflowPadding})),d.push(dW({padding:t.overflowPadding,apply({availableWidth:e,availableHeight:n,rects:o}){const i=Math.round(o.reference.width);e=Math.floor(e),n=Math.floor(n),r.style.setProperty("--kb-popper-anchor-width",`${i}px`),r.style.setProperty("--kb-popper-content-available-width",`${e}px`),r.style.setProperty("--kb-popper-content-available-height",`${n}px`),t.sameWidth&&(r.style.width=`${i}px`),t.fitViewport&&(r.style.maxWidth=`${e}px`,r.style.maxHeight=`${n}px`)}})),t.hideWhenDetached&&d.push(pW({padding:t.detachedPadding})),i&&d.push(fW({element:i,padding:t.arrowPadding}));const p=await hW(e,r,{placement:t.placement,strategy:"absolute",middleware:d,platform:{...sW,isRTL:()=>"rtl"===c()}});if(a(p.placement),t.onCurrentPlacementChange?.(p.placement),!r)return;r.style.setProperty("--kb-popper-content-transform-origin",function(e,t){const[n,r]=e.split("-"),o=SW[n];return r?"left"===n||"right"===n?`${o} ${"start"===r?"top":"bottom"}`:"start"===r?`${o} ${"rtl"===t?"right":"left"}`:`${o} ${"rtl"===t?"left":"right"}`:`${o} center`}(p.placement,c()));const f=Math.round(p.x),h=Math.round(p.y);let m;if(t.hideWhenDetached&&(m=p.middlewareData.hide?.referenceHidden?"hidden":"visible"),Object.assign(r.style,{top:"0",left:"0",transform:`translate3d(${f}px, ${h}px, 0)`,visibility:m}),i&&p.middlewareData.arrow){const{x:e,y:t}=p.middlewareData.arrow,n=p.placement.split("-")[0];Object.assign(i.style,{left:null!=e?`${e}px`:"",top:null!=t?`${t}px`:"",[n]:"100%"})}}return nt((()=>{const e=l(),t=n();if(!e||!t)return;lt(aW(e,t,u,{elementResize:"function"==typeof ResizeObserver}))})),nt((()=>{const e=n(),r=t.contentRef?.();e&&r&&queueMicrotask((()=>{e.style.zIndex=getComputedStyle(r).zIndex}))})),At(mW.Provider,{value:{currentPlacement:s,contentRef:()=>t.contentRef?.(),setPositionerRef:r,setArrowRef:i},get children(){return t.children}})}),{Arrow:bW,Context:mW,usePopperContext:gW,Positioner:function(e){const t=gW(),[n,r]=$t(e,["ref","style"]);return At(iK,Ft({as:"div",ref(e){const r=sV(t.setPositionerRef,n.ref);"function"==typeof r&&r(e)},"data-popper-positioner":"",get style(){return wV({position:"absolute",top:0,left:0,"min-width":"max-content"},n.style)}},r))}});var kW="interactOutside.pointerDownOutside",EW="interactOutside.focusOutside";var _W=ft();function jW(e){let t;const n=ht(_W),[r,o]=$t(e,["ref","disableOutsidePointerEvents","excludedElements","onEscapeKeyDown","onPointerDownOutside","onFocusOutside","onInteractOutside","onDismiss","bypassTopMostLayerCheck"]),i=new Set([]);!function(e,t){let n,r=GV;const o=()=>jV(t()),i=t=>e.onPointerDownOutside?.(t),s=t=>e.onFocusOutside?.(t),a=t=>e.onInteractOutside?.(t),l=n=>{const r=n.target;return r instanceof HTMLElement&&!r.closest(`[${GK}]`)&&!!EV(o(),r)&&!EV(t(),r)&&!e.shouldExcludeElement?.(r)},c=e=>{function n(){const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=OV([i,a]);r.addEventListener(kW,o,{once:!0});const s=new CustomEvent(kW,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:2===e.button||RV(e)&&0===e.button}});r.dispatchEvent(s)}"touch"===e.pointerType?(o().removeEventListener("click",n),r=n,o().addEventListener("click",n,{once:!0})):n()},u=e=>{const n=t(),r=e.target;if(!n||!r||!l(e))return;const o=OV([s,a]);r.addEventListener(EW,o,{once:!0});const i=new CustomEvent(EW,{bubbles:!1,cancelable:!0,detail:{originalEvent:e,isContextMenu:!1}});r.dispatchEvent(i)};nt((()=>{fB(e.isDisabled)||(n=window.setTimeout((()=>{o().addEventListener("pointerdown",c,!0)}),0),o().addEventListener("focusin",u,!0),lt((()=>{window.clearTimeout(n),o().removeEventListener("click",r),o().removeEventListener("pointerdown",c,!0),o().removeEventListener("focusin",u,!0)})))}))}({shouldExcludeElement:e=>!!t&&(r.excludedElements?.some((t=>EV(t(),e)))||[...i].some((t=>EV(t,e)))),onPointerDownOutside:e=>{t&&!tH.isBelowPointerBlockingLayer(t)&&(r.bypassTopMostLayerCheck||tH.isTopMostLayer(t))&&(r.onPointerDownOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.())},onFocusOutside:e=>{r.onFocusOutside?.(e),r.onInteractOutside?.(e),e.defaultPrevented||r.onDismiss?.()}},(()=>t)),function(e){const t=t=>{t.key===NV.Escape&&e.onEscapeKeyDown?.(t)};nt((()=>{if(fB(e.isDisabled))return;const n=e.ownerDocument?.()??jV();n.addEventListener("keydown",t),lt((()=>{n.removeEventListener("keydown",t)}))}))}({ownerDocument:()=>jV(t),onEscapeKeyDown:e=>{t&&tH.isTopMostLayer(t)&&(r.onEscapeKeyDown?.(e),!e.defaultPrevented&&r.onDismiss&&(e.preventDefault(),r.onDismiss()))}}),at((()=>{if(!t)return;tH.addLayer({node:t,isPointerBlocking:r.disableOutsidePointerEvents,dismiss:r.onDismiss});const e=n?.registerNestedLayer(t);tH.assignPointerEventToLayers(),tH.disableBodyPointerEvents(t),lt((()=>{t&&(tH.removeLayer(t),e?.(),tH.assignPointerEventToLayers(),tH.restoreBodyPointerEvents(t))}))})),nt(st([()=>t,()=>r.disableOutsidePointerEvents],(([e,t])=>{if(!e)return;const n=tH.find(e);n&&n.isPointerBlocking!==t&&(n.isPointerBlocking=t,tH.assignPointerEventToLayers()),t&&tH.disableBodyPointerEvents(e),lt((()=>{tH.restoreBodyPointerEvents(e)}))}),{defer:!0}));return At(_W.Provider,{value:{registerNestedLayer:e=>{i.add(e);const t=n?.registerNestedLayer(e);return()=>{i.delete(e),t?.()}}},get children(){return At(iK,Ft({as:"div",ref(e){const n=sV((e=>t=e),r.ref);"function"==typeof n&&n(e)}},o))}})}function TW(e={}){const[t,n]=hK({value:()=>fB(e.open),defaultValue:()=>!!fB(e.defaultOpen),onChange:t=>e.onOpenChange?.(t)}),r=()=>{n(!0)},o=()=>{n(!1)};return{isOpen:t,setIsOpen:n,open:r,close:o,toggle:()=>{t()?o():r()}}}var NW={};gK(NW,{Description:()=>cK,ErrorMessage:()=>uK,Item:()=>OW,ItemControl:()=>RW,ItemDescription:()=>LW,ItemIndicator:()=>IW,ItemInput:()=>FW,ItemLabel:()=>$W,Label:()=>qW,RadioGroup:()=>zW,Root:()=>UW});var PW=ft();function DW(){const e=ht(PW);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupContext` must be used within a `RadioGroup` component");return e}var MW=ft();function AW(){const e=ht(MW);if(void 0===e)throw new Error("[kobalte]: `useRadioGroupItemContext` must be used within a `RadioGroup.Item` component");return e}function OW(e){const t=lK(),n=DW(),r=YV({id:`${t.generateId("item")}-${zt()}`},e),[o,i]=$t(r,["value","disabled","onPointerDown"]),[s,a]=Ze(),[l,c]=Ze(),[u,d]=Ze(),[p,f]=Ze(),[h,m]=Ze(!1),g=rt((()=>n.isSelectedValue(o.value))),y=rt((()=>o.disabled||t.isDisabled()||!1)),v=e=>{AV(e,o.onPointerDown),h()&&e.preventDefault()},b=rt((()=>({...t.dataset(),"data-disabled":y()?"":void 0,"data-checked":g()?"":void 0}))),x={value:()=>o.value,dataset:b,isSelected:g,isDisabled:y,inputId:s,labelId:l,descriptionId:u,inputRef:p,select:()=>n.setSelectedValue(o.value),generateId:kV((()=>i.id)),registerInput:nK(a),registerLabel:nK(c),registerDescription:nK(d),setIsFocused:m,setInputRef:f};return At(MW.Provider,{value:x,get children(){return At(iK,Ft({as:"div",role:"group",onPointerDown:v},b,i))}})}function RW(e){const t=AW(),n=YV({id:t.generateId("control")},e),[r,o]=$t(n,["onClick","onKeyDown"]);return At(iK,Ft({as:"div",onClick:e=>{AV(e,r.onClick),t.select(),t.inputRef()?.focus()},onKeyDown:e=>{AV(e,r.onKeyDown),e.key===NV.Space&&(t.select(),t.inputRef()?.focus())}},(()=>t.dataset()),o))}function LW(e){const t=AW(),n=YV({id:t.generateId("description")},e);return nt((()=>lt(t.registerDescription(n.id)))),At(iK,Ft({as:"div"},(()=>t.dataset()),n))}function IW(e){const t=AW(),n=YV({id:t.generateId("indicator")},e),[r,o]=$t(n,["ref","forceMount"]),[i,s]=Ze(),{present:a}=WK({show:()=>r.forceMount||t.isSelected(),element:()=>i()??null});return At(Ht,{get when(){return a()},get children(){return At(iK,Ft({as:"div",ref(e){const t=sV(s,r.ref);"function"==typeof t&&t(e)}},(()=>t.dataset()),o))}})}function FW(e){const t=lK(),n=DW(),r=AW(),o=YV({id:r.generateId("input")},e),[i,s]=$t(o,["ref","style","aria-labelledby","aria-describedby","onChange","onFocus","onBlur"]),[a,l]=Ze(!1);return nt(st([()=>r.isSelected(),()=>r.value()],(e=>{if(!e[0]&&e[1]===r.value())return;l(!0);const t=r.inputRef();t?.dispatchEvent(new Event("input",{bubbles:!0,cancelable:!0})),t?.dispatchEvent(new Event("change",{bubbles:!0,cancelable:!0}))}),{defer:!0})),nt((()=>lt(r.registerInput(s.id)))),At(iK,Ft({as:"input",ref(e){const t=sV(r.setInputRef,i.ref);"function"==typeof t&&t(e)},type:"radio",get name(){return t.name()},get value(){return r.value()},get checked(){return r.isSelected()},get required(){return t.isRequired()},get disabled(){return r.isDisabled()},get readonly(){return t.isReadOnly()},get style(){return wV({...tK},i.style)},get"aria-labelledby"(){return[i["aria-labelledby"],r.labelId(),null!=i["aria-labelledby"]&&null!=s["aria-label"]?s.id:void 0].filter(Boolean).join(" ")||void 0},get"aria-describedby"(){return[i["aria-describedby"],r.descriptionId(),n.ariaDescribedBy()].filter(Boolean).join(" ")||void 0},onChange:e=>{if(AV(e,i.onChange),e.stopPropagation(),!a()){n.setSelectedValue(r.value());e.target.checked=r.isSelected()}l(!1)},onFocus:e=>{AV(e,i.onFocus),r.setIsFocused(!0)},onBlur:e=>{AV(e,i.onBlur),r.setIsFocused(!1)}},(()=>r.dataset()),s))}function $W(e){const t=AW(),n=YV({id:t.generateId("label")},e);return nt((()=>lt(t.registerLabel(n.id)))),At(iK,Ft({as:"label",get for(){return t.inputId()}},(()=>t.dataset()),n))}function qW(e){return At(dK,Ft({as:"span"},e))}function UW(e){let t;const n=YV({id:`radiogroup-${zt()}`,orientation:"vertical"},e),[r,o,i]=$t(n,["ref","value","defaultValue","onChange","orientation","aria-labelledby","aria-describedby"],sK),[s,a]=fK({value:()=>r.value,defaultValue:()=>r.defaultValue,onChange:e=>r.onChange?.(e)}),{formControlContext:l}=function(e){const t=YV({id:`form-control-${zt()}`},e),[n,r]=Ze(),[o,i]=Ze(),[s,a]=Ze(),[l,c]=Ze();return{formControlContext:{name:()=>fB(t.name)??fB(t.id),dataset:rt((()=>({"data-valid":"valid"===fB(t.validationState)?"":void 0,"data-invalid":"invalid"===fB(t.validationState)?"":void 0,"data-required":fB(t.required)?"":void 0,"data-disabled":fB(t.disabled)?"":void 0,"data-readonly":fB(t.readOnly)?"":void 0}))),validationState:()=>fB(t.validationState),isRequired:()=>fB(t.required),isDisabled:()=>fB(t.disabled),isReadOnly:()=>fB(t.readOnly),labelId:n,fieldId:o,descriptionId:s,errorMessageId:l,getAriaLabelledBy:(e,t,r)=>{const o=null!=r||null!=n();return[r,n(),o&&null!=t?e:void 0].filter(Boolean).join(" ")||void 0},getAriaDescribedBy:e=>[s(),l(),e].filter(Boolean).join(" ")||void 0,generateId:kV((()=>fB(t.id))),registerLabel:nK(r),registerField:nK(i),registerDescription:nK(a),registerErrorMessage:nK(c)}}}(o);pK((()=>t),(()=>a(r.defaultValue??"")));const c=()=>l.getAriaDescribedBy(r["aria-describedby"]),u=e=>e===s(),d={ariaDescribedBy:c,isSelectedValue:u,setSelectedValue:e=>{if(!l.isReadOnly()&&!l.isDisabled()&&(a(e),t))for(const n of t.querySelectorAll("[type='radio']")){n.checked=u(n.value)}}};return At(aK.Provider,{value:l,get children(){return At(PW.Provider,{value:d,get children(){return At(iK,Ft({as:"div",ref(e){const n=sV((e=>t=e),r.ref);"function"==typeof n&&n(e)},role:"radiogroup",get id(){return fB(o.id)},get"aria-invalid"(){return"invalid"===l.validationState()||void 0},get"aria-required"(){return l.isRequired()||void 0},get"aria-disabled"(){return l.isDisabled()||void 0},get"aria-readonly"(){return l.isReadOnly()||void 0},get"aria-orientation"(){return r.orientation},get"aria-labelledby"(){return l.getAriaLabelledBy(fB(o.id),i["aria-label"],r["aria-labelledby"])},get"aria-describedby"(){return c()}},(()=>l.dataset()),i))}})}})}var zW=Object.assign(UW,{Description:cK,ErrorMessage:uK,Item:OW,ItemControl:RW,ItemDescription:LW,ItemIndicator:IW,ItemInput:FW,ItemLabel:$W,Label:qW}),BW=class{collection;ref;collator;constructor(e,t,n){this.collection=e,this.ref=t,this.collator=n}getKeyBelow(e){let t=this.collection().getKeyAfter(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyAfter(t)}}getKeyAbove(e){let t=this.collection().getKeyBefore(e);for(;null!=t;){const e=this.collection().getItem(t);if(e&&"item"===e.type&&!e.disabled)return t;t=this.collection().getKeyBefore(t)}}getFirstKey(){let e=this.collection().getFirstKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyAfter(e)}}getLastKey(){let e=this.collection().getLastKey();for(;null!=e;){const t=this.collection().getItem(e);if(t&&"item"===t.type&&!t.disabled)return e;e=this.collection().getKeyBefore(e)}}getItem(e){return this.ref?.()?.querySelector(`[data-key="${e}"]`)??null}getKeyPageAbove(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.max(0,n.offsetTop+n.offsetHeight-t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop>r;)o=this.getKeyAbove(o),n=null!=o?this.getItem(o):null;return o}getKeyPageBelow(e){const t=this.ref?.();let n=this.getItem(e);if(!t||!n)return;const r=Math.min(t.scrollHeight,n.offsetTop-n.offsetHeight+t.offsetHeight);let o=e;for(;o&&n&&n.offsetTop<r;)o=this.getKeyBelow(o),n=null!=o?this.getItem(o):null;return o}getKeyForSearch(e,t){const n=this.collator?.();if(!n)return;let r=null!=t?this.getKeyBelow(t):this.getFirstKey();for(;null!=r;){const t=this.collection().getItem(r);if(t){const o=t.textValue.slice(0,e.length);if(t.textValue&&0===n.compare(o,e))return r}r=this.getKeyBelow(r)}}};function VW(e,t,n){const r=function(e){const{locale:t}=OK(),n=rt((()=>t()+(e?Object.entries(e).sort(((e,t)=>e[0]<t[0]?-1:1)).join():"")));return rt((()=>{const r=n();let o;return RK.has(r)&&(o=RK.get(r)),o||(o=new Intl.Collator(t(),e),RK.set(r,o)),o}))}({usage:"search",sensitivity:"base"});return UK({selectionManager:()=>fB(e.selectionManager),keyboardDelegate:rt((()=>{const n=fB(e.keyboardDelegate);return n||new BW(e.collection,t,r)})),autoFocus:()=>fB(e.autoFocus),deferAutoFocus:()=>fB(e.deferAutoFocus),shouldFocusWrap:()=>fB(e.shouldFocusWrap),disallowEmptySelection:()=>fB(e.disallowEmptySelection),selectOnFocus:()=>fB(e.selectOnFocus),disallowTypeAhead:()=>fB(e.disallowTypeAhead),shouldUseVirtualFocus:()=>fB(e.shouldUseVirtualFocus),allowsTabNavigation:()=>fB(e.allowsTabNavigation),isVirtualized:()=>fB(e.isVirtualized),scrollToKey:t=>fB(e.scrollToKey)?.(t),orientation:()=>fB(e.orientation)},t)}var KW="focusScope.autoFocusOnMount",HW="focusScope.autoFocusOnUnmount",WW={bubbles:!1,cancelable:!0},GW={stack:[],active(){return this.stack[0]},add(e){e!==this.active()&&this.active()?.pause(),this.stack=SV(this.stack,e),this.stack.unshift(e)},remove(e){this.stack=SV(this.stack,e),this.active()?.resume()}};function YW(e,t){const[n,r]=Ze(!1),o={pause(){r(!0)},resume(){r(!1)}};let i=null;const s=t=>e.onMountAutoFocus?.(t),a=t=>e.onUnmountAutoFocus?.(t),l=()=>jV(t()),c=()=>{const e=l().createElement("span");return e.setAttribute("data-focus-trap",""),e.tabIndex=0,Object.assign(e.style,tK),e},u=()=>{const e=t();return e?zV(e,!0).filter((e=>!e.hasAttribute("data-focus-trap"))):[]},d=()=>{const e=u();return e.length>0?e[0]:null};nt((()=>{const e=t();if(!e)return;GW.add(o);const n=_V(e);if(!EV(e,n)){const t=new CustomEvent(KW,WW);e.addEventListener(KW,s),e.dispatchEvent(t),t.defaultPrevented||setTimeout((()=>{LV(d()),_V(e)===n&&LV(e)}),0)}lt((()=>{e.removeEventListener(KW,s),setTimeout((()=>{const r=new CustomEvent(HW,WW);(()=>{const e=t();if(!e)return!1;const n=_V(e);return!!n&&!EV(e,n)&&VV(n)})()&&r.preventDefault(),e.addEventListener(HW,a),e.dispatchEvent(r),r.defaultPrevented||LV(n??l().body),e.removeEventListener(HW,a),GW.remove(o)}),0)}))})),nt((()=>{const r=t();if(!r||!fB(e.trapFocus)||n())return;const o=e=>{const t=e.target;t?.closest(`[${GK}]`)||(EV(r,t)?i=t:LV(i))},s=e=>{const t=e.relatedTarget??_V(r);t?.closest(`[${GK}]`)||EV(r,t)||LV(i)};l().addEventListener("focusin",o),l().addEventListener("focusout",s),lt((()=>{l().removeEventListener("focusin",o),l().removeEventListener("focusout",s)}))})),nt((()=>{const r=t();if(!r||!fB(e.trapFocus)||n())return;const o=c();r.insertAdjacentElement("afterbegin",o);const i=c();function s(e){const t=d(),n=(()=>{const e=u();return e.length>0?e[e.length-1]:null})();LV(e.relatedTarget===t?n:t)}r.insertAdjacentElement("beforeend",i),o.addEventListener("focusin",s),i.addEventListener("focusin",s);const a=new MutationObserver((e=>{for(const t of e)t.previousSibling===i&&(i.remove(),r.insertAdjacentElement("beforeend",i)),t.nextSibling===o&&(o.remove(),r.insertAdjacentElement("afterbegin",o))}));a.observe(r,{childList:!0,subtree:!1}),lt((()=>{o.removeEventListener("focusin",s),i.removeEventListener("focusin",s),o.remove(),i.remove(),a.disconnect()}))}))}var QW="data-live-announcer";function XW(e){nt((()=>{fB(e.isDisabled)||lt(function(e,t=document.body){const n=new Set(e),r=new Set,o=e=>{for(const r of e.querySelectorAll(`[${QW}], [${GK}]`))n.add(r);const t=e=>{if(n.has(e)||e.parentElement&&r.has(e.parentElement)&&"row"!==e.parentElement.getAttribute("role"))return NodeFilter.FILTER_REJECT;for(const t of n)if(e.contains(t))return NodeFilter.FILTER_SKIP;return NodeFilter.FILTER_ACCEPT},o=document.createTreeWalker(e,NodeFilter.SHOW_ELEMENT,{acceptNode:t}),s=t(e);if(s===NodeFilter.FILTER_ACCEPT&&i(e),s!==NodeFilter.FILTER_REJECT){let e=o.nextNode();for(;null!=e;)i(e),e=o.nextNode()}},i=e=>{const t=JW.get(e)??0;"true"===e.getAttribute("aria-hidden")&&0===t||(0===t&&e.setAttribute("aria-hidden","true"),r.add(e),JW.set(e,t+1))};ZW.length&&ZW[ZW.length-1].disconnect();o(t);const s=new MutationObserver((e=>{for(const t of e)if("childList"===t.type&&0!==t.addedNodes.length&&![...n,...r].some((e=>e.contains(t.target)))){for(const e of t.removedNodes)e instanceof Element&&(n.delete(e),r.delete(e));for(const e of t.addedNodes)!(e instanceof HTMLElement||e instanceof SVGElement)||"true"!==e.dataset.liveAnnouncer&&"true"!==e.dataset.reactAriaTopLayer?e instanceof Element&&o(e):n.add(e)}}));s.observe(t,{childList:!0,subtree:!0});const a={observe(){s.observe(t,{childList:!0,subtree:!0})},disconnect(){s.disconnect()}};return ZW.push(a),()=>{s.disconnect();for(const e of r){const t=JW.get(e);if(null==t)return;1===t?(e.removeAttribute("aria-hidden"),JW.delete(e)):JW.set(e,t-1)}a===ZW[ZW.length-1]?(ZW.pop(),ZW.length&&ZW[ZW.length-1].observe()):ZW.splice(ZW.indexOf(a),1)}}(fB(e.targets),fB(e.root)))}))}var JW=new WeakMap,ZW=[];var eG=new Map,tG=e=>{nt((()=>{const t=HK(e.style)??{},n=HK(e.properties)??[],r={};for(const i in t)r[i]=e.element.style[i];const o=eG.get(e.key);o?o.activeCount++:eG.set(e.key,{activeCount:1,originalStyles:r,properties:n.map((e=>e.key))}),Object.assign(e.element.style,e.style);for(const i of n)e.element.style.setProperty(i.key,i.value);lt((()=>{const t=eG.get(e.key);if(t)if(1===t.activeCount){eG.delete(e.key);for(const[n,r]of Object.entries(t.originalStyles))e.element.style[n]=r;for(const n of t.properties)e.element.style.removeProperty(n);0===e.element.style.length&&e.element.removeAttribute("style"),e.cleanup?.()}else t.activeCount--}))}))},nG=(e,t)=>{switch(t){case"x":return[e.clientWidth,e.scrollLeft,e.scrollWidth];case"y":return[e.clientHeight,e.scrollTop,e.scrollHeight]}},rG=(e,t)=>{const n=getComputedStyle(e),r="x"===t?n.overflowX:n.overflowY;return"auto"===r||"scroll"===r||"HTML"===e.tagName&&"visible"===r},[oG,iG]=Ze([]),sG=e=>[e.deltaX,e.deltaY],aG=e=>e.changedTouches[0]?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0],lG=(e,t,n,r)=>{const o=null!==r&&cG(r,e),[i,s]=((e,t,n)=>{const r="x"===t&&"rtl"===window.getComputedStyle(e).direction?-1:1;let o=e,i=0,s=0,a=!1;do{const[e,l,c]=nG(o,t),u=c-e-r*l;0===l&&0===u||!rG(o,t)||(i+=u,s+=l),o===(n??document.documentElement)?a=!0:o=o._$host??o.parentElement}while(o&&!a);return[i,s]})(e,t,o?r:void 0);return!(n>0&&Math.abs(i)<=1)&&!(n<0&&Math.abs(s)<1)},cG=(e,t)=>{if(e.contains(t))return!0;let n=t;for(;n;){if(n===e)return!0;n=n._$host??n.parentElement}return!1},uG=e=>{const t=Ft({element:null,enabled:!0,hideScrollbar:!0,preventScrollbarShift:!0,preventScrollbarShiftMode:"padding",restoreScrollPosition:!0,allowPinchZoom:!1},e),n=zt();let r=[0,0],o=null,i=null;nt((()=>{HK(t.enabled)&&(iG((e=>[...e,n])),lt((()=>{iG((e=>e.filter((e=>e!==n))))})))})),nt((()=>{if(!HK(t.enabled)||!HK(t.hideScrollbar))return;const{body:e}=document,n=window.innerWidth-e.offsetWidth;if(HK(t.preventScrollbarShift)){const r={overflow:"hidden"},o=[];n>0&&("padding"===HK(t.preventScrollbarShiftMode)?r.paddingRight=`calc(${window.getComputedStyle(e).paddingRight} + ${n}px)`:r.marginRight=`calc(${window.getComputedStyle(e).marginRight} + ${n}px)`,o.push({key:"--scrollbar-width",value:`${n}px`}));const i=window.scrollY,s=window.scrollX;tG({key:"prevent-scroll",element:e,style:r,properties:o,cleanup:()=>{HK(t.restoreScrollPosition)&&n>0&&window.scrollTo(s,i)}})}else tG({key:"prevent-scroll",element:e,style:{overflow:"hidden"}})})),nt((()=>{var e;(e=n,oG().indexOf(e)===oG().length-1&&HK(t.enabled))&&(document.addEventListener("wheel",a,{passive:!1}),document.addEventListener("touchstart",s,{passive:!1}),document.addEventListener("touchmove",l,{passive:!1}),lt((()=>{document.removeEventListener("wheel",a),document.removeEventListener("touchstart",s),document.removeEventListener("touchmove",l)})))}));const s=e=>{r=aG(e),o=null,i=null},a=e=>{const n=e.target,r=HK(t.element),o=sG(e),i=Math.abs(o[0])>Math.abs(o[1])?"x":"y",s=lG(n,i,"x"===i?o[0]:o[1],r);let a;a=!r||!cG(r,n)||!s,a&&e.cancelable&&e.preventDefault()},l=e=>{const n=HK(t.element),s=e.target;let a;if(2===e.touches.length)a=!HK(t.allowPinchZoom);else{if(null==o||null===i){const t=aG(e).map(((e,t)=>r[t]-e)),n=Math.abs(t[0])>Math.abs(t[1])?"x":"y";o=n,i="x"===n?t[0]:t[1]}if("range"===s.type)a=!1;else{const e=lG(s,o,i,n);a=!n||!cG(n,s)||!e}}a&&e.cancelable&&e.preventDefault()}},dG=ft();function pG(){return ht(dG)}function fG(){const e=pG();if(void 0===e)throw new Error("[kobalte]: `useMenuContext` must be used within a `Menu` component");return e}var hG=ft();function mG(){const e=ht(hG);if(void 0===e)throw new Error("[kobalte]: `useMenuItemContext` must be used within a `Menu.Item` component");return e}var gG=ft();function yG(){const e=ht(gG);if(void 0===e)throw new Error("[kobalte]: `useMenuRootContext` must be used within a `MenuRoot` component");return e}function vG(e){let t;const n=yG(),r=fG(),o=YV({id:n.generateId(`item-${zt()}`)},e),[i,s]=$t(o,["ref","textValue","disabled","closeOnSelect","checked","indeterminate","onSelect","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]),[a,l]=Ze(),[c,u]=Ze(),[d,p]=Ze(),f=()=>r.listState().selectionManager(),h=()=>s.id,m=()=>{i.onSelect?.(),i.closeOnSelect&&setTimeout((()=>{r.close(!0)}))};CK({getItem:()=>({ref:()=>t,type:"item",key:h(),textValue:i.textValue??d()?.textContent??t?.textContent??"",disabled:i.disabled??!1})});const g=zK({key:h,selectionManager:f,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),y=e=>{AV(e,i.onPointerMove),"mouse"===e.pointerType&&(i.disabled?r.onItemLeave(e):(r.onItemEnter(e),e.defaultPrevented||(LV(e.currentTarget),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(h()))))},v=e=>{AV(e,i.onPointerLeave),"mouse"===e.pointerType&&r.onItemLeave(e)},b=e=>{AV(e,i.onPointerUp),i.disabled||0!==e.button||m()},x=e=>{if(AV(e,i.onKeyDown),!e.repeat&&!i.disabled)switch(e.key){case"Enter":case" ":m()}},w=rt((()=>i.indeterminate?"mixed":null!=i.checked?i.checked:void 0)),S=rt((()=>({"data-indeterminate":i.indeterminate?"":void 0,"data-checked":i.checked&&!i.indeterminate?"":void 0,"data-disabled":i.disabled?"":void 0,"data-highlighted":f().focusedKey()===h()?"":void 0}))),C={isChecked:()=>i.checked,dataset:S,setLabelRef:p,generateId:kV((()=>s.id)),registerLabel:nK(l),registerDescription:nK(u)};return At(hG.Provider,{value:C,get children(){return At(iK,Ft({as:"div",ref(e){const n=sV((e=>t=e),i.ref);"function"==typeof n&&n(e)},get tabIndex(){return g.tabIndex()},get"aria-checked"(){return w()},get"aria-disabled"(){return i.disabled},get"aria-labelledby"(){return a()},get"aria-describedby"(){return c()},get"data-key"(){return g.dataKey()},get onPointerDown(){return OV([i.onPointerDown,g.onPointerDown])},get onPointerUp(){return OV([b,g.onPointerUp])},get onClick(){return OV([i.onClick,g.onClick])},get onKeyDown(){return OV([x,g.onKeyDown])},get onMouseDown(){return OV([i.onMouseDown,g.onMouseDown])},get onFocus(){return OV([i.onFocus,g.onFocus])},onPointerMove:y,onPointerLeave:v},S,s))}})}function bG(e){const t=YV({closeOnSelect:!1},e),[n,r]=$t(t,["checked","defaultChecked","onChange","onSelect"]),o=function(e={}){const[t,n]=hK({value:()=>fB(e.isSelected),defaultValue:()=>!!fB(e.defaultIsSelected),onChange:t=>e.onSelectedChange?.(t)});return{isSelected:t,setIsSelected:t=>{fB(e.isReadOnly)||fB(e.isDisabled)||n(t)},toggle:()=>{fB(e.isReadOnly)||fB(e.isDisabled)||n(!t())}}}({isSelected:()=>n.checked,defaultIsSelected:()=>n.defaultChecked,onSelectedChange:e=>n.onChange?.(e),isDisabled:()=>r.disabled});return At(vG,Ft({role:"menuitemcheckbox",get checked(){return o.isSelected()},onSelect:()=>{n.onSelect?.(),o.toggle()}},r))}var xG=ft();function wG(){return ht(xG)}var SG={next:(e,t)=>"ltr"===e?"horizontal"===t?"ArrowRight":"ArrowDown":"horizontal"===t?"ArrowLeft":"ArrowUp",previous:(e,t)=>SG.next("ltr"===e?"rtl":"ltr",t)},CG=e=>"horizontal"===e?"ArrowDown":"ArrowRight",kG=e=>"horizontal"===e?"ArrowUp":"ArrowLeft";function EG(e){const t=yG(),n=fG(),r=wG(),{direction:o}=OK(),i=YV({id:t.generateId("trigger")},e),[s,a]=$t(i,["ref","id","disabled","onPointerDown","onClick","onKeyDown","onMouseOver","onFocus"]);let l=()=>t.value();void 0!==r&&(l=()=>t.value()??s.id,void 0===r.lastValue()&&r.setLastValue(l));const c=rK((()=>n.triggerRef()),(()=>"button")),u=rt((()=>"a"===c()&&null!=n.triggerRef()?.getAttribute("href")));nt(st((()=>r?.value()),(e=>{u()&&e===l()&&n.triggerRef()?.focus()})));const d=()=>{void 0!==r?n.isOpen()?r.value()===l()&&r.closeMenu():(r.autoFocusMenu()||r.setAutoFocusMenu(!0),n.open(!1)):n.toggle(!0)};return nt((()=>lt(n.registerTriggerId(s.id)))),At(rH,Ft({ref(e){const t=sV(n.setTriggerRef,s.ref);"function"==typeof t&&t(e)},get"data-kb-menu-value-trigger"(){return t.value()},get id(){return s.id},get disabled(){return s.disabled},"aria-haspopup":"true",get"aria-expanded"(){return n.isOpen()},get"aria-controls"(){return rt((()=>!!n.isOpen()))()?n.contentId():void 0},get"data-highlighted"(){return void 0!==l()&&r?.value()===l()||void 0},get tabIndex(){return void 0!==r?r.value()===l()||r.lastValue()===l()?0:-1:void 0},onPointerDown:e=>{AV(e,s.onPointerDown),e.currentTarget.dataset.pointerType=e.pointerType,s.disabled||"touch"===e.pointerType||0!==e.button||d()},onMouseOver:e=>{AV(e,s.onMouseOver),"touch"!==n.triggerRef()?.dataset.pointerType&&(s.disabled||void 0===r||void 0===r.value()||r.setValue(l))},onClick:e=>{AV(e,s.onClick),s.disabled||"touch"===e.currentTarget.dataset.pointerType&&d()},onKeyDown:e=>{if(AV(e,s.onKeyDown),!s.disabled){if(u())switch(e.key){case"Enter":case" ":return}switch(e.key){case"Enter":case" ":case CG(t.orientation()):e.stopPropagation(),e.preventDefault(),function(e){if(document.contains(e)){const t=document.scrollingElement||document.documentElement;if("hidden"===window.getComputedStyle(t).overflow){let n=HV(e);for(;e&&n&&e!==t&&n!==t;)ZV(n,e),n=HV(e=n)}else{const{left:t,top:n}=e.getBoundingClientRect();e?.scrollIntoView?.({block:"nearest"});const{left:r,top:o}=e.getBoundingClientRect();(Math.abs(t-r)>1||Math.abs(n-o)>1)&&e.scrollIntoView?.({block:"nearest"})}}}(e.currentTarget),n.open("first"),r?.setAutoFocusMenu(!0),r?.setValue(l);break;case kG(t.orientation()):e.stopPropagation(),e.preventDefault(),n.open("last");break;case SG.next(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.nextMenu();break;case SG.previous(o(),t.orientation()):if(void 0===r)break;e.stopPropagation(),e.preventDefault(),r.previousMenu()}}},onFocus:e=>{AV(e,s.onFocus),void 0!==r&&"touch"!==e.currentTarget.dataset.pointerType&&r.setValue(l)},role:void 0!==r?"menuitem":void 0},(()=>n.dataset()),a))}var _G=ft();function jG(){return ht(_G)}function TG(e){let t;const n=yG(),r=fG(),o=wG(),i=jG(),{direction:s}=OK(),a=YV({id:n.generateId(`content-${zt()}`)},e),[l,c]=$t(a,["ref","id","style","onOpenAutoFocus","onCloseAutoFocus","onEscapeKeyDown","onFocusOutside","onPointerEnter","onPointerMove","onKeyDown","onMouseDown","onFocusIn","onFocusOut"]);let u=0;const d=()=>null==r.parentMenuContext()&&void 0===o&&n.isModal(),p=VW({selectionManager:r.listState().selectionManager,collection:r.listState().collection,autoFocus:r.autoFocus,deferAutoFocus:!0,shouldFocusWrap:!0,disallowTypeAhead:()=>!r.listState().selectionManager().isFocused(),orientation:()=>"horizontal"===n.orientation()?"vertical":"horizontal"},(()=>t));YW({trapFocus:()=>d()&&r.isOpen(),onMountAutoFocus:e=>{void 0===o&&l.onOpenAutoFocus?.(e)},onUnmountAutoFocus:l.onCloseAutoFocus},(()=>t));const f=e=>{l.onEscapeKeyDown?.(e),o?.setAutoFocusMenu(!1),r.close(!0)},h=e=>{l.onFocusOutside?.(e),n.isModal()&&e.preventDefault()};nt((()=>lt(r.registerContentId(l.id))));const m={ref:sV((e=>{r.setContentRef(e),t=e}),l.ref),role:"menu",get id(){return l.id},get tabIndex(){return p.tabIndex()},get"aria-labelledby"(){return r.triggerId()},onKeyDown:OV([l.onKeyDown,p.onKeyDown,e=>{if(EV(e.currentTarget,e.target)&&("Tab"===e.key&&r.isOpen()&&e.preventDefault(),void 0!==o&&"true"!==e.currentTarget.getAttribute("aria-haspopup")))switch(e.key){case SG.next(s(),n.orientation()):e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.nextMenu();break;case SG.previous(s(),n.orientation()):if(e.currentTarget.hasAttribute("data-closed"))break;e.stopPropagation(),e.preventDefault(),r.close(!0),o.setAutoFocusMenu(!0),o.previousMenu()}}]),onMouseDown:OV([l.onMouseDown,p.onMouseDown]),onFocusIn:OV([l.onFocusIn,p.onFocusIn]),onFocusOut:OV([l.onFocusOut,p.onFocusOut]),onPointerEnter:e=>{AV(e,l.onPointerEnter),r.isOpen()&&(r.parentMenuContext()?.listState().selectionManager().setFocused(!1),r.parentMenuContext()?.listState().selectionManager().setFocusedKey(void 0))},onPointerMove:e=>{if(AV(e,l.onPointerMove),"mouse"!==e.pointerType)return;const t=u!==e.clientX;EV(e.currentTarget,e.target)&&t&&(r.setPointerDir(e.clientX>u?"right":"left"),u=e.clientX)},get"data-orientation"(){return n.orientation()}};return At(Ht,{get when(){return r.contentPresent()},get children(){return At(Ht,{get when(){return void 0===i||null!=r.parentMenuContext()},get fallback(){return At(iK,Ft({as:"div"},(()=>r.dataset()),m,c))},get children(){return At(CW.Positioner,{get children(){return At(jW,Ft({get disableOutsidePointerEvents(){return rt((()=>!!d()))()&&r.isOpen()},get excludedElements(){return[r.triggerRef]},bypassTopMostLayerCheck:!0,get style(){return wV({"--kb-menu-content-transform-origin":"var(--kb-popper-content-transform-origin)",position:"relative"},l.style)},onEscapeKeyDown:f,onFocusOutside:h,get onDismiss(){return r.close}},(()=>r.dataset()),m,c))}})}})}})}function NG(e){let t;const n=yG(),r=fG(),[o,i]=$t(e,["ref"]);return uG({element:()=>t??null,enabled:()=>r.contentPresent()&&n.preventScroll()}),At(TG,Ft({ref(e){const n=sV((e=>{t=e}),o.ref);"function"==typeof n&&n(e)}},i))}var PG=ft();function DG(e){const t=YV({id:yG().generateId(`group-${zt()}`)},e),[n,r]=Ze(),o={generateId:kV((()=>t.id)),registerLabelId:nK(r)};return At(PG.Provider,{value:o,get children(){return At(iK,Ft({as:"div",role:"group",get"aria-labelledby"(){return n()}},t))}})}function MG(e){const t=function(){const e=ht(PG);if(void 0===e)throw new Error("[kobalte]: `useMenuGroupContext` must be used within a `Menu.Group` component");return e}(),n=YV({id:t.generateId("label")},e),[r,o]=$t(n,["id"]);return nt((()=>lt(t.registerLabelId(r.id)))),At(iK,Ft({as:"span",get id(){return r.id},"aria-hidden":"true"},o))}function AG(e){const t=fG();return At(iK,Ft({as:"span","aria-hidden":"true"},(()=>t.dataset()),YV({children:"▼"},e)))}function OG(e){return At(vG,Ft({role:"menuitem",closeOnSelect:!0},e))}function RG(e){const t=mG(),n=YV({id:t.generateId("description")},e),[r,o]=$t(n,["id"]);return nt((()=>lt(t.registerDescription(r.id)))),At(iK,Ft({as:"div",get id(){return r.id}},(()=>t.dataset()),o))}function LG(e){const t=mG(),n=YV({id:t.generateId("indicator")},e),[r,o]=$t(n,["forceMount"]);return At(Ht,{get when(){return r.forceMount||t.isChecked()},get children(){return At(iK,Ft({as:"div"},(()=>t.dataset()),o))}})}function IG(e){const t=mG(),n=YV({id:t.generateId("label")},e),[r,o]=$t(n,["ref","id"]);return nt((()=>lt(t.registerLabel(r.id)))),At(iK,Ft({as:"div",ref(e){const n=sV(t.setLabelRef,r.ref);"function"==typeof n&&n(e)},get id(){return r.id}},(()=>t.dataset()),o))}function FG(e){const t=fG();return At(Ht,{get when(){return t.contentPresent()},get children(){return At(Cn,e)}})}var $G=ft();function qG(e){const t=YV({id:yG().generateId(`radiogroup-${zt()}`)},e),[n,r]=$t(t,["value","defaultValue","onChange","disabled"]),[o,i]=fK({value:()=>n.value,defaultValue:()=>n.defaultValue,onChange:e=>n.onChange?.(e)});return At($G.Provider,{value:{isDisabled:()=>n.disabled,isSelectedValue:e=>e===o(),setSelectedValue:i},get children(){return At(DG,r)}})}function UG(e){const t=function(){const e=ht($G);if(void 0===e)throw new Error("[kobalte]: `useMenuRadioGroupContext` must be used within a `Menu.RadioGroup` component");return e}(),n=YV({closeOnSelect:!1},e),[r,o]=$t(n,["value","onSelect"]);return At(vG,Ft({role:"menuitemradio",get checked(){return t.isSelectedValue(r.value)},onSelect:()=>{r.onSelect?.(),t.setSelectedValue(r.value)}},o))}function zG(e,t,n){const r=e.split("-")[0],o=n.getBoundingClientRect(),i=[],s=t.clientX,a=t.clientY;switch(r){case"top":i.push([s,a+5]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]);break;case"right":i.push([s-5,a]),i.push([o.left,o.top]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]);break;case"bottom":i.push([s,a-5]),i.push([o.right,o.top]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]);break;case"left":i.push([s+5,a]),i.push([o.right,o.bottom]),i.push([o.left,o.bottom]),i.push([o.left,o.top]),i.push([o.right,o.top])}return i}function BG(e){const t=yG(),n=vK(),r=pG(),o=wG(),i=jG(),s=YV({placement:"horizontal"===t.orientation()?"bottom-start":"right-start"},e),[a,l]=$t(s,["open","defaultOpen","onOpenChange"]);let c=0,u=null,d="right";const[p,f]=Ze(),[h,m]=Ze(),[g,y]=Ze(),[v,b]=Ze(),[x,w]=Ze(!0),[S,C]=Ze(l.placement),[k,E]=Ze([]),[_,j]=Ze([]),{DomCollectionProvider:T}=SK({items:_,onItemsChange:j}),N=TW({open:()=>a.open,defaultOpen:()=>a.defaultOpen,onOpenChange:e=>a.onOpenChange?.(e)}),{present:P}=WK({show:()=>t.forceMount()||N.isOpen(),element:()=>v()??null}),D=function(e){const t=qK(e),n=EK({dataSource:()=>fB(e.dataSource),getKey:()=>fB(e.getKey),getTextValue:()=>fB(e.getTextValue),getDisabled:()=>fB(e.getDisabled),getSectionChildren:()=>fB(e.getSectionChildren),factory:t=>new VK(e.filter?e.filter(t):t)},[()=>e.filter]),r=new BK(n,t);return et((()=>{const e=t.focusedKey();null==e||n().getItem(e)||t.setFocusedKey(void 0)})),{collection:n,selectionManager:()=>r}}({selectionMode:"none",dataSource:_}),M=e=>{w(e),N.open()},A=(e=!1)=>{N.close(),e&&r&&r.close(!0)},O=()=>{const e=v();e&&(LV(e),D.selectionManager().setFocused(!0),D.selectionManager().setFocusedKey(void 0))},R=()=>{null!=i?setTimeout((()=>O())):O()},L=e=>{return d===u?.side&&(t=e,n=u?.area,!!n&&function(e,t){const[n,r]=e;let o=!1;for(let i=t.length,s=0,a=i-1;s<i;a=s++){const[e,l]=t[s],[c,u]=t[a],[,d]=t[0===a?i-1:a-1]||[0,0],p=(l-u)*(n-e)-(e-c)*(r-l);if(u<l){if(r>=u&&r<l){if(0===p)return!0;p>0&&(r===u?r>d&&(o=!o):o=!o)}}else if(l<u){if(r>l&&r<=u){if(0===p)return!0;p<0&&(r===u?r<d&&(o=!o):o=!o)}}else if(r==l&&(n>=c&&n<=e||n>=e&&n<=c))return!0}return o}([t.clientX,t.clientY],n));var t,n};XW({isDisabled:()=>!(null==r&&N.isOpen()&&t.isModal()),targets:()=>[v(),...k()].filter(Boolean)}),nt((()=>{const e=v();if(!e||!r)return;const t=r.registerNestedMenu(e);lt((()=>{t()}))})),nt((()=>{void 0===r&&o?.registerMenu(t.value(),[v(),...k()])})),nt((()=>{void 0===r&&void 0!==o&&(o.value()===t.value()?(g()?.focus(),o.autoFocusMenu()&&M(!0)):A())})),nt((()=>{void 0===r&&void 0!==o&&N.isOpen()&&o.setValue(t.value())})),lt((()=>{void 0===r&&o?.unregisterMenu(t.value())}));const I={dataset:rt((()=>({"data-expanded":N.isOpen()?"":void 0,"data-closed":N.isOpen()?void 0:""}))),isOpen:N.isOpen,contentPresent:P,nestedMenus:k,currentPlacement:S,pointerGraceTimeoutId:()=>c,autoFocus:x,listState:()=>D,parentMenuContext:()=>r,triggerRef:g,contentRef:v,triggerId:p,contentId:h,setTriggerRef:y,setContentRef:b,open:M,close:A,toggle:e=>{w(e),N.toggle()},focusContent:R,onItemEnter:e=>{L(e)&&e.preventDefault()},onItemLeave:e=>{L(e)||R()},onTriggerLeave:e=>{L(e)&&e.preventDefault()},setPointerDir:e=>d=e,setPointerGraceTimeoutId:e=>c=e,setPointerGraceIntent:e=>u=e,registerNestedMenu:e=>{E((t=>[...t,e]));const t=r?.registerNestedMenu(e);return()=>{E((t=>SV(t,e))),t?.()}},registerItemToParentDomCollection:n?.registerItem,registerTriggerId:nK(f),registerContentId:nK(m)};return At(T,{get children(){return At(dG.Provider,{value:I,get children(){return At(Ht,{when:void 0===i,get fallback(){return l.children},get children(){return At(CW,Ft({anchorRef:g,contentRef:v,onCurrentPlacementChange:C},l))}})}})}})}function VG(e){const{direction:t}=OK();return At(BG,Ft({get placement(){return"rtl"===t()?"left-start":"right-start"},flip:!0},e))}var KG=(e,t)=>"ltr"===e?["horizontal"===t?"ArrowLeft":"ArrowUp"]:["horizontal"===t?"ArrowRight":"ArrowDown"];function HG(e){const t=fG(),n=yG(),[r,o]=$t(e,["onFocusOutside","onKeyDown"]),{direction:i}=OK();return At(TG,Ft({onOpenAutoFocus:e=>{e.preventDefault()},onCloseAutoFocus:e=>{e.preventDefault()},onFocusOutside:e=>{r.onFocusOutside?.(e);const n=e.target;EV(t.triggerRef(),n)||t.close()},onKeyDown:e=>{AV(e,r.onKeyDown);const o=EV(e.currentTarget,e.target),s=KG(i(),n.orientation()).includes(e.key),a=null!=t.parentMenuContext();o&&s&&a&&(t.close(),LV(t.triggerRef()))}},o))}var WG=["Enter"," "],GG=(e,t)=>"ltr"===e?[...WG,"horizontal"===t?"ArrowRight":"ArrowDown"]:[...WG,"horizontal"===t?"ArrowLeft":"ArrowUp"];function YG(e){let t;const n=yG(),r=fG(),o=YV({id:n.generateId(`sub-trigger-${zt()}`)},e),[i,s]=$t(o,["ref","id","textValue","disabled","onPointerMove","onPointerLeave","onPointerDown","onPointerUp","onClick","onKeyDown","onMouseDown","onFocus"]);let a=null;const l=()=>{a&&window.clearTimeout(a),a=null},{direction:c}=OK(),u=()=>i.id,d=()=>{const e=r.parentMenuContext();if(null==e)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");return e.listState().selectionManager()},p=zK({key:u,selectionManager:d,shouldSelectOnPressUp:!0,allowsDifferentPressOrigin:!0,disabled:()=>i.disabled},(()=>t)),f=e=>{AV(e,i.onClick),r.isOpen()||i.disabled||r.open(!0)},h=e=>{AV(e,i.onKeyDown),e.repeat||i.disabled||GG(c(),n.orientation()).includes(e.key)&&(e.stopPropagation(),e.preventDefault(),d().setFocused(!1),d().setFocusedKey(void 0),r.isOpen()||r.open("first"),r.focusContent(),r.listState().selectionManager().setFocused(!0),r.listState().selectionManager().setFocusedKey(r.listState().collection().getFirstKey()))};return nt((()=>{if(null==r.registerItemToParentDomCollection)throw new Error("[kobalte]: `Menu.SubTrigger` must be used within a `Menu.Sub` component");lt(r.registerItemToParentDomCollection({ref:()=>t,type:"item",key:u(),textValue:i.textValue??t?.textContent??"",disabled:i.disabled??!1}))})),nt(st((()=>r.parentMenuContext()?.pointerGraceTimeoutId()),(e=>{lt((()=>{window.clearTimeout(e),r.parentMenuContext()?.setPointerGraceIntent(null)}))}))),nt((()=>lt(r.registerTriggerId(i.id)))),lt((()=>{l()})),At(iK,Ft({as:"div",ref(e){const n=sV((e=>{r.setTriggerRef(e),t=e}),i.ref);"function"==typeof n&&n(e)},get id(){return i.id},role:"menuitem",get tabIndex(){return p.tabIndex()},"aria-haspopup":"true",get"aria-expanded"(){return r.isOpen()},get"aria-controls"(){return rt((()=>!!r.isOpen()))()?r.contentId():void 0},get"aria-disabled"(){return i.disabled},get"data-key"(){return p.dataKey()},get"data-highlighted"(){return d().focusedKey()===u()?"":void 0},get"data-disabled"(){return i.disabled?"":void 0},get onPointerDown(){return OV([i.onPointerDown,p.onPointerDown])},get onPointerUp(){return OV([i.onPointerUp,p.onPointerUp])},get onClick(){return OV([f,p.onClick])},get onKeyDown(){return OV([h,p.onKeyDown])},get onMouseDown(){return OV([i.onMouseDown,p.onMouseDown])},get onFocus(){return OV([i.onFocus,p.onFocus])},onPointerMove:e=>{if(AV(e,i.onPointerMove),"mouse"!==e.pointerType)return;const t=r.parentMenuContext();t?.onItemEnter(e),e.defaultPrevented||(i.disabled?t?.onItemLeave(e):(r.isOpen()||a||(r.parentMenuContext()?.setPointerGraceIntent(null),a=window.setTimeout((()=>{r.open(!1),l()}),100)),t?.onItemEnter(e),e.defaultPrevented||(r.listState().selectionManager().isFocused()&&(r.listState().selectionManager().setFocused(!1),r.listState().selectionManager().setFocusedKey(void 0)),LV(e.currentTarget),t?.listState().selectionManager().setFocused(!0),t?.listState().selectionManager().setFocusedKey(u()))))},onPointerLeave:e=>{if(AV(e,i.onPointerLeave),"mouse"!==e.pointerType)return;l();const t=r.parentMenuContext(),n=r.contentRef();if(n){t?.setPointerGraceIntent({area:zG(r.currentPlacement(),e,n),side:r.currentPlacement().split("-")[0]}),window.clearTimeout(t?.pointerGraceTimeoutId());const o=window.setTimeout((()=>{t?.setPointerGraceIntent(null)}),300);t?.setPointerGraceTimeoutId(o)}else{if(t?.onTriggerLeave(e),e.defaultPrevented)return;t?.setPointerGraceIntent(null)}t?.onItemLeave(e)}},(()=>r.dataset()),s))}function QG(e){const t=wG(),n=YV({id:`menu-${zt()}`,modal:!0},e),[r,o]=$t(n,["id","modal","preventScroll","forceMount","open","defaultOpen","onOpenChange","value","orientation"]),i=TW({open:()=>r.open,defaultOpen:()=>r.defaultOpen,onOpenChange:e=>r.onOpenChange?.(e)}),s={isModal:()=>r.modal??!0,preventScroll:()=>r.preventScroll??s.isModal(),forceMount:()=>r.forceMount??!1,generateId:kV((()=>r.id)),value:()=>r.value,orientation:()=>r.orientation??t?.orientation()??"horizontal"};return At(gG.Provider,{value:s,get children(){return At(BG,Ft({get open(){return i.isOpen()},get onOpenChange(){return i.setIsOpen}},o))}})}function XG(e){let t;const n=YV({orientation:"horizontal"},e),[r,o]=$t(n,["ref","orientation"]),i=rK((()=>t),(()=>"hr"));return At(iK,Ft({as:"hr",ref(e){const n=sV((e=>t=e),r.ref);"function"==typeof n&&n(e)},get role(){return"hr"!==i()?"separator":void 0},get"aria-orientation"(){return"vertical"===r.orientation?"vertical":void 0},get"data-orientation"(){return r.orientation}},o))}gK({},{Root:()=>XG,Separator:()=>JG});var JG=XG,ZG={};function eY(e){const t=yG(),n=fG(),[r,o]=$t(e,["onCloseAutoFocus","onInteractOutside"]);let i=!1;return At(NG,Ft({onCloseAutoFocus:e=>{r.onCloseAutoFocus?.(e),i||LV(n.triggerRef()),i=!1,e.preventDefault()},onInteractOutside:e=>{r.onInteractOutside?.(e),t.isModal()&&!e.detail.isContextMenu||(i=!0)}},o))}function tY(e){return At(QG,YV({id:`dropdownmenu-${zt()}`},e))}gK(ZG,{Arrow:()=>bW,CheckboxItem:()=>bG,Content:()=>eY,DropdownMenu:()=>nY,Group:()=>DG,GroupLabel:()=>MG,Icon:()=>AG,Item:()=>OG,ItemDescription:()=>RG,ItemIndicator:()=>LG,ItemLabel:()=>IG,Portal:()=>FG,RadioGroup:()=>qG,RadioItem:()=>UG,Root:()=>tY,Separator:()=>XG,Sub:()=>VG,SubContent:()=>HG,SubTrigger:()=>YG,Trigger:()=>EG});var nY=Object.assign(tY,{Arrow:bW,CheckboxItem:bG,Content:eY,Group:DG,GroupLabel:MG,Icon:AG,Item:OG,ItemDescription:RG,ItemIndicator:LG,ItemLabel:IG,Portal:FG,RadioGroup:qG,RadioItem:UG,Separator:XG,Sub:VG,SubContent:HG,SubTrigger:YG,Trigger:EG}),rY={colors:{inherit:"inherit",current:"currentColor",transparent:"transparent",black:"#000000",white:"#ffffff",neutral:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},darkGray:{50:"#525c7a",100:"#49536e",200:"#414962",300:"#394056",400:"#313749",500:"#292e3d",600:"#212530",700:"#191c24",800:"#111318",900:"#0b0d10"},gray:{50:"#f9fafb",100:"#f2f4f7",200:"#eaecf0",300:"#d0d5dd",400:"#98a2b3",500:"#667085",600:"#475467",700:"#344054",800:"#1d2939",900:"#101828"},blue:{25:"#F5FAFF",50:"#EFF8FF",100:"#D1E9FF",200:"#B2DDFF",300:"#84CAFF",400:"#53B1FD",500:"#2E90FA",600:"#1570EF",700:"#175CD3",800:"#1849A9",900:"#194185"},green:{25:"#F6FEF9",50:"#ECFDF3",100:"#D1FADF",200:"#A6F4C5",300:"#6CE9A6",400:"#32D583",500:"#12B76A",600:"#039855",700:"#027A48",800:"#05603A",900:"#054F31"},red:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},yellow:{25:"#FFFCF5",50:"#FFFAEB",100:"#FEF0C7",200:"#FEDF89",300:"#FEC84B",400:"#FDB022",500:"#F79009",600:"#DC6803",700:"#B54708",800:"#93370D",900:"#7A2E0E"},purple:{25:"#FAFAFF",50:"#F4F3FF",100:"#EBE9FE",200:"#D9D6FE",300:"#BDB4FE",400:"#9B8AFB",500:"#7A5AF8",600:"#6938EF",700:"#5925DC",800:"#4A1FB8",900:"#3E1C96"},teal:{25:"#F6FEFC",50:"#F0FDF9",100:"#CCFBEF",200:"#99F6E0",300:"#5FE9D0",400:"#2ED3B7",500:"#15B79E",600:"#0E9384",700:"#107569",800:"#125D56",900:"#134E48"},pink:{25:"#fdf2f8",50:"#fce7f3",100:"#fbcfe8",200:"#f9a8d4",300:"#f472b6",400:"#ec4899",500:"#db2777",600:"#be185d",700:"#9d174d",800:"#831843",900:"#500724"},cyan:{25:"#ecfeff",50:"#cffafe",100:"#a5f3fc",200:"#67e8f9",300:"#22d3ee",400:"#06b6d4",500:"#0891b2",600:"#0e7490",700:"#155e75",800:"#164e63",900:"#083344"}},alpha:{90:"e5",80:"cc"},font:{size:{xs:"calc(var(--tsqd-font-size) * 0.75)",sm:"calc(var(--tsqd-font-size) * 0.875)",md:"var(--tsqd-font-size)"},lineHeight:{xs:"calc(var(--tsqd-font-size) * 1)",sm:"calc(var(--tsqd-font-size) * 1.25)",md:"calc(var(--tsqd-font-size) * 1.5)"},weight:{medium:"500",semibold:"600",bold:"700"}},border:{radius:{xs:"calc(var(--tsqd-font-size) * 0.125)",sm:"calc(var(--tsqd-font-size) * 0.25)",full:"9999px"}},size:{.25:"calc(var(--tsqd-font-size) * 0.0625)",.5:"calc(var(--tsqd-font-size) * 0.125)",1:"calc(var(--tsqd-font-size) * 0.25)",1.5:"calc(var(--tsqd-font-size) * 0.375)",2:"calc(var(--tsqd-font-size) * 0.5)",2.5:"calc(var(--tsqd-font-size) * 0.625)",3:"calc(var(--tsqd-font-size) * 0.75)",3.5:"calc(var(--tsqd-font-size) * 0.875)",4:"calc(var(--tsqd-font-size) * 1)",4.5:"calc(var(--tsqd-font-size) * 1.125)",5:"calc(var(--tsqd-font-size) * 1.25)",6:"calc(var(--tsqd-font-size) * 1.5)",6.5:"calc(var(--tsqd-font-size) * 1.625)",14:"calc(var(--tsqd-font-size) * 3.5)"},shadow:{xs:(e="rgb(0 0 0 / 0.1)")=>"0 1px 2px 0 rgb(0 0 0 / 0.05)",sm:(e="rgb(0 0 0 / 0.1)")=>`0 1px 3px 0 ${e}, 0 1px 2px -1px ${e}`,md:(e="rgb(0 0 0 / 0.1)")=>`0 4px 6px -1px ${e}, 0 2px 4px -2px ${e}`,lg:(e="rgb(0 0 0 / 0.1)")=>`0 10px 15px -3px ${e}, 0 4px 6px -4px ${e}`,xl:(e="rgb(0 0 0 / 0.1)")=>`0 20px 25px -5px ${e}, 0 8px 10px -6px ${e}`,"2xl":(e="rgb(0 0 0 / 0.25)")=>`0 25px 50px -12px ${e}`,inner:(e="rgb(0 0 0 / 0.05)")=>`inset 0 2px 4px 0 ${e}`,none:()=>"none"}},oY=on('<svg width=14 height=14 viewBox="0 0 14 14"fill=none xmlns=http://www.w3.org/2000/svg><path d="M13 13L9.00007 9M10.3333 5.66667C10.3333 8.244 8.244 10.3333 5.66667 10.3333C3.08934 10.3333 1 8.244 1 5.66667C1 3.08934 3.08934 1 5.66667 1C8.244 1 10.3333 3.08934 10.3333 5.66667Z"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),iY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 3H15M3 6H21M19 6L18.2987 16.5193C18.1935 18.0975 18.1409 18.8867 17.8 19.485C17.4999 20.0118 17.0472 20.4353 16.5017 20.6997C15.882 21 15.0911 21 13.5093 21H10.4907C8.90891 21 8.11803 21 7.49834 20.6997C6.95276 20.4353 6.50009 20.0118 6.19998 19.485C5.85911 18.8867 5.8065 18.0975 5.70129 16.5193L5 6M10 10.5V15.5M14 10.5V15.5"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),sY=on('<svg width=10 height=6 viewBox="0 0 10 6"fill=none xmlns=http://www.w3.org/2000/svg><path d="M1 1L5 5L9 1"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),aY=on('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 13.3333V2.66667M8 2.66667L4 6.66667M8 2.66667L12 6.66667"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),lY=on('<svg width=12 height=12 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 2.66667V13.3333M8 13.3333L4 9.33333M8 13.3333L12 9.33333"stroke=currentColor stroke-width=1.66667 stroke-linecap=round stroke-linejoin=round>'),cY=on('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2v2m0 16v2M4 12H2m4.314-5.686L4.9 4.9m12.786 1.414L19.1 4.9M6.314 17.69 4.9 19.104m12.786-1.414 1.414 1.414M22 12h-2m-3 0a5 5 0 1 1-10 0 5 5 0 0 1 10 0Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),uY=on('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M22 15.844a10.424 10.424 0 0 1-4.306.925c-5.779 0-10.463-4.684-10.463-10.462 0-1.536.33-2.994.925-4.307A10.464 10.464 0 0 0 2 11.538C2 17.316 6.684 22 12.462 22c4.243 0 7.896-2.526 9.538-6.156Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),dY=on('<svg viewBox="0 0 24 24"height=12 width=12 fill=none xmlns=http://www.w3.org/2000/svg><path d="M8 21h8m-4-4v4m-5.2-4h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 14.72 22 13.88 22 12.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v4.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 17 5.12 17 6.8 17Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),pY=on('<svg stroke=currentColor fill=currentColor stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M0 0h24v24H0z"></path><path d="M1 9l2 2c4.97-4.97 13.03-4.97 18 0l2-2C16.93 2.93 7.08 2.93 1 9zm8 8l3 3 3-3a4.237 4.237 0 00-6 0zm-4-4l2 2a7.074 7.074 0 0110 0l2-2C15.14 9.14 8.87 9.14 5 13z">'),fY=on('<svg stroke-width=0 viewBox="0 0 24 24"height=1em width=1em xmlns=http://www.w3.org/2000/svg><path fill=none d="M24 .01c0-.01 0-.01 0 0L0 0v24h24V.01zM0 0h24v24H0V0zm0 0h24v24H0V0z"></path><path d="M22.99 9C19.15 5.16 13.8 3.76 8.84 4.78l2.52 2.52c3.47-.17 6.99 1.05 9.63 3.7l2-2zm-4 4a9.793 9.793 0 00-4.49-2.56l3.53 3.53.96-.97zM2 3.05L5.07 6.1C3.6 6.82 2.22 7.78 1 9l1.99 2c1.24-1.24 2.67-2.16 4.2-2.77l2.24 2.24A9.684 9.684 0 005 13v.01L6.99 15a7.042 7.042 0 014.92-2.06L18.98 20l1.27-1.26L3.29 1.79 2 3.05zM9 17l3 3 3-3a4.237 4.237 0 00-6 0z">'),hY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.3951 19.3711L9.97955 20.6856C10.1533 21.0768 10.4368 21.4093 10.7958 21.6426C11.1547 21.8759 11.5737 22.0001 12.0018 22C12.4299 22.0001 12.8488 21.8759 13.2078 21.6426C13.5667 21.4093 13.8503 21.0768 14.024 20.6856L14.6084 19.3711C14.8165 18.9047 15.1664 18.5159 15.6084 18.26C16.0532 18.0034 16.5678 17.8941 17.0784 17.9478L18.5084 18.1C18.9341 18.145 19.3637 18.0656 19.7451 17.8713C20.1265 17.6771 20.4434 17.3763 20.6573 17.0056C20.8715 16.635 20.9735 16.2103 20.9511 15.7829C20.9286 15.3555 20.7825 14.9438 20.5307 14.5978L19.684 13.4344C19.3825 13.0171 19.2214 12.5148 19.224 12C19.2239 11.4866 19.3865 10.9864 19.6884 10.5711L20.5351 9.40778C20.787 9.06175 20.933 8.65007 20.9555 8.22267C20.978 7.79528 20.8759 7.37054 20.6618 7C20.4479 6.62923 20.131 6.32849 19.7496 6.13423C19.3681 5.93997 18.9386 5.86053 18.5129 5.90556L17.0829 6.05778C16.5722 6.11141 16.0577 6.00212 15.6129 5.74556C15.17 5.48825 14.82 5.09736 14.6129 4.62889L14.024 3.31444C13.8503 2.92317 13.5667 2.59072 13.2078 2.3574C12.8488 2.12408 12.4299 1.99993 12.0018 2C11.5737 1.99993 11.1547 2.12408 10.7958 2.3574C10.4368 2.59072 10.1533 2.92317 9.97955 3.31444L9.3951 4.62889C9.18803 5.09736 8.83798 5.48825 8.3951 5.74556C7.95032 6.00212 7.43577 6.11141 6.9251 6.05778L5.49066 5.90556C5.06499 5.86053 4.6354 5.93997 4.25397 6.13423C3.87255 6.32849 3.55567 6.62923 3.34177 7C3.12759 7.37054 3.02555 7.79528 3.04804 8.22267C3.07052 8.65007 3.21656 9.06175 3.46844 9.40778L4.3151 10.5711C4.61704 10.9864 4.77964 11.4866 4.77955 12C4.77964 12.5134 4.61704 13.0137 4.3151 13.4289L3.46844 14.5922C3.21656 14.9382 3.07052 15.3499 3.04804 15.7773C3.02555 16.2047 3.12759 16.6295 3.34177 17C3.55589 17.3706 3.8728 17.6712 4.25417 17.8654C4.63554 18.0596 5.06502 18.1392 5.49066 18.0944L6.92066 17.9422C7.43133 17.8886 7.94587 17.9979 8.39066 18.2544C8.83519 18.511 9.18687 18.902 9.3951 19.3711Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><path d="M12 15C13.6568 15 15 13.6569 15 12C15 10.3431 13.6568 9 12 9C10.3431 9 8.99998 10.3431 8.99998 12C8.99998 13.6569 10.3431 15 12 15Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),mY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M16 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V8M11.5 12.5L17 7M17 7H12M17 7V12M6.2 21H8.8C9.9201 21 10.4802 21 10.908 20.782C11.2843 20.5903 11.5903 20.2843 11.782 19.908C12 19.4802 12 18.9201 12 17.8V15.2C12 14.0799 12 13.5198 11.782 13.092C11.5903 12.7157 11.2843 12.4097 10.908 12.218C10.4802 12 9.92011 12 8.8 12H6.2C5.0799 12 4.51984 12 4.09202 12.218C3.71569 12.4097 3.40973 12.7157 3.21799 13.092C3 13.5198 3 14.0799 3 15.2V17.8C3 18.9201 3 19.4802 3.21799 19.908C3.40973 20.2843 3.71569 20.5903 4.09202 20.782C4.51984 21 5.07989 21 6.2 21Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),gY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path class=copier d="M8 8V5.2C8 4.0799 8 3.51984 8.21799 3.09202C8.40973 2.71569 8.71569 2.40973 9.09202 2.21799C9.51984 2 10.0799 2 11.2 2H18.8C19.9201 2 20.4802 2 20.908 2.21799C21.2843 2.40973 21.5903 2.71569 21.782 3.09202C22 3.51984 22 4.0799 22 5.2V12.8C22 13.9201 22 14.4802 21.782 14.908C21.5903 15.2843 21.2843 15.5903 20.908 15.782C20.4802 16 19.9201 16 18.8 16H16M5.2 22H12.8C13.9201 22 14.4802 22 14.908 21.782C15.2843 21.5903 15.5903 21.2843 15.782 20.908C16 20.4802 16 19.9201 16 18.8V11.2C16 10.0799 16 9.51984 15.782 9.09202C15.5903 8.71569 15.2843 8.40973 14.908 8.21799C14.4802 8 13.9201 8 12.8 8H5.2C4.0799 8 3.51984 8 3.09202 8.21799C2.71569 8.40973 2.40973 8.71569 2.21799 9.09202C2 9.51984 2 10.0799 2 11.2V18.8C2 19.9201 2 20.4802 2.21799 20.908C2.40973 21.2843 2.71569 21.5903 3.09202 21.782C3.51984 22 4.07989 22 5.2 22Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round stroke=currentColor>'),yY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M2.5 21.4998L8.04927 19.3655C8.40421 19.229 8.58168 19.1607 8.74772 19.0716C8.8952 18.9924 9.0358 18.901 9.16804 18.7984C9.31692 18.6829 9.45137 18.5484 9.72028 18.2795L21 6.99982C22.1046 5.89525 22.1046 4.10438 21 2.99981C19.8955 1.89525 18.1046 1.89524 17 2.99981L5.72028 14.2795C5.45138 14.5484 5.31692 14.6829 5.20139 14.8318C5.09877 14.964 5.0074 15.1046 4.92823 15.2521C4.83911 15.4181 4.77085 15.5956 4.63433 15.9506L2.5 21.4998ZM2.5 21.4998L4.55812 16.1488C4.7054 15.7659 4.77903 15.5744 4.90534 15.4867C5.01572 15.4101 5.1523 15.3811 5.2843 15.4063C5.43533 15.4351 5.58038 15.5802 5.87048 15.8703L8.12957 18.1294C8.41967 18.4195 8.56472 18.5645 8.59356 18.7155C8.61877 18.8475 8.58979 18.9841 8.51314 19.0945C8.42545 19.2208 8.23399 19.2944 7.85107 19.4417L2.5 21.4998Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),vY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),bY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9 9L15 15M15 9L9 15M7.8 21H16.2C17.8802 21 18.7202 21 19.362 20.673C19.9265 20.3854 20.3854 19.9265 20.673 19.362C21 18.7202 21 17.8802 21 16.2V7.8C21 6.11984 21 5.27976 20.673 4.63803C20.3854 4.07354 19.9265 3.6146 19.362 3.32698C18.7202 3 17.8802 3 16.2 3H7.8C6.11984 3 5.27976 3 4.63803 3.32698C4.07354 3.6146 3.6146 4.07354 3.32698 4.63803C3 5.27976 3 6.11984 3 7.8V16.2C3 17.8802 3 18.7202 3.32698 19.362C3.6146 19.9265 4.07354 20.3854 4.63803 20.673C5.27976 21 6.11984 21 7.8 21Z"stroke=#F04438 stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),xY=on('<svg width=24 height=24 viewBox="0 0 24 24"fill=none stroke=currentColor stroke-width=2 xmlns=http://www.w3.org/2000/svg><rect class=list width=20 height=20 y=2 x=2 rx=2></rect><line class=list-item y1=7 y2=7 x1=6 x2=18></line><line class=list-item y2=12 y1=12 x1=6 x2=18></line><line class=list-item y1=17 y2=17 x1=6 x2=18>'),wY=on('<svg viewBox="0 0 24 24"height=20 width=20 fill=none xmlns=http://www.w3.org/2000/svg><path d="M3 7.8c0-1.68 0-2.52.327-3.162a3 3 0 0 1 1.311-1.311C5.28 3 6.12 3 7.8 3h8.4c1.68 0 2.52 0 3.162.327a3 3 0 0 1 1.311 1.311C21 5.28 21 6.12 21 7.8v8.4c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C18.72 21 17.88 21 16.2 21H7.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C3 18.72 3 17.88 3 16.2V7.8Z"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),SY=on('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M7.5 12L10.5 15L16.5 9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),CY=on('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M12 2V6M12 18V22M6 12H2M22 12H18M19.0784 19.0784L16.25 16.25M19.0784 4.99994L16.25 7.82837M4.92157 19.0784L7.75 16.25M4.92157 4.99994L7.75 7.82837"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round></path><animateTransform attributeName=transform attributeType=XML type=rotate from=0 to=360 dur=2s repeatCount=indefinite>'),kY=on('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M15 9L9 15M9 9L15 15M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),EY=on('<svg width=14 height=14 viewBox="0 0 24 24"fill=none xmlns=http://www.w3.org/2000/svg><path d="M9.5 15V9M14.5 15V9M22 12C22 17.5228 17.5228 22 12 22C6.47715 22 2 17.5228 2 12C2 6.47715 6.47715 2 12 2C17.5228 2 22 6.47715 22 12Z"stroke=currentColor stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),_Y=on('<svg version=1.0 viewBox="0 0 633 633"><linearGradient x1=-666.45 x2=-666.45 y1=163.28 y2=163.99 gradientTransform="matrix(633 0 0 633 422177 -103358)"gradientUnits=userSpaceOnUse><stop stop-color=#6BDAFF offset=0></stop><stop stop-color=#F9FFB5 offset=.32></stop><stop stop-color=#FFA770 offset=.71></stop><stop stop-color=#FF7373 offset=1></stop></linearGradient><circle cx=316.5 cy=316.5 r=316.5></circle><defs><filter x=-137.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=316.5 y=412 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=412 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=610.5 rx=214.5 ry=186 fill=#015064 stroke=#00CFE2 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=316.5 y=450 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=450 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=648.5 rx=214.5 ry=186 fill=#015064 stroke=#00A8B8 stroke-width=25></ellipse></g><defs><filter x=-137.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=-137.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=89.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=316.5 y=486 width=454 height=396.9 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=316.5 y=486 width=454 height=396.9 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><ellipse cx=543.5 cy=684.5 rx=214.5 ry=186 fill=#015064 stroke=#007782 stroke-width=25></ellipse></g><defs><filter x=272.2 y=308 width=176.9 height=129.3 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=272.2 y=308 width=176.9 height=129.3 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><line x1=436 x2=431 y1=403.2 y2=431.8 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=291 x2=280 y1=341.5 y2=403.5 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><line x1=332.9 x2=328.6 y1=384.1 y2=411.2 fill=none stroke=#000 stroke-linecap=round stroke-linejoin=bevel stroke-width=11></line><linearGradient x1=-670.75 x2=-671.59 y1=164.4 y2=164.49 gradientTransform="matrix(-184.16 -32.472 -11.461 64.997 -121359 -32126)"gradientUnits=userSpaceOnUse><stop stop-color=#EE2700 offset=0></stop><stop stop-color=#FF008E offset=1></stop></linearGradient><path d="m344.1 363 97.7 17.2c5.8 2.1 8.2 6.1 7.1 12.1s-4.7 9.2-11 9.9l-106-18.7-57.5-59.2c-3.2-4.8-2.9-9.1 0.8-12.8s8.3-4.4 13.7-2.1l55.2 53.6z"clip-rule=evenodd fill-rule=evenodd></path><line x1=428.2 x2=429.1 y1=384.5 y2=378 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=395.2 x2=396.1 y1=379.5 y2=373 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=362.2 x2=363.1 y1=373.5 y2=367.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=324.2 x2=328.4 y1=351.3 y2=347.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line><line x1=303.2 x2=307.4 y1=331.3 y2=327.4 fill=none stroke=#fff stroke-linecap=round stroke-linejoin=bevel stroke-width=7></line></g><defs><filter x=73.2 y=113.8 width=280.6 height=317.4 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=73.2 y=113.8 width=280.6 height=317.4 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-672.16 x2=-672.16 y1=165.03 y2=166.03 gradientTransform="matrix(-100.18 48.861 97.976 200.88 -83342 -93.059)"gradientUnits=userSpaceOnUse><stop stop-color=#A17500 offset=0></stop><stop stop-color=#5D2100 offset=1></stop></linearGradient><path d="m192.3 203c8.1 37.3 14 73.6 17.8 109.1 3.8 35.4 2.8 75.1-3 119.2l61.2-16.7c-15.6-59-25.2-97.9-28.6-116.6s-10.8-51.9-22.1-99.6l-25.3 4.6"clip-rule=evenodd fill-rule=evenodd></path><g stroke=#2F8A00><linearGradient x1=-660.23 x2=-660.23 y1=166.72 y2=167.72 gradientTransform="matrix(92.683 4.8573 -2.0259 38.657 61680 -3088.6)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9s-12.6-22.1-36.5-29.9c-15.9-5.2-34.4-1.5-55.5 11.1 15.9 14.3 29.5 22.6 40.7 24.9 16.8 3.6 51.3-6.1 51.3-6.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-661.36 x2=-661.36 y1=164.18 y2=165.18 gradientTransform="matrix(110 5.7648 -6.3599 121.35 73933 -15933)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5s-47.5-8.5-83.2 15.7c-23.8 16.2-34.3 49.3-31.6 99.4 30.3-27.8 52.1-48.5 65.2-61.9 19.8-20.2 49.6-53.2 49.6-53.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.79 x2=-656.79 y1=165.15 y2=166.15 gradientTransform="matrix(62.954 3.2993 -3.5023 66.828 42156 -8754.1)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m195 183.9c-0.8-21.9 6-38 20.6-48.2s29.8-15.4 45.5-15.3c-6.1 21.4-14.5 35.8-25.2 43.4s-24.4 14.2-40.9 20.1z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-663.07 x2=-663.07 y1=165.44 y2=166.44 gradientTransform="matrix(152.47 7.9907 -3.0936 59.029 101884 -4318.7)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c31.9-30 64.1-39.7 96.7-29s50.8 30.4 54.6 59.1c-35.2-5.5-60.4-9.6-75.8-12.1-15.3-2.6-40.5-8.6-75.5-18z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-662.57 x2=-662.57 y1=164.44 y2=165.44 gradientTransform="matrix(136.46 7.1517 -5.2163 99.533 91536 -11442)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c35.8-7.6 65.6-0.2 89.2 22s37.7 49 42.3 80.3c-39.8-9.7-68.3-23.8-85.5-42.4s-32.5-38.5-46-59.9z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><linearGradient x1=-656.43 x2=-656.43 y1=163.86 y2=164.86 gradientTransform="matrix(60.866 3.1899 -8.7773 167.48 41560 -25168)"gradientUnits=userSpaceOnUse><stop stop-color=#2F8A00 offset=0></stop><stop stop-color=#90FF57 offset=1></stop></linearGradient><path d="m194.9 184.5c-33.6 13.8-53.6 35.7-60.1 65.6s-3.6 63.1 8.7 99.6c27.4-40.3 43.2-69.6 47.4-88s5.6-44.1 4-77.2z"clip-rule=evenodd fill-rule=evenodd stroke-width=13></path><path d="m196.5 182.3c-14.8 21.6-25.1 41.4-30.8 59.4s-9.5 33-11.1 45.1"fill=none stroke-linecap=round stroke-width=8></path><path d="m194.9 185.7c-24.4 1.7-43.8 9-58.1 21.8s-24.7 25.4-31.3 37.8"fill=none stroke-linecap=round stroke-width=8></path><path d="m204.5 176.4c29.7-6.7 52-8.4 67-5.1s26.9 8.6 35.8 15.9"fill=none stroke-linecap=round stroke-width=8></path><path d="m196.5 181.4c20.3 9.9 38.2 20.5 53.9 31.9s27.4 22.1 35.1 32"fill=none stroke-linecap=round stroke-width=8></path></g></g><defs><filter x=50.5 y=399 width=532 height=633 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=50.5 y=399 width=532 height=633 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-666.06 x2=-666.23 y1=163.36 y2=163.75 gradientTransform="matrix(532 0 0 633 354760 -102959)"gradientUnits=userSpaceOnUse><stop stop-color=#FFF400 offset=0></stop><stop stop-color=#3C8700 offset=1></stop></linearGradient><ellipse cx=316.5 cy=715.5 rx=266 ry=316.5></ellipse></g><defs><filter x=391 y=-24 width=288 height=283 filterUnits=userSpaceOnUse><feColorMatrix values="1 0 0 0 0 0 1 0 0 0 0 0 1 0 0 0 0 0 1 0"></feColorMatrix></filter></defs><mask x=391 y=-24 width=288 height=283 maskUnits=userSpaceOnUse><g><circle cx=316.5 cy=316.5 r=316.5 fill=#fff></circle></g></mask><g><linearGradient x1=-664.56 x2=-664.56 y1=163.79 y2=164.79 gradientTransform="matrix(227 0 0 227 151421 -37204)"gradientUnits=userSpaceOnUse><stop stop-color=#FFDF00 offset=0></stop><stop stop-color=#FF9D00 offset=1></stop></linearGradient><circle cx=565.5 cy=89.5 r=113.5></circle><linearGradient x1=-644.5 x2=-645.77 y1=342 y2=342 gradientTransform="matrix(30 0 0 1 19770 -253)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=427 x2=397 y1=89 y2=89 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-641.56 x2=-642.83 y1=196.02 y2=196.07 gradientTransform="matrix(26.5 0 0 5.5 17439 -1025.5)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=430.5 x2=404 y1=55.5 y2=50 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-643.73 x2=-645 y1=185.83 y2=185.9 gradientTransform="matrix(29 0 0 8 19107 -1361)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=431 x2=402 y1=122 y2=130 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-638.94 x2=-640.22 y1=177.09 y2=177.39 gradientTransform="matrix(24 0 0 13 15783 -2145)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=442 x2=418 y1=153 y2=166 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-633.42 x2=-634.7 y1=172.41 y2=173.31 gradientTransform="matrix(20 0 0 19 13137 -3096)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=464 x2=444 y1=180 y2=199 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-619.05 x2=-619.52 y1=170.82 y2=171.82 gradientTransform="matrix(13.83 0 0 22.85 9050 -3703.4)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=491.4 x2=477.5 y1=203 y2=225.9 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=-578.5 x2=-578.63 y1=170.31 y2=171.31 gradientTransform="matrix(7.5 0 0 24.5 4860 -3953)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=524.5 x2=517 y1=219.5 y2=244 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12></line><linearGradient x1=666.5 x2=666.5 y1=170.31 y2=171.31 gradientTransform="matrix(.5 0 0 24.5 231.5 -3944)"gradientUnits=userSpaceOnUse><stop stop-color=#FFA400 offset=0></stop><stop stop-color=#FF5E00 offset=1></stop></linearGradient><line x1=564.5 x2=565 y1=228.5 y2=253 fill=none stroke-linecap=round stroke-linejoin=bevel stroke-width=12>');function jY(){return oY()}function TY(){return iY()}function NY(){return sY()}function PY(){return aY()}function DY(){return lY()}function MY(){return(e=lY()).style.setProperty("transform","rotate(90deg)"),e;var e}function AY(){return(e=lY()).style.setProperty("transform","rotate(-90deg)"),e;var e}function OY(){return cY()}function RY(){return uY()}function LY(){return dY()}function IY(){return pY()}function FY(){return fY()}function $Y(){return hY()}function qY(){return mY()}function UY(){return gY()}function zY(){return yY()}function BY(e){return t=vY(),n=t.firstChild,tt((()=>an(n,"stroke","dark"===e.theme?"#12B76A":"#027A48"))),t;var t,n}function VY(){return bY()}function KY(){return xY()}function HY(e){return[At(Ht,{get when(){return e.checked},get children(){var t=vY(),n=t.firstChild;return tt((()=>an(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}}),At(Ht,{get when(){return!e.checked},get children(){var t=wY(),n=t.firstChild;return tt((()=>an(n,"stroke","dark"===e.theme?"#9B8AFB":"#6938EF"))),t}})]}function WY(){return SY()}function GY(){return CY()}function YY(){return kY()}function QY(){return EY()}function XY(){const e=zt();return t=_Y(),i=(o=(r=(n=t.firstChild).nextSibling).nextSibling).firstChild,a=(s=o.nextSibling).firstChild,u=(c=(l=s.nextSibling).nextSibling).firstChild,p=(d=c.nextSibling).firstChild,m=(h=(f=d.nextSibling).nextSibling).firstChild,y=(g=h.nextSibling).firstChild,x=(b=(v=g.nextSibling).nextSibling).firstChild,S=(w=b.nextSibling).firstChild,E=(k=(C=w.nextSibling).nextSibling).firstChild,j=(_=k.nextSibling).firstChild,P=(N=(T=_.nextSibling).nextSibling).firstChild,M=(D=N.nextSibling).firstChild,R=(O=(A=D.nextSibling).nextSibling).firstChild,I=(L=O.nextSibling).firstChild,q=($=(F=L.nextSibling).firstChild.nextSibling.nextSibling.nextSibling).nextSibling,z=(U=F.nextSibling).firstChild,V=(B=U.nextSibling).firstChild,ie=(oe=(re=(ne=(te=(ee=(Z=(J=(X=(Q=(Y=(G=(W=(H=(K=B.nextSibling).firstChild).nextSibling).nextSibling.firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,ae=(se=K.nextSibling).firstChild,ce=(le=se.nextSibling).firstChild,pe=(de=(ue=le.nextSibling).firstChild).nextSibling,he=(fe=ue.nextSibling).firstChild,ge=(me=fe.nextSibling).firstChild,Re=(Oe=(Ae=(Me=(De=(Pe=(Ne=(Te=(je=(_e=(Ee=(ke=(Ce=(Se=(we=(xe=(be=(ve=(ye=me.nextSibling).firstChild).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling).nextSibling,an(n,"id",`a-${e}`),an(r,"fill",`url(#a-${e})`),an(i,"id",`am-${e}`),an(s,"id",`b-${e}`),an(a,"filter",`url(#am-${e})`),an(l,"mask",`url(#b-${e})`),an(u,"id",`ah-${e}`),an(d,"id",`k-${e}`),an(p,"filter",`url(#ah-${e})`),an(f,"mask",`url(#k-${e})`),an(m,"id",`ae-${e}`),an(g,"id",`j-${e}`),an(y,"filter",`url(#ae-${e})`),an(v,"mask",`url(#j-${e})`),an(x,"id",`ai-${e}`),an(w,"id",`i-${e}`),an(S,"filter",`url(#ai-${e})`),an(C,"mask",`url(#i-${e})`),an(E,"id",`aj-${e}`),an(_,"id",`h-${e}`),an(j,"filter",`url(#aj-${e})`),an(T,"mask",`url(#h-${e})`),an(P,"id",`ag-${e}`),an(D,"id",`g-${e}`),an(M,"filter",`url(#ag-${e})`),an(A,"mask",`url(#g-${e})`),an(R,"id",`af-${e}`),an(L,"id",`f-${e}`),an(I,"filter",`url(#af-${e})`),an(F,"mask",`url(#f-${e})`),an($,"id",`m-${e}`),an(q,"fill",`url(#m-${e})`),an(z,"id",`ak-${e}`),an(B,"id",`e-${e}`),an(V,"filter",`url(#ak-${e})`),an(K,"mask",`url(#e-${e})`),an(H,"id",`n-${e}`),an(W,"fill",`url(#n-${e})`),an(G,"id",`r-${e}`),an(Y,"fill",`url(#r-${e})`),an(Q,"id",`s-${e}`),an(X,"fill",`url(#s-${e})`),an(J,"id",`q-${e}`),an(Z,"fill",`url(#q-${e})`),an(ee,"id",`p-${e}`),an(te,"fill",`url(#p-${e})`),an(ne,"id",`o-${e}`),an(re,"fill",`url(#o-${e})`),an(oe,"id",`l-${e}`),an(ie,"fill",`url(#l-${e})`),an(ae,"id",`al-${e}`),an(le,"id",`d-${e}`),an(ce,"filter",`url(#al-${e})`),an(ue,"mask",`url(#d-${e})`),an(de,"id",`u-${e}`),an(pe,"fill",`url(#u-${e})`),an(he,"id",`ad-${e}`),an(me,"id",`c-${e}`),an(ge,"filter",`url(#ad-${e})`),an(ye,"mask",`url(#c-${e})`),an(ve,"id",`t-${e}`),an(be,"fill",`url(#t-${e})`),an(xe,"id",`v-${e}`),an(we,"stroke",`url(#v-${e})`),an(Se,"id",`aa-${e}`),an(Ce,"stroke",`url(#aa-${e})`),an(ke,"id",`w-${e}`),an(Ee,"stroke",`url(#w-${e})`),an(_e,"id",`ac-${e}`),an(je,"stroke",`url(#ac-${e})`),an(Te,"id",`ab-${e}`),an(Ne,"stroke",`url(#ab-${e})`),an(Pe,"id",`y-${e}`),an(De,"stroke",`url(#y-${e})`),an(Me,"id",`x-${e}`),an(Ae,"stroke",`url(#x-${e})`),an(Oe,"id",`z-${e}`),an(Re,"stroke",`url(#z-${e})`),t;var t,n,r,o,i,s,a,l,c,u,d,p,f,h,m,g,y,v,b,x,w,S,C,k,E,_,j,T,N,P,D,M,A,O,R,L,I,F,$,q,U,z,B,V,K,H,W,G,Y,Q,X,J,Z,ee,te,ne,re,oe,ie,se,ae,le,ce,ue,de,pe,fe,he,me,ge,ye,ve,be,xe,we,Se,Ce,ke,Ee,_e,je,Te,Ne,Pe,De,Me,Ae,Oe,Re}var JY=on('<span><svg width=16 height=16 viewBox="0 0 16 16"fill=none xmlns=http://www.w3.org/2000/svg><path d="M6 12L10 8L6 4"stroke-width=2 stroke-linecap=round stroke-linejoin=round>'),ZY=on('<button title="Copy object to clipboard">'),eQ=on('<button title="Remove all items"aria-label="Remove all items">'),tQ=on('<button title="Delete item"aria-label="Delete item">'),nQ=on('<button title="Toggle value"aria-label="Toggle value">'),rQ=on('<button title="Bulk Edit Data"aria-label="Bulk Edit Data">'),oQ=on("<div>"),iQ=on("<div><button> <span></span> <span> "),sQ=on("<input>"),aQ=on("<span>"),lQ=on("<div><span>:"),cQ=on("<div><div><button> [<!>...<!>]");var uQ=e=>{const t=DB(),n=_B().shadowDOMTarget?nV.bind({target:_B().shadowDOMTarget}):nV,r=rt((()=>"dark"===t()?bQ(n):vQ(n)));return o=JY(),tt((()=>ln(o,oV(r().expander,n`
|
|
53
53
|
transform: rotate(${e.expanded?90:0}deg);
|
|
54
54
|
`,e.expanded&&n`
|
|
55
55
|
& svg {
|