randmarcomps 1.485.0 → 1.487.0
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/randmarcomps.js +293 -298
- package/dist/randmarcomps.umd.cjs +8 -8
- package/package.json +1 -1
|
@@ -512,11 +512,11 @@
|
|
|
512
512
|
`)},getCurrentUseCounter=function(){var e=parseInt(document.body.getAttribute(lockAttribute)||"0",10);return isFinite(e)?e:0},useLockAttribute=function(){React__namespace.useEffect(function(){return document.body.setAttribute(lockAttribute,(getCurrentUseCounter()+1).toString()),function(){var e=getCurrentUseCounter()-1;e<=0?document.body.removeAttribute(lockAttribute):document.body.setAttribute(lockAttribute,e.toString())}},[])},RemoveScrollBar=function(e){var t=e.noRelative,n=e.noImportant,o=e.gapMode,l=o===void 0?"margin":o;useLockAttribute();var d=React__namespace.useMemo(function(){return getGapWidth(l)},[l]);return React__namespace.createElement(Style,{styles:getStyles(d,!t,l,n?"":"!important")})},passiveSupported$1=!1;if(typeof window<"u")try{var options=Object.defineProperty({},"passive",{get:function(){return passiveSupported$1=!0,!0}});window.addEventListener("test",options,options),window.removeEventListener("test",options,options)}catch{passiveSupported$1=!1}var nonPassive=passiveSupported$1?{passive:!1}:!1,alwaysContainsScroll=function(e){return e.tagName==="TEXTAREA"},elementCanBeScrolled=function(e,t){if(!(e instanceof Element))return!1;var n=window.getComputedStyle(e);return n[t]!=="hidden"&&!(n.overflowY===n.overflowX&&!alwaysContainsScroll(e)&&n[t]==="visible")},elementCouldBeVScrolled=function(e){return elementCanBeScrolled(e,"overflowY")},elementCouldBeHScrolled=function(e){return elementCanBeScrolled(e,"overflowX")},locationCouldBeScrolled=function(e,t){var n=t.ownerDocument,o=t;do{typeof ShadowRoot<"u"&&o instanceof ShadowRoot&&(o=o.host);var l=elementCouldBeScrolled(e,o);if(l){var d=getScrollVariables(e,o),f=d[1],g=d[2];if(f>g)return!0}o=o.parentNode}while(o&&o!==n.body);return!1},getVScrollVariables=function(e){var t=e.scrollTop,n=e.scrollHeight,o=e.clientHeight;return[t,n,o]},getHScrollVariables=function(e){var t=e.scrollLeft,n=e.scrollWidth,o=e.clientWidth;return[t,n,o]},elementCouldBeScrolled=function(e,t){return e==="v"?elementCouldBeVScrolled(t):elementCouldBeHScrolled(t)},getScrollVariables=function(e,t){return e==="v"?getVScrollVariables(t):getHScrollVariables(t)},getDirectionFactor=function(e,t){return e==="h"&&t==="rtl"?-1:1},handleScroll=function(e,t,n,o,l){var d=getDirectionFactor(e,window.getComputedStyle(t).direction),f=d*o,g=n.target,b=t.contains(g),_=!1,S=f>0,R=0,C=0;do{if(!g)break;var E=getScrollVariables(e,g),A=E[0],M=E[1],I=E[2],j=M-I-d*A;(A||j)&&elementCouldBeScrolled(e,g)&&(R+=j,C+=A);var q=g.parentNode;g=q&&q.nodeType===Node.DOCUMENT_FRAGMENT_NODE?q.host:q}while(!b&&g!==document.body||b&&(t.contains(g)||t===g));return(S&&Math.abs(R)<1||!S&&Math.abs(C)<1)&&(_=!0),_},getTouchXY=function(e){return"changedTouches"in e?[e.changedTouches[0].clientX,e.changedTouches[0].clientY]:[0,0]},getDeltaXY=function(e){return[e.deltaX,e.deltaY]},extractRef=function(e){return e&&"current"in e?e.current:e},deltaCompare=function(e,t){return e[0]===t[0]&&e[1]===t[1]},generateStyle=function(e){return`
|
|
513
513
|
.block-interactivity-`.concat(e,` {pointer-events: none;}
|
|
514
514
|
.allow-interactivity-`).concat(e,` {pointer-events: all;}
|
|
515
|
-
`)},idCounter$1=0,lockStack=[];function RemoveScrollSideCar(e){var t=React__namespace.useRef([]),n=React__namespace.useRef([0,0]),o=React__namespace.useRef(),l=React__namespace.useState(idCounter$1++)[0],d=React__namespace.useState(styleSingleton)[0],f=React__namespace.useRef(e);React__namespace.useEffect(function(){f.current=e},[e]),React__namespace.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var M=__spreadArray([e.lockRef.current],(e.shards||[]).map(extractRef),!0).filter(Boolean);return M.forEach(function(I){return I.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),M.forEach(function(I){return I.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var g=React__namespace.useCallback(function(M,I){if("touches"in M&&M.touches.length===2||M.type==="wheel"&&M.ctrlKey)return!f.current.allowPinchZoom;var j=getTouchXY(M),q=n.current,Q="deltaX"in M?M.deltaX:q[0]-j[0],te="deltaY"in M?M.deltaY:q[1]-j[1],F,V=M.target,ne=Math.abs(Q)>Math.abs(te)?"h":"v";if("touches"in M&&ne==="h"&&V.type==="range")return!1;var ae=locationCouldBeScrolled(ne,V);if(!ae)return!0;if(ae?F=ne:(F=ne==="v"?"h":"v",ae=locationCouldBeScrolled(ne,V)),!ae)return!1;if(!o.current&&"changedTouches"in M&&(Q||te)&&(o.current=F),!F)return!0;var se=o.current||F;return handleScroll(se,I,M,se==="h"?Q:te)},[]),b=React__namespace.useCallback(function(M){var I=M;if(!(!lockStack.length||lockStack[lockStack.length-1]!==d)){var j="deltaY"in I?getDeltaXY(I):getTouchXY(I),q=t.current.filter(function(F){return F.name===I.type&&(F.target===I.target||I.target===F.shadowParent)&&deltaCompare(F.delta,j)})[0];if(q&&q.should){I.cancelable&&I.preventDefault();return}if(!q){var Q=(f.current.shards||[]).map(extractRef).filter(Boolean).filter(function(F){return F.contains(I.target)}),te=Q.length>0?g(I,Q[0]):!f.current.noIsolation;te&&I.cancelable&&I.preventDefault()}}},[]),_=React__namespace.useCallback(function(M,I,j,q){var Q={name:M,delta:I,target:j,should:q,shadowParent:getOutermostShadowParent(j)};t.current.push(Q),setTimeout(function(){t.current=t.current.filter(function(te){return te!==Q})},1)},[]),S=React__namespace.useCallback(function(M){n.current=getTouchXY(M),o.current=void 0},[]),R=React__namespace.useCallback(function(M){_(M.type,getDeltaXY(M),M.target,g(M,e.lockRef.current))},[]),C=React__namespace.useCallback(function(M){_(M.type,getTouchXY(M),M.target,g(M,e.lockRef.current))},[]);React__namespace.useEffect(function(){return lockStack.push(d),e.setCallbacks({onScrollCapture:R,onWheelCapture:R,onTouchMoveCapture:C}),document.addEventListener("wheel",b,nonPassive),document.addEventListener("touchmove",b,nonPassive),document.addEventListener("touchstart",S,nonPassive),function(){lockStack=lockStack.filter(function(M){return M!==d}),document.removeEventListener("wheel",b,nonPassive),document.removeEventListener("touchmove",b,nonPassive),document.removeEventListener("touchstart",S,nonPassive)}},[]);var E=e.removeScrollBar,A=e.inert;return React__namespace.createElement(React__namespace.Fragment,null,A?React__namespace.createElement(d,{styles:generateStyle(l)}):null,E?React__namespace.createElement(RemoveScrollBar,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function getOutermostShadowParent(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=React__namespace.forwardRef(function(e,t){return React__namespace.createElement(RemoveScroll,__assign$1({},e,{ref:t,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;var getDefaultParent=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(e){return e&&(e.host||unwrapHost(e.parentNode))},correctTargets=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=unwrapHost(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},applyAttributeToOthers=function(e,t,n,o){var l=correctTargets(t,Array.isArray(e)?e:[e]);markerMap[n]||(markerMap[n]=new WeakMap);var d=markerMap[n],f=[],g=new Set,b=new Set(l),_=function(R){!R||g.has(R)||(g.add(R),_(R.parentNode))};l.forEach(_);var S=function(R){!R||b.has(R)||Array.prototype.forEach.call(R.children,function(C){if(g.has(C))S(C);else try{var E=C.getAttribute(o),A=E!==null&&E!=="false",M=(counterMap.get(C)||0)+1,I=(d.get(C)||0)+1;counterMap.set(C,M),d.set(C,I),f.push(C),M===1&&A&&uncontrolledNodes.set(C,!0),I===1&&C.setAttribute(n,"true"),A||C.setAttribute(o,"true")}catch(j){console.error("aria-hidden: cannot operate on ",C,j)}})};return S(t),g.clear(),lockCount++,function(){f.forEach(function(R){var C=counterMap.get(R)-1,E=d.get(R)-1;counterMap.set(R,C),d.set(R,E),C||(uncontrolledNodes.has(R)||R.removeAttribute(o),uncontrolledNodes.delete(R)),E||R.removeAttribute(n)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),l=getDefaultParent(e);return l?(o.push.apply(o,Array.from(l.querySelectorAll("[aria-live], script"))),applyAttributeToOthers(o,l,n,"aria-hidden")):function(){return null}};function createSlot$4(e){const t=createSlotClone$4(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable$4);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}function createSlotClone$4(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$4(l),g=mergeProps$4(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$6=Symbol("radix.slottable");function isSlottable$4(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$6}function mergeProps$4(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$4(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var DIALOG_NAME="Dialog",[createDialogContext,createDialogScope]=createContextScope$2(DIALOG_NAME),[DialogProvider,useDialogContext]=createDialogContext(DIALOG_NAME),Dialog$1=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:l,onOpenChange:d,modal:f=!0}=e,g=React__namespace.useRef(null),b=React__namespace.useRef(null),[_,S]=useControllableState({prop:o,defaultProp:l??!1,onChange:d,caller:DIALOG_NAME});return jsxRuntime.jsx(DialogProvider,{scope:t,triggerRef:g,contentRef:b,contentId:useId(),titleId:useId(),descriptionId:useId(),open:_,onOpenChange:S,onOpenToggle:React__namespace.useCallback(()=>S(R=>!R),[S]),modal:f,children:n})};Dialog$1.displayName=DIALOG_NAME;var TRIGGER_NAME$9="DialogTrigger",DialogTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(TRIGGER_NAME$9,n),d=useComposedRefs(t,l.triggerRef);return jsxRuntime.jsx(Primitive$4.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":getState$5(l.open),...o,ref:d,onClick:composeEventHandlers(e.onClick,l.onOpenToggle)})});DialogTrigger$1.displayName=TRIGGER_NAME$9;var PORTAL_NAME$6="DialogPortal",[PortalProvider$3,usePortalContext$3]=createDialogContext(PORTAL_NAME$6,{forceMount:void 0}),DialogPortal$1=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:l}=e,d=useDialogContext(PORTAL_NAME$6,t);return jsxRuntime.jsx(PortalProvider$3,{scope:t,forceMount:n,children:React__namespace.Children.map(o,f=>jsxRuntime.jsx(Presence,{present:n||d.open,children:jsxRuntime.jsx(Portal$5,{asChild:!0,container:l,children:f})}))})};DialogPortal$1.displayName=PORTAL_NAME$6;var OVERLAY_NAME$1="DialogOverlay",DialogOverlay$1=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$3(OVERLAY_NAME$1,e.__scopeDialog),{forceMount:o=n.forceMount,...l}=e,d=useDialogContext(OVERLAY_NAME$1,e.__scopeDialog);return d.modal?jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(DialogOverlayImpl,{...l,ref:t})}):null});DialogOverlay$1.displayName=OVERLAY_NAME$1;var Slot$4=createSlot$4("DialogOverlay.RemoveScroll"),DialogOverlayImpl=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(OVERLAY_NAME$1,n);return jsxRuntime.jsx(ReactRemoveScroll,{as:Slot$4,allowPinchZoom:!0,shards:[l.contentRef],children:jsxRuntime.jsx(Primitive$4.div,{"data-state":getState$5(l.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),CONTENT_NAME$a="DialogContent",DialogContent$1=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$3(CONTENT_NAME$a,e.__scopeDialog),{forceMount:o=n.forceMount,...l}=e,d=useDialogContext(CONTENT_NAME$a,e.__scopeDialog);return jsxRuntime.jsx(Presence,{present:o||d.open,children:d.modal?jsxRuntime.jsx(DialogContentModal,{...l,ref:t}):jsxRuntime.jsx(DialogContentNonModal,{...l,ref:t})})});DialogContent$1.displayName=CONTENT_NAME$a;var DialogContentModal=React__namespace.forwardRef((e,t)=>{const n=useDialogContext(CONTENT_NAME$a,e.__scopeDialog),o=React__namespace.useRef(null),l=useComposedRefs(t,n.contentRef,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return hideOthers(d)},[]),jsxRuntime.jsx(DialogContentImpl,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),(f=n.triggerRef.current)==null||f.focus()}),onPointerDownOutside:composeEventHandlers(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,g=f.button===0&&f.ctrlKey===!0;(f.button===2||g)&&d.preventDefault()}),onFocusOutside:composeEventHandlers(e.onFocusOutside,d=>d.preventDefault())})}),DialogContentNonModal=React__namespace.forwardRef((e,t)=>{const n=useDialogContext(CONTENT_NAME$a,e.__scopeDialog),o=React__namespace.useRef(!1),l=React__namespace.useRef(!1);return jsxRuntime.jsx(DialogContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,g;(f=e.onCloseAutoFocus)==null||f.call(e,d),d.defaultPrevented||(o.current||(g=n.triggerRef.current)==null||g.focus(),d.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:d=>{var b,_;(b=e.onInteractOutside)==null||b.call(e,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=d.target;((_=n.triggerRef.current)==null?void 0:_.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.current&&d.preventDefault()}})}),DialogContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:d,...f}=e,g=useDialogContext(CONTENT_NAME$a,n),b=React__namespace.useRef(null),_=useComposedRefs(t,b);return useFocusGuards(),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:d,children:jsxRuntime.jsx(DismissableLayer,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionId,"aria-labelledby":g.titleId,"data-state":getState$5(g.open),...f,ref:_,onDismiss:()=>g.onOpenChange(!1)})}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(TitleWarning,{titleId:g.titleId}),jsxRuntime.jsx(DescriptionWarning$1,{contentRef:b,descriptionId:g.descriptionId})]})]})}),TITLE_NAME$2="DialogTitle",DialogTitle$1=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(TITLE_NAME$2,n);return jsxRuntime.jsx(Primitive$4.h2,{id:l.titleId,...o,ref:t})});DialogTitle$1.displayName=TITLE_NAME$2;var DESCRIPTION_NAME$2="DialogDescription",DialogDescription$1=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(DESCRIPTION_NAME$2,n);return jsxRuntime.jsx(Primitive$4.p,{id:l.descriptionId,...o,ref:t})});DialogDescription$1.displayName=DESCRIPTION_NAME$2;var CLOSE_NAME$2="DialogClose",DialogClose$1=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(CLOSE_NAME$2,n);return jsxRuntime.jsx(Primitive$4.button,{type:"button",...o,ref:t,onClick:composeEventHandlers(e.onClick,()=>l.onOpenChange(!1))})});DialogClose$1.displayName=CLOSE_NAME$2;function getState$5(e){return e?"open":"closed"}var TITLE_WARNING_NAME="DialogTitleWarning",[WarningProvider,useWarningContext]=createContext2(TITLE_WARNING_NAME,{contentName:CONTENT_NAME$a,titleName:TITLE_NAME$2,docsSlug:"dialog"}),TitleWarning=({titleId:e})=>{const t=useWarningContext(TITLE_WARNING_NAME),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
515
|
+
`)},idCounter$1=0,lockStack=[];function RemoveScrollSideCar(e){var t=React__namespace.useRef([]),n=React__namespace.useRef([0,0]),o=React__namespace.useRef(),l=React__namespace.useState(idCounter$1++)[0],d=React__namespace.useState(styleSingleton)[0],f=React__namespace.useRef(e);React__namespace.useEffect(function(){f.current=e},[e]),React__namespace.useEffect(function(){if(e.inert){document.body.classList.add("block-interactivity-".concat(l));var M=__spreadArray([e.lockRef.current],(e.shards||[]).map(extractRef),!0).filter(Boolean);return M.forEach(function(I){return I.classList.add("allow-interactivity-".concat(l))}),function(){document.body.classList.remove("block-interactivity-".concat(l)),M.forEach(function(I){return I.classList.remove("allow-interactivity-".concat(l))})}}},[e.inert,e.lockRef.current,e.shards]);var g=React__namespace.useCallback(function(M,I){if("touches"in M&&M.touches.length===2||M.type==="wheel"&&M.ctrlKey)return!f.current.allowPinchZoom;var j=getTouchXY(M),q=n.current,Q="deltaX"in M?M.deltaX:q[0]-j[0],te="deltaY"in M?M.deltaY:q[1]-j[1],F,V=M.target,ne=Math.abs(Q)>Math.abs(te)?"h":"v";if("touches"in M&&ne==="h"&&V.type==="range")return!1;var ae=window.getSelection(),se=ae&&ae.anchorNode,Oe=se?se===V||se.contains(V):!1;if(Oe)return!1;var Ne=locationCouldBeScrolled(ne,V);if(!Ne)return!0;if(Ne?F=ne:(F=ne==="v"?"h":"v",Ne=locationCouldBeScrolled(ne,V)),!Ne)return!1;if(!o.current&&"changedTouches"in M&&(Q||te)&&(o.current=F),!F)return!0;var oe=o.current||F;return handleScroll(oe,I,M,oe==="h"?Q:te)},[]),b=React__namespace.useCallback(function(M){var I=M;if(!(!lockStack.length||lockStack[lockStack.length-1]!==d)){var j="deltaY"in I?getDeltaXY(I):getTouchXY(I),q=t.current.filter(function(F){return F.name===I.type&&(F.target===I.target||I.target===F.shadowParent)&&deltaCompare(F.delta,j)})[0];if(q&&q.should){I.cancelable&&I.preventDefault();return}if(!q){var Q=(f.current.shards||[]).map(extractRef).filter(Boolean).filter(function(F){return F.contains(I.target)}),te=Q.length>0?g(I,Q[0]):!f.current.noIsolation;te&&I.cancelable&&I.preventDefault()}}},[]),_=React__namespace.useCallback(function(M,I,j,q){var Q={name:M,delta:I,target:j,should:q,shadowParent:getOutermostShadowParent(j)};t.current.push(Q),setTimeout(function(){t.current=t.current.filter(function(te){return te!==Q})},1)},[]),S=React__namespace.useCallback(function(M){n.current=getTouchXY(M),o.current=void 0},[]),R=React__namespace.useCallback(function(M){_(M.type,getDeltaXY(M),M.target,g(M,e.lockRef.current))},[]),C=React__namespace.useCallback(function(M){_(M.type,getTouchXY(M),M.target,g(M,e.lockRef.current))},[]);React__namespace.useEffect(function(){return lockStack.push(d),e.setCallbacks({onScrollCapture:R,onWheelCapture:R,onTouchMoveCapture:C}),document.addEventListener("wheel",b,nonPassive),document.addEventListener("touchmove",b,nonPassive),document.addEventListener("touchstart",S,nonPassive),function(){lockStack=lockStack.filter(function(M){return M!==d}),document.removeEventListener("wheel",b,nonPassive),document.removeEventListener("touchmove",b,nonPassive),document.removeEventListener("touchstart",S,nonPassive)}},[]);var E=e.removeScrollBar,A=e.inert;return React__namespace.createElement(React__namespace.Fragment,null,A?React__namespace.createElement(d,{styles:generateStyle(l)}):null,E?React__namespace.createElement(RemoveScrollBar,{noRelative:e.noRelative,gapMode:e.gapMode}):null)}function getOutermostShadowParent(e){for(var t=null;e!==null;)e instanceof ShadowRoot&&(t=e.host,e=e.host),e=e.parentNode;return t}const SideCar=exportSidecar(effectCar,RemoveScrollSideCar);var ReactRemoveScroll=React__namespace.forwardRef(function(e,t){return React__namespace.createElement(RemoveScroll,__assign$1({},e,{ref:t,sideCar:SideCar}))});ReactRemoveScroll.classNames=RemoveScroll.classNames;var getDefaultParent=function(e){if(typeof document>"u")return null;var t=Array.isArray(e)?e[0]:e;return t.ownerDocument.body},counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={},lockCount=0,unwrapHost=function(e){return e&&(e.host||unwrapHost(e.parentNode))},correctTargets=function(e,t){return t.map(function(n){if(e.contains(n))return n;var o=unwrapHost(n);return o&&e.contains(o)?o:(console.error("aria-hidden",n,"in not contained inside",e,". Doing nothing"),null)}).filter(function(n){return!!n})},applyAttributeToOthers=function(e,t,n,o){var l=correctTargets(t,Array.isArray(e)?e:[e]);markerMap[n]||(markerMap[n]=new WeakMap);var d=markerMap[n],f=[],g=new Set,b=new Set(l),_=function(R){!R||g.has(R)||(g.add(R),_(R.parentNode))};l.forEach(_);var S=function(R){!R||b.has(R)||Array.prototype.forEach.call(R.children,function(C){if(g.has(C))S(C);else try{var E=C.getAttribute(o),A=E!==null&&E!=="false",M=(counterMap.get(C)||0)+1,I=(d.get(C)||0)+1;counterMap.set(C,M),d.set(C,I),f.push(C),M===1&&A&&uncontrolledNodes.set(C,!0),I===1&&C.setAttribute(n,"true"),A||C.setAttribute(o,"true")}catch(j){console.error("aria-hidden: cannot operate on ",C,j)}})};return S(t),g.clear(),lockCount++,function(){f.forEach(function(R){var C=counterMap.get(R)-1,E=d.get(R)-1;counterMap.set(R,C),d.set(R,E),C||(uncontrolledNodes.has(R)||R.removeAttribute(o),uncontrolledNodes.delete(R)),E||R.removeAttribute(n)}),lockCount--,lockCount||(counterMap=new WeakMap,counterMap=new WeakMap,uncontrolledNodes=new WeakMap,markerMap={})}},hideOthers=function(e,t,n){n===void 0&&(n="data-aria-hidden");var o=Array.from(Array.isArray(e)?e:[e]),l=getDefaultParent(e);return l?(o.push.apply(o,Array.from(l.querySelectorAll("[aria-live], script"))),applyAttributeToOthers(o,l,n,"aria-hidden")):function(){return null}};function createSlot$4(e){const t=createSlotClone$4(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable$4);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}function createSlotClone$4(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$4(l),g=mergeProps$4(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$6=Symbol("radix.slottable");function isSlottable$4(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$6}function mergeProps$4(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$4(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var DIALOG_NAME="Dialog",[createDialogContext,createDialogScope]=createContextScope$2(DIALOG_NAME),[DialogProvider,useDialogContext]=createDialogContext(DIALOG_NAME),Dialog$1=e=>{const{__scopeDialog:t,children:n,open:o,defaultOpen:l,onOpenChange:d,modal:f=!0}=e,g=React__namespace.useRef(null),b=React__namespace.useRef(null),[_,S]=useControllableState({prop:o,defaultProp:l??!1,onChange:d,caller:DIALOG_NAME});return jsxRuntime.jsx(DialogProvider,{scope:t,triggerRef:g,contentRef:b,contentId:useId(),titleId:useId(),descriptionId:useId(),open:_,onOpenChange:S,onOpenToggle:React__namespace.useCallback(()=>S(R=>!R),[S]),modal:f,children:n})};Dialog$1.displayName=DIALOG_NAME;var TRIGGER_NAME$9="DialogTrigger",DialogTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(TRIGGER_NAME$9,n),d=useComposedRefs(t,l.triggerRef);return jsxRuntime.jsx(Primitive$4.button,{type:"button","aria-haspopup":"dialog","aria-expanded":l.open,"aria-controls":l.contentId,"data-state":getState$5(l.open),...o,ref:d,onClick:composeEventHandlers(e.onClick,l.onOpenToggle)})});DialogTrigger$1.displayName=TRIGGER_NAME$9;var PORTAL_NAME$6="DialogPortal",[PortalProvider$3,usePortalContext$3]=createDialogContext(PORTAL_NAME$6,{forceMount:void 0}),DialogPortal$1=e=>{const{__scopeDialog:t,forceMount:n,children:o,container:l}=e,d=useDialogContext(PORTAL_NAME$6,t);return jsxRuntime.jsx(PortalProvider$3,{scope:t,forceMount:n,children:React__namespace.Children.map(o,f=>jsxRuntime.jsx(Presence,{present:n||d.open,children:jsxRuntime.jsx(Portal$5,{asChild:!0,container:l,children:f})}))})};DialogPortal$1.displayName=PORTAL_NAME$6;var OVERLAY_NAME$1="DialogOverlay",DialogOverlay$1=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$3(OVERLAY_NAME$1,e.__scopeDialog),{forceMount:o=n.forceMount,...l}=e,d=useDialogContext(OVERLAY_NAME$1,e.__scopeDialog);return d.modal?jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(DialogOverlayImpl,{...l,ref:t})}):null});DialogOverlay$1.displayName=OVERLAY_NAME$1;var Slot$4=createSlot$4("DialogOverlay.RemoveScroll"),DialogOverlayImpl=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(OVERLAY_NAME$1,n);return jsxRuntime.jsx(ReactRemoveScroll,{as:Slot$4,allowPinchZoom:!0,shards:[l.contentRef],children:jsxRuntime.jsx(Primitive$4.div,{"data-state":getState$5(l.open),...o,ref:t,style:{pointerEvents:"auto",...o.style}})})}),CONTENT_NAME$a="DialogContent",DialogContent$1=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$3(CONTENT_NAME$a,e.__scopeDialog),{forceMount:o=n.forceMount,...l}=e,d=useDialogContext(CONTENT_NAME$a,e.__scopeDialog);return jsxRuntime.jsx(Presence,{present:o||d.open,children:d.modal?jsxRuntime.jsx(DialogContentModal,{...l,ref:t}):jsxRuntime.jsx(DialogContentNonModal,{...l,ref:t})})});DialogContent$1.displayName=CONTENT_NAME$a;var DialogContentModal=React__namespace.forwardRef((e,t)=>{const n=useDialogContext(CONTENT_NAME$a,e.__scopeDialog),o=React__namespace.useRef(null),l=useComposedRefs(t,n.contentRef,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return hideOthers(d)},[]),jsxRuntime.jsx(DialogContentImpl,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:!0,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,d=>{var f;d.preventDefault(),(f=n.triggerRef.current)==null||f.focus()}),onPointerDownOutside:composeEventHandlers(e.onPointerDownOutside,d=>{const f=d.detail.originalEvent,g=f.button===0&&f.ctrlKey===!0;(f.button===2||g)&&d.preventDefault()}),onFocusOutside:composeEventHandlers(e.onFocusOutside,d=>d.preventDefault())})}),DialogContentNonModal=React__namespace.forwardRef((e,t)=>{const n=useDialogContext(CONTENT_NAME$a,e.__scopeDialog),o=React__namespace.useRef(!1),l=React__namespace.useRef(!1);return jsxRuntime.jsx(DialogContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,onCloseAutoFocus:d=>{var f,g;(f=e.onCloseAutoFocus)==null||f.call(e,d),d.defaultPrevented||(o.current||(g=n.triggerRef.current)==null||g.focus(),d.preventDefault()),o.current=!1,l.current=!1},onInteractOutside:d=>{var b,_;(b=e.onInteractOutside)==null||b.call(e,d),d.defaultPrevented||(o.current=!0,d.detail.originalEvent.type==="pointerdown"&&(l.current=!0));const f=d.target;((_=n.triggerRef.current)==null?void 0:_.contains(f))&&d.preventDefault(),d.detail.originalEvent.type==="focusin"&&l.current&&d.preventDefault()}})}),DialogContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,trapFocus:o,onOpenAutoFocus:l,onCloseAutoFocus:d,...f}=e,g=useDialogContext(CONTENT_NAME$a,n),b=React__namespace.useRef(null),_=useComposedRefs(t,b);return useFocusGuards(),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(FocusScope,{asChild:!0,loop:!0,trapped:o,onMountAutoFocus:l,onUnmountAutoFocus:d,children:jsxRuntime.jsx(DismissableLayer,{role:"dialog",id:g.contentId,"aria-describedby":g.descriptionId,"aria-labelledby":g.titleId,"data-state":getState$5(g.open),...f,ref:_,onDismiss:()=>g.onOpenChange(!1)})}),jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(TitleWarning,{titleId:g.titleId}),jsxRuntime.jsx(DescriptionWarning$1,{contentRef:b,descriptionId:g.descriptionId})]})]})}),TITLE_NAME$2="DialogTitle",DialogTitle$1=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(TITLE_NAME$2,n);return jsxRuntime.jsx(Primitive$4.h2,{id:l.titleId,...o,ref:t})});DialogTitle$1.displayName=TITLE_NAME$2;var DESCRIPTION_NAME$2="DialogDescription",DialogDescription$1=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(DESCRIPTION_NAME$2,n);return jsxRuntime.jsx(Primitive$4.p,{id:l.descriptionId,...o,ref:t})});DialogDescription$1.displayName=DESCRIPTION_NAME$2;var CLOSE_NAME$2="DialogClose",DialogClose$1=React__namespace.forwardRef((e,t)=>{const{__scopeDialog:n,...o}=e,l=useDialogContext(CLOSE_NAME$2,n);return jsxRuntime.jsx(Primitive$4.button,{type:"button",...o,ref:t,onClick:composeEventHandlers(e.onClick,()=>l.onOpenChange(!1))})});DialogClose$1.displayName=CLOSE_NAME$2;function getState$5(e){return e?"open":"closed"}var TITLE_WARNING_NAME="DialogTitleWarning",[WarningProvider,useWarningContext]=createContext2(TITLE_WARNING_NAME,{contentName:CONTENT_NAME$a,titleName:TITLE_NAME$2,docsSlug:"dialog"}),TitleWarning=({titleId:e})=>{const t=useWarningContext(TITLE_WARNING_NAME),n=`\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
516
516
|
|
|
517
517
|
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
518
518
|
|
|
519
|
-
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return React__namespace.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning$1=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return React__namespace.useEffect(()=>{var d;const l=(d=e.current)==null?void 0:d.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Root$a=Dialog$1,Trigger$6=DialogTrigger$1,Portal$4=DialogPortal$1,Overlay=DialogOverlay$1,Content$3=DialogContent$1,Title$1=DialogTitle$1,Description$1=DialogDescription$1,Close$1=DialogClose$1;const Dialog=({modal:e=!1,...t})=>jsxRuntime.jsx(Root$a,{modal:e,...t});Dialog.displayName=Root$a.displayName;const DialogTrigger=Trigger$6,DialogPortal=Portal$4,DialogClose=Close$1,DialogOverlay=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Overlay,{ref:n,className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));DialogOverlay.displayName=Overlay.displayName;const DialogContent=React__namespace.forwardRef(({className:e,children:t,animateExit:n=!0,...o},l)=>jsxRuntime.jsxs(DialogPortal,{forceMount:o.forceMount,children:[jsxRuntime.jsx(DialogOverlay,{}),jsxRuntime.jsxs(Content$3,{ref:l,className:cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n&&"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",e),...o,children:[t,jsxRuntime.jsxs(Close$1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsxRuntime.jsx(X$1,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));DialogContent.displayName=Content$3.displayName;const DialogHeader=({className:e,...t})=>jsxRuntime.jsx("div",{className:cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});DialogHeader.displayName="DialogHeader";const DialogFooter=({className:e,...t})=>jsxRuntime.jsx("div",{className:cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});DialogFooter.displayName="DialogFooter";const DialogTitle=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Title$1,{ref:n,className:cn("text-lg font-semibold leading-none tracking-tight",e),...t}));DialogTitle.displayName=Title$1.displayName;const DialogDescription=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Description$1,{ref:n,className:cn("text-sm text-muted-foreground",e),...t}));DialogDescription.displayName=Description$1.displayName;const sides=["top","right","bottom","left"],min$4=Math.min,max$4=Math.max,round$1=Math.round,floor=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$1(e,t,n){return max$4(e,min$4(t,n))}function evaluate(e,t){return typeof e=="function"?e(t):e}function getSide$1(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return e==="x"?"y":"x"}function getAxisLength(e){return e==="y"?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(e){return yAxisSides.has(getSide$1(e))?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){n===void 0&&(n=!1);const o=getAlignment(e),l=getAlignmentAxis(e),d=getAxisLength(l);let f=l==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[d]>t.floating[d]&&(f=getOppositePlacement(f)),[f,getOppositePlacement(f)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,t=>oppositeAlignmentMap[t])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?rlPlacement:lrPlacement:t?lrPlacement:rlPlacement;case"left":case"right":return t?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(e,t,n,o){const l=getAlignment(e);let d=getSideList(getSide$1(e),n==="start",o);return l&&(d=d.map(f=>f+"-"+l),t&&(d=d.concat(d.map(getOppositeAlignmentPlacement)))),d}function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,t=>oppositeSideMap[t])}function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}function getPaddingObject(e){return typeof e!="number"?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function computeCoordsFromPlacement(e,t,n){let{reference:o,floating:l}=e;const d=getSideAxis(t),f=getAlignmentAxis(t),g=getAxisLength(f),b=getSide$1(t),_=d==="y",S=o.x+o.width/2-l.width/2,R=o.y+o.height/2-l.height/2,C=o[g]/2-l[g]/2;let E;switch(b){case"top":E={x:S,y:o.y-l.height};break;case"bottom":E={x:S,y:o.y+o.height};break;case"right":E={x:o.x+o.width,y:R};break;case"left":E={x:o.x-l.width,y:R};break;default:E={x:o.x,y:o.y}}switch(getAlignment(t)){case"start":E[f]-=C*(n&&_?-1:1);break;case"end":E[f]+=C*(n&&_?-1:1);break}return E}const computePosition$1=async(e,t,n)=>{const{placement:o="bottom",strategy:l="absolute",middleware:d=[],platform:f}=n,g=d.filter(Boolean),b=await(f.isRTL==null?void 0:f.isRTL(t));let _=await f.getElementRects({reference:e,floating:t,strategy:l}),{x:S,y:R}=computeCoordsFromPlacement(_,o,b),C=o,E={},A=0;for(let M=0;M<g.length;M++){const{name:I,fn:j}=g[M],{x:q,y:Q,data:te,reset:F}=await j({x:S,y:R,initialPlacement:o,placement:C,strategy:l,middlewareData:E,rects:_,platform:f,elements:{reference:e,floating:t}});S=q??S,R=Q??R,E={...E,[I]:{...E[I],...te}},F&&A<=50&&(A++,typeof F=="object"&&(F.placement&&(C=F.placement),F.rects&&(_=F.rects===!0?await f.getElementRects({reference:e,floating:t,strategy:l}):F.rects),{x:S,y:R}=computeCoordsFromPlacement(_,C,b)),M=-1)}return{x:S,y:R,placement:C,strategy:l,middlewareData:E}};async function detectOverflow(e,t){var n;t===void 0&&(t={});const{x:o,y:l,platform:d,rects:f,elements:g,strategy:b}=e,{boundary:_="clippingAncestors",rootBoundary:S="viewport",elementContext:R="floating",altBoundary:C=!1,padding:E=0}=evaluate(t,e),A=getPaddingObject(E),I=g[C?R==="floating"?"reference":"floating":R],j=rectToClientRect(await d.getClippingRect({element:(n=await(d.isElement==null?void 0:d.isElement(I)))==null||n?I:I.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(g.floating)),boundary:_,rootBoundary:S,strategy:b})),q=R==="floating"?{x:o,y:l,width:f.floating.width,height:f.floating.height}:f.reference,Q=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g.floating)),te=await(d.isElement==null?void 0:d.isElement(Q))?await(d.getScale==null?void 0:d.getScale(Q))||{x:1,y:1}:{x:1,y:1},F=rectToClientRect(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:q,offsetParent:Q,strategy:b}):q);return{top:(j.top-F.top+A.top)/te.y,bottom:(F.bottom-j.bottom+A.bottom)/te.y,left:(j.left-F.left+A.left)/te.x,right:(F.right-j.right+A.right)/te.x}}const arrow$4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:l,rects:d,platform:f,elements:g,middlewareData:b}=t,{element:_,padding:S=0}=evaluate(e,t)||{};if(_==null)return{};const R=getPaddingObject(S),C={x:n,y:o},E=getAlignmentAxis(l),A=getAxisLength(E),M=await f.getDimensions(_),I=E==="y",j=I?"top":"left",q=I?"bottom":"right",Q=I?"clientHeight":"clientWidth",te=d.reference[A]+d.reference[E]-C[E]-d.floating[A],F=C[E]-d.reference[E],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(_));let ne=V?V[Q]:0;(!ne||!await(f.isElement==null?void 0:f.isElement(V)))&&(ne=g.floating[Q]||d.floating[A]);const ae=te/2-F/2,se=ne/2-M[A]/2-1,Oe=min$4(R[j],se),Ne=min$4(R[q],se),oe=Oe,$e=ne-M[A]-Ne,Ae=ne/2-M[A]/2+ae,je=clamp$1(oe,Ae,$e),Be=!b.arrow&&getAlignment(l)!=null&&Ae!==je&&d.reference[A]/2-(Ae<oe?Oe:Ne)-M[A]/2<0,qe=Be?Ae<oe?Ae-oe:Ae-$e:0;return{[E]:C[E]+qe,data:{[E]:je,centerOffset:Ae-je-qe,...Be&&{alignmentOffset:qe}},reset:Be}}}),flip$2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:l,middlewareData:d,rects:f,initialPlacement:g,platform:b,elements:_}=t,{mainAxis:S=!0,crossAxis:R=!0,fallbackPlacements:C,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:M=!0,...I}=evaluate(e,t);if((n=d.arrow)!=null&&n.alignmentOffset)return{};const j=getSide$1(l),q=getSideAxis(g),Q=getSide$1(g)===g,te=await(b.isRTL==null?void 0:b.isRTL(_.floating)),F=C||(Q||!M?[getOppositePlacement(g)]:getExpandedPlacements(g)),V=A!=="none";!C&&V&&F.push(...getOppositeAxisPlacements(g,M,A,te));const ne=[g,...F],ae=await detectOverflow(t,I),se=[];let Oe=((o=d.flip)==null?void 0:o.overflows)||[];if(S&&se.push(ae[j]),R){const Ae=getAlignmentSides(l,f,te);se.push(ae[Ae[0]],ae[Ae[1]])}if(Oe=[...Oe,{placement:l,overflows:se}],!se.every(Ae=>Ae<=0)){var Ne,oe;const Ae=(((Ne=d.flip)==null?void 0:Ne.index)||0)+1,je=ne[Ae];if(je&&(!(R==="alignment"?q!==getSideAxis(je):!1)||Oe.every(Ve=>getSideAxis(Ve.placement)===q?Ve.overflows[0]>0:!0)))return{data:{index:Ae,overflows:Oe},reset:{placement:je}};let Be=(oe=Oe.filter(qe=>qe.overflows[0]<=0).sort((qe,Ve)=>qe.overflows[1]-Ve.overflows[1])[0])==null?void 0:oe.placement;if(!Be)switch(E){case"bestFit":{var $e;const qe=($e=Oe.filter(Ve=>{if(V){const Le=getSideAxis(Ve.placement);return Le===q||Le==="y"}return!0}).map(Ve=>[Ve.placement,Ve.overflows.filter(Le=>Le>0).reduce((Le,He)=>Le+He,0)]).sort((Ve,Le)=>Ve[1]-Le[1])[0])==null?void 0:$e[0];qe&&(Be=qe);break}case"initialPlacement":Be=g;break}if(l!==Be)return{reset:{placement:Be}}}return{}}}};function getSideOffsets(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function isAnySideFullyClipped(e){return sides.some(t=>e[t]>=0)}const hide$2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...l}=evaluate(e,t);switch(o){case"referenceHidden":{const d=await detectOverflow(t,{...l,elementContext:"reference"}),f=getSideOffsets(d,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:isAnySideFullyClipped(f)}}}case"escaped":{const d=await detectOverflow(t,{...l,altBoundary:!0}),f=getSideOffsets(d,n.floating);return{data:{escapedOffsets:f,escaped:isAnySideFullyClipped(f)}}}default:return{}}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(e,t){const{placement:n,platform:o,elements:l}=e,d=await(o.isRTL==null?void 0:o.isRTL(l.floating)),f=getSide$1(n),g=getAlignment(n),b=getSideAxis(n)==="y",_=originSides.has(f)?-1:1,S=d&&b?-1:1,R=evaluate(t,e);let{mainAxis:C,crossAxis:E,alignmentAxis:A}=typeof R=="number"?{mainAxis:R,crossAxis:0,alignmentAxis:null}:{mainAxis:R.mainAxis||0,crossAxis:R.crossAxis||0,alignmentAxis:R.alignmentAxis};return g&&typeof A=="number"&&(E=g==="end"?A*-1:A),b?{x:E*S,y:C*_}:{x:C*_,y:E*S}}const offset$2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:l,y:d,placement:f,middlewareData:g}=t,b=await convertValueToCoords(t,e);return f===((n=g.offset)==null?void 0:n.placement)&&(o=g.arrow)!=null&&o.alignmentOffset?{}:{x:l+b.x,y:d+b.y,data:{...b,placement:f}}}}},shift$3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:l}=t,{mainAxis:d=!0,crossAxis:f=!1,limiter:g={fn:I=>{let{x:j,y:q}=I;return{x:j,y:q}}},...b}=evaluate(e,t),_={x:n,y:o},S=await detectOverflow(t,b),R=getSideAxis(getSide$1(l)),C=getOppositeAxis(R);let E=_[C],A=_[R];if(d){const I=C==="y"?"top":"left",j=C==="y"?"bottom":"right",q=E+S[I],Q=E-S[j];E=clamp$1(q,E,Q)}if(f){const I=R==="y"?"top":"left",j=R==="y"?"bottom":"right",q=A+S[I],Q=A-S[j];A=clamp$1(q,A,Q)}const M=g.fn({...t,[C]:E,[R]:A});return{...M,data:{x:M.x-n,y:M.y-o,enabled:{[C]:d,[R]:f}}}}}},limitShift$2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:l,rects:d,middlewareData:f}=t,{offset:g=0,mainAxis:b=!0,crossAxis:_=!0}=evaluate(e,t),S={x:n,y:o},R=getSideAxis(l),C=getOppositeAxis(R);let E=S[C],A=S[R];const M=evaluate(g,t),I=typeof M=="number"?{mainAxis:M,crossAxis:0}:{mainAxis:0,crossAxis:0,...M};if(b){const Q=C==="y"?"height":"width",te=d.reference[C]-d.floating[Q]+I.mainAxis,F=d.reference[C]+d.reference[Q]-I.mainAxis;E<te?E=te:E>F&&(E=F)}if(_){var j,q;const Q=C==="y"?"width":"height",te=originSides.has(getSide$1(l)),F=d.reference[R]-d.floating[Q]+(te&&((j=f.offset)==null?void 0:j[R])||0)+(te?0:I.crossAxis),V=d.reference[R]+d.reference[Q]+(te?0:((q=f.offset)==null?void 0:q[R])||0)-(te?I.crossAxis:0);A<F?A=F:A>V&&(A=V)}return{[C]:E,[R]:A}}}},size$2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:l,rects:d,platform:f,elements:g}=t,{apply:b=()=>{},..._}=evaluate(e,t),S=await detectOverflow(t,_),R=getSide$1(l),C=getAlignment(l),E=getSideAxis(l)==="y",{width:A,height:M}=d.floating;let I,j;R==="top"||R==="bottom"?(I=R,j=C===(await(f.isRTL==null?void 0:f.isRTL(g.floating))?"start":"end")?"left":"right"):(j=R,I=C==="end"?"top":"bottom");const q=M-S.top-S.bottom,Q=A-S.left-S.right,te=min$4(M-S[I],q),F=min$4(A-S[j],Q),V=!t.middlewareData.shift;let ne=te,ae=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(ae=Q),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(ne=q),V&&!C){const Oe=max$4(S.left,0),Ne=max$4(S.right,0),oe=max$4(S.top,0),$e=max$4(S.bottom,0);E?ae=A-2*(Oe!==0||Ne!==0?Oe+Ne:max$4(S.left,S.right)):ne=M-2*(oe!==0||$e!==0?oe+$e:max$4(S.top,S.bottom))}await b({...t,availableWidth:ae,availableHeight:ne});const se=await f.getDimensions(g.floating);return A!==se.width||M!==se.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return(t=(isNode(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function isNode(e){return hasWindow()?e instanceof Node||e instanceof getWindow(e).Node:!1}function isElement(e){return hasWindow()?e instanceof Element||e instanceof getWindow(e).Element:!1}function isHTMLElement$2(e){return hasWindow()?e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement:!1}function isShadowRoot(e){return!hasWindow()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!invalidOverflowDisplayValues.has(l)}const tableElements=new Set(["table","td","th"]);function isTableElement(e){return tableElements.has(getNodeName(e))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(e){return topLayerSelectors.some(t=>{try{return e.matches(t)}catch{return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(e){const t=isWebKit(),n=isElement(e)?getComputedStyle$1(e):e;return transformProperties.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||willChangeValues.some(o=>(n.willChange||"").includes(o))||containValues.some(o=>(n.contain||"").includes(o))}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement$2(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(e){return lastTraversableNodeNames.has(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if(getNodeName(e)==="html")return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement$2(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const l=getNearestOverflowAncestor(e),d=l===((o=e.ownerDocument)==null?void 0:o.body),f=getWindow(l);if(d){const g=getFrameElement(f);return t.concat(f,f.visualViewport||[],isOverflowElement(l)?l:[],g&&n?getOverflowAncestors(g):[])}return t.concat(l,getOverflowAncestors(l,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function getCssDimensions(e){const t=getComputedStyle$1(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=isHTMLElement$2(e),d=l?e.offsetWidth:n,f=l?e.offsetHeight:o,g=round$1(n)!==d||round$1(o)!==f;return g&&(n=d,o=f),{width:n,height:o,$:g}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement$2(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:d}=getCssDimensions(t);let f=(d?round$1(n.width):n.width)/o,g=(d?round$1(n.height):n.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!g||!Number.isFinite(g))&&(g=1),{x:f,y:g}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return!isWebKit()||!t.visualViewport?noOffsets:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function shouldAddVisualOffsets(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==getWindow(e)?!1:t}function getBoundingClientRect(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect(),d=unwrapElement(e);let f=createCoords(1);t&&(o?isElement(o)&&(f=getScale(o)):f=getScale(e));const g=shouldAddVisualOffsets(d,n,o)?getVisualOffsets(d):createCoords(0);let b=(l.left+g.x)/f.x,_=(l.top+g.y)/f.y,S=l.width/f.x,R=l.height/f.y;if(d){const C=getWindow(d),E=o&&isElement(o)?getWindow(o):o;let A=C,M=getFrameElement(A);for(;M&&o&&E!==A;){const I=getScale(M),j=M.getBoundingClientRect(),q=getComputedStyle$1(M),Q=j.left+(M.clientLeft+parseFloat(q.paddingLeft))*I.x,te=j.top+(M.clientTop+parseFloat(q.paddingTop))*I.y;b*=I.x,_*=I.y,S*=I.x,R*=I.y,b+=Q,_+=te,A=getWindow(M),M=getFrameElement(A)}}return rectToClientRect({width:S,height:R,x:b,y:_})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-getWindowScrollBarX(e,n),l=n.top+t.scrollTop;return{x:o,y:l}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const d=l==="fixed",f=getDocumentElement(o),g=t?isTopLayer(t.floating):!1;if(o===f||g&&d)return n;let b={scrollLeft:0,scrollTop:0},_=createCoords(1);const S=createCoords(0),R=isHTMLElement$2(o);if((R||!R&&!d)&&((getNodeName(o)!=="body"||isOverflowElement(f))&&(b=getNodeScroll(o)),isHTMLElement$2(o))){const E=getBoundingClientRect(o);_=getScale(o),S.x=E.x+o.clientLeft,S.y=E.y+o.clientTop}const C=f&&!R&&!d?getHTMLOffset(f,b):createCoords(0);return{width:n.width*_.x,height:n.height*_.y,x:n.x*_.x-b.scrollLeft*_.x+S.x+C.x,y:n.y*_.y-b.scrollTop*_.y+S.y+C.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),o=e.ownerDocument.body,l=max$4(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),d=max$4(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let f=-n.scrollLeft+getWindowScrollBarX(e);const g=-n.scrollTop;return getComputedStyle$1(o).direction==="rtl"&&(f+=max$4(t.clientWidth,o.clientWidth)-l),{width:l,height:d,x:f,y:g}}const SCROLLBAR_MAX=25;function getViewportRect(e,t){const n=getWindow(e),o=getDocumentElement(e),l=n.visualViewport;let d=o.clientWidth,f=o.clientHeight,g=0,b=0;if(l){d=l.width,f=l.height;const S=isWebKit();(!S||S&&t==="fixed")&&(g=l.offsetLeft,b=l.offsetTop)}const _=getWindowScrollBarX(o);if(_<=0){const S=o.ownerDocument,R=S.body,C=getComputedStyle(R),E=S.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,A=Math.abs(o.clientWidth-R.clientWidth-E);A<=SCROLLBAR_MAX&&(d-=A)}else _<=SCROLLBAR_MAX&&(d+=_);return{width:d,height:f,x:g,y:b}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,t==="fixed"),o=n.top+e.clientTop,l=n.left+e.clientLeft,d=isHTMLElement$2(e)?getScale(e):createCoords(1),f=e.clientWidth*d.x,g=e.clientHeight*d.y,b=l*d.x,_=o*d.y;return{width:f,height:g,x:b,y:_}}function getClientRectFromClippingAncestor(e,t,n){let o;if(t==="viewport")o=getViewportRect(e,n);else if(t==="document")o=getDocumentRect(getDocumentElement(e));else if(isElement(t))o=getInnerBoundingClientRect(t,n);else{const l=getVisualOffsets(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return rectToClientRect(o)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return n===t||!isElement(n)||isLastTraversableNode(n)?!1:getComputedStyle$1(n).position==="fixed"||hasFixedPositionAncestor(n,t)}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let o=getOverflowAncestors(e,[],!1).filter(g=>isElement(g)&&getNodeName(g)!=="body"),l=null;const d=getComputedStyle$1(e).position==="fixed";let f=d?getParentNode(e):e;for(;isElement(f)&&!isLastTraversableNode(f);){const g=getComputedStyle$1(f),b=isContainingBlock(f);!b&&g.position==="fixed"&&(l=null),(d?!b&&!l:!b&&g.position==="static"&&!!l&&absoluteOrFixed.has(l.position)||isOverflowElement(f)&&!b&&hasFixedPositionAncestor(e,f))?o=o.filter(S=>S!==f):l=g,f=getParentNode(f)}return t.set(e,o),o}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const f=[...n==="clippingAncestors"?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),o],g=f[0],b=f.reduce((_,S)=>{const R=getClientRectFromClippingAncestor(t,S,l);return _.top=max$4(R.top,_.top),_.right=min$4(R.right,_.right),_.bottom=min$4(R.bottom,_.bottom),_.left=max$4(R.left,_.left),_},getClientRectFromClippingAncestor(t,g,l));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function getDimensions(e){const{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){const o=isHTMLElement$2(t),l=getDocumentElement(t),d=n==="fixed",f=getBoundingClientRect(e,!0,d,t);let g={scrollLeft:0,scrollTop:0};const b=createCoords(0);function _(){b.x=getWindowScrollBarX(l)}if(o||!o&&!d)if((getNodeName(t)!=="body"||isOverflowElement(l))&&(g=getNodeScroll(t)),o){const E=getBoundingClientRect(t,!0,d,t);b.x=E.x+t.clientLeft,b.y=E.y+t.clientTop}else l&&_();d&&!o&&l&&_();const S=l&&!o&&!d?getHTMLOffset(l,g):createCoords(0),R=f.left+g.scrollLeft-b.x-S.x,C=f.top+g.scrollTop-b.y-S.y;return{x:R,y:C,width:f.width,height:f.height}}function isStaticPositioned(e){return getComputedStyle$1(e).position==="static"}function getTrueOffsetParent(e,t){if(!isHTMLElement$2(e)||getComputedStyle$1(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement$2(e)){let l=getParentNode(e);for(;l&&!isLastTraversableNode(l);){if(isElement(l)&&!isStaticPositioned(l))return l;l=getParentNode(l)}return n}let o=getTrueOffsetParent(e,t);for(;o&&isTableElement(o)&&isStaticPositioned(o);)o=getTrueOffsetParent(o,t);return o&&isLastTraversableNode(o)&&isStaticPositioned(o)&&!isContainingBlock(o)?n:o||getContainingBlock(e)||n}const getElementRects=async function(e){const t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,o=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function isRTL(e){return getComputedStyle$1(e).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t){let n=null,o;const l=getDocumentElement(e);function d(){var g;clearTimeout(o),(g=n)==null||g.disconnect(),n=null}function f(g,b){g===void 0&&(g=!1),b===void 0&&(b=1),d();const _=e.getBoundingClientRect(),{left:S,top:R,width:C,height:E}=_;if(g||t(),!C||!E)return;const A=floor(R),M=floor(l.clientWidth-(S+C)),I=floor(l.clientHeight-(R+E)),j=floor(S),Q={rootMargin:-A+"px "+-M+"px "+-I+"px "+-j+"px",threshold:max$4(0,min$4(1,b))||1};let te=!0;function F(V){const ne=V[0].intersectionRatio;if(ne!==b){if(!te)return f();ne?f(!1,ne):o=setTimeout(()=>{f(!1,1e-7)},1e3)}ne===1&&!rectsAreEqual(_,e.getBoundingClientRect())&&f(),te=!1}try{n=new IntersectionObserver(F,{...Q,root:l.ownerDocument})}catch{n=new IntersectionObserver(F,Q)}n.observe(e)}return f(!0),d}function autoUpdate(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:b=!1}=o,_=unwrapElement(e),S=l||d?[..._?getOverflowAncestors(_):[],...getOverflowAncestors(t)]:[];S.forEach(j=>{l&&j.addEventListener("scroll",n,{passive:!0}),d&&j.addEventListener("resize",n)});const R=_&&g?observeMove(_,n):null;let C=-1,E=null;f&&(E=new ResizeObserver(j=>{let[q]=j;q&&q.target===_&&E&&(E.unobserve(t),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var Q;(Q=E)==null||Q.observe(t)})),n()}),_&&!b&&E.observe(_),E.observe(t));let A,M=b?getBoundingClientRect(e):null;b&&I();function I(){const j=getBoundingClientRect(e);M&&!rectsAreEqual(M,j)&&n(),M=j,A=requestAnimationFrame(I)}return n(),()=>{var j;S.forEach(q=>{l&&q.removeEventListener("scroll",n),d&&q.removeEventListener("resize",n)}),R==null||R(),(j=E)==null||j.disconnect(),E=null,b&&cancelAnimationFrame(A)}}const offset$1=offset$2,shift$2=shift$3,flip$1=flip$2,size$1=size$2,hide$1=hide$2,arrow$3=arrow$4,limitShift$1=limitShift$2,computePosition=(e,t,n)=>{const o=new Map,l={platform,...n},d={...l.platform,_c:o};return computePosition$1(e,t,{...l,platform:d})};var isClient=typeof document<"u",noop$2=function(){},index=isClient?React.useLayoutEffect:noop$2;function deepEqual$3(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!deepEqual$3(e[o],t[o]))return!1;return!0}if(l=Object.keys(e),n=l.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,l[o]))return!1;for(o=n;o--!==0;){const d=l[o];if(!(d==="_owner"&&e.$$typeof)&&!deepEqual$3(e[d],t[d]))return!1}return!0}return e!==e&&t!==t}function getDPR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(e,t){const n=getDPR(e);return Math.round(t*n)/n}function useLatestRef(e){const t=React__namespace.useRef(e);return index(()=>{t.current=e}),t}function useFloating(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:l,elements:{reference:d,floating:f}={},transform:g=!0,whileElementsMounted:b,open:_}=e,[S,R]=React__namespace.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[C,E]=React__namespace.useState(o);deepEqual$3(C,o)||E(o);const[A,M]=React__namespace.useState(null),[I,j]=React__namespace.useState(null),q=React__namespace.useCallback(Ve=>{Ve!==V.current&&(V.current=Ve,M(Ve))},[]),Q=React__namespace.useCallback(Ve=>{Ve!==ne.current&&(ne.current=Ve,j(Ve))},[]),te=d||A,F=f||I,V=React__namespace.useRef(null),ne=React__namespace.useRef(null),ae=React__namespace.useRef(S),se=b!=null,Oe=useLatestRef(b),Ne=useLatestRef(l),oe=useLatestRef(_),$e=React__namespace.useCallback(()=>{if(!V.current||!ne.current)return;const Ve={placement:t,strategy:n,middleware:C};Ne.current&&(Ve.platform=Ne.current),computePosition(V.current,ne.current,Ve).then(Le=>{const He={...Le,isPositioned:oe.current!==!1};Ae.current&&!deepEqual$3(ae.current,He)&&(ae.current=He,ReactDOM__namespace.flushSync(()=>{R(He)}))})},[C,t,n,Ne,oe]);index(()=>{_===!1&&ae.current.isPositioned&&(ae.current.isPositioned=!1,R(Ve=>({...Ve,isPositioned:!1})))},[_]);const Ae=React__namespace.useRef(!1);index(()=>(Ae.current=!0,()=>{Ae.current=!1}),[]),index(()=>{if(te&&(V.current=te),F&&(ne.current=F),te&&F){if(Oe.current)return Oe.current(te,F,$e);$e()}},[te,F,$e,Oe,se]);const je=React__namespace.useMemo(()=>({reference:V,floating:ne,setReference:q,setFloating:Q}),[q,Q]),Be=React__namespace.useMemo(()=>({reference:te,floating:F}),[te,F]),qe=React__namespace.useMemo(()=>{const Ve={position:n,left:0,top:0};if(!Be.floating)return Ve;const Le=roundByDPR(Be.floating,S.x),He=roundByDPR(Be.floating,S.y);return g?{...Ve,transform:"translate("+Le+"px, "+He+"px)",...getDPR(Be.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Le,top:He}},[n,g,Be.floating,S.x,S.y]);return React__namespace.useMemo(()=>({...S,update:$e,refs:je,elements:Be,floatingStyles:qe}),[S,$e,je,Be,qe])}const arrow$1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:l}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?arrow$3({element:o.current,padding:l}).fn(n):{}:o?arrow$3({element:o,padding:l}).fn(n):{}}}},offset=(e,t)=>({...offset$1(e),options:[e,t]}),shift$1=(e,t)=>({...shift$2(e),options:[e,t]}),limitShift=(e,t)=>({...limitShift$1(e),options:[e,t]}),flip=(e,t)=>({...flip$1(e),options:[e,t]}),size=(e,t)=>({...size$1(e),options:[e,t]}),hide=(e,t)=>({...hide$1(e),options:[e,t]}),arrow$2=(e,t)=>({...arrow$1(e),options:[e,t]});var NAME$3="Arrow",Arrow$1=React__namespace.forwardRef((e,t)=>{const{children:n,width:o=10,height:l=5,...d}=e;return jsxRuntime.jsx(Primitive$4.svg,{...d,ref:t,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:jsxRuntime.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$3;var Root$9=Arrow$1,POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope$2(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=e=>{const{__scopePopper:t,children:n}=e,[o,l]=React__namespace.useState(null);return jsxRuntime.jsx(PopperProvider,{scope:t,anchor:o,onAnchorChange:l,children:n})};Popper.displayName=POPPER_NAME;var ANCHOR_NAME$2="PopperAnchor",PopperAnchor=React__namespace.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...l}=e,d=usePopperContext(ANCHOR_NAME$2,n),f=React__namespace.useRef(null),g=useComposedRefs(t,f),b=React__namespace.useRef(null);return React__namespace.useEffect(()=>{const _=b.current;b.current=(o==null?void 0:o.current)||f.current,_!==b.current&&d.onAnchorChange(b.current)}),o?null:jsxRuntime.jsx(Primitive$4.div,{...l,ref:g})});PopperAnchor.displayName=ANCHOR_NAME$2;var CONTENT_NAME$9="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$9),PopperContent=React__namespace.forwardRef((e,t)=>{var et,at,tt,ot,lt,Ge;const{__scopePopper:n,side:o="bottom",sideOffset:l=0,align:d="center",alignOffset:f=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:_=[],collisionPadding:S=0,sticky:R="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:A,...M}=e,I=usePopperContext(CONTENT_NAME$9,n),[j,q]=React__namespace.useState(null),Q=useComposedRefs(t,$t=>q($t)),[te,F]=React__namespace.useState(null),V=useSize(te),ne=(V==null?void 0:V.width)??0,ae=(V==null?void 0:V.height)??0,se=o+(d!=="center"?"-"+d:""),Oe=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},Ne=Array.isArray(_)?_:[_],oe=Ne.length>0,$e={padding:Oe,boundary:Ne.filter(isNotNull),altBoundary:oe},{refs:Ae,floatingStyles:je,placement:Be,isPositioned:qe,middlewareData:Ve}=useFloating({strategy:"fixed",placement:se,whileElementsMounted:(...$t)=>autoUpdate(...$t,{animationFrame:E==="always"}),elements:{reference:I.anchor},middleware:[offset({mainAxis:l+ae,alignmentAxis:f}),b&&shift$1({mainAxis:!0,crossAxis:!1,limiter:R==="partial"?limitShift():void 0,...$e}),b&&flip({...$e}),size({...$e,apply:({elements:$t,rects:rt,availableWidth:Rt,availableHeight:dt})=>{const{width:It,height:Mt}=rt.reference,Ct=$t.floating.style;Ct.setProperty("--radix-popper-available-width",`${Rt}px`),Ct.setProperty("--radix-popper-available-height",`${dt}px`),Ct.setProperty("--radix-popper-anchor-width",`${It}px`),Ct.setProperty("--radix-popper-anchor-height",`${Mt}px`)}}),te&&arrow$2({element:te,padding:g}),transformOrigin({arrowWidth:ne,arrowHeight:ae}),C&&hide({strategy:"referenceHidden",...$e})]}),[Le,He]=getSideAndAlignFromPlacement(Be),We=useCallbackRef$1(A);useLayoutEffect2(()=>{qe&&(We==null||We())},[qe,We]);const ze=(et=Ve.arrow)==null?void 0:et.x,Xe=(at=Ve.arrow)==null?void 0:at.y,nt=((tt=Ve.arrow)==null?void 0:tt.centerOffset)!==0,[Je,st]=React__namespace.useState();return useLayoutEffect2(()=>{j&&st(window.getComputedStyle(j).zIndex)},[j]),jsxRuntime.jsx("div",{ref:Ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...je,transform:qe?je.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Je,"--radix-popper-transform-origin":[(ot=Ve.transformOrigin)==null?void 0:ot.x,(lt=Ve.transformOrigin)==null?void 0:lt.y].join(" "),...((Ge=Ve.hide)==null?void 0:Ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:jsxRuntime.jsx(PopperContentProvider,{scope:n,placedSide:Le,onArrowChange:F,arrowX:ze,arrowY:Xe,shouldHideArrow:nt,children:jsxRuntime.jsx(Primitive$4.div,{"data-side":Le,"data-align":He,...M,ref:Q,style:{...M.style,animation:qe?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$9;var ARROW_NAME$5="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=React__namespace.forwardRef(function(t,n){const{__scopePopper:o,...l}=t,d=useContentContext(ARROW_NAME$5,o),f=OPPOSITE_SIDE[d.placedSide];return jsxRuntime.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:jsxRuntime.jsx(Root$9,{...l,ref:n,style:{...l.style,display:"block"}})})});PopperArrow.displayName=ARROW_NAME$5;function isNotNull(e){return e!==null}var transformOrigin=e=>({name:"transformOrigin",options:e,fn(t){var I,j,q;const{placement:n,rects:o,middlewareData:l}=t,f=((I=l.arrow)==null?void 0:I.centerOffset)!==0,g=f?0:e.arrowWidth,b=f?0:e.arrowHeight,[_,S]=getSideAndAlignFromPlacement(n),R={start:"0%",center:"50%",end:"100%"}[S],C=(((j=l.arrow)==null?void 0:j.x)??0)+g/2,E=(((q=l.arrow)==null?void 0:q.y)??0)+b/2;let A="",M="";return _==="bottom"?(A=f?R:`${C}px`,M=`${-b}px`):_==="top"?(A=f?R:`${C}px`,M=`${o.floating.height+b}px`):_==="right"?(A=`${-b}px`,M=f?R:`${E}px`):_==="left"&&(A=`${o.floating.width+b}px`,M=f?R:`${E}px`),{data:{x:A,y:M}}}});function getSideAndAlignFromPlacement(e){const[t,n="center"]=e.split("-");return[t,n]}var Root2$7=Popper,Anchor=PopperAnchor,Content$2=PopperContent,Arrow=PopperArrow;function createSlot$3(e){const t=createSlotClone$3(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable$3);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}function createSlotClone$3(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$3(l),g=mergeProps$3(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$5=Symbol("radix.slottable");function isSlottable$3(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$5}function mergeProps$3(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$3(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SELECTION_KEYS$1=["Enter"," "],FIRST_KEYS=["ArrowDown","PageUp","Home"],LAST_KEYS=["ArrowUp","PageDown","End"],FIRST_LAST_KEYS=[...FIRST_KEYS,...LAST_KEYS],SUB_OPEN_KEYS={ltr:[...SELECTION_KEYS$1,"ArrowRight"],rtl:[...SELECTION_KEYS$1,"ArrowLeft"]},SUB_CLOSE_KEYS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},MENU_NAME="Menu",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(MENU_NAME),[createMenuContext,createMenuScope]=createContextScope$2(MENU_NAME,[createCollectionScope$3,createPopperScope,createRovingFocusGroupScope]),usePopperScope$3=createPopperScope(),useRovingFocusGroupScope$1=createRovingFocusGroupScope(),[MenuProvider,useMenuContext]=createMenuContext(MENU_NAME),[MenuRootProvider,useMenuRootContext]=createMenuContext(MENU_NAME),Menu=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:l,onOpenChange:d,modal:f=!0}=e,g=usePopperScope$3(t),[b,_]=React__namespace.useState(null),S=React__namespace.useRef(!1),R=useCallbackRef$1(d),C=useDirection(l);return React__namespace.useEffect(()=>{const E=()=>{S.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>S.current=!1;return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),jsxRuntime.jsx(Root2$7,{...g,children:jsxRuntime.jsx(MenuProvider,{scope:t,open:n,onOpenChange:R,content:b,onContentChange:_,children:jsxRuntime.jsx(MenuRootProvider,{scope:t,onClose:React__namespace.useCallback(()=>R(!1),[R]),isUsingKeyboardRef:S,dir:C,modal:f,children:o})})})};Menu.displayName=MENU_NAME;var ANCHOR_NAME$1="MenuAnchor",MenuAnchor=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,l=usePopperScope$3(n);return jsxRuntime.jsx(Anchor,{...l,...o,ref:t})});MenuAnchor.displayName=ANCHOR_NAME$1;var PORTAL_NAME$5="MenuPortal",[PortalProvider$2,usePortalContext$2]=createMenuContext(PORTAL_NAME$5,{forceMount:void 0}),MenuPortal=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:l}=e,d=useMenuContext(PORTAL_NAME$5,t);return jsxRuntime.jsx(PortalProvider$2,{scope:t,forceMount:n,children:jsxRuntime.jsx(Presence,{present:n||d.open,children:jsxRuntime.jsx(Portal$5,{asChild:!0,container:l,children:o})})})};MenuPortal.displayName=PORTAL_NAME$5;var CONTENT_NAME$8="MenuContent",[MenuContentProvider,useMenuContentContext]=createMenuContext(CONTENT_NAME$8),MenuContent=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$2(CONTENT_NAME$8,e.__scopeMenu),{forceMount:o=n.forceMount,...l}=e,d=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),f=useMenuRootContext(CONTENT_NAME$8,e.__scopeMenu);return jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeMenu,children:jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeMenu,children:f.modal?jsxRuntime.jsx(MenuRootContentModal,{...l,ref:t}):jsxRuntime.jsx(MenuRootContentNonModal,{...l,ref:t})})})})}),MenuRootContentModal=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),o=React__namespace.useRef(null),l=useComposedRefs(t,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return hideOthers(d)},[]),jsxRuntime.jsx(MenuContentImpl,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:composeEventHandlers(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),MenuRootContentNonModal=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(CONTENT_NAME$8,e.__scopeMenu);return jsxRuntime.jsx(MenuContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Slot$3=createSlot$3("MenuContent.ScrollLock"),MenuContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:f,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:_,onPointerDownOutside:S,onFocusOutside:R,onInteractOutside:C,onDismiss:E,disableOutsideScroll:A,...M}=e,I=useMenuContext(CONTENT_NAME$8,n),j=useMenuRootContext(CONTENT_NAME$8,n),q=usePopperScope$3(n),Q=useRovingFocusGroupScope$1(n),te=useCollection$3(n),[F,V]=React__namespace.useState(null),ne=React__namespace.useRef(null),ae=useComposedRefs(t,ne,I.onContentChange),se=React__namespace.useRef(0),Oe=React__namespace.useRef(""),Ne=React__namespace.useRef(0),oe=React__namespace.useRef(null),$e=React__namespace.useRef("right"),Ae=React__namespace.useRef(0),je=A?ReactRemoveScroll:React__namespace.Fragment,Be=A?{as:Slot$3,allowPinchZoom:!0}:void 0,qe=Le=>{var et,at;const He=Oe.current+Le,We=te().filter(tt=>!tt.disabled),ze=document.activeElement,Xe=(et=We.find(tt=>tt.ref.current===ze))==null?void 0:et.textValue,nt=We.map(tt=>tt.textValue),Je=getNextMatch(nt,He,Xe),st=(at=We.find(tt=>tt.textValue===Je))==null?void 0:at.ref.current;(function tt(ot){Oe.current=ot,window.clearTimeout(se.current),ot!==""&&(se.current=window.setTimeout(()=>tt(""),1e3))})(He),st&&setTimeout(()=>st.focus())};React__namespace.useEffect(()=>()=>window.clearTimeout(se.current),[]),useFocusGuards();const Ve=React__namespace.useCallback(Le=>{var We,ze;return $e.current===((We=oe.current)==null?void 0:We.side)&&isPointerInGraceArea(Le,(ze=oe.current)==null?void 0:ze.area)},[]);return jsxRuntime.jsx(MenuContentProvider,{scope:n,searchRef:Oe,onItemEnter:React__namespace.useCallback(Le=>{Ve(Le)&&Le.preventDefault()},[Ve]),onItemLeave:React__namespace.useCallback(Le=>{var He;Ve(Le)||((He=ne.current)==null||He.focus(),V(null))},[Ve]),onTriggerLeave:React__namespace.useCallback(Le=>{Ve(Le)&&Le.preventDefault()},[Ve]),pointerGraceTimerRef:Ne,onPointerGraceIntentChange:React__namespace.useCallback(Le=>{oe.current=Le},[]),children:jsxRuntime.jsx(je,{...Be,children:jsxRuntime.jsx(FocusScope,{asChild:!0,trapped:l,onMountAutoFocus:composeEventHandlers(d,Le=>{var He;Le.preventDefault(),(He=ne.current)==null||He.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:_,onPointerDownOutside:S,onFocusOutside:R,onInteractOutside:C,onDismiss:E,children:jsxRuntime.jsx(Root$c,{asChild:!0,...Q,dir:j.dir,orientation:"vertical",loop:o,currentTabStopId:F,onCurrentTabStopIdChange:V,onEntryFocus:composeEventHandlers(b,Le=>{j.isUsingKeyboardRef.current||Le.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsxRuntime.jsx(Content$2,{role:"menu","aria-orientation":"vertical","data-state":getOpenState(I.open),"data-radix-menu-content":"",dir:j.dir,...q,...M,ref:ae,style:{outline:"none",...M.style},onKeyDown:composeEventHandlers(M.onKeyDown,Le=>{const We=Le.target.closest("[data-radix-menu-content]")===Le.currentTarget,ze=Le.ctrlKey||Le.altKey||Le.metaKey,Xe=Le.key.length===1;We&&(Le.key==="Tab"&&Le.preventDefault(),!ze&&Xe&&qe(Le.key));const nt=ne.current;if(Le.target!==nt||!FIRST_LAST_KEYS.includes(Le.key))return;Le.preventDefault();const st=te().filter(et=>!et.disabled).map(et=>et.ref.current);LAST_KEYS.includes(Le.key)&&st.reverse(),focusFirst$1(st)}),onBlur:composeEventHandlers(e.onBlur,Le=>{Le.currentTarget.contains(Le.target)||(window.clearTimeout(se.current),Oe.current="")}),onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(Le=>{const He=Le.target,We=Ae.current!==Le.clientX;if(Le.currentTarget.contains(He)&&We){const ze=Le.clientX>Ae.current?"right":"left";$e.current=ze,Ae.current=Le.clientX}}))})})})})})})});MenuContent.displayName=CONTENT_NAME$8;var GROUP_NAME$2="MenuGroup",MenuGroup=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{role:"group",...o,ref:t})});MenuGroup.displayName=GROUP_NAME$2;var LABEL_NAME$2="MenuLabel",MenuLabel=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{...o,ref:t})});MenuLabel.displayName=LABEL_NAME$2;var ITEM_NAME$3="MenuItem",ITEM_SELECT="menu.itemSelect",MenuItem=React__namespace.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...l}=e,d=React__namespace.useRef(null),f=useMenuRootContext(ITEM_NAME$3,e.__scopeMenu),g=useMenuContentContext(ITEM_NAME$3,e.__scopeMenu),b=useComposedRefs(t,d),_=React__namespace.useRef(!1),S=()=>{const R=d.current;if(!n&&R){const C=new CustomEvent(ITEM_SELECT,{bubbles:!0,cancelable:!0});R.addEventListener(ITEM_SELECT,E=>o==null?void 0:o(E),{once:!0}),dispatchDiscreteCustomEvent(R,C),C.defaultPrevented?_.current=!1:f.onClose()}};return jsxRuntime.jsx(MenuItemImpl,{...l,ref:b,disabled:n,onClick:composeEventHandlers(e.onClick,S),onPointerDown:R=>{var C;(C=e.onPointerDown)==null||C.call(e,R),_.current=!0},onPointerUp:composeEventHandlers(e.onPointerUp,R=>{var C;_.current||(C=R.currentTarget)==null||C.click()}),onKeyDown:composeEventHandlers(e.onKeyDown,R=>{const C=g.searchRef.current!=="";n||C&&R.key===" "||SELECTION_KEYS$1.includes(R.key)&&(R.currentTarget.click(),R.preventDefault())})})});MenuItem.displayName=ITEM_NAME$3;var MenuItemImpl=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:l,...d}=e,f=useMenuContentContext(ITEM_NAME$3,n),g=useRovingFocusGroupScope$1(n),b=React__namespace.useRef(null),_=useComposedRefs(t,b),[S,R]=React__namespace.useState(!1),[C,E]=React__namespace.useState("");return React__namespace.useEffect(()=>{const A=b.current;A&&E((A.textContent??"").trim())},[d.children]),jsxRuntime.jsx(Collection$3.ItemSlot,{scope:n,disabled:o,textValue:l??C,children:jsxRuntime.jsx(Item$3,{asChild:!0,...g,focusable:!o,children:jsxRuntime.jsx(Primitive$4.div,{role:"menuitem","data-highlighted":S?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...d,ref:_,onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(A=>{o?f.onItemLeave(A):(f.onItemEnter(A),A.defaultPrevented||A.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(A=>f.onItemLeave(A))),onFocus:composeEventHandlers(e.onFocus,()=>R(!0)),onBlur:composeEventHandlers(e.onBlur,()=>R(!1))})})})}),CHECKBOX_ITEM_NAME$1="MenuCheckboxItem",MenuCheckboxItem=React__namespace.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...l}=e;return jsxRuntime.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:n,children:jsxRuntime.jsx(MenuItem,{role:"menuitemcheckbox","aria-checked":isIndeterminate$1(n)?"mixed":n,...l,ref:t,"data-state":getCheckedState(n),onSelect:composeEventHandlers(l.onSelect,()=>o==null?void 0:o(isIndeterminate$1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});MenuCheckboxItem.displayName=CHECKBOX_ITEM_NAME$1;var RADIO_GROUP_NAME$1="MenuRadioGroup",[RadioGroupProvider,useRadioGroupContext]=createMenuContext(RADIO_GROUP_NAME$1,{value:void 0,onValueChange:()=>{}}),MenuRadioGroup=React__namespace.forwardRef((e,t)=>{const{value:n,onValueChange:o,...l}=e,d=useCallbackRef$1(o);return jsxRuntime.jsx(RadioGroupProvider,{scope:e.__scopeMenu,value:n,onValueChange:d,children:jsxRuntime.jsx(MenuGroup,{...l,ref:t})})});MenuRadioGroup.displayName=RADIO_GROUP_NAME$1;var RADIO_ITEM_NAME$1="MenuRadioItem",MenuRadioItem=React__namespace.forwardRef((e,t)=>{const{value:n,...o}=e,l=useRadioGroupContext(RADIO_ITEM_NAME$1,e.__scopeMenu),d=n===l.value;return jsxRuntime.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:d,children:jsxRuntime.jsx(MenuItem,{role:"menuitemradio","aria-checked":d,...o,ref:t,"data-state":getCheckedState(d),onSelect:composeEventHandlers(o.onSelect,()=>{var f;return(f=l.onValueChange)==null?void 0:f.call(l,n)},{checkForDefaultPrevented:!1})})})});MenuRadioItem.displayName=RADIO_ITEM_NAME$1;var ITEM_INDICATOR_NAME$1="MenuItemIndicator",[ItemIndicatorProvider,useItemIndicatorContext]=createMenuContext(ITEM_INDICATOR_NAME$1,{checked:!1}),MenuItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...l}=e,d=useItemIndicatorContext(ITEM_INDICATOR_NAME$1,n);return jsxRuntime.jsx(Presence,{present:o||isIndeterminate$1(d.checked)||d.checked===!0,children:jsxRuntime.jsx(Primitive$4.span,{...l,ref:t,"data-state":getCheckedState(d.checked)})})});MenuItemIndicator.displayName=ITEM_INDICATOR_NAME$1;var SEPARATOR_NAME$2="MenuSeparator",MenuSeparator=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});MenuSeparator.displayName=SEPARATOR_NAME$2;var ARROW_NAME$4="MenuArrow",MenuArrow=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,l=usePopperScope$3(n);return jsxRuntime.jsx(Arrow,{...l,...o,ref:t})});MenuArrow.displayName=ARROW_NAME$4;var SUB_NAME="MenuSub",[MenuSubProvider,useMenuSubContext]=createMenuContext(SUB_NAME),MenuSub=e=>{const{__scopeMenu:t,children:n,open:o=!1,onOpenChange:l}=e,d=useMenuContext(SUB_NAME,t),f=usePopperScope$3(t),[g,b]=React__namespace.useState(null),[_,S]=React__namespace.useState(null),R=useCallbackRef$1(l);return React__namespace.useEffect(()=>(d.open===!1&&R(!1),()=>R(!1)),[d.open,R]),jsxRuntime.jsx(Root2$7,{...f,children:jsxRuntime.jsx(MenuProvider,{scope:t,open:o,onOpenChange:R,content:_,onContentChange:S,children:jsxRuntime.jsx(MenuSubProvider,{scope:t,contentId:useId(),triggerId:useId(),trigger:g,onTriggerChange:b,children:n})})})};MenuSub.displayName=SUB_NAME;var SUB_TRIGGER_NAME$1="MenuSubTrigger",MenuSubTrigger=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),o=useMenuRootContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),l=useMenuSubContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),d=useMenuContentContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),f=React__namespace.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=d,_={__scopeMenu:e.__scopeMenu},S=React__namespace.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);return React__namespace.useEffect(()=>S,[S]),React__namespace.useEffect(()=>{const R=g.current;return()=>{window.clearTimeout(R),b(null)}},[g,b]),jsxRuntime.jsx(MenuAnchor,{asChild:!0,..._,children:jsxRuntime.jsx(MenuItemImpl,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":getOpenState(n.open),...e,ref:composeRefs(t,l.onTriggerChange),onClick:R=>{var C;(C=e.onClick)==null||C.call(e,R),!(e.disabled||R.defaultPrevented)&&(R.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(R=>{d.onItemEnter(R),!R.defaultPrevented&&!e.disabled&&!n.open&&!f.current&&(d.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{n.onOpenChange(!0),S()},100))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(R=>{var E,A;S();const C=(E=n.content)==null?void 0:E.getBoundingClientRect();if(C){const M=(A=n.content)==null?void 0:A.dataset.side,I=M==="right",j=I?-5:5,q=C[I?"left":"right"],Q=C[I?"right":"left"];d.onPointerGraceIntentChange({area:[{x:R.clientX+j,y:R.clientY},{x:q,y:C.top},{x:Q,y:C.top},{x:Q,y:C.bottom},{x:q,y:C.bottom}],side:M}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.onPointerGraceIntentChange(null),300)}else{if(d.onTriggerLeave(R),R.defaultPrevented)return;d.onPointerGraceIntentChange(null)}})),onKeyDown:composeEventHandlers(e.onKeyDown,R=>{var E;const C=d.searchRef.current!=="";e.disabled||C&&R.key===" "||SUB_OPEN_KEYS[o.dir].includes(R.key)&&(n.onOpenChange(!0),(E=n.content)==null||E.focus(),R.preventDefault())})})})});MenuSubTrigger.displayName=SUB_TRIGGER_NAME$1;var SUB_CONTENT_NAME$1="MenuSubContent",MenuSubContent=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$2(CONTENT_NAME$8,e.__scopeMenu),{forceMount:o=n.forceMount,...l}=e,d=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),f=useMenuRootContext(CONTENT_NAME$8,e.__scopeMenu),g=useMenuSubContext(SUB_CONTENT_NAME$1,e.__scopeMenu),b=React__namespace.useRef(null),_=useComposedRefs(t,b);return jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeMenu,children:jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeMenu,children:jsxRuntime.jsx(MenuContentImpl,{id:g.contentId,"aria-labelledby":g.triggerId,...l,ref:_,align:"start",side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:S=>{var R;f.isUsingKeyboardRef.current&&((R=b.current)==null||R.focus()),S.preventDefault()},onCloseAutoFocus:S=>S.preventDefault(),onFocusOutside:composeEventHandlers(e.onFocusOutside,S=>{S.target!==g.trigger&&d.onOpenChange(!1)}),onEscapeKeyDown:composeEventHandlers(e.onEscapeKeyDown,S=>{f.onClose(),S.preventDefault()}),onKeyDown:composeEventHandlers(e.onKeyDown,S=>{var E;const R=S.currentTarget.contains(S.target),C=SUB_CLOSE_KEYS[f.dir].includes(S.key);R&&C&&(d.onOpenChange(!1),(E=g.trigger)==null||E.focus(),S.preventDefault())})})})})})});MenuSubContent.displayName=SUB_CONTENT_NAME$1;function getOpenState(e){return e?"open":"closed"}function isIndeterminate$1(e){return e==="indeterminate"}function getCheckedState(e){return isIndeterminate$1(e)?"indeterminate":e?"checked":"unchecked"}function focusFirst$1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wrapArray$1(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function getNextMatch(e,t,n){const l=t.length>1&&Array.from(t).every(_=>_===t[0])?t[0]:t,d=n?e.indexOf(n):-1;let f=wrapArray$1(e,Math.max(d,0));l.length===1&&(f=f.filter(_=>_!==n));const b=f.find(_=>_.toLowerCase().startsWith(l.toLowerCase()));return b!==n?b:void 0}function isPointInPolygon$1(e,t){const{x:n,y:o}=e;let l=!1;for(let d=0,f=t.length-1;d<t.length;f=d++){const g=t[d],b=t[f],_=g.x,S=g.y,R=b.x,C=b.y;S>o!=C>o&&n<(R-_)*(o-S)/(C-S)+_&&(l=!l)}return l}function isPointerInGraceArea(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return isPointInPolygon$1(n,t)}function whenMouse(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Root3$1=Menu,Anchor2$1=MenuAnchor,Portal$3=MenuPortal,Content2$6=MenuContent,Group$1=MenuGroup,Label$4=MenuLabel,Item2$1=MenuItem,CheckboxItem=MenuCheckboxItem,RadioGroup=MenuRadioGroup,RadioItem=MenuRadioItem,ItemIndicator$1=MenuItemIndicator,Separator$3=MenuSeparator,Arrow2=MenuArrow,Sub=MenuSub,SubTrigger=MenuSubTrigger,SubContent=MenuSubContent,DROPDOWN_MENU_NAME="DropdownMenu",[createDropdownMenuContext]=createContextScope$2(DROPDOWN_MENU_NAME,[createMenuScope]),useMenuScope=createMenuScope(),[DropdownMenuProvider,useDropdownMenuContext]=createDropdownMenuContext(DROPDOWN_MENU_NAME),DropdownMenu$1=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:l,defaultOpen:d,onOpenChange:f,modal:g=!0}=e,b=useMenuScope(t),_=React__namespace.useRef(null),[S,R]=useControllableState({prop:l,defaultProp:d??!1,onChange:f,caller:DROPDOWN_MENU_NAME});return jsxRuntime.jsx(DropdownMenuProvider,{scope:t,triggerId:useId(),triggerRef:_,contentId:useId(),open:S,onOpenChange:R,onOpenToggle:React__namespace.useCallback(()=>R(C=>!C),[R]),modal:g,children:jsxRuntime.jsx(Root3$1,{...b,open:S,onOpenChange:R,dir:o,modal:g,children:n})})};DropdownMenu$1.displayName=DROPDOWN_MENU_NAME;var TRIGGER_NAME$8="DropdownMenuTrigger",DropdownMenuTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...l}=e,d=useDropdownMenuContext(TRIGGER_NAME$8,n),f=useMenuScope(n);return jsxRuntime.jsx(Anchor2$1,{asChild:!0,...f,children:jsxRuntime.jsx(Primitive$4.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:composeRefs(t,d.triggerRef),onPointerDown:composeEventHandlers(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(d.onOpenToggle(),d.open||g.preventDefault())}),onKeyDown:composeEventHandlers(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&d.onOpenToggle(),g.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});DropdownMenuTrigger$1.displayName=TRIGGER_NAME$8;var PORTAL_NAME$4="DropdownMenuPortal",DropdownMenuPortal$1=e=>{const{__scopeDropdownMenu:t,...n}=e,o=useMenuScope(t);return jsxRuntime.jsx(Portal$3,{...o,...n})};DropdownMenuPortal$1.displayName=PORTAL_NAME$4;var CONTENT_NAME$7="DropdownMenuContent",DropdownMenuContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useDropdownMenuContext(CONTENT_NAME$7,n),d=useMenuScope(n),f=React__namespace.useRef(!1);return jsxRuntime.jsx(Content2$6,{id:l.contentId,"aria-labelledby":l.triggerId,...d,...o,ref:t,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,g=>{var b;f.current||(b=l.triggerRef.current)==null||b.focus(),f.current=!1,g.preventDefault()}),onInteractOutside:composeEventHandlers(e.onInteractOutside,g=>{const b=g.detail.originalEvent,_=b.button===0&&b.ctrlKey===!0,S=b.button===2||_;(!l.modal||S)&&(f.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)"}})});DropdownMenuContent$1.displayName=CONTENT_NAME$7;var GROUP_NAME$1="DropdownMenuGroup",DropdownMenuGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Group$1,{...l,...o,ref:t})});DropdownMenuGroup$1.displayName=GROUP_NAME$1;var LABEL_NAME$1="DropdownMenuLabel",DropdownMenuLabel$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Label$4,{...l,...o,ref:t})});DropdownMenuLabel$1.displayName=LABEL_NAME$1;var ITEM_NAME$2="DropdownMenuItem",DropdownMenuItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Item2$1,{...l,...o,ref:t})});DropdownMenuItem$1.displayName=ITEM_NAME$2;var CHECKBOX_ITEM_NAME="DropdownMenuCheckboxItem",DropdownMenuCheckboxItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(CheckboxItem,{...l,...o,ref:t})});DropdownMenuCheckboxItem$1.displayName=CHECKBOX_ITEM_NAME;var RADIO_GROUP_NAME="DropdownMenuRadioGroup",DropdownMenuRadioGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(RadioGroup,{...l,...o,ref:t})});DropdownMenuRadioGroup$1.displayName=RADIO_GROUP_NAME;var RADIO_ITEM_NAME="DropdownMenuRadioItem",DropdownMenuRadioItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(RadioItem,{...l,...o,ref:t})});DropdownMenuRadioItem$1.displayName=RADIO_ITEM_NAME;var INDICATOR_NAME$2="DropdownMenuItemIndicator",DropdownMenuItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(ItemIndicator$1,{...l,...o,ref:t})});DropdownMenuItemIndicator.displayName=INDICATOR_NAME$2;var SEPARATOR_NAME$1="DropdownMenuSeparator",DropdownMenuSeparator$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Separator$3,{...l,...o,ref:t})});DropdownMenuSeparator$1.displayName=SEPARATOR_NAME$1;var ARROW_NAME$3="DropdownMenuArrow",DropdownMenuArrow=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Arrow2,{...l,...o,ref:t})});DropdownMenuArrow.displayName=ARROW_NAME$3;var DropdownMenuSub$1=e=>{const{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:l,defaultOpen:d}=e,f=useMenuScope(t),[g,b]=useControllableState({prop:o,defaultProp:d??!1,onChange:l,caller:"DropdownMenuSub"});return jsxRuntime.jsx(Sub,{...f,open:g,onOpenChange:b,children:n})},SUB_TRIGGER_NAME="DropdownMenuSubTrigger",DropdownMenuSubTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(SubTrigger,{...l,...o,ref:t})});DropdownMenuSubTrigger$1.displayName=SUB_TRIGGER_NAME;var SUB_CONTENT_NAME="DropdownMenuSubContent",DropdownMenuSubContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(SubContent,{...l,...o,ref:t,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)"}})});DropdownMenuSubContent$1.displayName=SUB_CONTENT_NAME;var Root2$6=DropdownMenu$1,Trigger$5=DropdownMenuTrigger$1,Portal2$1=DropdownMenuPortal$1,Content2$5=DropdownMenuContent$1,Group2=DropdownMenuGroup$1,Label2=DropdownMenuLabel$1,Item2=DropdownMenuItem$1,CheckboxItem2=DropdownMenuCheckboxItem$1,RadioGroup2=DropdownMenuRadioGroup$1,RadioItem2=DropdownMenuRadioItem$1,ItemIndicator2=DropdownMenuItemIndicator,Separator2=DropdownMenuSeparator$1,Sub2=DropdownMenuSub$1,SubTrigger2=DropdownMenuSubTrigger$1,SubContent2=DropdownMenuSubContent$1;const DropdownMenu=Root2$6,DropdownMenuTrigger=Trigger$5,DropdownMenuGroup=Group2,DropdownMenuPortal=Portal2$1,DropdownMenuSub=Sub2,DropdownMenuRadioGroup=RadioGroup2,DropdownMenuSubTrigger=React__namespace.forwardRef(({className:e,inset:t,children:n,...o},l)=>jsxRuntime.jsxs(SubTrigger2,{ref:l,className:cn("flex cursor-default select-none items-center gap-2 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",t&&"pl-8",e),...o,children:[n,jsxRuntime.jsx(ChevronRight,{className:"ml-auto"})]}));DropdownMenuSubTrigger.displayName=SubTrigger2.displayName;const DropdownMenuSubContent=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(SubContent2,{ref:n,className:cn("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 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));DropdownMenuSubContent.displayName=SubContent2.displayName;const DropdownMenuContent=React__namespace.forwardRef(({className:e,sideOffset:t=4,...n},o)=>jsxRuntime.jsx(Portal2$1,{children:jsxRuntime.jsx(Content2$5,{ref:o,sideOffset:t,className:cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n})}));DropdownMenuContent.displayName=Content2$5.displayName;const DropdownMenuItem=React__namespace.forwardRef(({className:e,inset:t,...n},o)=>jsxRuntime.jsx(Item2,{ref:o,className:cn("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",t&&"pl-8",e),...n}));DropdownMenuItem.displayName=Item2.displayName;const DropdownMenuCheckboxItem=React__namespace.forwardRef(({className:e,children:t,checked:n,...o},l)=>jsxRuntime.jsxs(CheckboxItem2,{ref:l,className:cn("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:n,...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator2,{children:jsxRuntime.jsx(Check,{className:"h-4 w-4"})})}),t]}));DropdownMenuCheckboxItem.displayName=CheckboxItem2.displayName;const DropdownMenuRadioItem=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(RadioItem2,{ref:o,className:cn("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),...n,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator2,{children:jsxRuntime.jsx(Circle,{className:"h-2 w-2 fill-current"})})}),t]}));DropdownMenuRadioItem.displayName=RadioItem2.displayName;const DropdownMenuLabel=React__namespace.forwardRef(({className:e,inset:t,...n},o)=>jsxRuntime.jsx(Label2,{ref:o,className:cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));DropdownMenuLabel.displayName=Label2.displayName;const DropdownMenuSeparator=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Separator2,{ref:n,className:cn("-mx-1 my-1 h-px bg-muted",e),...t}));DropdownMenuSeparator.displayName=Separator2.displayName;const DropdownMenuShortcut=({className:e,...t})=>jsxRuntime.jsx("span",{className:cn("ml-auto text-xs tracking-widest opacity-60",e),...t});DropdownMenuShortcut.displayName="DropdownMenuShortcut";var REACT_LAZY_TYPE=Symbol.for("react.lazy"),use=React__namespace[" use ".trim().toString()];function isPromiseLike(e){return typeof e=="object"&&e!==null&&"then"in e}function isLazyComponent(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===REACT_LAZY_TYPE&&"_payload"in e&&isPromiseLike(e._payload)}function createSlot$2(e){const t=createSlotClone$2(e),n=React__namespace.forwardRef((o,l)=>{let{children:d,...f}=o;isLazyComponent(d)&&typeof use=="function"&&(d=use(d._payload));const g=React__namespace.Children.toArray(d),b=g.find(isSlottable$2);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}var Slot$2=createSlot$2("Slot");function createSlotClone$2(e){const t=React__namespace.forwardRef((n,o)=>{let{children:l,...d}=n;if(isLazyComponent(l)&&typeof use=="function"&&(l=use(l._payload)),React__namespace.isValidElement(l)){const f=getElementRef$2(l),g=mergeProps$2(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$4=Symbol("radix.slottable");function isSlottable$2(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$4}function mergeProps$2(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$2(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const falsyToString=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cx=clsx,cva=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return cx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:d}=t,f=Object.keys(l).map(_=>{const S=n==null?void 0:n[_],R=d==null?void 0:d[_];if(S===null)return null;const C=falsyToString(S)||falsyToString(R);return l[_][C]}),g=n&&Object.entries(n).reduce((_,S)=>{let[R,C]=S;return C===void 0||(_[R]=C),_},{}),b=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((_,S)=>{let{class:R,className:C,...E}=S;return Object.entries(E).every(A=>{let[M,I]=A;return Array.isArray(I)?I.includes({...d,...g}[M]):{...d,...g}[M]===I})?[..._,R,C]:_},[]);return cx(e,f,b,n==null?void 0:n.class,n==null?void 0:n.className)},buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input text-foreground bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",purple:"bg-randmar-purple text-gray-100 shadow-sm hover:bg-randmar-purple/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Button$1=React__namespace.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,confirmationDialog:l,onClick:d,...f},g)=>{const b=o?Slot$2:"button";if(!l)return jsxRuntime.jsx(b,{className:cn(buttonVariants({variant:t,size:n,className:e})),ref:g,onClick:d,...f});d&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:_,content:S,onConfirm:R,confirmText:C="Confirm",cancelText:E="Cancel"}=l,A=()=>{R()};return jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(b,{className:cn(buttonVariants({variant:t,size:n,className:e})),ref:g,...f})}),jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:_}),jsxRuntime.jsx(DialogDescription,{children:S})]}),jsxRuntime.jsxs(DialogFooter,{className:"flex justify-end gap-2 pt-4",children:[jsxRuntime.jsx(DialogClose,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"outline",children:E})}),jsxRuntime.jsx(DialogClose,{asChild:!0,children:jsxRuntime.jsx(Button$1,{onClick:A,children:C})})]})]})]})});Button$1.displayName="Button";function formatProdErrorMessage$1(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject$4(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function miniKindOf(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(isDate$1(e))return"date";if(isError(e))return"error";const n=ctorName(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ctorName(e){return typeof e.constructor=="function"?e.constructor.name:null}function isError(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function isDate$1(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kindOf(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=miniKindOf(e)),t}function warning(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function getUnexpectedStateShapeWarningMessage(e,t,n,o){const l=Object.keys(t),d=n&&n.type===actionTypes_default.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(l.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!isPlainObject$4(e))return`The ${d} has unexpected type of "${kindOf(e)}". Expected argument to be an object with the following keys: "${l.join('", "')}"`;const f=Object.keys(e).filter(g=>!t.hasOwnProperty(g)&&!o[g]);if(f.forEach(g=>{o[g]=!0}),!(n&&n.type===actionTypes_default.REPLACE)&&f.length>0)return`Unexpected ${f.length>1?"keys":"key"} "${f.join('", "')}" found in ${d}. Expected to find one of the known reducer keys instead: "${l.join('", "')}". Unexpected keys will be ignored.`}function assertReducerShape(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function combineReducers(e){const t=Object.keys(e),n={};for(let f=0;f<t.length;f++){const g=t[f];process.env.NODE_ENV!=="production"&&typeof e[g]>"u"&&warning(`No reducer provided for key "${g}"`),typeof e[g]=="function"&&(n[g]=e[g])}const o=Object.keys(n);let l;process.env.NODE_ENV!=="production"&&(l={});let d;try{assertReducerShape(n)}catch(f){d=f}return function(g={},b){if(d)throw d;if(process.env.NODE_ENV!=="production"){const R=getUnexpectedStateShapeWarningMessage(g,n,b,l);R&&warning(R)}let _=!1;const S={};for(let R=0;R<o.length;R++){const C=o[R],E=n[C],A=g[C],M=E(A,b);if(typeof M>"u"){const I=b&&b.type;throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(14):`When called with an action of type ${I?`"${String(I)}"`:"(unknown type)"}, the slice reducer for key "${C}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}S[C]=M,_=_||M!==A}return _=_||o.length!==Object.keys(g).length,_?S:g}}function isAction(e){return isPlainObject$4(e)&&"type"in e&&typeof e.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state"),errors=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function die(e,...t){if(process.env.NODE_ENV!=="production"){const n=errors[e],o=isFunction$6(n)?n.apply(null,t):n;throw new Error(`[Immer] ${o}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var O=Object,getPrototypeOf$1=O.getPrototypeOf,CONSTRUCTOR="constructor",PROTOTYPE="prototype",CONFIGURABLE="configurable",ENUMERABLE="enumerable",WRITABLE="writable",VALUE="value",isDraft=e=>!!e&&!!e[DRAFT_STATE];function isDraftable(e){var t;return e?isPlainObject$3(e)||isArray$2(e)||!!e[DRAFTABLE]||!!((t=e[CONSTRUCTOR])!=null&&t[DRAFTABLE])||isMap(e)||isSet(e):!1}var objectCtorString=O[PROTOTYPE][CONSTRUCTOR].toString(),cachedCtorStrings=new WeakMap;function isPlainObject$3(e){if(!e||!isObjectish(e))return!1;const t=getPrototypeOf$1(e);if(t===null||t===O[PROTOTYPE])return!0;const n=O.hasOwnProperty.call(t,CONSTRUCTOR)&&t[CONSTRUCTOR];if(n===Object)return!0;if(!isFunction$6(n))return!1;let o=cachedCtorStrings.get(n);return o===void 0&&(o=Function.toString.call(n),cachedCtorStrings.set(n,o)),o===objectCtorString}function original(e){return isDraft(e)||die(15,e),e[DRAFT_STATE].base_}function each(e,t,n=!0){getArchtype(e)===0?(n?Reflect.ownKeys(e):O.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((o,l)=>t(l,o,e))}function getArchtype(e){const t=e[DRAFT_STATE];return t?t.type_:isArray$2(e)?1:isMap(e)?2:isSet(e)?3:0}var has$1=(e,t,n=getArchtype(e))=>n===2?e.has(t):O[PROTOTYPE].hasOwnProperty.call(e,t),get$3=(e,t,n=getArchtype(e))=>n===2?e.get(t):e[t],set$2=(e,t,n,o=getArchtype(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function is$1(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var isArray$2=Array.isArray,isMap=e=>e instanceof Map,isSet=e=>e instanceof Set,isObjectish=e=>typeof e=="object",isFunction$6=e=>typeof e=="function",isBoolean$2=e=>typeof e=="boolean",getProxyDraft=e=>isObjectish(e)?e==null?void 0:e[DRAFT_STATE]:null,latest=e=>e.copy_||e.base_,getFinalValue=e=>e.modified_?e.copy_:e.base_;function shallowCopy(e,t){if(isMap(e))return new Map(e);if(isSet(e))return new Set(e);if(isArray$2(e))return Array[PROTOTYPE].slice.call(e);const n=isPlainObject$3(e);if(t===!0||t==="class_only"&&!n){const o=O.getOwnPropertyDescriptors(e);delete o[DRAFT_STATE];let l=Reflect.ownKeys(o);for(let d=0;d<l.length;d++){const f=l[d],g=o[f];g[WRITABLE]===!1&&(g[WRITABLE]=!0,g[CONFIGURABLE]=!0),(g.get||g.set)&&(o[f]={[CONFIGURABLE]:!0,[WRITABLE]:!0,[ENUMERABLE]:g[ENUMERABLE],[VALUE]:e[f]})}return O.create(getPrototypeOf$1(e),o)}else{const o=getPrototypeOf$1(e);if(o!==null&&n)return{...e};const l=O.create(o);return O.assign(l,e)}}function freeze$1(e,t=!1){return isFrozen$1(e)||isDraft(e)||(getArchtype(e)>1&&O.defineProperties(e,{set:dontMutateMethodOverride,add:dontMutateMethodOverride,clear:dontMutateMethodOverride,delete:dontMutateMethodOverride}),O.freeze(e),t&&each(e,(n,o)=>{freeze$1(o,!0)},!1)),e}function dontMutateFrozenCollections(){die(2)}var dontMutateMethodOverride={[VALUE]:dontMutateFrozenCollections};function isFrozen$1(e){return e===null||!isObjectish(e)?!0:O.isFrozen(e)}var PluginMapSet="MapSet",PluginPatches="Patches",plugins={};function getPlugin(e){const t=plugins[e];return t||die(0,e),t}var isPluginLoaded=e=>!!plugins[e];function loadPlugin(e,t){plugins[e]||(plugins[e]=t)}var currentScope,getCurrentScope=()=>currentScope,createScope=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(PluginMapSet)?getPlugin(PluginMapSet):void 0});function usePatchesInScope(e,t){t&&(e.patchPlugin_=getPlugin(PluginPatches),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function revokeScope(e){leaveScope(e),e.drafts_.forEach(revokeDraft),e.drafts_=null}function leaveScope(e){e===currentScope&&(currentScope=e.parent_)}var enterScope=e=>currentScope=createScope(currentScope,e);function revokeDraft(e){const t=e[DRAFT_STATE];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function processResult(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[DRAFT_STATE].modified_&&(revokeScope(t),die(4)),isDraftable(e)&&(e=finalize(t,e));const{patchPlugin_:l}=t;l&&l.generateReplacementPatches_(n[DRAFT_STATE].base_,e,t)}else e=finalize(t,n);return maybeFreeze(t,e,!0),revokeScope(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NOTHING?e:void 0}function finalize(e,t){if(isFrozen$1(t))return t;const n=t[DRAFT_STATE];if(!n)return handleValue(t,e.handledSet_,e);if(!isSameScope(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);generatePatchesAndFinalize(n,e)}return n.copy_}function maybeFreeze(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&freeze$1(t,n)}function markStateFinalized(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var isSameScope=(e,t)=>e.scope_===t,EMPTY_LOCATIONS_RESULT=[];function updateDraftInParent(e,t,n,o){const l=latest(e),d=e.type_;if(o!==void 0&&get$3(l,o,d)===t){set$2(l,o,n,d);return}if(!e.draftLocations_){const g=e.draftLocations_=new Map;each(l,(b,_)=>{if(isDraft(_)){const S=g.get(_)||[];S.push(b),g.set(_,S)}})}const f=e.draftLocations_.get(t)??EMPTY_LOCATIONS_RESULT;for(const g of f)set$2(l,g,n,d)}function registerChildFinalizationCallback(e,t,n){e.callbacks_.push(function(l){var g;const d=t;if(!d||!isSameScope(d,l))return;(g=l.mapSetPlugin_)==null||g.fixSetContents(d);const f=getFinalValue(d);updateDraftInParent(e,d.draft_??d,f,n),generatePatchesAndFinalize(d,l)})}function generatePatchesAndFinalize(e,t){var o;if(e.modified_&&!e.finalized_&&(e.type_===3||(((o=e.assigned_)==null?void 0:o.size)??0)>0)){const{patchPlugin_:l}=t;if(l){const d=l.getPath(e);d&&l.generatePatches_(e,d,t)}markStateFinalized(e)}}function handleCrossReference(e,t,n){const{scope_:o}=e;if(isDraft(n)){const l=n[DRAFT_STATE];isSameScope(l,o)&&l.callbacks_.push(function(){prepareCopy(e);const f=getFinalValue(l);updateDraftInParent(e,n,f,t)})}else isDraftable(n)&&e.callbacks_.push(function(){const d=latest(e);get$3(d,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&handleValue(get$3(e.copy_,t,e.type_),o.handledSet_,o)})}function handleValue(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||isDraft(e)||t.has(e)||!isDraftable(e)||isFrozen$1(e)||(t.add(e),each(e,(o,l)=>{if(isDraft(l)){const d=l[DRAFT_STATE];if(isSameScope(d,n)){const f=getFinalValue(d);set$2(e,o,f,e.type_),markStateFinalized(d)}}else isDraftable(l)&&handleValue(l,t,n)})),e}function createProxyProxy(e,t){const n=isArray$2(e),o={type_:n?1:0,scope_:t?t.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=o,d=objectTraps;n&&(l=[o],d=arrayTraps);const{revoke:f,proxy:g}=Proxy.revocable(l,d);return o.draft_=g,o.revoke_=f,[g,o]}var objectTraps={get(e,t){if(t===DRAFT_STATE)return e;const n=latest(e);if(!has$1(n,t,e.type_))return readPropFromProto(e,n,t);const o=n[t];if(e.finalized_||!isDraftable(o))return o;if(o===peek(e.base_,t)){prepareCopy(e);const l=e.type_===1?+t:t,d=createProxy(e.scope_,o,e,l);return e.copy_[l]=d}return o},has(e,t){return t in latest(e)},ownKeys(e){return Reflect.ownKeys(latest(e))},set(e,t,n){const o=getDescriptorFromProto(latest(e),t);if(o!=null&&o.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const l=peek(latest(e),t),d=l==null?void 0:l[DRAFT_STATE];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(is$1(n,l)&&(n!==void 0||has$1(e.base_,t,e.type_)))return!0;prepareCopy(e),markChanged(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),handleCrossReference(e,t,n)),!0},deleteProperty(e,t){return prepareCopy(e),peek(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),markChanged(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=latest(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[WRITABLE]:!0,[CONFIGURABLE]:e.type_!==1||t!=="length",[ENUMERABLE]:o[ENUMERABLE],[VALUE]:n[t]}},defineProperty(){die(11)},getPrototypeOf(e){return getPrototypeOf$1(e.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(e,t)=>{arrayTraps[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}),arrayTraps.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&die(13),arrayTraps.set.call(this,e,t,void 0)},arrayTraps.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&die(14),objectTraps.set.call(this,e[0],t,n,e[0])};function peek(e,t){const n=e[DRAFT_STATE];return(n?latest(n):e)[t]}function readPropFromProto(e,t,n){var l;const o=getDescriptorFromProto(t,n);return o?VALUE in o?o[VALUE]:(l=o.get)==null?void 0:l.call(e.draft_):void 0}function getDescriptorFromProto(e,t){if(!(t in e))return;let n=getPrototypeOf$1(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=getPrototypeOf$1(n)}}function markChanged(e){e.modified_||(e.modified_=!0,e.parent_&&markChanged(e.parent_))}function prepareCopy(e){e.copy_||(e.assigned_=new Map,e.copy_=shallowCopy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(isFunction$6(t)&&!isFunction$6(n)){const d=n;n=t;const f=this;return function(b=d,..._){return f.produce(b,S=>n.call(this,S,..._))}}isFunction$6(n)||die(6),o!==void 0&&!isFunction$6(o)&&die(7);let l;if(isDraftable(t)){const d=enterScope(this),f=createProxy(d,t,void 0);let g=!0;try{l=n(f),g=!1}finally{g?revokeScope(d):leaveScope(d)}return usePatchesInScope(d,o),processResult(l,d)}else if(!t||!isObjectish(t)){if(l=n(t),l===void 0&&(l=t),l===NOTHING&&(l=void 0),this.autoFreeze_&&freeze$1(l,!0),o){const d=[],f=[];getPlugin(PluginPatches).generateReplacementPatches_(t,l,{patches_:d,inversePatches_:f}),o(d,f)}return l}else die(1,t)},this.produceWithPatches=(t,n)=>{if(isFunction$6(t))return(f,...g)=>this.produceWithPatches(f,b=>t(b,...g));let o,l;return[this.produce(t,n,(f,g)=>{o=f,l=g}),o,l]},isBoolean$2(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),isBoolean$2(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),isBoolean$2(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){isDraftable(e)||die(8),isDraft(e)&&(e=current(e));const t=enterScope(this),n=createProxy(t,e,void 0);return n[DRAFT_STATE].isManual_=!0,leaveScope(t),n}finishDraft(e,t){const n=e&&e[DRAFT_STATE];(!n||!n.isManual_)&&die(9);const{scope_:o}=n;return usePatchesInScope(o,t),processResult(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const l=t[n];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}n>-1&&(t=t.slice(n+1));const o=getPlugin(PluginPatches).applyPatches_;return isDraft(e)?o(e,t):this.produce(e,l=>o(l,t))}};function createProxy(e,t,n,o){const[l,d]=isMap(t)?getPlugin(PluginMapSet).proxyMap_(t,n):isSet(t)?getPlugin(PluginMapSet).proxySet_(t,n):createProxyProxy(t,n);return((n==null?void 0:n.scope_)??getCurrentScope()).drafts_.push(l),d.callbacks_=(n==null?void 0:n.callbacks_)??[],d.key_=o,n&&o!==void 0?registerChildFinalizationCallback(n,d,o):d.callbacks_.push(function(b){var S;(S=b.mapSetPlugin_)==null||S.fixSetContents(d);const{patchPlugin_:_}=b;d.modified_&&_&&_.generatePatches_(d,[],b)}),l}function current(e){return isDraft(e)||die(10,e),currentImpl(e)}function currentImpl(e){if(!isDraftable(e)||isFrozen$1(e))return e;const t=e[DRAFT_STATE];let n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=shallowCopy(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=shallowCopy(e,!0);return each(n,(l,d)=>{set$2(n,l,currentImpl(d))},o),t&&(t.finalized_=!1),n}function enablePatches(){process.env.NODE_ENV!=="production"&&errors.push('Sets cannot have "replace" patches.',function(A){return"Unsupported patch operation: "+A},function(A){return"Cannot apply patch, path doesn't resolve: "+A},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(A,M=[]){if("key_"in A&&A.key_!==void 0){const I=A.parent_.copy_??A.parent_.base_,j=getProxyDraft(get$3(I,A.key_)),q=get$3(I,A.key_);if(q===void 0||q!==A.draft_&&q!==A.base_&&q!==A.copy_||j!=null&&j.base_!==A.base_)return null;const Q=A.parent_.type_===3;let te;if(Q){const F=A.parent_;te=Array.from(F.drafts_.keys()).indexOf(A.key_)}else te=A.key_;if(!(Q&&I.size>te||has$1(I,te)))return null;M.push(te)}if(A.parent_)return t(A.parent_,M);M.reverse();try{n(A.copy_,M)}catch{return null}return M}function n(A,M){let I=A;for(let j=0;j<M.length-1;j++){const q=M[j];if(I=get$3(I,q),!isObjectish(I)||I===null)throw new Error(`Cannot resolve path at '${M.join("/")}'`)}return I}const o="replace",l="add",d="remove";function f(A,M,I){if(A.scope_.processedForPatches_.has(A))return;A.scope_.processedForPatches_.add(A);const{patches_:j,inversePatches_:q}=I;switch(A.type_){case 0:case 2:return b(A,M,j,q);case 1:return g(A,M,j,q);case 3:return _(A,M,j,q)}}function g(A,M,I,j){let{base_:q,assigned_:Q}=A,te=A.copy_;te.length<q.length&&([q,te]=[te,q],[I,j]=[j,I]);for(let F=0;F<q.length;F++){const V=te[F],ne=q[F];if(Q!=null&&Q.get(F.toString())&&V!==ne){const ae=V==null?void 0:V[DRAFT_STATE];if(ae&&ae.modified_)continue;const se=M.concat([F]);I.push({op:o,path:se,value:E(V)}),j.push({op:o,path:se,value:E(ne)})}}for(let F=q.length;F<te.length;F++){const V=M.concat([F]);I.push({op:l,path:V,value:E(te[F])})}for(let F=te.length-1;q.length<=F;--F){const V=M.concat([F]);j.push({op:d,path:V})}}function b(A,M,I,j){const{base_:q,copy_:Q,type_:te}=A;each(A.assigned_,(F,V)=>{const ne=get$3(q,F,te),ae=get$3(Q,F,te),se=V?has$1(q,F)?o:l:d;if(ne===ae&&se===o)return;const Oe=M.concat(F);I.push(se===d?{op:se,path:Oe}:{op:se,path:Oe,value:E(ae)}),j.push(se===l?{op:d,path:Oe}:se===d?{op:l,path:Oe,value:E(ne)}:{op:o,path:Oe,value:E(ne)})})}function _(A,M,I,j){let{base_:q,copy_:Q}=A,te=0;q.forEach(F=>{if(!Q.has(F)){const V=M.concat([te]);I.push({op:d,path:V,value:F}),j.unshift({op:l,path:V,value:F})}te++}),te=0,Q.forEach(F=>{if(!q.has(F)){const V=M.concat([te]);I.push({op:l,path:V,value:F}),j.unshift({op:d,path:V,value:F})}te++})}function S(A,M,I){const{patches_:j,inversePatches_:q}=I;j.push({op:o,path:[],value:M===NOTHING?void 0:M}),q.push({op:o,path:[],value:A})}function R(A,M){return M.forEach(I=>{const{path:j,op:q}=I;let Q=A;for(let ne=0;ne<j.length-1;ne++){const ae=getArchtype(Q);let se=j[ne];typeof se!="string"&&typeof se!="number"&&(se=""+se),(ae===0||ae===1)&&(se==="__proto__"||se===CONSTRUCTOR)&&die(19),isFunction$6(Q)&&se===PROTOTYPE&&die(19),Q=get$3(Q,se),isObjectish(Q)||die(18,j.join("/"))}const te=getArchtype(Q),F=C(I.value),V=j[j.length-1];switch(q){case o:switch(te){case 2:return Q.set(V,F);case 3:die(16);default:return Q[V]=F}case l:switch(te){case 1:return V==="-"?Q.push(F):Q.splice(V,0,F);case 2:return Q.set(V,F);case 3:return Q.add(F);default:return Q[V]=F}case d:switch(te){case 1:return Q.splice(V,1);case 2:return Q.delete(V);case 3:return Q.delete(I.value);default:return delete Q[V]}default:die(17,q)}}),A}function C(A){if(!isDraftable(A))return A;if(isArray$2(A))return A.map(C);if(isMap(A))return new Map(Array.from(A.entries()).map(([I,j])=>[I,C(j)]));if(isSet(A))return new Set(Array.from(A).map(C));const M=Object.create(getPrototypeOf$1(A));for(const I in A)M[I]=C(A[I]);return has$1(A,DRAFTABLE)&&(M[DRAFTABLE]=A[DRAFTABLE]),M}function E(A){return isDraft(A)?C(A):A}loadPlugin(PluginPatches,{applyPatches_:R,generatePatches_:f,generateReplacementPatches_:S,getPath:t})}var immer=new Immer2,produce=immer.produce,produceWithPatches=immer.produceWithPatches.bind(immer),applyPatches=immer.applyPatches.bind(immer),runIdentityFunctionCheck=(e,t,n)=>{if(t.length===1&&t[0]===n){let o=!1;try{const l={};e(l)===l&&(o=!0)}catch{}if(o){let l;try{throw new Error}catch(d){({stack:l}=d)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
519
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;return React__namespace.useEffect(()=>{e&&(document.getElementById(e)||console.error(n))},[n,e]),null},DESCRIPTION_WARNING_NAME="DialogDescriptionWarning",DescriptionWarning$1=({contentRef:e,descriptionId:t})=>{const o=`Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${useWarningContext(DESCRIPTION_WARNING_NAME).contentName}}.`;return React__namespace.useEffect(()=>{var d;const l=(d=e.current)==null?void 0:d.getAttribute("aria-describedby");t&&l&&(document.getElementById(t)||console.warn(o))},[o,e,t]),null},Root$a=Dialog$1,Trigger$6=DialogTrigger$1,Portal$4=DialogPortal$1,Overlay=DialogOverlay$1,Content$3=DialogContent$1,Title$1=DialogTitle$1,Description$1=DialogDescription$1,Close$1=DialogClose$1;const Dialog=({modal:e=!1,...t})=>jsxRuntime.jsx(Root$a,{modal:e,...t});Dialog.displayName=Root$a.displayName;const DialogTrigger=Trigger$6,DialogPortal=Portal$4,DialogClose=Close$1,DialogOverlay=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Overlay,{ref:n,className:cn("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",e),...t}));DialogOverlay.displayName=Overlay.displayName;const DialogContent=React__namespace.forwardRef(({className:e,children:t,animateExit:n=!0,...o},l)=>jsxRuntime.jsxs(DialogPortal,{forceMount:o.forceMount,children:[jsxRuntime.jsx(DialogOverlay,{}),jsxRuntime.jsxs(Content$3,{ref:l,className:cn("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-2xl shadow-primary duration-200 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",n&&"data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%]",e),...o,children:[t,jsxRuntime.jsxs(Close$1,{className:"absolute right-4 top-4 rounded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-hidden focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[jsxRuntime.jsx(X$1,{className:"h-4 w-4"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));DialogContent.displayName=Content$3.displayName;const DialogHeader=({className:e,...t})=>jsxRuntime.jsx("div",{className:cn("flex flex-col space-y-1.5 text-center sm:text-left",e),...t});DialogHeader.displayName="DialogHeader";const DialogFooter=({className:e,...t})=>jsxRuntime.jsx("div",{className:cn("flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2",e),...t});DialogFooter.displayName="DialogFooter";const DialogTitle=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Title$1,{ref:n,className:cn("text-lg font-semibold leading-none tracking-tight",e),...t}));DialogTitle.displayName=Title$1.displayName;const DialogDescription=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Description$1,{ref:n,className:cn("text-sm text-muted-foreground",e),...t}));DialogDescription.displayName=Description$1.displayName;const sides=["top","right","bottom","left"],min$4=Math.min,max$4=Math.max,round$1=Math.round,floor=Math.floor,createCoords=e=>({x:e,y:e}),oppositeSideMap={left:"right",right:"left",bottom:"top",top:"bottom"},oppositeAlignmentMap={start:"end",end:"start"};function clamp$1(e,t,n){return max$4(e,min$4(t,n))}function evaluate(e,t){return typeof e=="function"?e(t):e}function getSide$1(e){return e.split("-")[0]}function getAlignment(e){return e.split("-")[1]}function getOppositeAxis(e){return e==="x"?"y":"x"}function getAxisLength(e){return e==="y"?"height":"width"}const yAxisSides=new Set(["top","bottom"]);function getSideAxis(e){return yAxisSides.has(getSide$1(e))?"y":"x"}function getAlignmentAxis(e){return getOppositeAxis(getSideAxis(e))}function getAlignmentSides(e,t,n){n===void 0&&(n=!1);const o=getAlignment(e),l=getAlignmentAxis(e),d=getAxisLength(l);let f=l==="x"?o===(n?"end":"start")?"right":"left":o==="start"?"bottom":"top";return t.reference[d]>t.floating[d]&&(f=getOppositePlacement(f)),[f,getOppositePlacement(f)]}function getExpandedPlacements(e){const t=getOppositePlacement(e);return[getOppositeAlignmentPlacement(e),t,getOppositeAlignmentPlacement(t)]}function getOppositeAlignmentPlacement(e){return e.replace(/start|end/g,t=>oppositeAlignmentMap[t])}const lrPlacement=["left","right"],rlPlacement=["right","left"],tbPlacement=["top","bottom"],btPlacement=["bottom","top"];function getSideList(e,t,n){switch(e){case"top":case"bottom":return n?t?rlPlacement:lrPlacement:t?lrPlacement:rlPlacement;case"left":case"right":return t?tbPlacement:btPlacement;default:return[]}}function getOppositeAxisPlacements(e,t,n,o){const l=getAlignment(e);let d=getSideList(getSide$1(e),n==="start",o);return l&&(d=d.map(f=>f+"-"+l),t&&(d=d.concat(d.map(getOppositeAlignmentPlacement)))),d}function getOppositePlacement(e){return e.replace(/left|right|bottom|top/g,t=>oppositeSideMap[t])}function expandPaddingObject(e){return{top:0,right:0,bottom:0,left:0,...e}}function getPaddingObject(e){return typeof e!="number"?expandPaddingObject(e):{top:e,right:e,bottom:e,left:e}}function rectToClientRect(e){const{x:t,y:n,width:o,height:l}=e;return{width:o,height:l,top:n,left:t,right:t+o,bottom:n+l,x:t,y:n}}function computeCoordsFromPlacement(e,t,n){let{reference:o,floating:l}=e;const d=getSideAxis(t),f=getAlignmentAxis(t),g=getAxisLength(f),b=getSide$1(t),_=d==="y",S=o.x+o.width/2-l.width/2,R=o.y+o.height/2-l.height/2,C=o[g]/2-l[g]/2;let E;switch(b){case"top":E={x:S,y:o.y-l.height};break;case"bottom":E={x:S,y:o.y+o.height};break;case"right":E={x:o.x+o.width,y:R};break;case"left":E={x:o.x-l.width,y:R};break;default:E={x:o.x,y:o.y}}switch(getAlignment(t)){case"start":E[f]-=C*(n&&_?-1:1);break;case"end":E[f]+=C*(n&&_?-1:1);break}return E}const computePosition$1=async(e,t,n)=>{const{placement:o="bottom",strategy:l="absolute",middleware:d=[],platform:f}=n,g=d.filter(Boolean),b=await(f.isRTL==null?void 0:f.isRTL(t));let _=await f.getElementRects({reference:e,floating:t,strategy:l}),{x:S,y:R}=computeCoordsFromPlacement(_,o,b),C=o,E={},A=0;for(let M=0;M<g.length;M++){const{name:I,fn:j}=g[M],{x:q,y:Q,data:te,reset:F}=await j({x:S,y:R,initialPlacement:o,placement:C,strategy:l,middlewareData:E,rects:_,platform:f,elements:{reference:e,floating:t}});S=q??S,R=Q??R,E={...E,[I]:{...E[I],...te}},F&&A<=50&&(A++,typeof F=="object"&&(F.placement&&(C=F.placement),F.rects&&(_=F.rects===!0?await f.getElementRects({reference:e,floating:t,strategy:l}):F.rects),{x:S,y:R}=computeCoordsFromPlacement(_,C,b)),M=-1)}return{x:S,y:R,placement:C,strategy:l,middlewareData:E}};async function detectOverflow(e,t){var n;t===void 0&&(t={});const{x:o,y:l,platform:d,rects:f,elements:g,strategy:b}=e,{boundary:_="clippingAncestors",rootBoundary:S="viewport",elementContext:R="floating",altBoundary:C=!1,padding:E=0}=evaluate(t,e),A=getPaddingObject(E),I=g[C?R==="floating"?"reference":"floating":R],j=rectToClientRect(await d.getClippingRect({element:(n=await(d.isElement==null?void 0:d.isElement(I)))==null||n?I:I.contextElement||await(d.getDocumentElement==null?void 0:d.getDocumentElement(g.floating)),boundary:_,rootBoundary:S,strategy:b})),q=R==="floating"?{x:o,y:l,width:f.floating.width,height:f.floating.height}:f.reference,Q=await(d.getOffsetParent==null?void 0:d.getOffsetParent(g.floating)),te=await(d.isElement==null?void 0:d.isElement(Q))?await(d.getScale==null?void 0:d.getScale(Q))||{x:1,y:1}:{x:1,y:1},F=rectToClientRect(d.convertOffsetParentRelativeRectToViewportRelativeRect?await d.convertOffsetParentRelativeRectToViewportRelativeRect({elements:g,rect:q,offsetParent:Q,strategy:b}):q);return{top:(j.top-F.top+A.top)/te.y,bottom:(F.bottom-j.bottom+A.bottom)/te.y,left:(j.left-F.left+A.left)/te.x,right:(F.right-j.right+A.right)/te.x}}const arrow$4=e=>({name:"arrow",options:e,async fn(t){const{x:n,y:o,placement:l,rects:d,platform:f,elements:g,middlewareData:b}=t,{element:_,padding:S=0}=evaluate(e,t)||{};if(_==null)return{};const R=getPaddingObject(S),C={x:n,y:o},E=getAlignmentAxis(l),A=getAxisLength(E),M=await f.getDimensions(_),I=E==="y",j=I?"top":"left",q=I?"bottom":"right",Q=I?"clientHeight":"clientWidth",te=d.reference[A]+d.reference[E]-C[E]-d.floating[A],F=C[E]-d.reference[E],V=await(f.getOffsetParent==null?void 0:f.getOffsetParent(_));let ne=V?V[Q]:0;(!ne||!await(f.isElement==null?void 0:f.isElement(V)))&&(ne=g.floating[Q]||d.floating[A]);const ae=te/2-F/2,se=ne/2-M[A]/2-1,Oe=min$4(R[j],se),Ne=min$4(R[q],se),oe=Oe,$e=ne-M[A]-Ne,Ae=ne/2-M[A]/2+ae,je=clamp$1(oe,Ae,$e),Be=!b.arrow&&getAlignment(l)!=null&&Ae!==je&&d.reference[A]/2-(Ae<oe?Oe:Ne)-M[A]/2<0,qe=Be?Ae<oe?Ae-oe:Ae-$e:0;return{[E]:C[E]+qe,data:{[E]:je,centerOffset:Ae-je-qe,...Be&&{alignmentOffset:qe}},reset:Be}}}),flip$2=function(e){return e===void 0&&(e={}),{name:"flip",options:e,async fn(t){var n,o;const{placement:l,middlewareData:d,rects:f,initialPlacement:g,platform:b,elements:_}=t,{mainAxis:S=!0,crossAxis:R=!0,fallbackPlacements:C,fallbackStrategy:E="bestFit",fallbackAxisSideDirection:A="none",flipAlignment:M=!0,...I}=evaluate(e,t);if((n=d.arrow)!=null&&n.alignmentOffset)return{};const j=getSide$1(l),q=getSideAxis(g),Q=getSide$1(g)===g,te=await(b.isRTL==null?void 0:b.isRTL(_.floating)),F=C||(Q||!M?[getOppositePlacement(g)]:getExpandedPlacements(g)),V=A!=="none";!C&&V&&F.push(...getOppositeAxisPlacements(g,M,A,te));const ne=[g,...F],ae=await detectOverflow(t,I),se=[];let Oe=((o=d.flip)==null?void 0:o.overflows)||[];if(S&&se.push(ae[j]),R){const Ae=getAlignmentSides(l,f,te);se.push(ae[Ae[0]],ae[Ae[1]])}if(Oe=[...Oe,{placement:l,overflows:se}],!se.every(Ae=>Ae<=0)){var Ne,oe;const Ae=(((Ne=d.flip)==null?void 0:Ne.index)||0)+1,je=ne[Ae];if(je&&(!(R==="alignment"?q!==getSideAxis(je):!1)||Oe.every(Ve=>getSideAxis(Ve.placement)===q?Ve.overflows[0]>0:!0)))return{data:{index:Ae,overflows:Oe},reset:{placement:je}};let Be=(oe=Oe.filter(qe=>qe.overflows[0]<=0).sort((qe,Ve)=>qe.overflows[1]-Ve.overflows[1])[0])==null?void 0:oe.placement;if(!Be)switch(E){case"bestFit":{var $e;const qe=($e=Oe.filter(Ve=>{if(V){const Le=getSideAxis(Ve.placement);return Le===q||Le==="y"}return!0}).map(Ve=>[Ve.placement,Ve.overflows.filter(Le=>Le>0).reduce((Le,He)=>Le+He,0)]).sort((Ve,Le)=>Ve[1]-Le[1])[0])==null?void 0:$e[0];qe&&(Be=qe);break}case"initialPlacement":Be=g;break}if(l!==Be)return{reset:{placement:Be}}}return{}}}};function getSideOffsets(e,t){return{top:e.top-t.height,right:e.right-t.width,bottom:e.bottom-t.height,left:e.left-t.width}}function isAnySideFullyClipped(e){return sides.some(t=>e[t]>=0)}const hide$2=function(e){return e===void 0&&(e={}),{name:"hide",options:e,async fn(t){const{rects:n}=t,{strategy:o="referenceHidden",...l}=evaluate(e,t);switch(o){case"referenceHidden":{const d=await detectOverflow(t,{...l,elementContext:"reference"}),f=getSideOffsets(d,n.reference);return{data:{referenceHiddenOffsets:f,referenceHidden:isAnySideFullyClipped(f)}}}case"escaped":{const d=await detectOverflow(t,{...l,altBoundary:!0}),f=getSideOffsets(d,n.floating);return{data:{escapedOffsets:f,escaped:isAnySideFullyClipped(f)}}}default:return{}}}}},originSides=new Set(["left","top"]);async function convertValueToCoords(e,t){const{placement:n,platform:o,elements:l}=e,d=await(o.isRTL==null?void 0:o.isRTL(l.floating)),f=getSide$1(n),g=getAlignment(n),b=getSideAxis(n)==="y",_=originSides.has(f)?-1:1,S=d&&b?-1:1,R=evaluate(t,e);let{mainAxis:C,crossAxis:E,alignmentAxis:A}=typeof R=="number"?{mainAxis:R,crossAxis:0,alignmentAxis:null}:{mainAxis:R.mainAxis||0,crossAxis:R.crossAxis||0,alignmentAxis:R.alignmentAxis};return g&&typeof A=="number"&&(E=g==="end"?A*-1:A),b?{x:E*S,y:C*_}:{x:C*_,y:E*S}}const offset$2=function(e){return e===void 0&&(e=0),{name:"offset",options:e,async fn(t){var n,o;const{x:l,y:d,placement:f,middlewareData:g}=t,b=await convertValueToCoords(t,e);return f===((n=g.offset)==null?void 0:n.placement)&&(o=g.arrow)!=null&&o.alignmentOffset?{}:{x:l+b.x,y:d+b.y,data:{...b,placement:f}}}}},shift$3=function(e){return e===void 0&&(e={}),{name:"shift",options:e,async fn(t){const{x:n,y:o,placement:l}=t,{mainAxis:d=!0,crossAxis:f=!1,limiter:g={fn:I=>{let{x:j,y:q}=I;return{x:j,y:q}}},...b}=evaluate(e,t),_={x:n,y:o},S=await detectOverflow(t,b),R=getSideAxis(getSide$1(l)),C=getOppositeAxis(R);let E=_[C],A=_[R];if(d){const I=C==="y"?"top":"left",j=C==="y"?"bottom":"right",q=E+S[I],Q=E-S[j];E=clamp$1(q,E,Q)}if(f){const I=R==="y"?"top":"left",j=R==="y"?"bottom":"right",q=A+S[I],Q=A-S[j];A=clamp$1(q,A,Q)}const M=g.fn({...t,[C]:E,[R]:A});return{...M,data:{x:M.x-n,y:M.y-o,enabled:{[C]:d,[R]:f}}}}}},limitShift$2=function(e){return e===void 0&&(e={}),{options:e,fn(t){const{x:n,y:o,placement:l,rects:d,middlewareData:f}=t,{offset:g=0,mainAxis:b=!0,crossAxis:_=!0}=evaluate(e,t),S={x:n,y:o},R=getSideAxis(l),C=getOppositeAxis(R);let E=S[C],A=S[R];const M=evaluate(g,t),I=typeof M=="number"?{mainAxis:M,crossAxis:0}:{mainAxis:0,crossAxis:0,...M};if(b){const Q=C==="y"?"height":"width",te=d.reference[C]-d.floating[Q]+I.mainAxis,F=d.reference[C]+d.reference[Q]-I.mainAxis;E<te?E=te:E>F&&(E=F)}if(_){var j,q;const Q=C==="y"?"width":"height",te=originSides.has(getSide$1(l)),F=d.reference[R]-d.floating[Q]+(te&&((j=f.offset)==null?void 0:j[R])||0)+(te?0:I.crossAxis),V=d.reference[R]+d.reference[Q]+(te?0:((q=f.offset)==null?void 0:q[R])||0)-(te?I.crossAxis:0);A<F?A=F:A>V&&(A=V)}return{[C]:E,[R]:A}}}},size$2=function(e){return e===void 0&&(e={}),{name:"size",options:e,async fn(t){var n,o;const{placement:l,rects:d,platform:f,elements:g}=t,{apply:b=()=>{},..._}=evaluate(e,t),S=await detectOverflow(t,_),R=getSide$1(l),C=getAlignment(l),E=getSideAxis(l)==="y",{width:A,height:M}=d.floating;let I,j;R==="top"||R==="bottom"?(I=R,j=C===(await(f.isRTL==null?void 0:f.isRTL(g.floating))?"start":"end")?"left":"right"):(j=R,I=C==="end"?"top":"bottom");const q=M-S.top-S.bottom,Q=A-S.left-S.right,te=min$4(M-S[I],q),F=min$4(A-S[j],Q),V=!t.middlewareData.shift;let ne=te,ae=F;if((n=t.middlewareData.shift)!=null&&n.enabled.x&&(ae=Q),(o=t.middlewareData.shift)!=null&&o.enabled.y&&(ne=q),V&&!C){const Oe=max$4(S.left,0),Ne=max$4(S.right,0),oe=max$4(S.top,0),$e=max$4(S.bottom,0);E?ae=A-2*(Oe!==0||Ne!==0?Oe+Ne:max$4(S.left,S.right)):ne=M-2*(oe!==0||$e!==0?oe+$e:max$4(S.top,S.bottom))}await b({...t,availableWidth:ae,availableHeight:ne});const se=await f.getDimensions(g.floating);return A!==se.width||M!==se.height?{reset:{rects:!0}}:{}}}};function hasWindow(){return typeof window<"u"}function getNodeName(e){return isNode(e)?(e.nodeName||"").toLowerCase():"#document"}function getWindow(e){var t;return(e==null||(t=e.ownerDocument)==null?void 0:t.defaultView)||window}function getDocumentElement(e){var t;return(t=(isNode(e)?e.ownerDocument:e.document)||window.document)==null?void 0:t.documentElement}function isNode(e){return hasWindow()?e instanceof Node||e instanceof getWindow(e).Node:!1}function isElement(e){return hasWindow()?e instanceof Element||e instanceof getWindow(e).Element:!1}function isHTMLElement$2(e){return hasWindow()?e instanceof HTMLElement||e instanceof getWindow(e).HTMLElement:!1}function isShadowRoot(e){return!hasWindow()||typeof ShadowRoot>"u"?!1:e instanceof ShadowRoot||e instanceof getWindow(e).ShadowRoot}const invalidOverflowDisplayValues=new Set(["inline","contents"]);function isOverflowElement(e){const{overflow:t,overflowX:n,overflowY:o,display:l}=getComputedStyle$1(e);return/auto|scroll|overlay|hidden|clip/.test(t+o+n)&&!invalidOverflowDisplayValues.has(l)}const tableElements=new Set(["table","td","th"]);function isTableElement(e){return tableElements.has(getNodeName(e))}const topLayerSelectors=[":popover-open",":modal"];function isTopLayer(e){return topLayerSelectors.some(t=>{try{return e.matches(t)}catch{return!1}})}const transformProperties=["transform","translate","scale","rotate","perspective"],willChangeValues=["transform","translate","scale","rotate","perspective","filter"],containValues=["paint","layout","strict","content"];function isContainingBlock(e){const t=isWebKit(),n=isElement(e)?getComputedStyle$1(e):e;return transformProperties.some(o=>n[o]?n[o]!=="none":!1)||(n.containerType?n.containerType!=="normal":!1)||!t&&(n.backdropFilter?n.backdropFilter!=="none":!1)||!t&&(n.filter?n.filter!=="none":!1)||willChangeValues.some(o=>(n.willChange||"").includes(o))||containValues.some(o=>(n.contain||"").includes(o))}function getContainingBlock(e){let t=getParentNode(e);for(;isHTMLElement$2(t)&&!isLastTraversableNode(t);){if(isContainingBlock(t))return t;if(isTopLayer(t))return null;t=getParentNode(t)}return null}function isWebKit(){return typeof CSS>"u"||!CSS.supports?!1:CSS.supports("-webkit-backdrop-filter","none")}const lastTraversableNodeNames=new Set(["html","body","#document"]);function isLastTraversableNode(e){return lastTraversableNodeNames.has(getNodeName(e))}function getComputedStyle$1(e){return getWindow(e).getComputedStyle(e)}function getNodeScroll(e){return isElement(e)?{scrollLeft:e.scrollLeft,scrollTop:e.scrollTop}:{scrollLeft:e.scrollX,scrollTop:e.scrollY}}function getParentNode(e){if(getNodeName(e)==="html")return e;const t=e.assignedSlot||e.parentNode||isShadowRoot(e)&&e.host||getDocumentElement(e);return isShadowRoot(t)?t.host:t}function getNearestOverflowAncestor(e){const t=getParentNode(e);return isLastTraversableNode(t)?e.ownerDocument?e.ownerDocument.body:e.body:isHTMLElement$2(t)&&isOverflowElement(t)?t:getNearestOverflowAncestor(t)}function getOverflowAncestors(e,t,n){var o;t===void 0&&(t=[]),n===void 0&&(n=!0);const l=getNearestOverflowAncestor(e),d=l===((o=e.ownerDocument)==null?void 0:o.body),f=getWindow(l);if(d){const g=getFrameElement(f);return t.concat(f,f.visualViewport||[],isOverflowElement(l)?l:[],g&&n?getOverflowAncestors(g):[])}return t.concat(l,getOverflowAncestors(l,[],n))}function getFrameElement(e){return e.parent&&Object.getPrototypeOf(e.parent)?e.frameElement:null}function getCssDimensions(e){const t=getComputedStyle$1(e);let n=parseFloat(t.width)||0,o=parseFloat(t.height)||0;const l=isHTMLElement$2(e),d=l?e.offsetWidth:n,f=l?e.offsetHeight:o,g=round$1(n)!==d||round$1(o)!==f;return g&&(n=d,o=f),{width:n,height:o,$:g}}function unwrapElement(e){return isElement(e)?e:e.contextElement}function getScale(e){const t=unwrapElement(e);if(!isHTMLElement$2(t))return createCoords(1);const n=t.getBoundingClientRect(),{width:o,height:l,$:d}=getCssDimensions(t);let f=(d?round$1(n.width):n.width)/o,g=(d?round$1(n.height):n.height)/l;return(!f||!Number.isFinite(f))&&(f=1),(!g||!Number.isFinite(g))&&(g=1),{x:f,y:g}}const noOffsets=createCoords(0);function getVisualOffsets(e){const t=getWindow(e);return!isWebKit()||!t.visualViewport?noOffsets:{x:t.visualViewport.offsetLeft,y:t.visualViewport.offsetTop}}function shouldAddVisualOffsets(e,t,n){return t===void 0&&(t=!1),!n||t&&n!==getWindow(e)?!1:t}function getBoundingClientRect(e,t,n,o){t===void 0&&(t=!1),n===void 0&&(n=!1);const l=e.getBoundingClientRect(),d=unwrapElement(e);let f=createCoords(1);t&&(o?isElement(o)&&(f=getScale(o)):f=getScale(e));const g=shouldAddVisualOffsets(d,n,o)?getVisualOffsets(d):createCoords(0);let b=(l.left+g.x)/f.x,_=(l.top+g.y)/f.y,S=l.width/f.x,R=l.height/f.y;if(d){const C=getWindow(d),E=o&&isElement(o)?getWindow(o):o;let A=C,M=getFrameElement(A);for(;M&&o&&E!==A;){const I=getScale(M),j=M.getBoundingClientRect(),q=getComputedStyle$1(M),Q=j.left+(M.clientLeft+parseFloat(q.paddingLeft))*I.x,te=j.top+(M.clientTop+parseFloat(q.paddingTop))*I.y;b*=I.x,_*=I.y,S*=I.x,R*=I.y,b+=Q,_+=te,A=getWindow(M),M=getFrameElement(A)}}return rectToClientRect({width:S,height:R,x:b,y:_})}function getWindowScrollBarX(e,t){const n=getNodeScroll(e).scrollLeft;return t?t.left+n:getBoundingClientRect(getDocumentElement(e)).left+n}function getHTMLOffset(e,t){const n=e.getBoundingClientRect(),o=n.left+t.scrollLeft-getWindowScrollBarX(e,n),l=n.top+t.scrollTop;return{x:o,y:l}}function convertOffsetParentRelativeRectToViewportRelativeRect(e){let{elements:t,rect:n,offsetParent:o,strategy:l}=e;const d=l==="fixed",f=getDocumentElement(o),g=t?isTopLayer(t.floating):!1;if(o===f||g&&d)return n;let b={scrollLeft:0,scrollTop:0},_=createCoords(1);const S=createCoords(0),R=isHTMLElement$2(o);if((R||!R&&!d)&&((getNodeName(o)!=="body"||isOverflowElement(f))&&(b=getNodeScroll(o)),isHTMLElement$2(o))){const E=getBoundingClientRect(o);_=getScale(o),S.x=E.x+o.clientLeft,S.y=E.y+o.clientTop}const C=f&&!R&&!d?getHTMLOffset(f,b):createCoords(0);return{width:n.width*_.x,height:n.height*_.y,x:n.x*_.x-b.scrollLeft*_.x+S.x+C.x,y:n.y*_.y-b.scrollTop*_.y+S.y+C.y}}function getClientRects(e){return Array.from(e.getClientRects())}function getDocumentRect(e){const t=getDocumentElement(e),n=getNodeScroll(e),o=e.ownerDocument.body,l=max$4(t.scrollWidth,t.clientWidth,o.scrollWidth,o.clientWidth),d=max$4(t.scrollHeight,t.clientHeight,o.scrollHeight,o.clientHeight);let f=-n.scrollLeft+getWindowScrollBarX(e);const g=-n.scrollTop;return getComputedStyle$1(o).direction==="rtl"&&(f+=max$4(t.clientWidth,o.clientWidth)-l),{width:l,height:d,x:f,y:g}}const SCROLLBAR_MAX=25;function getViewportRect(e,t){const n=getWindow(e),o=getDocumentElement(e),l=n.visualViewport;let d=o.clientWidth,f=o.clientHeight,g=0,b=0;if(l){d=l.width,f=l.height;const S=isWebKit();(!S||S&&t==="fixed")&&(g=l.offsetLeft,b=l.offsetTop)}const _=getWindowScrollBarX(o);if(_<=0){const S=o.ownerDocument,R=S.body,C=getComputedStyle(R),E=S.compatMode==="CSS1Compat"&&parseFloat(C.marginLeft)+parseFloat(C.marginRight)||0,A=Math.abs(o.clientWidth-R.clientWidth-E);A<=SCROLLBAR_MAX&&(d-=A)}else _<=SCROLLBAR_MAX&&(d+=_);return{width:d,height:f,x:g,y:b}}const absoluteOrFixed=new Set(["absolute","fixed"]);function getInnerBoundingClientRect(e,t){const n=getBoundingClientRect(e,!0,t==="fixed"),o=n.top+e.clientTop,l=n.left+e.clientLeft,d=isHTMLElement$2(e)?getScale(e):createCoords(1),f=e.clientWidth*d.x,g=e.clientHeight*d.y,b=l*d.x,_=o*d.y;return{width:f,height:g,x:b,y:_}}function getClientRectFromClippingAncestor(e,t,n){let o;if(t==="viewport")o=getViewportRect(e,n);else if(t==="document")o=getDocumentRect(getDocumentElement(e));else if(isElement(t))o=getInnerBoundingClientRect(t,n);else{const l=getVisualOffsets(e);o={x:t.x-l.x,y:t.y-l.y,width:t.width,height:t.height}}return rectToClientRect(o)}function hasFixedPositionAncestor(e,t){const n=getParentNode(e);return n===t||!isElement(n)||isLastTraversableNode(n)?!1:getComputedStyle$1(n).position==="fixed"||hasFixedPositionAncestor(n,t)}function getClippingElementAncestors(e,t){const n=t.get(e);if(n)return n;let o=getOverflowAncestors(e,[],!1).filter(g=>isElement(g)&&getNodeName(g)!=="body"),l=null;const d=getComputedStyle$1(e).position==="fixed";let f=d?getParentNode(e):e;for(;isElement(f)&&!isLastTraversableNode(f);){const g=getComputedStyle$1(f),b=isContainingBlock(f);!b&&g.position==="fixed"&&(l=null),(d?!b&&!l:!b&&g.position==="static"&&!!l&&absoluteOrFixed.has(l.position)||isOverflowElement(f)&&!b&&hasFixedPositionAncestor(e,f))?o=o.filter(S=>S!==f):l=g,f=getParentNode(f)}return t.set(e,o),o}function getClippingRect(e){let{element:t,boundary:n,rootBoundary:o,strategy:l}=e;const f=[...n==="clippingAncestors"?isTopLayer(t)?[]:getClippingElementAncestors(t,this._c):[].concat(n),o],g=f[0],b=f.reduce((_,S)=>{const R=getClientRectFromClippingAncestor(t,S,l);return _.top=max$4(R.top,_.top),_.right=min$4(R.right,_.right),_.bottom=min$4(R.bottom,_.bottom),_.left=max$4(R.left,_.left),_},getClientRectFromClippingAncestor(t,g,l));return{width:b.right-b.left,height:b.bottom-b.top,x:b.left,y:b.top}}function getDimensions(e){const{width:t,height:n}=getCssDimensions(e);return{width:t,height:n}}function getRectRelativeToOffsetParent(e,t,n){const o=isHTMLElement$2(t),l=getDocumentElement(t),d=n==="fixed",f=getBoundingClientRect(e,!0,d,t);let g={scrollLeft:0,scrollTop:0};const b=createCoords(0);function _(){b.x=getWindowScrollBarX(l)}if(o||!o&&!d)if((getNodeName(t)!=="body"||isOverflowElement(l))&&(g=getNodeScroll(t)),o){const E=getBoundingClientRect(t,!0,d,t);b.x=E.x+t.clientLeft,b.y=E.y+t.clientTop}else l&&_();d&&!o&&l&&_();const S=l&&!o&&!d?getHTMLOffset(l,g):createCoords(0),R=f.left+g.scrollLeft-b.x-S.x,C=f.top+g.scrollTop-b.y-S.y;return{x:R,y:C,width:f.width,height:f.height}}function isStaticPositioned(e){return getComputedStyle$1(e).position==="static"}function getTrueOffsetParent(e,t){if(!isHTMLElement$2(e)||getComputedStyle$1(e).position==="fixed")return null;if(t)return t(e);let n=e.offsetParent;return getDocumentElement(e)===n&&(n=n.ownerDocument.body),n}function getOffsetParent(e,t){const n=getWindow(e);if(isTopLayer(e))return n;if(!isHTMLElement$2(e)){let l=getParentNode(e);for(;l&&!isLastTraversableNode(l);){if(isElement(l)&&!isStaticPositioned(l))return l;l=getParentNode(l)}return n}let o=getTrueOffsetParent(e,t);for(;o&&isTableElement(o)&&isStaticPositioned(o);)o=getTrueOffsetParent(o,t);return o&&isLastTraversableNode(o)&&isStaticPositioned(o)&&!isContainingBlock(o)?n:o||getContainingBlock(e)||n}const getElementRects=async function(e){const t=this.getOffsetParent||getOffsetParent,n=this.getDimensions,o=await n(e.floating);return{reference:getRectRelativeToOffsetParent(e.reference,await t(e.floating),e.strategy),floating:{x:0,y:0,width:o.width,height:o.height}}};function isRTL(e){return getComputedStyle$1(e).direction==="rtl"}const platform={convertOffsetParentRelativeRectToViewportRelativeRect,getDocumentElement,getClippingRect,getOffsetParent,getElementRects,getClientRects,getDimensions,getScale,isElement,isRTL};function rectsAreEqual(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}function observeMove(e,t){let n=null,o;const l=getDocumentElement(e);function d(){var g;clearTimeout(o),(g=n)==null||g.disconnect(),n=null}function f(g,b){g===void 0&&(g=!1),b===void 0&&(b=1),d();const _=e.getBoundingClientRect(),{left:S,top:R,width:C,height:E}=_;if(g||t(),!C||!E)return;const A=floor(R),M=floor(l.clientWidth-(S+C)),I=floor(l.clientHeight-(R+E)),j=floor(S),Q={rootMargin:-A+"px "+-M+"px "+-I+"px "+-j+"px",threshold:max$4(0,min$4(1,b))||1};let te=!0;function F(V){const ne=V[0].intersectionRatio;if(ne!==b){if(!te)return f();ne?f(!1,ne):o=setTimeout(()=>{f(!1,1e-7)},1e3)}ne===1&&!rectsAreEqual(_,e.getBoundingClientRect())&&f(),te=!1}try{n=new IntersectionObserver(F,{...Q,root:l.ownerDocument})}catch{n=new IntersectionObserver(F,Q)}n.observe(e)}return f(!0),d}function autoUpdate(e,t,n,o){o===void 0&&(o={});const{ancestorScroll:l=!0,ancestorResize:d=!0,elementResize:f=typeof ResizeObserver=="function",layoutShift:g=typeof IntersectionObserver=="function",animationFrame:b=!1}=o,_=unwrapElement(e),S=l||d?[..._?getOverflowAncestors(_):[],...getOverflowAncestors(t)]:[];S.forEach(j=>{l&&j.addEventListener("scroll",n,{passive:!0}),d&&j.addEventListener("resize",n)});const R=_&&g?observeMove(_,n):null;let C=-1,E=null;f&&(E=new ResizeObserver(j=>{let[q]=j;q&&q.target===_&&E&&(E.unobserve(t),cancelAnimationFrame(C),C=requestAnimationFrame(()=>{var Q;(Q=E)==null||Q.observe(t)})),n()}),_&&!b&&E.observe(_),E.observe(t));let A,M=b?getBoundingClientRect(e):null;b&&I();function I(){const j=getBoundingClientRect(e);M&&!rectsAreEqual(M,j)&&n(),M=j,A=requestAnimationFrame(I)}return n(),()=>{var j;S.forEach(q=>{l&&q.removeEventListener("scroll",n),d&&q.removeEventListener("resize",n)}),R==null||R(),(j=E)==null||j.disconnect(),E=null,b&&cancelAnimationFrame(A)}}const offset$1=offset$2,shift$2=shift$3,flip$1=flip$2,size$1=size$2,hide$1=hide$2,arrow$3=arrow$4,limitShift$1=limitShift$2,computePosition=(e,t,n)=>{const o=new Map,l={platform,...n},d={...l.platform,_c:o};return computePosition$1(e,t,{...l,platform:d})};var isClient=typeof document<"u",noop$2=function(){},index=isClient?React.useLayoutEffect:noop$2;function deepEqual$3(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(typeof e=="function"&&e.toString()===t.toString())return!0;let n,o,l;if(e&&t&&typeof e=="object"){if(Array.isArray(e)){if(n=e.length,n!==t.length)return!1;for(o=n;o--!==0;)if(!deepEqual$3(e[o],t[o]))return!1;return!0}if(l=Object.keys(e),n=l.length,n!==Object.keys(t).length)return!1;for(o=n;o--!==0;)if(!{}.hasOwnProperty.call(t,l[o]))return!1;for(o=n;o--!==0;){const d=l[o];if(!(d==="_owner"&&e.$$typeof)&&!deepEqual$3(e[d],t[d]))return!1}return!0}return e!==e&&t!==t}function getDPR(e){return typeof window>"u"?1:(e.ownerDocument.defaultView||window).devicePixelRatio||1}function roundByDPR(e,t){const n=getDPR(e);return Math.round(t*n)/n}function useLatestRef(e){const t=React__namespace.useRef(e);return index(()=>{t.current=e}),t}function useFloating(e){e===void 0&&(e={});const{placement:t="bottom",strategy:n="absolute",middleware:o=[],platform:l,elements:{reference:d,floating:f}={},transform:g=!0,whileElementsMounted:b,open:_}=e,[S,R]=React__namespace.useState({x:0,y:0,strategy:n,placement:t,middlewareData:{},isPositioned:!1}),[C,E]=React__namespace.useState(o);deepEqual$3(C,o)||E(o);const[A,M]=React__namespace.useState(null),[I,j]=React__namespace.useState(null),q=React__namespace.useCallback(Ve=>{Ve!==V.current&&(V.current=Ve,M(Ve))},[]),Q=React__namespace.useCallback(Ve=>{Ve!==ne.current&&(ne.current=Ve,j(Ve))},[]),te=d||A,F=f||I,V=React__namespace.useRef(null),ne=React__namespace.useRef(null),ae=React__namespace.useRef(S),se=b!=null,Oe=useLatestRef(b),Ne=useLatestRef(l),oe=useLatestRef(_),$e=React__namespace.useCallback(()=>{if(!V.current||!ne.current)return;const Ve={placement:t,strategy:n,middleware:C};Ne.current&&(Ve.platform=Ne.current),computePosition(V.current,ne.current,Ve).then(Le=>{const He={...Le,isPositioned:oe.current!==!1};Ae.current&&!deepEqual$3(ae.current,He)&&(ae.current=He,ReactDOM__namespace.flushSync(()=>{R(He)}))})},[C,t,n,Ne,oe]);index(()=>{_===!1&&ae.current.isPositioned&&(ae.current.isPositioned=!1,R(Ve=>({...Ve,isPositioned:!1})))},[_]);const Ae=React__namespace.useRef(!1);index(()=>(Ae.current=!0,()=>{Ae.current=!1}),[]),index(()=>{if(te&&(V.current=te),F&&(ne.current=F),te&&F){if(Oe.current)return Oe.current(te,F,$e);$e()}},[te,F,$e,Oe,se]);const je=React__namespace.useMemo(()=>({reference:V,floating:ne,setReference:q,setFloating:Q}),[q,Q]),Be=React__namespace.useMemo(()=>({reference:te,floating:F}),[te,F]),qe=React__namespace.useMemo(()=>{const Ve={position:n,left:0,top:0};if(!Be.floating)return Ve;const Le=roundByDPR(Be.floating,S.x),He=roundByDPR(Be.floating,S.y);return g?{...Ve,transform:"translate("+Le+"px, "+He+"px)",...getDPR(Be.floating)>=1.5&&{willChange:"transform"}}:{position:n,left:Le,top:He}},[n,g,Be.floating,S.x,S.y]);return React__namespace.useMemo(()=>({...S,update:$e,refs:je,elements:Be,floatingStyles:qe}),[S,$e,je,Be,qe])}const arrow$1=e=>{function t(n){return{}.hasOwnProperty.call(n,"current")}return{name:"arrow",options:e,fn(n){const{element:o,padding:l}=typeof e=="function"?e(n):e;return o&&t(o)?o.current!=null?arrow$3({element:o.current,padding:l}).fn(n):{}:o?arrow$3({element:o,padding:l}).fn(n):{}}}},offset=(e,t)=>({...offset$1(e),options:[e,t]}),shift$1=(e,t)=>({...shift$2(e),options:[e,t]}),limitShift=(e,t)=>({...limitShift$1(e),options:[e,t]}),flip=(e,t)=>({...flip$1(e),options:[e,t]}),size=(e,t)=>({...size$1(e),options:[e,t]}),hide=(e,t)=>({...hide$1(e),options:[e,t]}),arrow$2=(e,t)=>({...arrow$1(e),options:[e,t]});var NAME$3="Arrow",Arrow$1=React__namespace.forwardRef((e,t)=>{const{children:n,width:o=10,height:l=5,...d}=e;return jsxRuntime.jsx(Primitive$4.svg,{...d,ref:t,width:o,height:l,viewBox:"0 0 30 10",preserveAspectRatio:"none",children:e.asChild?n:jsxRuntime.jsx("polygon",{points:"0,0 30,0 15,10"})})});Arrow$1.displayName=NAME$3;var Root$9=Arrow$1,POPPER_NAME="Popper",[createPopperContext,createPopperScope]=createContextScope$2(POPPER_NAME),[PopperProvider,usePopperContext]=createPopperContext(POPPER_NAME),Popper=e=>{const{__scopePopper:t,children:n}=e,[o,l]=React__namespace.useState(null);return jsxRuntime.jsx(PopperProvider,{scope:t,anchor:o,onAnchorChange:l,children:n})};Popper.displayName=POPPER_NAME;var ANCHOR_NAME$2="PopperAnchor",PopperAnchor=React__namespace.forwardRef((e,t)=>{const{__scopePopper:n,virtualRef:o,...l}=e,d=usePopperContext(ANCHOR_NAME$2,n),f=React__namespace.useRef(null),g=useComposedRefs(t,f),b=React__namespace.useRef(null);return React__namespace.useEffect(()=>{const _=b.current;b.current=(o==null?void 0:o.current)||f.current,_!==b.current&&d.onAnchorChange(b.current)}),o?null:jsxRuntime.jsx(Primitive$4.div,{...l,ref:g})});PopperAnchor.displayName=ANCHOR_NAME$2;var CONTENT_NAME$9="PopperContent",[PopperContentProvider,useContentContext]=createPopperContext(CONTENT_NAME$9),PopperContent=React__namespace.forwardRef((e,t)=>{var et,at,tt,ot,lt,Ge;const{__scopePopper:n,side:o="bottom",sideOffset:l=0,align:d="center",alignOffset:f=0,arrowPadding:g=0,avoidCollisions:b=!0,collisionBoundary:_=[],collisionPadding:S=0,sticky:R="partial",hideWhenDetached:C=!1,updatePositionStrategy:E="optimized",onPlaced:A,...M}=e,I=usePopperContext(CONTENT_NAME$9,n),[j,q]=React__namespace.useState(null),Q=useComposedRefs(t,$t=>q($t)),[te,F]=React__namespace.useState(null),V=useSize(te),ne=(V==null?void 0:V.width)??0,ae=(V==null?void 0:V.height)??0,se=o+(d!=="center"?"-"+d:""),Oe=typeof S=="number"?S:{top:0,right:0,bottom:0,left:0,...S},Ne=Array.isArray(_)?_:[_],oe=Ne.length>0,$e={padding:Oe,boundary:Ne.filter(isNotNull),altBoundary:oe},{refs:Ae,floatingStyles:je,placement:Be,isPositioned:qe,middlewareData:Ve}=useFloating({strategy:"fixed",placement:se,whileElementsMounted:(...$t)=>autoUpdate(...$t,{animationFrame:E==="always"}),elements:{reference:I.anchor},middleware:[offset({mainAxis:l+ae,alignmentAxis:f}),b&&shift$1({mainAxis:!0,crossAxis:!1,limiter:R==="partial"?limitShift():void 0,...$e}),b&&flip({...$e}),size({...$e,apply:({elements:$t,rects:rt,availableWidth:Rt,availableHeight:dt})=>{const{width:It,height:Mt}=rt.reference,Ct=$t.floating.style;Ct.setProperty("--radix-popper-available-width",`${Rt}px`),Ct.setProperty("--radix-popper-available-height",`${dt}px`),Ct.setProperty("--radix-popper-anchor-width",`${It}px`),Ct.setProperty("--radix-popper-anchor-height",`${Mt}px`)}}),te&&arrow$2({element:te,padding:g}),transformOrigin({arrowWidth:ne,arrowHeight:ae}),C&&hide({strategy:"referenceHidden",...$e})]}),[Le,He]=getSideAndAlignFromPlacement(Be),We=useCallbackRef$1(A);useLayoutEffect2(()=>{qe&&(We==null||We())},[qe,We]);const ze=(et=Ve.arrow)==null?void 0:et.x,Xe=(at=Ve.arrow)==null?void 0:at.y,nt=((tt=Ve.arrow)==null?void 0:tt.centerOffset)!==0,[Je,st]=React__namespace.useState();return useLayoutEffect2(()=>{j&&st(window.getComputedStyle(j).zIndex)},[j]),jsxRuntime.jsx("div",{ref:Ae.setFloating,"data-radix-popper-content-wrapper":"",style:{...je,transform:qe?je.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:Je,"--radix-popper-transform-origin":[(ot=Ve.transformOrigin)==null?void 0:ot.x,(lt=Ve.transformOrigin)==null?void 0:lt.y].join(" "),...((Ge=Ve.hide)==null?void 0:Ge.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:jsxRuntime.jsx(PopperContentProvider,{scope:n,placedSide:Le,onArrowChange:F,arrowX:ze,arrowY:Xe,shouldHideArrow:nt,children:jsxRuntime.jsx(Primitive$4.div,{"data-side":Le,"data-align":He,...M,ref:Q,style:{...M.style,animation:qe?void 0:"none"}})})})});PopperContent.displayName=CONTENT_NAME$9;var ARROW_NAME$5="PopperArrow",OPPOSITE_SIDE={top:"bottom",right:"left",bottom:"top",left:"right"},PopperArrow=React__namespace.forwardRef(function(t,n){const{__scopePopper:o,...l}=t,d=useContentContext(ARROW_NAME$5,o),f=OPPOSITE_SIDE[d.placedSide];return jsxRuntime.jsx("span",{ref:d.onArrowChange,style:{position:"absolute",left:d.arrowX,top:d.arrowY,[f]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[d.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[d.placedSide],visibility:d.shouldHideArrow?"hidden":void 0},children:jsxRuntime.jsx(Root$9,{...l,ref:n,style:{...l.style,display:"block"}})})});PopperArrow.displayName=ARROW_NAME$5;function isNotNull(e){return e!==null}var transformOrigin=e=>({name:"transformOrigin",options:e,fn(t){var I,j,q;const{placement:n,rects:o,middlewareData:l}=t,f=((I=l.arrow)==null?void 0:I.centerOffset)!==0,g=f?0:e.arrowWidth,b=f?0:e.arrowHeight,[_,S]=getSideAndAlignFromPlacement(n),R={start:"0%",center:"50%",end:"100%"}[S],C=(((j=l.arrow)==null?void 0:j.x)??0)+g/2,E=(((q=l.arrow)==null?void 0:q.y)??0)+b/2;let A="",M="";return _==="bottom"?(A=f?R:`${C}px`,M=`${-b}px`):_==="top"?(A=f?R:`${C}px`,M=`${o.floating.height+b}px`):_==="right"?(A=`${-b}px`,M=f?R:`${E}px`):_==="left"&&(A=`${o.floating.width+b}px`,M=f?R:`${E}px`),{data:{x:A,y:M}}}});function getSideAndAlignFromPlacement(e){const[t,n="center"]=e.split("-");return[t,n]}var Root2$7=Popper,Anchor=PopperAnchor,Content$2=PopperContent,Arrow=PopperArrow;function createSlot$3(e){const t=createSlotClone$3(e),n=React__namespace.forwardRef((o,l)=>{const{children:d,...f}=o,g=React__namespace.Children.toArray(d),b=g.find(isSlottable$3);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}function createSlotClone$3(e){const t=React__namespace.forwardRef((n,o)=>{const{children:l,...d}=n;if(React__namespace.isValidElement(l)){const f=getElementRef$3(l),g=mergeProps$3(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$5=Symbol("radix.slottable");function isSlottable$3(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$5}function mergeProps$3(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$3(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}var SELECTION_KEYS$1=["Enter"," "],FIRST_KEYS=["ArrowDown","PageUp","Home"],LAST_KEYS=["ArrowUp","PageDown","End"],FIRST_LAST_KEYS=[...FIRST_KEYS,...LAST_KEYS],SUB_OPEN_KEYS={ltr:[...SELECTION_KEYS$1,"ArrowRight"],rtl:[...SELECTION_KEYS$1,"ArrowLeft"]},SUB_CLOSE_KEYS={ltr:["ArrowLeft"],rtl:["ArrowRight"]},MENU_NAME="Menu",[Collection$3,useCollection$3,createCollectionScope$3]=createCollection(MENU_NAME),[createMenuContext,createMenuScope]=createContextScope$2(MENU_NAME,[createCollectionScope$3,createPopperScope,createRovingFocusGroupScope]),usePopperScope$3=createPopperScope(),useRovingFocusGroupScope$1=createRovingFocusGroupScope(),[MenuProvider,useMenuContext]=createMenuContext(MENU_NAME),[MenuRootProvider,useMenuRootContext]=createMenuContext(MENU_NAME),Menu=e=>{const{__scopeMenu:t,open:n=!1,children:o,dir:l,onOpenChange:d,modal:f=!0}=e,g=usePopperScope$3(t),[b,_]=React__namespace.useState(null),S=React__namespace.useRef(!1),R=useCallbackRef$1(d),C=useDirection(l);return React__namespace.useEffect(()=>{const E=()=>{S.current=!0,document.addEventListener("pointerdown",A,{capture:!0,once:!0}),document.addEventListener("pointermove",A,{capture:!0,once:!0})},A=()=>S.current=!1;return document.addEventListener("keydown",E,{capture:!0}),()=>{document.removeEventListener("keydown",E,{capture:!0}),document.removeEventListener("pointerdown",A,{capture:!0}),document.removeEventListener("pointermove",A,{capture:!0})}},[]),jsxRuntime.jsx(Root2$7,{...g,children:jsxRuntime.jsx(MenuProvider,{scope:t,open:n,onOpenChange:R,content:b,onContentChange:_,children:jsxRuntime.jsx(MenuRootProvider,{scope:t,onClose:React__namespace.useCallback(()=>R(!1),[R]),isUsingKeyboardRef:S,dir:C,modal:f,children:o})})})};Menu.displayName=MENU_NAME;var ANCHOR_NAME$1="MenuAnchor",MenuAnchor=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,l=usePopperScope$3(n);return jsxRuntime.jsx(Anchor,{...l,...o,ref:t})});MenuAnchor.displayName=ANCHOR_NAME$1;var PORTAL_NAME$5="MenuPortal",[PortalProvider$2,usePortalContext$2]=createMenuContext(PORTAL_NAME$5,{forceMount:void 0}),MenuPortal=e=>{const{__scopeMenu:t,forceMount:n,children:o,container:l}=e,d=useMenuContext(PORTAL_NAME$5,t);return jsxRuntime.jsx(PortalProvider$2,{scope:t,forceMount:n,children:jsxRuntime.jsx(Presence,{present:n||d.open,children:jsxRuntime.jsx(Portal$5,{asChild:!0,container:l,children:o})})})};MenuPortal.displayName=PORTAL_NAME$5;var CONTENT_NAME$8="MenuContent",[MenuContentProvider,useMenuContentContext]=createMenuContext(CONTENT_NAME$8),MenuContent=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$2(CONTENT_NAME$8,e.__scopeMenu),{forceMount:o=n.forceMount,...l}=e,d=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),f=useMenuRootContext(CONTENT_NAME$8,e.__scopeMenu);return jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeMenu,children:jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeMenu,children:f.modal?jsxRuntime.jsx(MenuRootContentModal,{...l,ref:t}):jsxRuntime.jsx(MenuRootContentNonModal,{...l,ref:t})})})})}),MenuRootContentModal=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),o=React__namespace.useRef(null),l=useComposedRefs(t,o);return React__namespace.useEffect(()=>{const d=o.current;if(d)return hideOthers(d)},[]),jsxRuntime.jsx(MenuContentImpl,{...e,ref:l,trapFocus:n.open,disableOutsidePointerEvents:n.open,disableOutsideScroll:!0,onFocusOutside:composeEventHandlers(e.onFocusOutside,d=>d.preventDefault(),{checkForDefaultPrevented:!1}),onDismiss:()=>n.onOpenChange(!1)})}),MenuRootContentNonModal=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(CONTENT_NAME$8,e.__scopeMenu);return jsxRuntime.jsx(MenuContentImpl,{...e,ref:t,trapFocus:!1,disableOutsidePointerEvents:!1,disableOutsideScroll:!1,onDismiss:()=>n.onOpenChange(!1)})}),Slot$3=createSlot$3("MenuContent.ScrollLock"),MenuContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,loop:o=!1,trapFocus:l,onOpenAutoFocus:d,onCloseAutoFocus:f,disableOutsidePointerEvents:g,onEntryFocus:b,onEscapeKeyDown:_,onPointerDownOutside:S,onFocusOutside:R,onInteractOutside:C,onDismiss:E,disableOutsideScroll:A,...M}=e,I=useMenuContext(CONTENT_NAME$8,n),j=useMenuRootContext(CONTENT_NAME$8,n),q=usePopperScope$3(n),Q=useRovingFocusGroupScope$1(n),te=useCollection$3(n),[F,V]=React__namespace.useState(null),ne=React__namespace.useRef(null),ae=useComposedRefs(t,ne,I.onContentChange),se=React__namespace.useRef(0),Oe=React__namespace.useRef(""),Ne=React__namespace.useRef(0),oe=React__namespace.useRef(null),$e=React__namespace.useRef("right"),Ae=React__namespace.useRef(0),je=A?ReactRemoveScroll:React__namespace.Fragment,Be=A?{as:Slot$3,allowPinchZoom:!0}:void 0,qe=Le=>{var et,at;const He=Oe.current+Le,We=te().filter(tt=>!tt.disabled),ze=document.activeElement,Xe=(et=We.find(tt=>tt.ref.current===ze))==null?void 0:et.textValue,nt=We.map(tt=>tt.textValue),Je=getNextMatch(nt,He,Xe),st=(at=We.find(tt=>tt.textValue===Je))==null?void 0:at.ref.current;(function tt(ot){Oe.current=ot,window.clearTimeout(se.current),ot!==""&&(se.current=window.setTimeout(()=>tt(""),1e3))})(He),st&&setTimeout(()=>st.focus())};React__namespace.useEffect(()=>()=>window.clearTimeout(se.current),[]),useFocusGuards();const Ve=React__namespace.useCallback(Le=>{var We,ze;return $e.current===((We=oe.current)==null?void 0:We.side)&&isPointerInGraceArea(Le,(ze=oe.current)==null?void 0:ze.area)},[]);return jsxRuntime.jsx(MenuContentProvider,{scope:n,searchRef:Oe,onItemEnter:React__namespace.useCallback(Le=>{Ve(Le)&&Le.preventDefault()},[Ve]),onItemLeave:React__namespace.useCallback(Le=>{var He;Ve(Le)||((He=ne.current)==null||He.focus(),V(null))},[Ve]),onTriggerLeave:React__namespace.useCallback(Le=>{Ve(Le)&&Le.preventDefault()},[Ve]),pointerGraceTimerRef:Ne,onPointerGraceIntentChange:React__namespace.useCallback(Le=>{oe.current=Le},[]),children:jsxRuntime.jsx(je,{...Be,children:jsxRuntime.jsx(FocusScope,{asChild:!0,trapped:l,onMountAutoFocus:composeEventHandlers(d,Le=>{var He;Le.preventDefault(),(He=ne.current)==null||He.focus({preventScroll:!0})}),onUnmountAutoFocus:f,children:jsxRuntime.jsx(DismissableLayer,{asChild:!0,disableOutsidePointerEvents:g,onEscapeKeyDown:_,onPointerDownOutside:S,onFocusOutside:R,onInteractOutside:C,onDismiss:E,children:jsxRuntime.jsx(Root$c,{asChild:!0,...Q,dir:j.dir,orientation:"vertical",loop:o,currentTabStopId:F,onCurrentTabStopIdChange:V,onEntryFocus:composeEventHandlers(b,Le=>{j.isUsingKeyboardRef.current||Le.preventDefault()}),preventScrollOnEntryFocus:!0,children:jsxRuntime.jsx(Content$2,{role:"menu","aria-orientation":"vertical","data-state":getOpenState(I.open),"data-radix-menu-content":"",dir:j.dir,...q,...M,ref:ae,style:{outline:"none",...M.style},onKeyDown:composeEventHandlers(M.onKeyDown,Le=>{const We=Le.target.closest("[data-radix-menu-content]")===Le.currentTarget,ze=Le.ctrlKey||Le.altKey||Le.metaKey,Xe=Le.key.length===1;We&&(Le.key==="Tab"&&Le.preventDefault(),!ze&&Xe&&qe(Le.key));const nt=ne.current;if(Le.target!==nt||!FIRST_LAST_KEYS.includes(Le.key))return;Le.preventDefault();const st=te().filter(et=>!et.disabled).map(et=>et.ref.current);LAST_KEYS.includes(Le.key)&&st.reverse(),focusFirst$1(st)}),onBlur:composeEventHandlers(e.onBlur,Le=>{Le.currentTarget.contains(Le.target)||(window.clearTimeout(se.current),Oe.current="")}),onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(Le=>{const He=Le.target,We=Ae.current!==Le.clientX;if(Le.currentTarget.contains(He)&&We){const ze=Le.clientX>Ae.current?"right":"left";$e.current=ze,Ae.current=Le.clientX}}))})})})})})})});MenuContent.displayName=CONTENT_NAME$8;var GROUP_NAME$2="MenuGroup",MenuGroup=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{role:"group",...o,ref:t})});MenuGroup.displayName=GROUP_NAME$2;var LABEL_NAME$2="MenuLabel",MenuLabel=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{...o,ref:t})});MenuLabel.displayName=LABEL_NAME$2;var ITEM_NAME$3="MenuItem",ITEM_SELECT="menu.itemSelect",MenuItem=React__namespace.forwardRef((e,t)=>{const{disabled:n=!1,onSelect:o,...l}=e,d=React__namespace.useRef(null),f=useMenuRootContext(ITEM_NAME$3,e.__scopeMenu),g=useMenuContentContext(ITEM_NAME$3,e.__scopeMenu),b=useComposedRefs(t,d),_=React__namespace.useRef(!1),S=()=>{const R=d.current;if(!n&&R){const C=new CustomEvent(ITEM_SELECT,{bubbles:!0,cancelable:!0});R.addEventListener(ITEM_SELECT,E=>o==null?void 0:o(E),{once:!0}),dispatchDiscreteCustomEvent(R,C),C.defaultPrevented?_.current=!1:f.onClose()}};return jsxRuntime.jsx(MenuItemImpl,{...l,ref:b,disabled:n,onClick:composeEventHandlers(e.onClick,S),onPointerDown:R=>{var C;(C=e.onPointerDown)==null||C.call(e,R),_.current=!0},onPointerUp:composeEventHandlers(e.onPointerUp,R=>{var C;_.current||(C=R.currentTarget)==null||C.click()}),onKeyDown:composeEventHandlers(e.onKeyDown,R=>{const C=g.searchRef.current!=="";n||C&&R.key===" "||SELECTION_KEYS$1.includes(R.key)&&(R.currentTarget.click(),R.preventDefault())})})});MenuItem.displayName=ITEM_NAME$3;var MenuItemImpl=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,disabled:o=!1,textValue:l,...d}=e,f=useMenuContentContext(ITEM_NAME$3,n),g=useRovingFocusGroupScope$1(n),b=React__namespace.useRef(null),_=useComposedRefs(t,b),[S,R]=React__namespace.useState(!1),[C,E]=React__namespace.useState("");return React__namespace.useEffect(()=>{const A=b.current;A&&E((A.textContent??"").trim())},[d.children]),jsxRuntime.jsx(Collection$3.ItemSlot,{scope:n,disabled:o,textValue:l??C,children:jsxRuntime.jsx(Item$3,{asChild:!0,...g,focusable:!o,children:jsxRuntime.jsx(Primitive$4.div,{role:"menuitem","data-highlighted":S?"":void 0,"aria-disabled":o||void 0,"data-disabled":o?"":void 0,...d,ref:_,onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(A=>{o?f.onItemLeave(A):(f.onItemEnter(A),A.defaultPrevented||A.currentTarget.focus({preventScroll:!0}))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(A=>f.onItemLeave(A))),onFocus:composeEventHandlers(e.onFocus,()=>R(!0)),onBlur:composeEventHandlers(e.onBlur,()=>R(!1))})})})}),CHECKBOX_ITEM_NAME$1="MenuCheckboxItem",MenuCheckboxItem=React__namespace.forwardRef((e,t)=>{const{checked:n=!1,onCheckedChange:o,...l}=e;return jsxRuntime.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:n,children:jsxRuntime.jsx(MenuItem,{role:"menuitemcheckbox","aria-checked":isIndeterminate$1(n)?"mixed":n,...l,ref:t,"data-state":getCheckedState(n),onSelect:composeEventHandlers(l.onSelect,()=>o==null?void 0:o(isIndeterminate$1(n)?!0:!n),{checkForDefaultPrevented:!1})})})});MenuCheckboxItem.displayName=CHECKBOX_ITEM_NAME$1;var RADIO_GROUP_NAME$1="MenuRadioGroup",[RadioGroupProvider,useRadioGroupContext]=createMenuContext(RADIO_GROUP_NAME$1,{value:void 0,onValueChange:()=>{}}),MenuRadioGroup=React__namespace.forwardRef((e,t)=>{const{value:n,onValueChange:o,...l}=e,d=useCallbackRef$1(o);return jsxRuntime.jsx(RadioGroupProvider,{scope:e.__scopeMenu,value:n,onValueChange:d,children:jsxRuntime.jsx(MenuGroup,{...l,ref:t})})});MenuRadioGroup.displayName=RADIO_GROUP_NAME$1;var RADIO_ITEM_NAME$1="MenuRadioItem",MenuRadioItem=React__namespace.forwardRef((e,t)=>{const{value:n,...o}=e,l=useRadioGroupContext(RADIO_ITEM_NAME$1,e.__scopeMenu),d=n===l.value;return jsxRuntime.jsx(ItemIndicatorProvider,{scope:e.__scopeMenu,checked:d,children:jsxRuntime.jsx(MenuItem,{role:"menuitemradio","aria-checked":d,...o,ref:t,"data-state":getCheckedState(d),onSelect:composeEventHandlers(o.onSelect,()=>{var f;return(f=l.onValueChange)==null?void 0:f.call(l,n)},{checkForDefaultPrevented:!1})})})});MenuRadioItem.displayName=RADIO_ITEM_NAME$1;var ITEM_INDICATOR_NAME$1="MenuItemIndicator",[ItemIndicatorProvider,useItemIndicatorContext]=createMenuContext(ITEM_INDICATOR_NAME$1,{checked:!1}),MenuItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,forceMount:o,...l}=e,d=useItemIndicatorContext(ITEM_INDICATOR_NAME$1,n);return jsxRuntime.jsx(Presence,{present:o||isIndeterminate$1(d.checked)||d.checked===!0,children:jsxRuntime.jsx(Primitive$4.span,{...l,ref:t,"data-state":getCheckedState(d.checked)})})});MenuItemIndicator.displayName=ITEM_INDICATOR_NAME$1;var SEPARATOR_NAME$2="MenuSeparator",MenuSeparator=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e;return jsxRuntime.jsx(Primitive$4.div,{role:"separator","aria-orientation":"horizontal",...o,ref:t})});MenuSeparator.displayName=SEPARATOR_NAME$2;var ARROW_NAME$4="MenuArrow",MenuArrow=React__namespace.forwardRef((e,t)=>{const{__scopeMenu:n,...o}=e,l=usePopperScope$3(n);return jsxRuntime.jsx(Arrow,{...l,...o,ref:t})});MenuArrow.displayName=ARROW_NAME$4;var SUB_NAME="MenuSub",[MenuSubProvider,useMenuSubContext]=createMenuContext(SUB_NAME),MenuSub=e=>{const{__scopeMenu:t,children:n,open:o=!1,onOpenChange:l}=e,d=useMenuContext(SUB_NAME,t),f=usePopperScope$3(t),[g,b]=React__namespace.useState(null),[_,S]=React__namespace.useState(null),R=useCallbackRef$1(l);return React__namespace.useEffect(()=>(d.open===!1&&R(!1),()=>R(!1)),[d.open,R]),jsxRuntime.jsx(Root2$7,{...f,children:jsxRuntime.jsx(MenuProvider,{scope:t,open:o,onOpenChange:R,content:_,onContentChange:S,children:jsxRuntime.jsx(MenuSubProvider,{scope:t,contentId:useId(),triggerId:useId(),trigger:g,onTriggerChange:b,children:n})})})};MenuSub.displayName=SUB_NAME;var SUB_TRIGGER_NAME$1="MenuSubTrigger",MenuSubTrigger=React__namespace.forwardRef((e,t)=>{const n=useMenuContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),o=useMenuRootContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),l=useMenuSubContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),d=useMenuContentContext(SUB_TRIGGER_NAME$1,e.__scopeMenu),f=React__namespace.useRef(null),{pointerGraceTimerRef:g,onPointerGraceIntentChange:b}=d,_={__scopeMenu:e.__scopeMenu},S=React__namespace.useCallback(()=>{f.current&&window.clearTimeout(f.current),f.current=null},[]);return React__namespace.useEffect(()=>S,[S]),React__namespace.useEffect(()=>{const R=g.current;return()=>{window.clearTimeout(R),b(null)}},[g,b]),jsxRuntime.jsx(MenuAnchor,{asChild:!0,..._,children:jsxRuntime.jsx(MenuItemImpl,{id:l.triggerId,"aria-haspopup":"menu","aria-expanded":n.open,"aria-controls":l.contentId,"data-state":getOpenState(n.open),...e,ref:composeRefs(t,l.onTriggerChange),onClick:R=>{var C;(C=e.onClick)==null||C.call(e,R),!(e.disabled||R.defaultPrevented)&&(R.currentTarget.focus(),n.open||n.onOpenChange(!0))},onPointerMove:composeEventHandlers(e.onPointerMove,whenMouse(R=>{d.onItemEnter(R),!R.defaultPrevented&&!e.disabled&&!n.open&&!f.current&&(d.onPointerGraceIntentChange(null),f.current=window.setTimeout(()=>{n.onOpenChange(!0),S()},100))})),onPointerLeave:composeEventHandlers(e.onPointerLeave,whenMouse(R=>{var E,A;S();const C=(E=n.content)==null?void 0:E.getBoundingClientRect();if(C){const M=(A=n.content)==null?void 0:A.dataset.side,I=M==="right",j=I?-5:5,q=C[I?"left":"right"],Q=C[I?"right":"left"];d.onPointerGraceIntentChange({area:[{x:R.clientX+j,y:R.clientY},{x:q,y:C.top},{x:Q,y:C.top},{x:Q,y:C.bottom},{x:q,y:C.bottom}],side:M}),window.clearTimeout(g.current),g.current=window.setTimeout(()=>d.onPointerGraceIntentChange(null),300)}else{if(d.onTriggerLeave(R),R.defaultPrevented)return;d.onPointerGraceIntentChange(null)}})),onKeyDown:composeEventHandlers(e.onKeyDown,R=>{var E;const C=d.searchRef.current!=="";e.disabled||C&&R.key===" "||SUB_OPEN_KEYS[o.dir].includes(R.key)&&(n.onOpenChange(!0),(E=n.content)==null||E.focus(),R.preventDefault())})})})});MenuSubTrigger.displayName=SUB_TRIGGER_NAME$1;var SUB_CONTENT_NAME$1="MenuSubContent",MenuSubContent=React__namespace.forwardRef((e,t)=>{const n=usePortalContext$2(CONTENT_NAME$8,e.__scopeMenu),{forceMount:o=n.forceMount,...l}=e,d=useMenuContext(CONTENT_NAME$8,e.__scopeMenu),f=useMenuRootContext(CONTENT_NAME$8,e.__scopeMenu),g=useMenuSubContext(SUB_CONTENT_NAME$1,e.__scopeMenu),b=React__namespace.useRef(null),_=useComposedRefs(t,b);return jsxRuntime.jsx(Collection$3.Provider,{scope:e.__scopeMenu,children:jsxRuntime.jsx(Presence,{present:o||d.open,children:jsxRuntime.jsx(Collection$3.Slot,{scope:e.__scopeMenu,children:jsxRuntime.jsx(MenuContentImpl,{id:g.contentId,"aria-labelledby":g.triggerId,...l,ref:_,align:"start",side:f.dir==="rtl"?"left":"right",disableOutsidePointerEvents:!1,disableOutsideScroll:!1,trapFocus:!1,onOpenAutoFocus:S=>{var R;f.isUsingKeyboardRef.current&&((R=b.current)==null||R.focus()),S.preventDefault()},onCloseAutoFocus:S=>S.preventDefault(),onFocusOutside:composeEventHandlers(e.onFocusOutside,S=>{S.target!==g.trigger&&d.onOpenChange(!1)}),onEscapeKeyDown:composeEventHandlers(e.onEscapeKeyDown,S=>{f.onClose(),S.preventDefault()}),onKeyDown:composeEventHandlers(e.onKeyDown,S=>{var E;const R=S.currentTarget.contains(S.target),C=SUB_CLOSE_KEYS[f.dir].includes(S.key);R&&C&&(d.onOpenChange(!1),(E=g.trigger)==null||E.focus(),S.preventDefault())})})})})})});MenuSubContent.displayName=SUB_CONTENT_NAME$1;function getOpenState(e){return e?"open":"closed"}function isIndeterminate$1(e){return e==="indeterminate"}function getCheckedState(e){return isIndeterminate$1(e)?"indeterminate":e?"checked":"unchecked"}function focusFirst$1(e){const t=document.activeElement;for(const n of e)if(n===t||(n.focus(),document.activeElement!==t))return}function wrapArray$1(e,t){return e.map((n,o)=>e[(t+o)%e.length])}function getNextMatch(e,t,n){const l=t.length>1&&Array.from(t).every(_=>_===t[0])?t[0]:t,d=n?e.indexOf(n):-1;let f=wrapArray$1(e,Math.max(d,0));l.length===1&&(f=f.filter(_=>_!==n));const b=f.find(_=>_.toLowerCase().startsWith(l.toLowerCase()));return b!==n?b:void 0}function isPointInPolygon$1(e,t){const{x:n,y:o}=e;let l=!1;for(let d=0,f=t.length-1;d<t.length;f=d++){const g=t[d],b=t[f],_=g.x,S=g.y,R=b.x,C=b.y;S>o!=C>o&&n<(R-_)*(o-S)/(C-S)+_&&(l=!l)}return l}function isPointerInGraceArea(e,t){if(!t)return!1;const n={x:e.clientX,y:e.clientY};return isPointInPolygon$1(n,t)}function whenMouse(e){return t=>t.pointerType==="mouse"?e(t):void 0}var Root3$1=Menu,Anchor2$1=MenuAnchor,Portal$3=MenuPortal,Content2$6=MenuContent,Group$1=MenuGroup,Label$4=MenuLabel,Item2$1=MenuItem,CheckboxItem=MenuCheckboxItem,RadioGroup=MenuRadioGroup,RadioItem=MenuRadioItem,ItemIndicator$1=MenuItemIndicator,Separator$3=MenuSeparator,Arrow2=MenuArrow,Sub=MenuSub,SubTrigger=MenuSubTrigger,SubContent=MenuSubContent,DROPDOWN_MENU_NAME="DropdownMenu",[createDropdownMenuContext]=createContextScope$2(DROPDOWN_MENU_NAME,[createMenuScope]),useMenuScope=createMenuScope(),[DropdownMenuProvider,useDropdownMenuContext]=createDropdownMenuContext(DROPDOWN_MENU_NAME),DropdownMenu$1=e=>{const{__scopeDropdownMenu:t,children:n,dir:o,open:l,defaultOpen:d,onOpenChange:f,modal:g=!0}=e,b=useMenuScope(t),_=React__namespace.useRef(null),[S,R]=useControllableState({prop:l,defaultProp:d??!1,onChange:f,caller:DROPDOWN_MENU_NAME});return jsxRuntime.jsx(DropdownMenuProvider,{scope:t,triggerId:useId(),triggerRef:_,contentId:useId(),open:S,onOpenChange:R,onOpenToggle:React__namespace.useCallback(()=>R(C=>!C),[R]),modal:g,children:jsxRuntime.jsx(Root3$1,{...b,open:S,onOpenChange:R,dir:o,modal:g,children:n})})};DropdownMenu$1.displayName=DROPDOWN_MENU_NAME;var TRIGGER_NAME$8="DropdownMenuTrigger",DropdownMenuTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,disabled:o=!1,...l}=e,d=useDropdownMenuContext(TRIGGER_NAME$8,n),f=useMenuScope(n);return jsxRuntime.jsx(Anchor2$1,{asChild:!0,...f,children:jsxRuntime.jsx(Primitive$4.button,{type:"button",id:d.triggerId,"aria-haspopup":"menu","aria-expanded":d.open,"aria-controls":d.open?d.contentId:void 0,"data-state":d.open?"open":"closed","data-disabled":o?"":void 0,disabled:o,...l,ref:composeRefs(t,d.triggerRef),onPointerDown:composeEventHandlers(e.onPointerDown,g=>{!o&&g.button===0&&g.ctrlKey===!1&&(d.onOpenToggle(),d.open||g.preventDefault())}),onKeyDown:composeEventHandlers(e.onKeyDown,g=>{o||(["Enter"," "].includes(g.key)&&d.onOpenToggle(),g.key==="ArrowDown"&&d.onOpenChange(!0),["Enter"," ","ArrowDown"].includes(g.key)&&g.preventDefault())})})})});DropdownMenuTrigger$1.displayName=TRIGGER_NAME$8;var PORTAL_NAME$4="DropdownMenuPortal",DropdownMenuPortal$1=e=>{const{__scopeDropdownMenu:t,...n}=e,o=useMenuScope(t);return jsxRuntime.jsx(Portal$3,{...o,...n})};DropdownMenuPortal$1.displayName=PORTAL_NAME$4;var CONTENT_NAME$7="DropdownMenuContent",DropdownMenuContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useDropdownMenuContext(CONTENT_NAME$7,n),d=useMenuScope(n),f=React__namespace.useRef(!1);return jsxRuntime.jsx(Content2$6,{id:l.contentId,"aria-labelledby":l.triggerId,...d,...o,ref:t,onCloseAutoFocus:composeEventHandlers(e.onCloseAutoFocus,g=>{var b;f.current||(b=l.triggerRef.current)==null||b.focus(),f.current=!1,g.preventDefault()}),onInteractOutside:composeEventHandlers(e.onInteractOutside,g=>{const b=g.detail.originalEvent,_=b.button===0&&b.ctrlKey===!0,S=b.button===2||_;(!l.modal||S)&&(f.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)"}})});DropdownMenuContent$1.displayName=CONTENT_NAME$7;var GROUP_NAME$1="DropdownMenuGroup",DropdownMenuGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Group$1,{...l,...o,ref:t})});DropdownMenuGroup$1.displayName=GROUP_NAME$1;var LABEL_NAME$1="DropdownMenuLabel",DropdownMenuLabel$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Label$4,{...l,...o,ref:t})});DropdownMenuLabel$1.displayName=LABEL_NAME$1;var ITEM_NAME$2="DropdownMenuItem",DropdownMenuItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Item2$1,{...l,...o,ref:t})});DropdownMenuItem$1.displayName=ITEM_NAME$2;var CHECKBOX_ITEM_NAME="DropdownMenuCheckboxItem",DropdownMenuCheckboxItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(CheckboxItem,{...l,...o,ref:t})});DropdownMenuCheckboxItem$1.displayName=CHECKBOX_ITEM_NAME;var RADIO_GROUP_NAME="DropdownMenuRadioGroup",DropdownMenuRadioGroup$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(RadioGroup,{...l,...o,ref:t})});DropdownMenuRadioGroup$1.displayName=RADIO_GROUP_NAME;var RADIO_ITEM_NAME="DropdownMenuRadioItem",DropdownMenuRadioItem$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(RadioItem,{...l,...o,ref:t})});DropdownMenuRadioItem$1.displayName=RADIO_ITEM_NAME;var INDICATOR_NAME$2="DropdownMenuItemIndicator",DropdownMenuItemIndicator=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(ItemIndicator$1,{...l,...o,ref:t})});DropdownMenuItemIndicator.displayName=INDICATOR_NAME$2;var SEPARATOR_NAME$1="DropdownMenuSeparator",DropdownMenuSeparator$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Separator$3,{...l,...o,ref:t})});DropdownMenuSeparator$1.displayName=SEPARATOR_NAME$1;var ARROW_NAME$3="DropdownMenuArrow",DropdownMenuArrow=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(Arrow2,{...l,...o,ref:t})});DropdownMenuArrow.displayName=ARROW_NAME$3;var DropdownMenuSub$1=e=>{const{__scopeDropdownMenu:t,children:n,open:o,onOpenChange:l,defaultOpen:d}=e,f=useMenuScope(t),[g,b]=useControllableState({prop:o,defaultProp:d??!1,onChange:l,caller:"DropdownMenuSub"});return jsxRuntime.jsx(Sub,{...f,open:g,onOpenChange:b,children:n})},SUB_TRIGGER_NAME="DropdownMenuSubTrigger",DropdownMenuSubTrigger$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(SubTrigger,{...l,...o,ref:t})});DropdownMenuSubTrigger$1.displayName=SUB_TRIGGER_NAME;var SUB_CONTENT_NAME="DropdownMenuSubContent",DropdownMenuSubContent$1=React__namespace.forwardRef((e,t)=>{const{__scopeDropdownMenu:n,...o}=e,l=useMenuScope(n);return jsxRuntime.jsx(SubContent,{...l,...o,ref:t,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)"}})});DropdownMenuSubContent$1.displayName=SUB_CONTENT_NAME;var Root2$6=DropdownMenu$1,Trigger$5=DropdownMenuTrigger$1,Portal2$1=DropdownMenuPortal$1,Content2$5=DropdownMenuContent$1,Group2=DropdownMenuGroup$1,Label2=DropdownMenuLabel$1,Item2=DropdownMenuItem$1,CheckboxItem2=DropdownMenuCheckboxItem$1,RadioGroup2=DropdownMenuRadioGroup$1,RadioItem2=DropdownMenuRadioItem$1,ItemIndicator2=DropdownMenuItemIndicator,Separator2=DropdownMenuSeparator$1,Sub2=DropdownMenuSub$1,SubTrigger2=DropdownMenuSubTrigger$1,SubContent2=DropdownMenuSubContent$1;const DropdownMenu=Root2$6,DropdownMenuTrigger=Trigger$5,DropdownMenuGroup=Group2,DropdownMenuPortal=Portal2$1,DropdownMenuSub=Sub2,DropdownMenuRadioGroup=RadioGroup2,DropdownMenuSubTrigger=React__namespace.forwardRef(({className:e,inset:t,children:n,...o},l)=>jsxRuntime.jsxs(SubTrigger2,{ref:l,className:cn("flex cursor-default select-none items-center gap-2 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",t&&"pl-8",e),...o,children:[n,jsxRuntime.jsx(ChevronRight,{className:"ml-auto"})]}));DropdownMenuSubTrigger.displayName=SubTrigger2.displayName;const DropdownMenuSubContent=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(SubContent2,{ref:n,className:cn("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 origin-[--radix-dropdown-menu-content-transform-origin]",e),...t}));DropdownMenuSubContent.displayName=SubContent2.displayName;const DropdownMenuContent=React__namespace.forwardRef(({className:e,sideOffset:t=4,...n},o)=>jsxRuntime.jsx(Portal2$1,{children:jsxRuntime.jsx(Content2$5,{ref:o,sideOffset:t,className:cn("z-50 max-h-[var(--radix-dropdown-menu-content-available-height)] min-w-[8rem] overflow-y-auto overflow-x-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 origin-[--radix-dropdown-menu-content-transform-origin]",e),...n})}));DropdownMenuContent.displayName=Content2$5.displayName;const DropdownMenuItem=React__namespace.forwardRef(({className:e,inset:t,...n},o)=>jsxRuntime.jsx(Item2,{ref:o,className:cn("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",t&&"pl-8",e),...n}));DropdownMenuItem.displayName=Item2.displayName;const DropdownMenuCheckboxItem=React__namespace.forwardRef(({className:e,children:t,checked:n,...o},l)=>jsxRuntime.jsxs(CheckboxItem2,{ref:l,className:cn("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:n,...o,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator2,{children:jsxRuntime.jsx(Check,{className:"h-4 w-4"})})}),t]}));DropdownMenuCheckboxItem.displayName=CheckboxItem2.displayName;const DropdownMenuRadioItem=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsxs(RadioItem2,{ref:o,className:cn("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),...n,children:[jsxRuntime.jsx("span",{className:"absolute left-2 flex h-3.5 w-3.5 items-center justify-center",children:jsxRuntime.jsx(ItemIndicator2,{children:jsxRuntime.jsx(Circle,{className:"h-2 w-2 fill-current"})})}),t]}));DropdownMenuRadioItem.displayName=RadioItem2.displayName;const DropdownMenuLabel=React__namespace.forwardRef(({className:e,inset:t,...n},o)=>jsxRuntime.jsx(Label2,{ref:o,className:cn("px-2 py-1.5 text-sm font-semibold",t&&"pl-8",e),...n}));DropdownMenuLabel.displayName=Label2.displayName;const DropdownMenuSeparator=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Separator2,{ref:n,className:cn("-mx-1 my-1 h-px bg-muted",e),...t}));DropdownMenuSeparator.displayName=Separator2.displayName;const DropdownMenuShortcut=({className:e,...t})=>jsxRuntime.jsx("span",{className:cn("ml-auto text-xs tracking-widest opacity-60",e),...t});DropdownMenuShortcut.displayName="DropdownMenuShortcut";var REACT_LAZY_TYPE=Symbol.for("react.lazy"),use=React__namespace[" use ".trim().toString()];function isPromiseLike(e){return typeof e=="object"&&e!==null&&"then"in e}function isLazyComponent(e){return e!=null&&typeof e=="object"&&"$$typeof"in e&&e.$$typeof===REACT_LAZY_TYPE&&"_payload"in e&&isPromiseLike(e._payload)}function createSlot$2(e){const t=createSlotClone$2(e),n=React__namespace.forwardRef((o,l)=>{let{children:d,...f}=o;isLazyComponent(d)&&typeof use=="function"&&(d=use(d._payload));const g=React__namespace.Children.toArray(d),b=g.find(isSlottable$2);if(b){const _=b.props.children,S=g.map(R=>R===b?React__namespace.Children.count(_)>1?React__namespace.Children.only(null):React__namespace.isValidElement(_)?_.props.children:null:R);return jsxRuntime.jsx(t,{...f,ref:l,children:React__namespace.isValidElement(_)?React__namespace.cloneElement(_,void 0,S):null})}return jsxRuntime.jsx(t,{...f,ref:l,children:d})});return n.displayName=`${e}.Slot`,n}var Slot$2=createSlot$2("Slot");function createSlotClone$2(e){const t=React__namespace.forwardRef((n,o)=>{let{children:l,...d}=n;if(isLazyComponent(l)&&typeof use=="function"&&(l=use(l._payload)),React__namespace.isValidElement(l)){const f=getElementRef$2(l),g=mergeProps$2(d,l.props);return l.type!==React__namespace.Fragment&&(g.ref=o?composeRefs(o,f):f),React__namespace.cloneElement(l,g)}return React__namespace.Children.count(l)>1?React__namespace.Children.only(null):null});return t.displayName=`${e}.SlotClone`,t}var SLOTTABLE_IDENTIFIER$4=Symbol("radix.slottable");function isSlottable$2(e){return React__namespace.isValidElement(e)&&typeof e.type=="function"&&"__radixId"in e.type&&e.type.__radixId===SLOTTABLE_IDENTIFIER$4}function mergeProps$2(e,t){const n={...t};for(const o in t){const l=e[o],d=t[o];/^on[A-Z]/.test(o)?l&&d?n[o]=(...g)=>{const b=d(...g);return l(...g),b}:l&&(n[o]=l):o==="style"?n[o]={...l,...d}:o==="className"&&(n[o]=[l,d].filter(Boolean).join(" "))}return{...e,...n}}function getElementRef$2(e){var o,l;let t=(o=Object.getOwnPropertyDescriptor(e.props,"ref"))==null?void 0:o.get,n=t&&"isReactWarning"in t&&t.isReactWarning;return n?e.ref:(t=(l=Object.getOwnPropertyDescriptor(e,"ref"))==null?void 0:l.get,n=t&&"isReactWarning"in t&&t.isReactWarning,n?e.props.ref:e.props.ref||e.ref)}const falsyToString=e=>typeof e=="boolean"?`${e}`:e===0?"0":e,cx=clsx,cva=(e,t)=>n=>{var o;if((t==null?void 0:t.variants)==null)return cx(e,n==null?void 0:n.class,n==null?void 0:n.className);const{variants:l,defaultVariants:d}=t,f=Object.keys(l).map(_=>{const S=n==null?void 0:n[_],R=d==null?void 0:d[_];if(S===null)return null;const C=falsyToString(S)||falsyToString(R);return l[_][C]}),g=n&&Object.entries(n).reduce((_,S)=>{let[R,C]=S;return C===void 0||(_[R]=C),_},{}),b=t==null||(o=t.compoundVariants)===null||o===void 0?void 0:o.reduce((_,S)=>{let{class:R,className:C,...E}=S;return Object.entries(E).every(A=>{let[M,I]=A;return Array.isArray(I)?I.includes({...d,...g}[M]):{...d,...g}[M]===I})?[..._,R,C]:_},[]);return cx(e,f,b,n==null?void 0:n.class,n==null?void 0:n.className)},buttonVariants=cva("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0 cursor-pointer",{variants:{variant:{default:"bg-primary text-primary-foreground shadow-sm hover:bg-primary/90",destructive:"bg-destructive text-destructive-foreground shadow-xs hover:bg-destructive/90",outline:"border border-input text-foreground bg-background shadow-xs hover:bg-accent hover:text-accent-foreground",defaultOutline:"border border-red-600/30 text-red-600 bg-background shadow-xs hover:bg-red-600/5 ",secondary:"bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline",blue:"bg-randmar-blue text-gray-100 shadow-sm hover:bg-randmar-blue/90",red:"bg-randmar-red text-gray-100 shadow-sm hover:bg-randmar-red/90",purple:"bg-randmar-purple text-gray-100 shadow-sm hover:bg-randmar-purple/90",none:""},size:{default:"h-9 px-4 py-2",sm:"h-8 rounded-md px-3 text-xs",lg:"h-10 rounded-md px-8",icon:"h-9 w-9"}},defaultVariants:{variant:"default",size:"default"}}),Button$1=React__namespace.forwardRef(({className:e,variant:t,size:n,asChild:o=!1,confirmationDialog:l,onClick:d,...f},g)=>{const b=o?Slot$2:"button";if(!l)return jsxRuntime.jsx(b,{className:cn(buttonVariants({variant:t,size:n,className:e})),ref:g,onClick:d,...f});d&&console.warn("Button: You provided both onClick and confirmationDialog props. The onClick prop will be ignored. Use the onConfirm callback in confirmationDialog instead.");const{title:_,content:S,onConfirm:R,confirmText:C="Confirm",cancelText:E="Cancel"}=l,A=()=>{R()};return jsxRuntime.jsxs(Dialog,{children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsx(b,{className:cn(buttonVariants({variant:t,size:n,className:e})),ref:g,...f})}),jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:_}),jsxRuntime.jsx(DialogDescription,{children:S})]}),jsxRuntime.jsxs(DialogFooter,{className:"flex justify-end gap-2 pt-4",children:[jsxRuntime.jsx(DialogClose,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"outline",children:E})}),jsxRuntime.jsx(DialogClose,{asChild:!0,children:jsxRuntime.jsx(Button$1,{onClick:A,children:C})})]})]})]})});Button$1.displayName="Button";function formatProdErrorMessage$1(e){return`Minified Redux error #${e}; visit https://redux.js.org/Errors?code=${e} for the full message or use the non-minified dev environment for full errors. `}var randomString=()=>Math.random().toString(36).substring(7).split("").join("."),ActionTypes={INIT:`@@redux/INIT${randomString()}`,REPLACE:`@@redux/REPLACE${randomString()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${randomString()}`},actionTypes_default=ActionTypes;function isPlainObject$4(e){if(typeof e!="object"||e===null)return!1;let t=e;for(;Object.getPrototypeOf(t)!==null;)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t||Object.getPrototypeOf(e)===null}function miniKindOf(e){if(e===void 0)return"undefined";if(e===null)return"null";const t=typeof e;switch(t){case"boolean":case"string":case"number":case"symbol":case"function":return t}if(Array.isArray(e))return"array";if(isDate$1(e))return"date";if(isError(e))return"error";const n=ctorName(e);switch(n){case"Symbol":case"Promise":case"WeakMap":case"WeakSet":case"Map":case"Set":return n}return Object.prototype.toString.call(e).slice(8,-1).toLowerCase().replace(/\s/g,"")}function ctorName(e){return typeof e.constructor=="function"?e.constructor.name:null}function isError(e){return e instanceof Error||typeof e.message=="string"&&e.constructor&&typeof e.constructor.stackTraceLimit=="number"}function isDate$1(e){return e instanceof Date?!0:typeof e.toDateString=="function"&&typeof e.getDate=="function"&&typeof e.setDate=="function"}function kindOf(e){let t=typeof e;return process.env.NODE_ENV!=="production"&&(t=miniKindOf(e)),t}function warning(e){typeof console<"u"&&typeof console.error=="function"&&console.error(e);try{throw new Error(e)}catch{}}function getUnexpectedStateShapeWarningMessage(e,t,n,o){const l=Object.keys(t),d=n&&n.type===actionTypes_default.INIT?"preloadedState argument passed to createStore":"previous state received by the reducer";if(l.length===0)return"Store does not have a valid reducer. Make sure the argument passed to combineReducers is an object whose values are reducers.";if(!isPlainObject$4(e))return`The ${d} has unexpected type of "${kindOf(e)}". Expected argument to be an object with the following keys: "${l.join('", "')}"`;const f=Object.keys(e).filter(g=>!t.hasOwnProperty(g)&&!o[g]);if(f.forEach(g=>{o[g]=!0}),!(n&&n.type===actionTypes_default.REPLACE)&&f.length>0)return`Unexpected ${f.length>1?"keys":"key"} "${f.join('", "')}" found in ${d}. Expected to find one of the known reducer keys instead: "${l.join('", "')}". Unexpected keys will be ignored.`}function assertReducerShape(e){Object.keys(e).forEach(t=>{const n=e[t];if(typeof n(void 0,{type:actionTypes_default.INIT})>"u")throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(12):`The slice reducer for key "${t}" returned undefined during initialization. If the state passed to the reducer is undefined, you must explicitly return the initial state. The initial state may not be undefined. If you don't want to set a value for this reducer, you can use null instead of undefined.`);if(typeof n(void 0,{type:actionTypes_default.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(13):`The slice reducer for key "${t}" returned undefined when probed with a random type. Don't try to handle '${actionTypes_default.INIT}' or other actions in "redux/*" namespace. They are considered private. Instead, you must return the current state for any unknown actions, unless it is undefined, in which case you must return the initial state, regardless of the action type. The initial state may not be undefined, but can be null.`)})}function combineReducers(e){const t=Object.keys(e),n={};for(let f=0;f<t.length;f++){const g=t[f];process.env.NODE_ENV!=="production"&&typeof e[g]>"u"&&warning(`No reducer provided for key "${g}"`),typeof e[g]=="function"&&(n[g]=e[g])}const o=Object.keys(n);let l;process.env.NODE_ENV!=="production"&&(l={});let d;try{assertReducerShape(n)}catch(f){d=f}return function(g={},b){if(d)throw d;if(process.env.NODE_ENV!=="production"){const R=getUnexpectedStateShapeWarningMessage(g,n,b,l);R&&warning(R)}let _=!1;const S={};for(let R=0;R<o.length;R++){const C=o[R],E=n[C],A=g[C],M=E(A,b);if(typeof M>"u"){const I=b&&b.type;throw new Error(process.env.NODE_ENV==="production"?formatProdErrorMessage$1(14):`When called with an action of type ${I?`"${String(I)}"`:"(unknown type)"}, the slice reducer for key "${C}" returned undefined. To ignore an action, you must explicitly return the previous state. If you want this reducer to hold no value, you can return null instead of undefined.`)}S[C]=M,_=_||M!==A}return _=_||o.length!==Object.keys(g).length,_?S:g}}function isAction(e){return isPlainObject$4(e)&&"type"in e&&typeof e.type=="string"}var NOTHING=Symbol.for("immer-nothing"),DRAFTABLE=Symbol.for("immer-draftable"),DRAFT_STATE=Symbol.for("immer-state"),errors=process.env.NODE_ENV!=="production"?[function(e){return`The plugin for '${e}' has not been loaded into Immer. To enable the plugin, import and call \`enable${e}()\` when initializing your application.`},function(e){return`produce can only be called on things that are draftable: plain objects, arrays, Map, Set or classes that are marked with '[immerable]: true'. Got '${e}'`},"This object has been frozen and should not be mutated",function(e){return"Cannot use a proxy that has been revoked. Did you pass an object from inside an immer function to an async process? "+e},"An immer producer returned a new value *and* modified its draft. Either return a new value *or* modify the draft.","Immer forbids circular references","The first or second argument to `produce` must be a function","The third argument to `produce` must be a function or undefined","First argument to `createDraft` must be a plain object, an array, or an immerable object","First argument to `finishDraft` must be a draft returned by `createDraft`",function(e){return`'current' expects a draft, got: ${e}`},"Object.defineProperty() cannot be used on an Immer draft","Object.setPrototypeOf() cannot be used on an Immer draft","Immer only supports deleting array indices","Immer only supports setting array indices and the 'length' property",function(e){return`'original' expects a draft, got: ${e}`}]:[];function die(e,...t){if(process.env.NODE_ENV!=="production"){const n=errors[e],o=isFunction$6(n)?n.apply(null,t):n;throw new Error(`[Immer] ${o}`)}throw new Error(`[Immer] minified error nr: ${e}. Full error at: https://bit.ly/3cXEKWf`)}var O=Object,getPrototypeOf$1=O.getPrototypeOf,CONSTRUCTOR="constructor",PROTOTYPE="prototype",CONFIGURABLE="configurable",ENUMERABLE="enumerable",WRITABLE="writable",VALUE="value",isDraft=e=>!!e&&!!e[DRAFT_STATE];function isDraftable(e){var t;return e?isPlainObject$3(e)||isArray$2(e)||!!e[DRAFTABLE]||!!((t=e[CONSTRUCTOR])!=null&&t[DRAFTABLE])||isMap(e)||isSet(e):!1}var objectCtorString=O[PROTOTYPE][CONSTRUCTOR].toString(),cachedCtorStrings=new WeakMap;function isPlainObject$3(e){if(!e||!isObjectish(e))return!1;const t=getPrototypeOf$1(e);if(t===null||t===O[PROTOTYPE])return!0;const n=O.hasOwnProperty.call(t,CONSTRUCTOR)&&t[CONSTRUCTOR];if(n===Object)return!0;if(!isFunction$6(n))return!1;let o=cachedCtorStrings.get(n);return o===void 0&&(o=Function.toString.call(n),cachedCtorStrings.set(n,o)),o===objectCtorString}function original(e){return isDraft(e)||die(15,e),e[DRAFT_STATE].base_}function each(e,t,n=!0){getArchtype(e)===0?(n?Reflect.ownKeys(e):O.keys(e)).forEach(l=>{t(l,e[l],e)}):e.forEach((o,l)=>t(l,o,e))}function getArchtype(e){const t=e[DRAFT_STATE];return t?t.type_:isArray$2(e)?1:isMap(e)?2:isSet(e)?3:0}var has$1=(e,t,n=getArchtype(e))=>n===2?e.has(t):O[PROTOTYPE].hasOwnProperty.call(e,t),get$3=(e,t,n=getArchtype(e))=>n===2?e.get(t):e[t],set$2=(e,t,n,o=getArchtype(e))=>{o===2?e.set(t,n):o===3?e.add(n):e[t]=n};function is$1(e,t){return e===t?e!==0||1/e===1/t:e!==e&&t!==t}var isArray$2=Array.isArray,isMap=e=>e instanceof Map,isSet=e=>e instanceof Set,isObjectish=e=>typeof e=="object",isFunction$6=e=>typeof e=="function",isBoolean$2=e=>typeof e=="boolean",getProxyDraft=e=>isObjectish(e)?e==null?void 0:e[DRAFT_STATE]:null,latest=e=>e.copy_||e.base_,getFinalValue=e=>e.modified_?e.copy_:e.base_;function shallowCopy(e,t){if(isMap(e))return new Map(e);if(isSet(e))return new Set(e);if(isArray$2(e))return Array[PROTOTYPE].slice.call(e);const n=isPlainObject$3(e);if(t===!0||t==="class_only"&&!n){const o=O.getOwnPropertyDescriptors(e);delete o[DRAFT_STATE];let l=Reflect.ownKeys(o);for(let d=0;d<l.length;d++){const f=l[d],g=o[f];g[WRITABLE]===!1&&(g[WRITABLE]=!0,g[CONFIGURABLE]=!0),(g.get||g.set)&&(o[f]={[CONFIGURABLE]:!0,[WRITABLE]:!0,[ENUMERABLE]:g[ENUMERABLE],[VALUE]:e[f]})}return O.create(getPrototypeOf$1(e),o)}else{const o=getPrototypeOf$1(e);if(o!==null&&n)return{...e};const l=O.create(o);return O.assign(l,e)}}function freeze$1(e,t=!1){return isFrozen$1(e)||isDraft(e)||!isDraftable(e)||(getArchtype(e)>1&&O.defineProperties(e,{set:dontMutateMethodOverride,add:dontMutateMethodOverride,clear:dontMutateMethodOverride,delete:dontMutateMethodOverride}),O.freeze(e),t&&each(e,(n,o)=>{freeze$1(o,!0)},!1)),e}function dontMutateFrozenCollections(){die(2)}var dontMutateMethodOverride={[VALUE]:dontMutateFrozenCollections};function isFrozen$1(e){return e===null||!isObjectish(e)?!0:O.isFrozen(e)}var PluginMapSet="MapSet",PluginPatches="Patches",plugins={};function getPlugin(e){const t=plugins[e];return t||die(0,e),t}var isPluginLoaded=e=>!!plugins[e];function loadPlugin(e,t){plugins[e]||(plugins[e]=t)}var currentScope,getCurrentScope=()=>currentScope,createScope=(e,t)=>({drafts_:[],parent_:e,immer_:t,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:isPluginLoaded(PluginMapSet)?getPlugin(PluginMapSet):void 0});function usePatchesInScope(e,t){t&&(e.patchPlugin_=getPlugin(PluginPatches),e.patches_=[],e.inversePatches_=[],e.patchListener_=t)}function revokeScope(e){leaveScope(e),e.drafts_.forEach(revokeDraft),e.drafts_=null}function leaveScope(e){e===currentScope&&(currentScope=e.parent_)}var enterScope=e=>currentScope=createScope(currentScope,e);function revokeDraft(e){const t=e[DRAFT_STATE];t.type_===0||t.type_===1?t.revoke_():t.revoked_=!0}function processResult(e,t){t.unfinalizedDrafts_=t.drafts_.length;const n=t.drafts_[0];if(e!==void 0&&e!==n){n[DRAFT_STATE].modified_&&(revokeScope(t),die(4)),isDraftable(e)&&(e=finalize(t,e));const{patchPlugin_:l}=t;l&&l.generateReplacementPatches_(n[DRAFT_STATE].base_,e,t)}else e=finalize(t,n);return maybeFreeze(t,e,!0),revokeScope(t),t.patches_&&t.patchListener_(t.patches_,t.inversePatches_),e!==NOTHING?e:void 0}function finalize(e,t){if(isFrozen$1(t))return t;const n=t[DRAFT_STATE];if(!n)return handleValue(t,e.handledSet_,e);if(!isSameScope(n,e))return t;if(!n.modified_)return n.base_;if(!n.finalized_){const{callbacks_:o}=n;if(o)for(;o.length>0;)o.pop()(e);generatePatchesAndFinalize(n,e)}return n.copy_}function maybeFreeze(e,t,n=!1){!e.parent_&&e.immer_.autoFreeze_&&e.canAutoFreeze_&&freeze$1(t,n)}function markStateFinalized(e){e.finalized_=!0,e.scope_.unfinalizedDrafts_--}var isSameScope=(e,t)=>e.scope_===t,EMPTY_LOCATIONS_RESULT=[];function updateDraftInParent(e,t,n,o){const l=latest(e),d=e.type_;if(o!==void 0&&get$3(l,o,d)===t){set$2(l,o,n,d);return}if(!e.draftLocations_){const g=e.draftLocations_=new Map;each(l,(b,_)=>{if(isDraft(_)){const S=g.get(_)||[];S.push(b),g.set(_,S)}})}const f=e.draftLocations_.get(t)??EMPTY_LOCATIONS_RESULT;for(const g of f)set$2(l,g,n,d)}function registerChildFinalizationCallback(e,t,n){e.callbacks_.push(function(l){var g;const d=t;if(!d||!isSameScope(d,l))return;(g=l.mapSetPlugin_)==null||g.fixSetContents(d);const f=getFinalValue(d);updateDraftInParent(e,d.draft_??d,f,n),generatePatchesAndFinalize(d,l)})}function generatePatchesAndFinalize(e,t){var o;if(e.modified_&&!e.finalized_&&(e.type_===3||(((o=e.assigned_)==null?void 0:o.size)??0)>0)){const{patchPlugin_:l}=t;if(l){const d=l.getPath(e);d&&l.generatePatches_(e,d,t)}markStateFinalized(e)}}function handleCrossReference(e,t,n){const{scope_:o}=e;if(isDraft(n)){const l=n[DRAFT_STATE];isSameScope(l,o)&&l.callbacks_.push(function(){prepareCopy(e);const f=getFinalValue(l);updateDraftInParent(e,n,f,t)})}else isDraftable(n)&&e.callbacks_.push(function(){const d=latest(e);get$3(d,t,e.type_)===n&&o.drafts_.length>1&&(e.assigned_.get(t)??!1)===!0&&e.copy_&&handleValue(get$3(e.copy_,t,e.type_),o.handledSet_,o)})}function handleValue(e,t,n){return!n.immer_.autoFreeze_&&n.unfinalizedDrafts_<1||isDraft(e)||t.has(e)||!isDraftable(e)||isFrozen$1(e)||(t.add(e),each(e,(o,l)=>{if(isDraft(l)){const d=l[DRAFT_STATE];if(isSameScope(d,n)){const f=getFinalValue(d);set$2(e,o,f,e.type_),markStateFinalized(d)}}else isDraftable(l)&&handleValue(l,t,n)})),e}function createProxyProxy(e,t){const n=isArray$2(e),o={type_:n?1:0,scope_:t?t.scope_:getCurrentScope(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:t,base_:e,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let l=o,d=objectTraps;n&&(l=[o],d=arrayTraps);const{revoke:f,proxy:g}=Proxy.revocable(l,d);return o.draft_=g,o.revoke_=f,[g,o]}var objectTraps={get(e,t){if(t===DRAFT_STATE)return e;const n=latest(e);if(!has$1(n,t,e.type_))return readPropFromProto(e,n,t);const o=n[t];if(e.finalized_||!isDraftable(o))return o;if(o===peek(e.base_,t)){prepareCopy(e);const l=e.type_===1?+t:t,d=createProxy(e.scope_,o,e,l);return e.copy_[l]=d}return o},has(e,t){return t in latest(e)},ownKeys(e){return Reflect.ownKeys(latest(e))},set(e,t,n){const o=getDescriptorFromProto(latest(e),t);if(o!=null&&o.set)return o.set.call(e.draft_,n),!0;if(!e.modified_){const l=peek(latest(e),t),d=l==null?void 0:l[DRAFT_STATE];if(d&&d.base_===n)return e.copy_[t]=n,e.assigned_.set(t,!1),!0;if(is$1(n,l)&&(n!==void 0||has$1(e.base_,t,e.type_)))return!0;prepareCopy(e),markChanged(e)}return e.copy_[t]===n&&(n!==void 0||t in e.copy_)||Number.isNaN(n)&&Number.isNaN(e.copy_[t])||(e.copy_[t]=n,e.assigned_.set(t,!0),handleCrossReference(e,t,n)),!0},deleteProperty(e,t){return prepareCopy(e),peek(e.base_,t)!==void 0||t in e.base_?(e.assigned_.set(t,!1),markChanged(e)):e.assigned_.delete(t),e.copy_&&delete e.copy_[t],!0},getOwnPropertyDescriptor(e,t){const n=latest(e),o=Reflect.getOwnPropertyDescriptor(n,t);return o&&{[WRITABLE]:!0,[CONFIGURABLE]:e.type_!==1||t!=="length",[ENUMERABLE]:o[ENUMERABLE],[VALUE]:n[t]}},defineProperty(){die(11)},getPrototypeOf(e){return getPrototypeOf$1(e.base_)},setPrototypeOf(){die(12)}},arrayTraps={};each(objectTraps,(e,t)=>{arrayTraps[e]=function(){const n=arguments;return n[0]=n[0][0],t.apply(this,n)}}),arrayTraps.deleteProperty=function(e,t){return process.env.NODE_ENV!=="production"&&isNaN(parseInt(t))&&die(13),arrayTraps.set.call(this,e,t,void 0)},arrayTraps.set=function(e,t,n){return process.env.NODE_ENV!=="production"&&t!=="length"&&isNaN(parseInt(t))&&die(14),objectTraps.set.call(this,e[0],t,n,e[0])};function peek(e,t){const n=e[DRAFT_STATE];return(n?latest(n):e)[t]}function readPropFromProto(e,t,n){var l;const o=getDescriptorFromProto(t,n);return o?VALUE in o?o[VALUE]:(l=o.get)==null?void 0:l.call(e.draft_):void 0}function getDescriptorFromProto(e,t){if(!(t in e))return;let n=getPrototypeOf$1(e);for(;n;){const o=Object.getOwnPropertyDescriptor(n,t);if(o)return o;n=getPrototypeOf$1(n)}}function markChanged(e){e.modified_||(e.modified_=!0,e.parent_&&markChanged(e.parent_))}function prepareCopy(e){e.copy_||(e.assigned_=new Map,e.copy_=shallowCopy(e.base_,e.scope_.immer_.useStrictShallowCopy_))}var Immer2=class{constructor(e){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(t,n,o)=>{if(isFunction$6(t)&&!isFunction$6(n)){const d=n;n=t;const f=this;return function(b=d,..._){return f.produce(b,S=>n.call(this,S,..._))}}isFunction$6(n)||die(6),o!==void 0&&!isFunction$6(o)&&die(7);let l;if(isDraftable(t)){const d=enterScope(this),f=createProxy(d,t,void 0);let g=!0;try{l=n(f),g=!1}finally{g?revokeScope(d):leaveScope(d)}return usePatchesInScope(d,o),processResult(l,d)}else if(!t||!isObjectish(t)){if(l=n(t),l===void 0&&(l=t),l===NOTHING&&(l=void 0),this.autoFreeze_&&freeze$1(l,!0),o){const d=[],f=[];getPlugin(PluginPatches).generateReplacementPatches_(t,l,{patches_:d,inversePatches_:f}),o(d,f)}return l}else die(1,t)},this.produceWithPatches=(t,n)=>{if(isFunction$6(t))return(f,...g)=>this.produceWithPatches(f,b=>t(b,...g));let o,l;return[this.produce(t,n,(f,g)=>{o=f,l=g}),o,l]},isBoolean$2(e==null?void 0:e.autoFreeze)&&this.setAutoFreeze(e.autoFreeze),isBoolean$2(e==null?void 0:e.useStrictShallowCopy)&&this.setUseStrictShallowCopy(e.useStrictShallowCopy),isBoolean$2(e==null?void 0:e.useStrictIteration)&&this.setUseStrictIteration(e.useStrictIteration)}createDraft(e){isDraftable(e)||die(8),isDraft(e)&&(e=current(e));const t=enterScope(this),n=createProxy(t,e,void 0);return n[DRAFT_STATE].isManual_=!0,leaveScope(t),n}finishDraft(e,t){const n=e&&e[DRAFT_STATE];(!n||!n.isManual_)&&die(9);const{scope_:o}=n;return usePatchesInScope(o,t),processResult(void 0,o)}setAutoFreeze(e){this.autoFreeze_=e}setUseStrictShallowCopy(e){this.useStrictShallowCopy_=e}setUseStrictIteration(e){this.useStrictIteration_=e}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(e,t){let n;for(n=t.length-1;n>=0;n--){const l=t[n];if(l.path.length===0&&l.op==="replace"){e=l.value;break}}n>-1&&(t=t.slice(n+1));const o=getPlugin(PluginPatches).applyPatches_;return isDraft(e)?o(e,t):this.produce(e,l=>o(l,t))}};function createProxy(e,t,n,o){const[l,d]=isMap(t)?getPlugin(PluginMapSet).proxyMap_(t,n):isSet(t)?getPlugin(PluginMapSet).proxySet_(t,n):createProxyProxy(t,n);return((n==null?void 0:n.scope_)??getCurrentScope()).drafts_.push(l),d.callbacks_=(n==null?void 0:n.callbacks_)??[],d.key_=o,n&&o!==void 0?registerChildFinalizationCallback(n,d,o):d.callbacks_.push(function(b){var S;(S=b.mapSetPlugin_)==null||S.fixSetContents(d);const{patchPlugin_:_}=b;d.modified_&&_&&_.generatePatches_(d,[],b)}),l}function current(e){return isDraft(e)||die(10,e),currentImpl(e)}function currentImpl(e){if(!isDraftable(e)||isFrozen$1(e))return e;const t=e[DRAFT_STATE];let n,o=!0;if(t){if(!t.modified_)return t.base_;t.finalized_=!0,n=shallowCopy(e,t.scope_.immer_.useStrictShallowCopy_),o=t.scope_.immer_.shouldUseStrictIteration()}else n=shallowCopy(e,!0);return each(n,(l,d)=>{set$2(n,l,currentImpl(d))},o),t&&(t.finalized_=!1),n}function enablePatches(){process.env.NODE_ENV!=="production"&&errors.push('Sets cannot have "replace" patches.',function(A){return"Unsupported patch operation: "+A},function(A){return"Cannot apply patch, path doesn't resolve: "+A},"Patching reserved attributes like __proto__, prototype and constructor is not allowed");function t(A,M=[]){if("key_"in A&&A.key_!==void 0){const I=A.parent_.copy_??A.parent_.base_,j=getProxyDraft(get$3(I,A.key_)),q=get$3(I,A.key_);if(q===void 0||q!==A.draft_&&q!==A.base_&&q!==A.copy_||j!=null&&j.base_!==A.base_)return null;const Q=A.parent_.type_===3;let te;if(Q){const F=A.parent_;te=Array.from(F.drafts_.keys()).indexOf(A.key_)}else te=A.key_;if(!(Q&&I.size>te||has$1(I,te)))return null;M.push(te)}if(A.parent_)return t(A.parent_,M);M.reverse();try{n(A.copy_,M)}catch{return null}return M}function n(A,M){let I=A;for(let j=0;j<M.length-1;j++){const q=M[j];if(I=get$3(I,q),!isObjectish(I)||I===null)throw new Error(`Cannot resolve path at '${M.join("/")}'`)}return I}const o="replace",l="add",d="remove";function f(A,M,I){if(A.scope_.processedForPatches_.has(A))return;A.scope_.processedForPatches_.add(A);const{patches_:j,inversePatches_:q}=I;switch(A.type_){case 0:case 2:return b(A,M,j,q);case 1:return g(A,M,j,q);case 3:return _(A,M,j,q)}}function g(A,M,I,j){let{base_:q,assigned_:Q}=A,te=A.copy_;te.length<q.length&&([q,te]=[te,q],[I,j]=[j,I]);for(let F=0;F<q.length;F++){const V=te[F],ne=q[F];if(Q!=null&&Q.get(F.toString())&&V!==ne){const ae=V==null?void 0:V[DRAFT_STATE];if(ae&&ae.modified_)continue;const se=M.concat([F]);I.push({op:o,path:se,value:E(V)}),j.push({op:o,path:se,value:E(ne)})}}for(let F=q.length;F<te.length;F++){const V=M.concat([F]);I.push({op:l,path:V,value:E(te[F])})}for(let F=te.length-1;q.length<=F;--F){const V=M.concat([F]);j.push({op:d,path:V})}}function b(A,M,I,j){const{base_:q,copy_:Q,type_:te}=A;each(A.assigned_,(F,V)=>{const ne=get$3(q,F,te),ae=get$3(Q,F,te),se=V?has$1(q,F)?o:l:d;if(ne===ae&&se===o)return;const Oe=M.concat(F);I.push(se===d?{op:se,path:Oe}:{op:se,path:Oe,value:E(ae)}),j.push(se===l?{op:d,path:Oe}:se===d?{op:l,path:Oe,value:E(ne)}:{op:o,path:Oe,value:E(ne)})})}function _(A,M,I,j){let{base_:q,copy_:Q}=A,te=0;q.forEach(F=>{if(!Q.has(F)){const V=M.concat([te]);I.push({op:d,path:V,value:F}),j.unshift({op:l,path:V,value:F})}te++}),te=0,Q.forEach(F=>{if(!q.has(F)){const V=M.concat([te]);I.push({op:l,path:V,value:F}),j.unshift({op:d,path:V,value:F})}te++})}function S(A,M,I){const{patches_:j,inversePatches_:q}=I;j.push({op:o,path:[],value:M===NOTHING?void 0:M}),q.push({op:o,path:[],value:A})}function R(A,M){return M.forEach(I=>{const{path:j,op:q}=I;let Q=A;for(let ne=0;ne<j.length-1;ne++){const ae=getArchtype(Q);let se=j[ne];typeof se!="string"&&typeof se!="number"&&(se=""+se),(ae===0||ae===1)&&(se==="__proto__"||se===CONSTRUCTOR)&&die(19),isFunction$6(Q)&&se===PROTOTYPE&&die(19),Q=get$3(Q,se),isObjectish(Q)||die(18,j.join("/"))}const te=getArchtype(Q),F=C(I.value),V=j[j.length-1];switch(q){case o:switch(te){case 2:return Q.set(V,F);case 3:die(16);default:return Q[V]=F}case l:switch(te){case 1:return V==="-"?Q.push(F):Q.splice(V,0,F);case 2:return Q.set(V,F);case 3:return Q.add(F);default:return Q[V]=F}case d:switch(te){case 1:return Q.splice(V,1);case 2:return Q.delete(V);case 3:return Q.delete(I.value);default:return delete Q[V]}default:die(17,q)}}),A}function C(A){if(!isDraftable(A))return A;if(isArray$2(A))return A.map(C);if(isMap(A))return new Map(Array.from(A.entries()).map(([I,j])=>[I,C(j)]));if(isSet(A))return new Set(Array.from(A).map(C));const M=Object.create(getPrototypeOf$1(A));for(const I in A)M[I]=C(A[I]);return has$1(A,DRAFTABLE)&&(M[DRAFTABLE]=A[DRAFTABLE]),M}function E(A){return isDraft(A)?C(A):A}loadPlugin(PluginPatches,{applyPatches_:R,generatePatches_:f,generateReplacementPatches_:S,getPath:t})}var immer=new Immer2,produce=immer.produce,produceWithPatches=immer.produceWithPatches.bind(immer),applyPatches=immer.applyPatches.bind(immer),runIdentityFunctionCheck=(e,t,n)=>{if(t.length===1&&t[0]===n){let o=!1;try{const l={};e(l)===l&&(o=!0)}catch{}if(o){let l;try{throw new Error}catch(d){({stack:l}=d)}console.warn(`The result function returned its own inputs without modification. e.g
|
|
520
520
|
\`createSelector([state => state.todos], todos => todos)\`
|
|
521
521
|
This could lead to inefficient memoization and unnecessary re-renders.
|
|
522
522
|
Ensure transformation logic is in the result function, and extraction logic is in the input selectors.`,{stack:l})}}},runInputStabilityCheck=(e,t,n)=>{const{memoize:o,memoizeOptions:l}=t,{inputSelectorResults:d,inputSelectorResultsCopy:f}=e,g=o(()=>({}),...l);if(!(g.apply(null,d)===g.apply(null,f))){let _;try{throw new Error}catch(S){({stack:_}=S)}console.warn(`An input selector returned a different result when passed same arguments.
|
|
@@ -1155,7 +1155,7 @@ ${e}</tr>
|
|
|
1155
1155
|
`}tablecell(e){const t=this.parser.parseInline(e.tokens),n=e.header?"th":"td";return(e.align?`<${n} align="${e.align}">`:`<${n}>`)+t+`</${n}>
|
|
1156
1156
|
`}strong({tokens:e}){return`<strong>${this.parser.parseInline(e)}</strong>`}em({tokens:e}){return`<em>${this.parser.parseInline(e)}</em>`}codespan({text:e}){return`<code>${escape2(e,!0)}</code>`}br(e){return"<br>"}del({tokens:e}){return`<del>${this.parser.parseInline(e)}</del>`}link({href:e,title:t,tokens:n}){const o=this.parser.parseInline(n),l=cleanUrl(e);if(l===null)return o;e=l;let d='<a href="'+e+'"';return t&&(d+=' title="'+escape2(t)+'"'),d+=">"+o+"</a>",d}image({href:e,title:t,text:n,tokens:o}){o&&(n=this.parser.parseInline(o,this.parser.textRenderer));const l=cleanUrl(e);if(l===null)return escape2(n);e=l;let d=`<img src="${e}" alt="${n}"`;return t&&(d+=` title="${escape2(t)}"`),d+=">",d}text(e){return"tokens"in e&&e.tokens?this.parser.parseInline(e.tokens):"escaped"in e&&e.escaped?e.text:escape2(e.text)}},_TextRenderer=class{strong({text:e}){return e}em({text:e}){return e}codespan({text:e}){return e}del({text:e}){return e}html({text:e}){return e}text({text:e}){return e}link({text:e}){return""+e}image({text:e}){return""+e}br(){return""}},_Parser=class vr{constructor(t){en(this,"options");en(this,"renderer");en(this,"textRenderer");this.options=t||_defaults,this.options.renderer=this.options.renderer||new _Renderer,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new _TextRenderer}static parse(t,n){return new vr(n).parse(t)}static parseInline(t,n){return new vr(n).parseInline(t)}parse(t,n=!0){var l,d;let o="";for(let f=0;f<t.length;f++){const g=t[f];if((d=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&d[g.type]){const _=g,S=this.options.extensions.renderers[_.type].call({parser:this},_);if(S!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes(_.type)){o+=S||"";continue}}const b=g;switch(b.type){case"space":{o+=this.renderer.space(b);continue}case"hr":{o+=this.renderer.hr(b);continue}case"heading":{o+=this.renderer.heading(b);continue}case"code":{o+=this.renderer.code(b);continue}case"table":{o+=this.renderer.table(b);continue}case"blockquote":{o+=this.renderer.blockquote(b);continue}case"list":{o+=this.renderer.list(b);continue}case"html":{o+=this.renderer.html(b);continue}case"paragraph":{o+=this.renderer.paragraph(b);continue}case"text":{let _=b,S=this.renderer.text(_);for(;f+1<t.length&&t[f+1].type==="text";)_=t[++f],S+=`
|
|
1157
1157
|
`+this.renderer.text(_);n?o+=this.renderer.paragraph({type:"paragraph",raw:S,text:S,tokens:[{type:"text",raw:S,text:S,escaped:!0}]}):o+=S;continue}default:{const _='Token with "'+b.type+'" type was not found.';if(this.options.silent)return console.error(_),"";throw new Error(_)}}}return o}parseInline(t,n=this.renderer){var l,d;let o="";for(let f=0;f<t.length;f++){const g=t[f];if((d=(l=this.options.extensions)==null?void 0:l.renderers)!=null&&d[g.type]){const _=this.options.extensions.renderers[g.type].call({parser:this},g);if(_!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(g.type)){o+=_||"";continue}}const b=g;switch(b.type){case"escape":{o+=n.text(b);break}case"html":{o+=n.html(b);break}case"link":{o+=n.link(b);break}case"image":{o+=n.image(b);break}case"strong":{o+=n.strong(b);break}case"em":{o+=n.em(b);break}case"codespan":{o+=n.codespan(b);break}case"br":{o+=n.br(b);break}case"del":{o+=n.del(b);break}case"text":{o+=n.text(b);break}default:{const _='Token with "'+b.type+'" type was not found.';if(this.options.silent)return console.error(_),"";throw new Error(_)}}}return o}},_Hooks=(dn=class{constructor(e){en(this,"options");en(this,"block");this.options=e||_defaults}preprocess(e){return e}postprocess(e){return e}processAllTokens(e){return e}provideLexer(){return this.block?_Lexer.lex:_Lexer.lexInline}provideParser(){return this.block?_Parser.parse:_Parser.parseInline}},en(dn,"passThroughHooks",new Set(["preprocess","postprocess","processAllTokens"])),dn),Marked=class{constructor(...e){en(this,"defaults",_getDefaults());en(this,"options",this.setOptions);en(this,"parse",this.parseMarkdown(!0));en(this,"parseInline",this.parseMarkdown(!1));en(this,"Parser",_Parser);en(this,"Renderer",_Renderer);en(this,"TextRenderer",_TextRenderer);en(this,"Lexer",_Lexer);en(this,"Tokenizer",_Tokenizer);en(this,"Hooks",_Hooks);this.use(...e)}walkTokens(e,t){var o,l;let n=[];for(const d of e)switch(n=n.concat(t.call(this,d)),d.type){case"table":{const f=d;for(const g of f.header)n=n.concat(this.walkTokens(g.tokens,t));for(const g of f.rows)for(const b of g)n=n.concat(this.walkTokens(b.tokens,t));break}case"list":{const f=d;n=n.concat(this.walkTokens(f.items,t));break}default:{const f=d;(l=(o=this.defaults.extensions)==null?void 0:o.childTokens)!=null&&l[f.type]?this.defaults.extensions.childTokens[f.type].forEach(g=>{const b=f[g].flat(1/0);n=n.concat(this.walkTokens(b,t))}):f.tokens&&(n=n.concat(this.walkTokens(f.tokens,t)))}}return n}use(...e){const t=this.defaults.extensions||{renderers:{},childTokens:{}};return e.forEach(n=>{const o={...n};if(o.async=this.defaults.async||o.async||!1,n.extensions&&(n.extensions.forEach(l=>{if(!l.name)throw new Error("extension name required");if("renderer"in l){const d=t.renderers[l.name];d?t.renderers[l.name]=function(...f){let g=l.renderer.apply(this,f);return g===!1&&(g=d.apply(this,f)),g}:t.renderers[l.name]=l.renderer}if("tokenizer"in l){if(!l.level||l.level!=="block"&&l.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");const d=t[l.level];d?d.unshift(l.tokenizer):t[l.level]=[l.tokenizer],l.start&&(l.level==="block"?t.startBlock?t.startBlock.push(l.start):t.startBlock=[l.start]:l.level==="inline"&&(t.startInline?t.startInline.push(l.start):t.startInline=[l.start]))}"childTokens"in l&&l.childTokens&&(t.childTokens[l.name]=l.childTokens)}),o.extensions=t),n.renderer){const l=this.defaults.renderer||new _Renderer(this.defaults);for(const d in n.renderer){if(!(d in l))throw new Error(`renderer '${d}' does not exist`);if(["options","parser"].includes(d))continue;const f=d,g=n.renderer[f],b=l[f];l[f]=(..._)=>{let S=g.apply(l,_);return S===!1&&(S=b.apply(l,_)),S||""}}o.renderer=l}if(n.tokenizer){const l=this.defaults.tokenizer||new _Tokenizer(this.defaults);for(const d in n.tokenizer){if(!(d in l))throw new Error(`tokenizer '${d}' does not exist`);if(["options","rules","lexer"].includes(d))continue;const f=d,g=n.tokenizer[f],b=l[f];l[f]=(..._)=>{let S=g.apply(l,_);return S===!1&&(S=b.apply(l,_)),S}}o.tokenizer=l}if(n.hooks){const l=this.defaults.hooks||new _Hooks;for(const d in n.hooks){if(!(d in l))throw new Error(`hook '${d}' does not exist`);if(["options","block"].includes(d))continue;const f=d,g=n.hooks[f],b=l[f];_Hooks.passThroughHooks.has(d)?l[f]=_=>{if(this.defaults.async)return Promise.resolve(g.call(l,_)).then(R=>b.call(l,R));const S=g.call(l,_);return b.call(l,S)}:l[f]=(..._)=>{let S=g.apply(l,_);return S===!1&&(S=b.apply(l,_)),S}}o.hooks=l}if(n.walkTokens){const l=this.defaults.walkTokens,d=n.walkTokens;o.walkTokens=function(f){let g=[];return g.push(d.call(this,f)),l&&(g=g.concat(l.call(this,f))),g}}this.defaults={...this.defaults,...o}}),this}setOptions(e){return this.defaults={...this.defaults,...e},this}lexer(e,t){return _Lexer.lex(e,t??this.defaults)}parser(e,t){return _Parser.parse(e,t??this.defaults)}parseMarkdown(e){return(n,o)=>{const l={...o},d={...this.defaults,...l},f=this.onError(!!d.silent,!!d.async);if(this.defaults.async===!0&&l.async===!1)return f(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof n>"u"||n===null)return f(new Error("marked(): input parameter is undefined or null"));if(typeof n!="string")return f(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(n)+", string expected"));d.hooks&&(d.hooks.options=d,d.hooks.block=e);const g=d.hooks?d.hooks.provideLexer():e?_Lexer.lex:_Lexer.lexInline,b=d.hooks?d.hooks.provideParser():e?_Parser.parse:_Parser.parseInline;if(d.async)return Promise.resolve(d.hooks?d.hooks.preprocess(n):n).then(_=>g(_,d)).then(_=>d.hooks?d.hooks.processAllTokens(_):_).then(_=>d.walkTokens?Promise.all(this.walkTokens(_,d.walkTokens)).then(()=>_):_).then(_=>b(_,d)).then(_=>d.hooks?d.hooks.postprocess(_):_).catch(f);try{d.hooks&&(n=d.hooks.preprocess(n));let _=g(n,d);d.hooks&&(_=d.hooks.processAllTokens(_)),d.walkTokens&&this.walkTokens(_,d.walkTokens);let S=b(_,d);return d.hooks&&(S=d.hooks.postprocess(S)),S}catch(_){return f(_)}}}onError(e,t){return n=>{if(n.message+=`
|
|
1158
|
-
Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+escape2(n.message+"",!0)+"</pre>";return t?Promise.resolve(o):o}if(t)return Promise.reject(n);throw n}}},markedInstance=new Marked;function marked(e,t){return markedInstance.parse(e,t)}marked.options=marked.setOptions=function(e){return markedInstance.setOptions(e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.getDefaults=_getDefaults,marked.defaults=_defaults,marked.use=function(...e){return markedInstance.use(...e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.walkTokens=function(e,t){return markedInstance.walkTokens(e,t)},marked.parseInline=markedInstance.parseInline,marked.Parser=_Parser,marked.parser=_Parser.parse,marked.Renderer=_Renderer,marked.TextRenderer=_TextRenderer,marked.Lexer=_Lexer,marked.lexer=_Lexer.lex,marked.Tokenizer=_Tokenizer,marked.Hooks=_Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,_Parser.parse,_Lexer.lex;/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries,setPrototypeOf,isFrozen,getPrototypeOf,getOwnPropertyDescriptor}=Object;let{freeze,seal,create}=Object,{apply:apply$1,construct}=typeof Reflect<"u"&&Reflect;freeze||(freeze=function(t){return t}),seal||(seal=function(t){return t}),apply$1||(apply$1=function(t,n){for(var o=arguments.length,l=new Array(o>2?o-2:0),d=2;d<o;d++)l[d-2]=arguments[d];return t.apply(n,l)}),construct||(construct=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),l=1;l<n;l++)o[l-1]=arguments[l];return new t(...o)});const arrayForEach=unapply(Array.prototype.forEach),arrayLastIndexOf=unapply(Array.prototype.lastIndexOf),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),arraySplice=unapply(Array.prototype.splice),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),l=1;l<n;l++)o[l-1]=arguments[l];return apply$1(e,t,o)}}function unconstruct(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return construct(e,n)}}function addToSet(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:stringToLowerCase;setPrototypeOf&&setPrototypeOf(e,null);let o=t.length;for(;o--;){let l=t[o];if(typeof l=="string"){const d=n(l);d!==l&&(isFrozen(t)||(t[o]=d),l=d)}e[l]=!0}return e}function cleanArray(e){for(let t=0;t<e.length;t++)objectHasOwnProperty(e,t)||(e[t]=null);return e}function clone(e){const t=create(null);for(const[n,o]of entries(e))objectHasOwnProperty(e,n)&&(Array.isArray(o)?t[n]=cleanArray(o):o&&typeof o=="object"&&o.constructor===Object?t[n]=clone(o):t[n]=o);return t}function lookupGetter(e,t){for(;e!==null;){const o=getOwnPropertyDescriptor(e,t);if(o){if(o.get)return unapply(o.get);if(typeof o.value=="function")return unapply(o.value)}e=getPrototypeOf(e)}function n(){return null}return n}const html$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text$1=freeze(["#text"]),html=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\$\{[\w\W]*/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i);var EXPRESSIONS=Object.freeze({__proto__:null,ARIA_ATTR,ATTR_WHITESPACE,CUSTOM_ELEMENT,DATA_ATTR,DOCTYPE_NAME,ERB_EXPR,IS_ALLOWED_URI,IS_SCRIPT_OR_DATA,MUSTACHE_EXPR,TMPLIT_EXPR});const NODE_TYPE={element:1,text:3,progressingInstruction:7,comment:8,document:9},getGlobal=function e(){return typeof window>"u"?null:window},_createTrustedTypesPolicy=function e(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const l="data-tt-policy-suffix";n&&n.hasAttribute(l)&&(o=n.getAttribute(l));const d="dompurify"+(o?"#"+o:"");try{return t.createPolicy(d,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},_createHooksMap=function e(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function createDOMPurify(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal();const t=Xt=>createDOMPurify(Xt);if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==NODE_TYPE.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const o=n,l=o.currentScript,{DocumentFragment:d,HTMLTemplateElement:f,Node:g,Element:b,NodeFilter:_,NamedNodeMap:S=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:R,DOMParser:C,trustedTypes:E}=e,A=b.prototype,M=lookupGetter(A,"cloneNode"),I=lookupGetter(A,"remove"),j=lookupGetter(A,"nextSibling"),q=lookupGetter(A,"childNodes"),Q=lookupGetter(A,"parentNode");if(typeof f=="function"){const Xt=n.createElement("template");Xt.content&&Xt.content.ownerDocument&&(n=Xt.content.ownerDocument)}let te,F="";const{implementation:V,createNodeIterator:ne,createDocumentFragment:ae,getElementsByTagName:se}=n,{importNode:Oe}=o;let Ne=_createHooksMap();t.isSupported=typeof entries=="function"&&typeof Q=="function"&&V&&V.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:oe,ERB_EXPR:$e,TMPLIT_EXPR:Ae,DATA_ATTR:je,ARIA_ATTR:Be,IS_SCRIPT_OR_DATA:qe,ATTR_WHITESPACE:Ve,CUSTOM_ELEMENT:Le}=EXPRESSIONS;let{IS_ALLOWED_URI:He}=EXPRESSIONS,We=null;const ze=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text$1]);let Xe=null;const nt=addToSet({},[...html,...svg,...mathMl,...xml]);let Je=Object.seal(create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),st=null,et=null;const at=Object.seal(create(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let tt=!0,ot=!0,lt=!1,Ge=!0,$t=!1,rt=!0,Rt=!1,dt=!1,It=!1,Mt=!1,Ct=!1,Ke=!1,Ye=!0,Ze=!1;const ct="user-content-";let mt=!0,ft=!1,yt={},Ht=null;const Kt=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let un=null;const hn=addToSet({},["audio","video","img","source","image","track"]);let qt=null;const An=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xn="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let Pn=vn,Mn=!1,$n=null;const Vn=addToSet({},[xn,Rn,vn],stringToString);let Jt=addToSet({},["mi","mo","mn","ms","mtext"]),Zt=addToSet({},["annotation-xml"]);const Ut=addToSet({},["title","style","font","a","script"]);let tn=null;const Yt=["application/xhtml+xml","text/html"],an="text/html";let mn=null,On=null;const Fn=n.createElement("form"),Cn=function(it){return it instanceof RegExp||it instanceof Function},Bn=function(){let it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(On&&On===it)){if((!it||typeof it!="object")&&(it={}),it=clone(it),tn=Yt.indexOf(it.PARSER_MEDIA_TYPE)===-1?an:it.PARSER_MEDIA_TYPE,mn=tn==="application/xhtml+xml"?stringToString:stringToLowerCase,We=objectHasOwnProperty(it,"ALLOWED_TAGS")?addToSet({},it.ALLOWED_TAGS,mn):ze,Xe=objectHasOwnProperty(it,"ALLOWED_ATTR")?addToSet({},it.ALLOWED_ATTR,mn):nt,$n=objectHasOwnProperty(it,"ALLOWED_NAMESPACES")?addToSet({},it.ALLOWED_NAMESPACES,stringToString):Vn,qt=objectHasOwnProperty(it,"ADD_URI_SAFE_ATTR")?addToSet(clone(An),it.ADD_URI_SAFE_ATTR,mn):An,un=objectHasOwnProperty(it,"ADD_DATA_URI_TAGS")?addToSet(clone(hn),it.ADD_DATA_URI_TAGS,mn):hn,Ht=objectHasOwnProperty(it,"FORBID_CONTENTS")?addToSet({},it.FORBID_CONTENTS,mn):Kt,st=objectHasOwnProperty(it,"FORBID_TAGS")?addToSet({},it.FORBID_TAGS,mn):clone({}),et=objectHasOwnProperty(it,"FORBID_ATTR")?addToSet({},it.FORBID_ATTR,mn):clone({}),yt=objectHasOwnProperty(it,"USE_PROFILES")?it.USE_PROFILES:!1,tt=it.ALLOW_ARIA_ATTR!==!1,ot=it.ALLOW_DATA_ATTR!==!1,lt=it.ALLOW_UNKNOWN_PROTOCOLS||!1,Ge=it.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$t=it.SAFE_FOR_TEMPLATES||!1,rt=it.SAFE_FOR_XML!==!1,Rt=it.WHOLE_DOCUMENT||!1,Mt=it.RETURN_DOM||!1,Ct=it.RETURN_DOM_FRAGMENT||!1,Ke=it.RETURN_TRUSTED_TYPE||!1,It=it.FORCE_BODY||!1,Ye=it.SANITIZE_DOM!==!1,Ze=it.SANITIZE_NAMED_PROPS||!1,mt=it.KEEP_CONTENT!==!1,ft=it.IN_PLACE||!1,He=it.ALLOWED_URI_REGEXP||IS_ALLOWED_URI,Pn=it.NAMESPACE||vn,Jt=it.MATHML_TEXT_INTEGRATION_POINTS||Jt,Zt=it.HTML_INTEGRATION_POINTS||Zt,Je=it.CUSTOM_ELEMENT_HANDLING||{},it.CUSTOM_ELEMENT_HANDLING&&Cn(it.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Je.tagNameCheck=it.CUSTOM_ELEMENT_HANDLING.tagNameCheck),it.CUSTOM_ELEMENT_HANDLING&&Cn(it.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Je.attributeNameCheck=it.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),it.CUSTOM_ELEMENT_HANDLING&&typeof it.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Je.allowCustomizedBuiltInElements=it.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$t&&(ot=!1),Ct&&(Mt=!0),yt&&(We=addToSet({},text$1),Xe=[],yt.html===!0&&(addToSet(We,html$1),addToSet(Xe,html)),yt.svg===!0&&(addToSet(We,svg$1),addToSet(Xe,svg),addToSet(Xe,xml)),yt.svgFilters===!0&&(addToSet(We,svgFilters),addToSet(Xe,svg),addToSet(Xe,xml)),yt.mathMl===!0&&(addToSet(We,mathMl$1),addToSet(Xe,mathMl),addToSet(Xe,xml))),it.ADD_TAGS&&(typeof it.ADD_TAGS=="function"?at.tagCheck=it.ADD_TAGS:(We===ze&&(We=clone(We)),addToSet(We,it.ADD_TAGS,mn))),it.ADD_ATTR&&(typeof it.ADD_ATTR=="function"?at.attributeCheck=it.ADD_ATTR:(Xe===nt&&(Xe=clone(Xe)),addToSet(Xe,it.ADD_ATTR,mn))),it.ADD_URI_SAFE_ATTR&&addToSet(qt,it.ADD_URI_SAFE_ATTR,mn),it.FORBID_CONTENTS&&(Ht===Kt&&(Ht=clone(Ht)),addToSet(Ht,it.FORBID_CONTENTS,mn)),mt&&(We["#text"]=!0),Rt&&addToSet(We,["html","head","body"]),We.table&&(addToSet(We,["tbody"]),delete st.tbody),it.TRUSTED_TYPES_POLICY){if(typeof it.TRUSTED_TYPES_POLICY.createHTML!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof it.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');te=it.TRUSTED_TYPES_POLICY,F=te.createHTML("")}else te===void 0&&(te=_createTrustedTypesPolicy(E,l)),te!==null&&typeof F=="string"&&(F=te.createHTML(""));freeze&&freeze(it),On=it}},qn=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),Un=addToSet({},[...mathMl$1,...mathMlDisallowed]),sr=function(it){let Dt=Q(it);(!Dt||!Dt.tagName)&&(Dt={namespaceURI:Pn,tagName:"template"});const Wt=stringToLowerCase(it.tagName),pn=stringToLowerCase(Dt.tagName);return $n[it.namespaceURI]?it.namespaceURI===Rn?Dt.namespaceURI===vn?Wt==="svg":Dt.namespaceURI===xn?Wt==="svg"&&(pn==="annotation-xml"||Jt[pn]):!!qn[Wt]:it.namespaceURI===xn?Dt.namespaceURI===vn?Wt==="math":Dt.namespaceURI===Rn?Wt==="math"&&Zt[pn]:!!Un[Wt]:it.namespaceURI===vn?Dt.namespaceURI===Rn&&!Zt[pn]||Dt.namespaceURI===xn&&!Jt[pn]?!1:!Un[Wt]&&(Ut[Wt]||!qn[Wt]):!!(tn==="application/xhtml+xml"&&$n[it.namespaceURI]):!1},wn=function(it){arrayPush(t.removed,{element:it});try{Q(it).removeChild(it)}catch{I(it)}},Dn=function(it,Dt){try{arrayPush(t.removed,{attribute:Dt.getAttributeNode(it),from:Dt})}catch{arrayPush(t.removed,{attribute:null,from:Dt})}if(Dt.removeAttribute(it),it==="is")if(Mt||Ct)try{wn(Dt)}catch{}else try{Dt.setAttribute(it,"")}catch{}},Zn=function(it){let Dt=null,Wt=null;if(It)it="<remove></remove>"+it;else{const gn=stringMatch(it,/^[\r\n\t ]+/);Wt=gn&&gn[0]}tn==="application/xhtml+xml"&&Pn===vn&&(it='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+it+"</body></html>");const pn=te?te.createHTML(it):it;if(Pn===vn)try{Dt=new C().parseFromString(pn,tn)}catch{}if(!Dt||!Dt.documentElement){Dt=V.createDocument(Pn,"template",null);try{Dt.documentElement.innerHTML=Mn?F:pn}catch{}}const bn=Dt.body||Dt.documentElement;return it&&Wt&&bn.insertBefore(n.createTextNode(Wt),bn.childNodes[0]||null),Pn===vn?se.call(Dt,Rt?"html":"body")[0]:Rt?Dt.documentElement:bn},er=function(it){return ne.call(it.ownerDocument||it,it,_.SHOW_ELEMENT|_.SHOW_COMMENT|_.SHOW_TEXT|_.SHOW_PROCESSING_INSTRUCTION|_.SHOW_CDATA_SECTION,null)},Kn=function(it){return it instanceof R&&(typeof it.nodeName!="string"||typeof it.textContent!="string"||typeof it.removeChild!="function"||!(it.attributes instanceof S)||typeof it.removeAttribute!="function"||typeof it.setAttribute!="function"||typeof it.namespaceURI!="string"||typeof it.insertBefore!="function"||typeof it.hasChildNodes!="function")},or=function(it){return typeof g=="function"&&it instanceof g};function kn(Xt,it,Dt){arrayForEach(Xt,Wt=>{Wt.call(t,it,Dt,On)})}const lr=function(it){let Dt=null;if(kn(Ne.beforeSanitizeElements,it,null),Kn(it))return wn(it),!0;const Wt=mn(it.nodeName);if(kn(Ne.uponSanitizeElement,it,{tagName:Wt,allowedTags:We}),rt&&it.hasChildNodes()&&!or(it.firstElementChild)&®ExpTest(/<[/\w!]/g,it.innerHTML)&®ExpTest(/<[/\w!]/g,it.textContent)||it.nodeType===NODE_TYPE.progressingInstruction||rt&&it.nodeType===NODE_TYPE.comment&®ExpTest(/<[/\w]/g,it.data))return wn(it),!0;if(!(at.tagCheck instanceof Function&&at.tagCheck(Wt))&&(!We[Wt]||st[Wt])){if(!st[Wt]&&tr(Wt)&&(Je.tagNameCheck instanceof RegExp&®ExpTest(Je.tagNameCheck,Wt)||Je.tagNameCheck instanceof Function&&Je.tagNameCheck(Wt)))return!1;if(mt&&!Ht[Wt]){const pn=Q(it)||it.parentNode,bn=q(it)||it.childNodes;if(bn&&pn){const gn=bn.length;for(let Sn=gn-1;Sn>=0;--Sn){const In=M(bn[Sn],!0);In.__removalCount=(it.__removalCount||0)+1,pn.insertBefore(In,j(it))}}}return wn(it),!0}return it instanceof b&&!sr(it)||(Wt==="noscript"||Wt==="noembed"||Wt==="noframes")&®ExpTest(/<\/no(script|embed|frames)/i,it.innerHTML)?(wn(it),!0):($t&&it.nodeType===NODE_TYPE.text&&(Dt=it.textContent,arrayForEach([oe,$e,Ae],pn=>{Dt=stringReplace(Dt,pn," ")}),it.textContent!==Dt&&(arrayPush(t.removed,{element:it.cloneNode()}),it.textContent=Dt)),kn(Ne.afterSanitizeElements,it,null),!1)},cr=function(it,Dt,Wt){if(Ye&&(Dt==="id"||Dt==="name")&&(Wt in n||Wt in Fn))return!1;if(!(ot&&!et[Dt]&®ExpTest(je,Dt))){if(!(tt&®ExpTest(Be,Dt))){if(!(at.attributeCheck instanceof Function&&at.attributeCheck(Dt,it))){if(!Xe[Dt]||et[Dt]){if(!(tr(it)&&(Je.tagNameCheck instanceof RegExp&®ExpTest(Je.tagNameCheck,it)||Je.tagNameCheck instanceof Function&&Je.tagNameCheck(it))&&(Je.attributeNameCheck instanceof RegExp&®ExpTest(Je.attributeNameCheck,Dt)||Je.attributeNameCheck instanceof Function&&Je.attributeNameCheck(Dt,it))||Dt==="is"&&Je.allowCustomizedBuiltInElements&&(Je.tagNameCheck instanceof RegExp&®ExpTest(Je.tagNameCheck,Wt)||Je.tagNameCheck instanceof Function&&Je.tagNameCheck(Wt))))return!1}else if(!qt[Dt]){if(!regExpTest(He,stringReplace(Wt,Ve,""))){if(!((Dt==="src"||Dt==="xlink:href"||Dt==="href")&&it!=="script"&&stringIndexOf(Wt,"data:")===0&&un[it])){if(!(lt&&!regExpTest(qe,stringReplace(Wt,Ve,"")))){if(Wt)return!1}}}}}}}return!0},tr=function(it){return it!=="annotation-xml"&&stringMatch(it,Le)},nr=function(it){kn(Ne.beforeSanitizeAttributes,it,null);const{attributes:Dt}=it;if(!Dt||Kn(it))return;const Wt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Xe,forceKeepAttr:void 0};let pn=Dt.length;for(;pn--;){const bn=Dt[pn],{name:gn,namespaceURI:Sn,value:In}=bn,Hn=mn(gn),zt=In;let yn=gn==="value"?zt:stringTrim(zt);if(Wt.attrName=Hn,Wt.attrValue=yn,Wt.keepAttr=!0,Wt.forceKeepAttr=void 0,kn(Ne.uponSanitizeAttribute,it,Wt),yn=Wt.attrValue,Ze&&(Hn==="id"||Hn==="name")&&(Dn(gn,it),yn=ct+yn),rt&®ExpTest(/((--!?|])>)|<\/(style|title|textarea)/i,yn)){Dn(gn,it);continue}if(Hn==="attributename"&&stringMatch(yn,"href")){Dn(gn,it);continue}if(Wt.forceKeepAttr)continue;if(!Wt.keepAttr){Dn(gn,it);continue}if(!Ge&®ExpTest(/\/>/i,yn)){Dn(gn,it);continue}$t&&arrayForEach([oe,$e,Ae],dr=>{yn=stringReplace(yn,dr," ")});const En=mn(it.nodeName);if(!cr(En,Hn,yn)){Dn(gn,it);continue}if(te&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Sn)switch(E.getAttributeType(En,Hn)){case"TrustedHTML":{yn=te.createHTML(yn);break}case"TrustedScriptURL":{yn=te.createScriptURL(yn);break}}if(yn!==zt)try{Sn?it.setAttributeNS(Sn,gn,yn):it.setAttribute(gn,yn),Kn(it)?wn(it):arrayPop(t.removed)}catch{Dn(gn,it)}}kn(Ne.afterSanitizeAttributes,it,null)},ur=function Xt(it){let Dt=null;const Wt=er(it);for(kn(Ne.beforeSanitizeShadowDOM,it,null);Dt=Wt.nextNode();)kn(Ne.uponSanitizeShadowNode,Dt,null),lr(Dt),nr(Dt),Dt.content instanceof d&&Xt(Dt.content);kn(Ne.afterSanitizeShadowDOM,it,null)};return t.sanitize=function(Xt){let it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Dt=null,Wt=null,pn=null,bn=null;if(Mn=!Xt,Mn&&(Xt="<!-->"),typeof Xt!="string"&&!or(Xt))if(typeof Xt.toString=="function"){if(Xt=Xt.toString(),typeof Xt!="string")throw typeErrorCreate("dirty is not a string, aborting")}else throw typeErrorCreate("toString is not a function");if(!t.isSupported)return Xt;if(dt||Bn(it),t.removed=[],typeof Xt=="string"&&(ft=!1),ft){if(Xt.nodeName){const In=mn(Xt.nodeName);if(!We[In]||st[In])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(Xt instanceof g)Dt=Zn("<!---->"),Wt=Dt.ownerDocument.importNode(Xt,!0),Wt.nodeType===NODE_TYPE.element&&Wt.nodeName==="BODY"||Wt.nodeName==="HTML"?Dt=Wt:Dt.appendChild(Wt);else{if(!Mt&&!$t&&!Rt&&Xt.indexOf("<")===-1)return te&&Ke?te.createHTML(Xt):Xt;if(Dt=Zn(Xt),!Dt)return Mt?null:Ke?F:""}Dt&&It&&wn(Dt.firstChild);const gn=er(ft?Xt:Dt);for(;pn=gn.nextNode();)lr(pn),nr(pn),pn.content instanceof d&&ur(pn.content);if(ft)return Xt;if(Mt){if(Ct)for(bn=ae.call(Dt.ownerDocument);Dt.firstChild;)bn.appendChild(Dt.firstChild);else bn=Dt;return(Xe.shadowroot||Xe.shadowrootmode)&&(bn=Oe.call(o,bn,!0)),bn}let Sn=Rt?Dt.outerHTML:Dt.innerHTML;return Rt&&We["!doctype"]&&Dt.ownerDocument&&Dt.ownerDocument.doctype&&Dt.ownerDocument.doctype.name&®ExpTest(DOCTYPE_NAME,Dt.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+Dt.ownerDocument.doctype.name+`>
|
|
1158
|
+
Please report this to https://github.com/markedjs/marked.`,e){const o="<p>An error occurred:</p><pre>"+escape2(n.message+"",!0)+"</pre>";return t?Promise.resolve(o):o}if(t)return Promise.reject(n);throw n}}},markedInstance=new Marked;function marked(e,t){return markedInstance.parse(e,t)}marked.options=marked.setOptions=function(e){return markedInstance.setOptions(e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.getDefaults=_getDefaults,marked.defaults=_defaults,marked.use=function(...e){return markedInstance.use(...e),marked.defaults=markedInstance.defaults,changeDefaults(marked.defaults),marked},marked.walkTokens=function(e,t){return markedInstance.walkTokens(e,t)},marked.parseInline=markedInstance.parseInline,marked.Parser=_Parser,marked.parser=_Parser.parse,marked.Renderer=_Renderer,marked.TextRenderer=_TextRenderer,marked.Lexer=_Lexer,marked.lexer=_Lexer.lex,marked.Tokenizer=_Tokenizer,marked.Hooks=_Hooks,marked.parse=marked,marked.options,marked.setOptions,marked.use,marked.walkTokens,marked.parseInline,_Parser.parse,_Lexer.lex;/*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */const{entries,setPrototypeOf,isFrozen,getPrototypeOf,getOwnPropertyDescriptor}=Object;let{freeze,seal,create}=Object,{apply:apply$1,construct}=typeof Reflect<"u"&&Reflect;freeze||(freeze=function(t){return t}),seal||(seal=function(t){return t}),apply$1||(apply$1=function(t,n){for(var o=arguments.length,l=new Array(o>2?o-2:0),d=2;d<o;d++)l[d-2]=arguments[d];return t.apply(n,l)}),construct||(construct=function(t){for(var n=arguments.length,o=new Array(n>1?n-1:0),l=1;l<n;l++)o[l-1]=arguments[l];return new t(...o)});const arrayForEach=unapply(Array.prototype.forEach),arrayLastIndexOf=unapply(Array.prototype.lastIndexOf),arrayPop=unapply(Array.prototype.pop),arrayPush=unapply(Array.prototype.push),arraySplice=unapply(Array.prototype.splice),stringToLowerCase=unapply(String.prototype.toLowerCase),stringToString=unapply(String.prototype.toString),stringMatch=unapply(String.prototype.match),stringReplace=unapply(String.prototype.replace),stringIndexOf=unapply(String.prototype.indexOf),stringTrim=unapply(String.prototype.trim),objectHasOwnProperty=unapply(Object.prototype.hasOwnProperty),regExpTest=unapply(RegExp.prototype.test),typeErrorCreate=unconstruct(TypeError);function unapply(e){return function(t){t instanceof RegExp&&(t.lastIndex=0);for(var n=arguments.length,o=new Array(n>1?n-1:0),l=1;l<n;l++)o[l-1]=arguments[l];return apply$1(e,t,o)}}function unconstruct(e){return function(){for(var t=arguments.length,n=new Array(t),o=0;o<t;o++)n[o]=arguments[o];return construct(e,n)}}function addToSet(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:stringToLowerCase;setPrototypeOf&&setPrototypeOf(e,null);let o=t.length;for(;o--;){let l=t[o];if(typeof l=="string"){const d=n(l);d!==l&&(isFrozen(t)||(t[o]=d),l=d)}e[l]=!0}return e}function cleanArray(e){for(let t=0;t<e.length;t++)objectHasOwnProperty(e,t)||(e[t]=null);return e}function clone(e){const t=create(null);for(const[n,o]of entries(e))objectHasOwnProperty(e,n)&&(Array.isArray(o)?t[n]=cleanArray(o):o&&typeof o=="object"&&o.constructor===Object?t[n]=clone(o):t[n]=o);return t}function lookupGetter(e,t){for(;e!==null;){const o=getOwnPropertyDescriptor(e,t);if(o){if(o.get)return unapply(o.get);if(typeof o.value=="function")return unapply(o.value)}e=getPrototypeOf(e)}function n(){return null}return n}const html$1=freeze(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),svg$1=freeze(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),svgFilters=freeze(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),svgDisallowed=freeze(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),mathMl$1=freeze(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),mathMlDisallowed=freeze(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),text$1=freeze(["#text"]),html=freeze(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns","slot"]),svg=freeze(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-rendering","textlength","type","u1","u2","unicode","values","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),mathMl=freeze(["accent","accentunder","align","bevelled","close","columnsalign","columnlines","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lspace","lquote","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),xml=freeze(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),MUSTACHE_EXPR=seal(/\{\{[\w\W]*|[\w\W]*\}\}/gm),ERB_EXPR=seal(/<%[\w\W]*|[\w\W]*%>/gm),TMPLIT_EXPR=seal(/\$\{[\w\W]*/gm),DATA_ATTR=seal(/^data-[\-\w.\u00B7-\uFFFF]+$/),ARIA_ATTR=seal(/^aria-[\-\w]+$/),IS_ALLOWED_URI=seal(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),IS_SCRIPT_OR_DATA=seal(/^(?:\w+script|data):/i),ATTR_WHITESPACE=seal(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),DOCTYPE_NAME=seal(/^html$/i),CUSTOM_ELEMENT=seal(/^[a-z][.\w]*(-[.\w]+)+$/i);var EXPRESSIONS=Object.freeze({__proto__:null,ARIA_ATTR,ATTR_WHITESPACE,CUSTOM_ELEMENT,DATA_ATTR,DOCTYPE_NAME,ERB_EXPR,IS_ALLOWED_URI,IS_SCRIPT_OR_DATA,MUSTACHE_EXPR,TMPLIT_EXPR});const NODE_TYPE={element:1,text:3,progressingInstruction:7,comment:8,document:9},getGlobal=function e(){return typeof window>"u"?null:window},_createTrustedTypesPolicy=function e(t,n){if(typeof t!="object"||typeof t.createPolicy!="function")return null;let o=null;const l="data-tt-policy-suffix";n&&n.hasAttribute(l)&&(o=n.getAttribute(l));const d="dompurify"+(o?"#"+o:"");try{return t.createPolicy(d,{createHTML(f){return f},createScriptURL(f){return f}})}catch{return console.warn("TrustedTypes policy "+d+" could not be created."),null}},_createHooksMap=function e(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}};function createDOMPurify(){let e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:getGlobal();const t=Xt=>createDOMPurify(Xt);if(t.version="3.3.0",t.removed=[],!e||!e.document||e.document.nodeType!==NODE_TYPE.document||!e.Element)return t.isSupported=!1,t;let{document:n}=e;const o=n,l=o.currentScript,{DocumentFragment:d,HTMLTemplateElement:f,Node:g,Element:b,NodeFilter:_,NamedNodeMap:S=e.NamedNodeMap||e.MozNamedAttrMap,HTMLFormElement:R,DOMParser:C,trustedTypes:E}=e,A=b.prototype,M=lookupGetter(A,"cloneNode"),I=lookupGetter(A,"remove"),j=lookupGetter(A,"nextSibling"),q=lookupGetter(A,"childNodes"),Q=lookupGetter(A,"parentNode");if(typeof f=="function"){const Xt=n.createElement("template");Xt.content&&Xt.content.ownerDocument&&(n=Xt.content.ownerDocument)}let te,F="";const{implementation:V,createNodeIterator:ne,createDocumentFragment:ae,getElementsByTagName:se}=n,{importNode:Oe}=o;let Ne=_createHooksMap();t.isSupported=typeof entries=="function"&&typeof Q=="function"&&V&&V.createHTMLDocument!==void 0;const{MUSTACHE_EXPR:oe,ERB_EXPR:$e,TMPLIT_EXPR:Ae,DATA_ATTR:je,ARIA_ATTR:Be,IS_SCRIPT_OR_DATA:qe,ATTR_WHITESPACE:Ve,CUSTOM_ELEMENT:Le}=EXPRESSIONS;let{IS_ALLOWED_URI:He}=EXPRESSIONS,We=null;const ze=addToSet({},[...html$1,...svg$1,...svgFilters,...mathMl$1,...text$1]);let Xe=null;const nt=addToSet({},[...html,...svg,...mathMl,...xml]);let Je=Object.seal(create(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),st=null,et=null;const at=Object.seal(create(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let tt=!0,ot=!0,lt=!1,Ge=!0,$t=!1,rt=!0,Rt=!1,dt=!1,It=!1,Mt=!1,Ct=!1,Ke=!1,Ye=!0,Ze=!1;const ct="user-content-";let mt=!0,ft=!1,yt={},Ht=null;const Kt=addToSet({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","style","svg","template","thead","title","video","xmp"]);let un=null;const hn=addToSet({},["audio","video","img","source","image","track"]);let qt=null;const An=addToSet({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),xn="http://www.w3.org/1998/Math/MathML",Rn="http://www.w3.org/2000/svg",vn="http://www.w3.org/1999/xhtml";let Pn=vn,Mn=!1,$n=null;const Vn=addToSet({},[xn,Rn,vn],stringToString);let Jt=addToSet({},["mi","mo","mn","ms","mtext"]),Qt=addToSet({},["annotation-xml"]);const Ut=addToSet({},["title","style","font","a","script"]);let tn=null;const Yt=["application/xhtml+xml","text/html"],an="text/html";let mn=null,On=null;const Fn=n.createElement("form"),Cn=function(it){return it instanceof RegExp||it instanceof Function},Bn=function(){let it=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!(On&&On===it)){if((!it||typeof it!="object")&&(it={}),it=clone(it),tn=Yt.indexOf(it.PARSER_MEDIA_TYPE)===-1?an:it.PARSER_MEDIA_TYPE,mn=tn==="application/xhtml+xml"?stringToString:stringToLowerCase,We=objectHasOwnProperty(it,"ALLOWED_TAGS")?addToSet({},it.ALLOWED_TAGS,mn):ze,Xe=objectHasOwnProperty(it,"ALLOWED_ATTR")?addToSet({},it.ALLOWED_ATTR,mn):nt,$n=objectHasOwnProperty(it,"ALLOWED_NAMESPACES")?addToSet({},it.ALLOWED_NAMESPACES,stringToString):Vn,qt=objectHasOwnProperty(it,"ADD_URI_SAFE_ATTR")?addToSet(clone(An),it.ADD_URI_SAFE_ATTR,mn):An,un=objectHasOwnProperty(it,"ADD_DATA_URI_TAGS")?addToSet(clone(hn),it.ADD_DATA_URI_TAGS,mn):hn,Ht=objectHasOwnProperty(it,"FORBID_CONTENTS")?addToSet({},it.FORBID_CONTENTS,mn):Kt,st=objectHasOwnProperty(it,"FORBID_TAGS")?addToSet({},it.FORBID_TAGS,mn):clone({}),et=objectHasOwnProperty(it,"FORBID_ATTR")?addToSet({},it.FORBID_ATTR,mn):clone({}),yt=objectHasOwnProperty(it,"USE_PROFILES")?it.USE_PROFILES:!1,tt=it.ALLOW_ARIA_ATTR!==!1,ot=it.ALLOW_DATA_ATTR!==!1,lt=it.ALLOW_UNKNOWN_PROTOCOLS||!1,Ge=it.ALLOW_SELF_CLOSE_IN_ATTR!==!1,$t=it.SAFE_FOR_TEMPLATES||!1,rt=it.SAFE_FOR_XML!==!1,Rt=it.WHOLE_DOCUMENT||!1,Mt=it.RETURN_DOM||!1,Ct=it.RETURN_DOM_FRAGMENT||!1,Ke=it.RETURN_TRUSTED_TYPE||!1,It=it.FORCE_BODY||!1,Ye=it.SANITIZE_DOM!==!1,Ze=it.SANITIZE_NAMED_PROPS||!1,mt=it.KEEP_CONTENT!==!1,ft=it.IN_PLACE||!1,He=it.ALLOWED_URI_REGEXP||IS_ALLOWED_URI,Pn=it.NAMESPACE||vn,Jt=it.MATHML_TEXT_INTEGRATION_POINTS||Jt,Qt=it.HTML_INTEGRATION_POINTS||Qt,Je=it.CUSTOM_ELEMENT_HANDLING||{},it.CUSTOM_ELEMENT_HANDLING&&Cn(it.CUSTOM_ELEMENT_HANDLING.tagNameCheck)&&(Je.tagNameCheck=it.CUSTOM_ELEMENT_HANDLING.tagNameCheck),it.CUSTOM_ELEMENT_HANDLING&&Cn(it.CUSTOM_ELEMENT_HANDLING.attributeNameCheck)&&(Je.attributeNameCheck=it.CUSTOM_ELEMENT_HANDLING.attributeNameCheck),it.CUSTOM_ELEMENT_HANDLING&&typeof it.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements=="boolean"&&(Je.allowCustomizedBuiltInElements=it.CUSTOM_ELEMENT_HANDLING.allowCustomizedBuiltInElements),$t&&(ot=!1),Ct&&(Mt=!0),yt&&(We=addToSet({},text$1),Xe=[],yt.html===!0&&(addToSet(We,html$1),addToSet(Xe,html)),yt.svg===!0&&(addToSet(We,svg$1),addToSet(Xe,svg),addToSet(Xe,xml)),yt.svgFilters===!0&&(addToSet(We,svgFilters),addToSet(Xe,svg),addToSet(Xe,xml)),yt.mathMl===!0&&(addToSet(We,mathMl$1),addToSet(Xe,mathMl),addToSet(Xe,xml))),it.ADD_TAGS&&(typeof it.ADD_TAGS=="function"?at.tagCheck=it.ADD_TAGS:(We===ze&&(We=clone(We)),addToSet(We,it.ADD_TAGS,mn))),it.ADD_ATTR&&(typeof it.ADD_ATTR=="function"?at.attributeCheck=it.ADD_ATTR:(Xe===nt&&(Xe=clone(Xe)),addToSet(Xe,it.ADD_ATTR,mn))),it.ADD_URI_SAFE_ATTR&&addToSet(qt,it.ADD_URI_SAFE_ATTR,mn),it.FORBID_CONTENTS&&(Ht===Kt&&(Ht=clone(Ht)),addToSet(Ht,it.FORBID_CONTENTS,mn)),mt&&(We["#text"]=!0),Rt&&addToSet(We,["html","head","body"]),We.table&&(addToSet(We,["tbody"]),delete st.tbody),it.TRUSTED_TYPES_POLICY){if(typeof it.TRUSTED_TYPES_POLICY.createHTML!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof it.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw typeErrorCreate('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');te=it.TRUSTED_TYPES_POLICY,F=te.createHTML("")}else te===void 0&&(te=_createTrustedTypesPolicy(E,l)),te!==null&&typeof F=="string"&&(F=te.createHTML(""));freeze&&freeze(it),On=it}},qn=addToSet({},[...svg$1,...svgFilters,...svgDisallowed]),Un=addToSet({},[...mathMl$1,...mathMlDisallowed]),sr=function(it){let Dt=Q(it);(!Dt||!Dt.tagName)&&(Dt={namespaceURI:Pn,tagName:"template"});const Wt=stringToLowerCase(it.tagName),pn=stringToLowerCase(Dt.tagName);return $n[it.namespaceURI]?it.namespaceURI===Rn?Dt.namespaceURI===vn?Wt==="svg":Dt.namespaceURI===xn?Wt==="svg"&&(pn==="annotation-xml"||Jt[pn]):!!qn[Wt]:it.namespaceURI===xn?Dt.namespaceURI===vn?Wt==="math":Dt.namespaceURI===Rn?Wt==="math"&&Qt[pn]:!!Un[Wt]:it.namespaceURI===vn?Dt.namespaceURI===Rn&&!Qt[pn]||Dt.namespaceURI===xn&&!Jt[pn]?!1:!Un[Wt]&&(Ut[Wt]||!qn[Wt]):!!(tn==="application/xhtml+xml"&&$n[it.namespaceURI]):!1},wn=function(it){arrayPush(t.removed,{element:it});try{Q(it).removeChild(it)}catch{I(it)}},Dn=function(it,Dt){try{arrayPush(t.removed,{attribute:Dt.getAttributeNode(it),from:Dt})}catch{arrayPush(t.removed,{attribute:null,from:Dt})}if(Dt.removeAttribute(it),it==="is")if(Mt||Ct)try{wn(Dt)}catch{}else try{Dt.setAttribute(it,"")}catch{}},Zn=function(it){let Dt=null,Wt=null;if(It)it="<remove></remove>"+it;else{const gn=stringMatch(it,/^[\r\n\t ]+/);Wt=gn&&gn[0]}tn==="application/xhtml+xml"&&Pn===vn&&(it='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+it+"</body></html>");const pn=te?te.createHTML(it):it;if(Pn===vn)try{Dt=new C().parseFromString(pn,tn)}catch{}if(!Dt||!Dt.documentElement){Dt=V.createDocument(Pn,"template",null);try{Dt.documentElement.innerHTML=Mn?F:pn}catch{}}const bn=Dt.body||Dt.documentElement;return it&&Wt&&bn.insertBefore(n.createTextNode(Wt),bn.childNodes[0]||null),Pn===vn?se.call(Dt,Rt?"html":"body")[0]:Rt?Dt.documentElement:bn},er=function(it){return ne.call(it.ownerDocument||it,it,_.SHOW_ELEMENT|_.SHOW_COMMENT|_.SHOW_TEXT|_.SHOW_PROCESSING_INSTRUCTION|_.SHOW_CDATA_SECTION,null)},Kn=function(it){return it instanceof R&&(typeof it.nodeName!="string"||typeof it.textContent!="string"||typeof it.removeChild!="function"||!(it.attributes instanceof S)||typeof it.removeAttribute!="function"||typeof it.setAttribute!="function"||typeof it.namespaceURI!="string"||typeof it.insertBefore!="function"||typeof it.hasChildNodes!="function")},or=function(it){return typeof g=="function"&&it instanceof g};function kn(Xt,it,Dt){arrayForEach(Xt,Wt=>{Wt.call(t,it,Dt,On)})}const lr=function(it){let Dt=null;if(kn(Ne.beforeSanitizeElements,it,null),Kn(it))return wn(it),!0;const Wt=mn(it.nodeName);if(kn(Ne.uponSanitizeElement,it,{tagName:Wt,allowedTags:We}),rt&&it.hasChildNodes()&&!or(it.firstElementChild)&®ExpTest(/<[/\w!]/g,it.innerHTML)&®ExpTest(/<[/\w!]/g,it.textContent)||it.nodeType===NODE_TYPE.progressingInstruction||rt&&it.nodeType===NODE_TYPE.comment&®ExpTest(/<[/\w]/g,it.data))return wn(it),!0;if(!(at.tagCheck instanceof Function&&at.tagCheck(Wt))&&(!We[Wt]||st[Wt])){if(!st[Wt]&&tr(Wt)&&(Je.tagNameCheck instanceof RegExp&®ExpTest(Je.tagNameCheck,Wt)||Je.tagNameCheck instanceof Function&&Je.tagNameCheck(Wt)))return!1;if(mt&&!Ht[Wt]){const pn=Q(it)||it.parentNode,bn=q(it)||it.childNodes;if(bn&&pn){const gn=bn.length;for(let Sn=gn-1;Sn>=0;--Sn){const In=M(bn[Sn],!0);In.__removalCount=(it.__removalCount||0)+1,pn.insertBefore(In,j(it))}}}return wn(it),!0}return it instanceof b&&!sr(it)||(Wt==="noscript"||Wt==="noembed"||Wt==="noframes")&®ExpTest(/<\/no(script|embed|frames)/i,it.innerHTML)?(wn(it),!0):($t&&it.nodeType===NODE_TYPE.text&&(Dt=it.textContent,arrayForEach([oe,$e,Ae],pn=>{Dt=stringReplace(Dt,pn," ")}),it.textContent!==Dt&&(arrayPush(t.removed,{element:it.cloneNode()}),it.textContent=Dt)),kn(Ne.afterSanitizeElements,it,null),!1)},cr=function(it,Dt,Wt){if(Ye&&(Dt==="id"||Dt==="name")&&(Wt in n||Wt in Fn))return!1;if(!(ot&&!et[Dt]&®ExpTest(je,Dt))){if(!(tt&®ExpTest(Be,Dt))){if(!(at.attributeCheck instanceof Function&&at.attributeCheck(Dt,it))){if(!Xe[Dt]||et[Dt]){if(!(tr(it)&&(Je.tagNameCheck instanceof RegExp&®ExpTest(Je.tagNameCheck,it)||Je.tagNameCheck instanceof Function&&Je.tagNameCheck(it))&&(Je.attributeNameCheck instanceof RegExp&®ExpTest(Je.attributeNameCheck,Dt)||Je.attributeNameCheck instanceof Function&&Je.attributeNameCheck(Dt,it))||Dt==="is"&&Je.allowCustomizedBuiltInElements&&(Je.tagNameCheck instanceof RegExp&®ExpTest(Je.tagNameCheck,Wt)||Je.tagNameCheck instanceof Function&&Je.tagNameCheck(Wt))))return!1}else if(!qt[Dt]){if(!regExpTest(He,stringReplace(Wt,Ve,""))){if(!((Dt==="src"||Dt==="xlink:href"||Dt==="href")&&it!=="script"&&stringIndexOf(Wt,"data:")===0&&un[it])){if(!(lt&&!regExpTest(qe,stringReplace(Wt,Ve,"")))){if(Wt)return!1}}}}}}}return!0},tr=function(it){return it!=="annotation-xml"&&stringMatch(it,Le)},nr=function(it){kn(Ne.beforeSanitizeAttributes,it,null);const{attributes:Dt}=it;if(!Dt||Kn(it))return;const Wt={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Xe,forceKeepAttr:void 0};let pn=Dt.length;for(;pn--;){const bn=Dt[pn],{name:gn,namespaceURI:Sn,value:In}=bn,Hn=mn(gn),zt=In;let yn=gn==="value"?zt:stringTrim(zt);if(Wt.attrName=Hn,Wt.attrValue=yn,Wt.keepAttr=!0,Wt.forceKeepAttr=void 0,kn(Ne.uponSanitizeAttribute,it,Wt),yn=Wt.attrValue,Ze&&(Hn==="id"||Hn==="name")&&(Dn(gn,it),yn=ct+yn),rt&®ExpTest(/((--!?|])>)|<\/(style|title|textarea)/i,yn)){Dn(gn,it);continue}if(Hn==="attributename"&&stringMatch(yn,"href")){Dn(gn,it);continue}if(Wt.forceKeepAttr)continue;if(!Wt.keepAttr){Dn(gn,it);continue}if(!Ge&®ExpTest(/\/>/i,yn)){Dn(gn,it);continue}$t&&arrayForEach([oe,$e,Ae],dr=>{yn=stringReplace(yn,dr," ")});const En=mn(it.nodeName);if(!cr(En,Hn,yn)){Dn(gn,it);continue}if(te&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!Sn)switch(E.getAttributeType(En,Hn)){case"TrustedHTML":{yn=te.createHTML(yn);break}case"TrustedScriptURL":{yn=te.createScriptURL(yn);break}}if(yn!==zt)try{Sn?it.setAttributeNS(Sn,gn,yn):it.setAttribute(gn,yn),Kn(it)?wn(it):arrayPop(t.removed)}catch{Dn(gn,it)}}kn(Ne.afterSanitizeAttributes,it,null)},ur=function Xt(it){let Dt=null;const Wt=er(it);for(kn(Ne.beforeSanitizeShadowDOM,it,null);Dt=Wt.nextNode();)kn(Ne.uponSanitizeShadowNode,Dt,null),lr(Dt),nr(Dt),Dt.content instanceof d&&Xt(Dt.content);kn(Ne.afterSanitizeShadowDOM,it,null)};return t.sanitize=function(Xt){let it=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Dt=null,Wt=null,pn=null,bn=null;if(Mn=!Xt,Mn&&(Xt="<!-->"),typeof Xt!="string"&&!or(Xt))if(typeof Xt.toString=="function"){if(Xt=Xt.toString(),typeof Xt!="string")throw typeErrorCreate("dirty is not a string, aborting")}else throw typeErrorCreate("toString is not a function");if(!t.isSupported)return Xt;if(dt||Bn(it),t.removed=[],typeof Xt=="string"&&(ft=!1),ft){if(Xt.nodeName){const In=mn(Xt.nodeName);if(!We[In]||st[In])throw typeErrorCreate("root node is forbidden and cannot be sanitized in-place")}}else if(Xt instanceof g)Dt=Zn("<!---->"),Wt=Dt.ownerDocument.importNode(Xt,!0),Wt.nodeType===NODE_TYPE.element&&Wt.nodeName==="BODY"||Wt.nodeName==="HTML"?Dt=Wt:Dt.appendChild(Wt);else{if(!Mt&&!$t&&!Rt&&Xt.indexOf("<")===-1)return te&&Ke?te.createHTML(Xt):Xt;if(Dt=Zn(Xt),!Dt)return Mt?null:Ke?F:""}Dt&&It&&wn(Dt.firstChild);const gn=er(ft?Xt:Dt);for(;pn=gn.nextNode();)lr(pn),nr(pn),pn.content instanceof d&&ur(pn.content);if(ft)return Xt;if(Mt){if(Ct)for(bn=ae.call(Dt.ownerDocument);Dt.firstChild;)bn.appendChild(Dt.firstChild);else bn=Dt;return(Xe.shadowroot||Xe.shadowrootmode)&&(bn=Oe.call(o,bn,!0)),bn}let Sn=Rt?Dt.outerHTML:Dt.innerHTML;return Rt&&We["!doctype"]&&Dt.ownerDocument&&Dt.ownerDocument.doctype&&Dt.ownerDocument.doctype.name&®ExpTest(DOCTYPE_NAME,Dt.ownerDocument.doctype.name)&&(Sn="<!DOCTYPE "+Dt.ownerDocument.doctype.name+`>
|
|
1159
1159
|
`+Sn),$t&&arrayForEach([oe,$e,Ae],In=>{Sn=stringReplace(Sn,In," ")}),te&&Ke?te.createHTML(Sn):Sn},t.setConfig=function(){let Xt=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Bn(Xt),dt=!0},t.clearConfig=function(){On=null,dt=!1},t.isValidAttribute=function(Xt,it,Dt){On||Bn({});const Wt=mn(Xt),pn=mn(it);return cr(Wt,pn,Dt)},t.addHook=function(Xt,it){typeof it=="function"&&arrayPush(Ne[Xt],it)},t.removeHook=function(Xt,it){if(it!==void 0){const Dt=arrayLastIndexOf(Ne[Xt],it);return Dt===-1?void 0:arraySplice(Ne[Xt],Dt,1)[0]}return arrayPop(Ne[Xt])},t.removeHooks=function(Xt){Ne[Xt]=[]},t.removeAllHooks=function(){Ne=_createHooksMap()},t}var purify=createDOMPurify();function markdownToSafeHTML(e){const t=marked(e,{async:!1});return purify.sanitize(t,{ALLOWED_TAGS:["h1","h2","h3","h4","h5","h6","b","strong","i","em","u","s","sub","sup","mark","blockquote","q","ul","ol","li","dl","dt","dd","p","div","span","br","hr","table","thead","tbody","tfoot","tr","th","td"]})}function SkeletonMessage({botStatus:e}){return jsxRuntime.jsxs("div",{className:"flex items-start gap-2",children:[jsxRuntime.jsx("div",{className:"h-8 w-8 mt-1 rounded-full bg-gray-300 animate-pulse flex-shrink-0"}),jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[jsxRuntime.jsx("p",{className:"mb-1",children:"Assistant"}),jsxRuntime.jsxs("div",{className:"flex items-end gap-2",children:[jsxRuntime.jsx("div",{className:"rounded-md p-3 break-words bg-white border rounded-tl-none",children:jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse"}),jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse delay-150"}),jsxRuntime.jsx("div",{className:"h-2 w-2 rounded-full bg-primary animate-pulse delay-300"}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground ml-1",children:e})]})}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:new Date().toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})})]})]})]})}function ChatMessages({messages:e,appID:t,botStatus:n,isAssistantChat:o}){const l=(()=>{const d=new Set;let f=null;for(const g of e){const b=(g.senderName??"").trim();b&&(f===b?d.add(g.id):f=b)}return d})();return jsxRuntime.jsxs("div",{children:[e.map(d=>{var g;const f=d.fromPartnerID===t;return jsxRuntime.jsx("div",{className:cn("flex items-start gap-2 mt-2 mb-2",f&&"flex-row-reverse"),children:jsxRuntime.jsxs("div",{className:"flex flex-col max-w-[70%]",children:[!l.has(d.id)&&!!((g=d.senderName)!=null&&g.trim())&&jsxRuntime.jsx("p",{className:cn("mb-1 flex",f&&"flex-row-reverse"),children:d.senderName}),jsxRuntime.jsxs("div",{className:cn("flex items-baseline gap-2",f&&"flex-row-reverse"),children:[jsxRuntime.jsx("div",{className:cn("rounded-md p-3 break-words [&_li]:ml-6 [&_li]:list-disc [&_h1]:text-lg [&_h1]:font-bold [&_h1]:mt-4 [&_h2]:font-bold [&_h2]:mt-4 [&_h3]:mt-4 ",f?"bg-primary text-white rounded-tr-none":"bg-white border rounded-tl-none"),children:parser(markdownToSafeHTML(d.content))}),jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground whitespace-nowrap",children:(()=>{const b=new Date(d.timestamp);return isToday(b)?b.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0}):isYesterday(b)?`Yesterday, ${b.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`:`${b.toLocaleDateString([],{month:"short",day:"numeric"})} ${b.toLocaleTimeString([],{hour:"numeric",minute:"2-digit",hour12:!0})}`})()})]})]})},d.id)}),n!==""&&jsxRuntime.jsx(SkeletonMessage,{botStatus:n}),e.length===0&&!o&&jsxRuntime.jsxs("div",{className:"mt-1 text-xl",children:[jsxRuntime.jsx(Send,{className:"w-full h-32"}),jsxRuntime.jsx("p",{className:"text-center",children:"No messages yet... Say hello!"})]}),e.length===0&&n===""&&o&&jsxRuntime.jsxs("div",{className:"text-center py-8",children:[jsxRuntime.jsx("p",{children:"The Randmar Assistant is ready to help you. Ask anything about products, orders, carts, shipments and tracking numbers."}),jsxRuntime.jsx("p",{children:jsxRuntime.jsx("strong",{children:'Try it now, type "my open orders"!'})})]})]})}const Textarea=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx("textarea",{className:cn("flex min-h-[60px] w-full rounded-md border border-input bg-transparent px-3 py-2 text-base shadow-xs placeholder:text-muted-foreground focus-visible:outline-hidden focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50 md:text-sm",e),ref:n,...t}));Textarea.displayName="Textarea";function ChatMainArea({activeChat:e,activeChatObj:t,appID:n,messagesEndRef:o,inputRef:l,content:d,setContent:f,handleSendMessage:g,isPostBizDevConvoLoading:b,acceptChat:_}){return jsxRuntime.jsx("div",{className:"flex-5 flex flex-col",children:e?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center p-4 border-b",children:[jsxRuntime.jsx(Avatar,{className:"h-8 w-8 flex-shrink-0 rounded-none",children:jsxRuntime.jsx(PartnerLogo,{id:e[0]===n?e[1]:e[0],width:72,height:72})}),jsxRuntime.jsx("div",{className:"ml-3 font-medium",children:t==null?void 0:t.name})]}),t!=null&&t.pending&&t.partner1==n?jsxRuntime.jsx("p",{className:"mt-8 p-2 mx-auto",children:"This conversation is awaiting approval by the other party — please check back later."}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(ScrollArea,{className:"flex-1 pl-2 pr-2 bg-slate-50",children:[jsxRuntime.jsx("div",{className:(t==null?void 0:t.messages)===null?" opacity-0":"",children:jsxRuntime.jsx(ChatMessages,{messages:(t==null?void 0:t.messages)??[],appID:n,isAssistantChat:!1,botStatus:""})}),jsxRuntime.jsx("div",{ref:o})]}),jsxRuntime.jsxs("div",{className:"p-4 border-t border-r flex",children:[(t==null?void 0:t.pending)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Button$1,{disabled:b,onClick:()=>_(),children:[jsxRuntime.jsx(Handshake,{}),"Accept Conversation Request"]}),jsxRuntime.jsxs(Button$1,{disabled:!0,className:"ml-2",children:[jsxRuntime.jsx(ThumbsDown,{}),"Block Partner"]})]}),jsxRuntime.jsx(Textarea,{ref:l,placeholder:"Type a message...",value:d,onChange:S=>f(S.target.value),onKeyDown:S=>{S.key!=="Enter"||S.shiftKey||(S.preventDefault(),g())},className:t!=null&&t.pending?"collapse":"flex-1 resize-none field-sizing-content max-h-[30em]",disabled:t==null?void 0:t.pending}),jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsx(Button$1,{size:"icon",variant:"default",className:t!=null&&t.pending?"collapse":"ml-2 h-8 w-8",disabled:t==null?void 0:t.pending,onClick:g,children:jsxRuntime.jsx(Send,{className:"h-6 w-6"})})})]})]})]}):jsxRuntime.jsxs("div",{className:"flex flex-col m-auto text-xl",children:[jsxRuntime.jsx(MousePointerClick,{className:"w-full h-32"}),jsxRuntime.jsx("p",{children:"Select a chat from the left menu to start messaging"})]})})}function ChatRightSidebar({activeChatObj:e,appID:t,sendChatToAssistant:n,isAnalyzingPartnership:o,analyzePartnership:l}){const d=e?[e.partner1,e.partner2]:void 0;return jsxRuntime.jsx("div",{className:"flex border-l flex-1",children:jsxRuntime.jsxs("div",{className:"flex flex-col p-4 border-b gap-2",children:[jsxRuntime.jsx("p",{className:"h-9 font-medium text-base/9",children:"Actions"}),jsxRuntime.jsx(reactRouterDom.Link,{className:"w-full",inert:d===void 0,to:`/${t}/Partner/${(d==null?void 0:d[0])===t?d[1]:d==null?void 0:d[0]}`,children:jsxRuntime.jsx(Button$1,{className:"w-full",disabled:d===void 0,children:"View Partner"})}),jsxRuntime.jsx(Button$1,{disabled:((e==null?void 0:e.messages)??[]).length<1,onClick:()=>n(e.messages),children:"Export to Randmar Assistant"}),jsxRuntime.jsx(Button$1,{disabled:d===void 0||o,onClick:l,children:o?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Analyzing..."]}):"Analyze Partnership"}),jsxRuntime.jsx(PartnerActions,{userId:t,partnerId:(d==null?void 0:d[0])===t?d[1]:(d==null?void 0:d[0])||"",isAdmin:!1}),jsxRuntime.jsx(PeopleSection,{appID:t,activeChatObj:e}),jsxRuntime.jsx(LinkSection,{appID:t,activeChatObj:e})]})})}const PeopleSection=({appID:e,activeChatObj:t})=>{const n=(t==null?void 0:t.conversationID)??-1,o=!t||n===-1,{data:l,isLoading:d,isError:f,refetch:g,isFetching:b}=useGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationAndConversationIdPeopleQuery({routeApplicationId:e,conversationId:n},{skip:o}),_=l??[];return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("p",{className:"font-medium pt-2 border-t",children:"People"}),o?jsxRuntime.jsx("p",{className:"font-light",children:"Select a chat to see participants."}):d||b?jsxRuntime.jsx("p",{children:"Loading people..."}):f?jsxRuntime.jsxs("div",{className:"flex items-center justify-between gap-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-destructive",children:"Could not load people."}),jsxRuntime.jsx(Button$1,{variant:"secondary",size:"sm",onClick:()=>g(),children:"Retry"})]}):_.length===0?jsxRuntime.jsx("p",{className:"font-light",children:"No participants found."}):jsxRuntime.jsx("ul",{className:"flex flex-col gap-2",children:_.map((S,R)=>{const C=S.ApplicationId??`${S.Name??"person"}-${R}`,E=S.LastAuthentication?new Date(S.LastAuthentication).toLocaleString():void 0;return jsxRuntime.jsxs("li",{className:"rounded border px-3 py-2 text-sm",children:[jsxRuntime.jsx("p",{className:"font-medium leading-tight",children:S.Name??"Unknown person"}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:S.Role??"Role unavailable"}),E?jsxRuntime.jsxs("p",{className:"text-xs text-muted-foreground",children:["Last auth ",E]}):null]},C)})})]})},LinkSection=({appID:e,activeChatObj:t})=>{const[n,o]=React.useState(!1),l=t==null?void 0:t.conversationID,d=l===void 0||l===-1,{data:f,isLoading:g}=useGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationAndConversationIdLinksQuery({routeApplicationId:e,conversationId:l??-1},{skip:d}),[b]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationAndConversationIdLinkMutation(),[_]=useDeleteV4PartnerByRouteApplicationIdBusinessDevelopmentConversationLinkAndLinkIdMutation();return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("p",{className:"font-medium pt-2 border-t",children:"Links"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-1",children:[g?jsxRuntime.jsx("p",{children:"Loading links..."}):(f==null?void 0:f.length)===0?jsxRuntime.jsx("p",{children:"No links attached."}):null,f==null?void 0:f.map(S=>jsxRuntime.jsxs("div",{className:"flex items-center justify-between",children:[jsxRuntime.jsx("a",{href:S.URL,target:"_blank",rel:"noopener noreferrer",className:"text-randmar-red underline break-all",children:S.Title}),jsxRuntime.jsx(Button$1,{variant:"secondary",size:"icon",onClick:()=>_({routeApplicationId:e,linkId:S.LinkId}),children:jsxRuntime.jsx(Trash2,{className:"h-4 w-4"})})]},S.LinkId))]}),jsxRuntime.jsxs(Dialog,{open:n,onOpenChange:o,children:[jsxRuntime.jsx(DialogTrigger$1,{asChild:!0,children:jsxRuntime.jsx(Button$1,{className:"p-0",disabled:d,children:"Add Link"})}),jsxRuntime.jsxs(DialogContent,{children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle$1,{children:"Add Link"}),jsxRuntime.jsx(DialogDescription$1,{children:"Please enter the details for the new link."})]}),jsxRuntime.jsxs("form",{className:"space-y-4",onSubmit:S=>{S.preventDefault();const R=document.getElementById("link-title").value,C=document.getElementById("link-url").value;l===void 0||l===-1||(b({routeApplicationId:e,conversationId:l,createLinkRequest:{Title:R,Url:C}}),o(!1))},children:[jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"link-title",children:"Title"}),jsxRuntime.jsx(Input,{id:"link-title",required:!0,minLength:2})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"link-url",children:"URL"}),jsxRuntime.jsx(Input,{id:"link-url",type:"url",required:!0,minLength:2,placeholder:"https://"})]}),jsxRuntime.jsx(Button$1,{type:"submit",disabled:d,children:"Add Link"})]})]})]})]})},UserSetupForm=e=>{const[t]=usePostV4UserByFieldNameMutation(),[n,o]=React.useState(""),[l,d]=React.useState(""),[f,g]=React.useState(!1),[b]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation();return jsxRuntime.jsxs("div",{className:"mx-auto mt-2",children:[jsxRuntime.jsx("p",{className:"mb-4",children:"Before you can start chatting, please set up your profile."}),jsxRuntime.jsxs("form",{className:"space-y-2",onSubmit:_=>{f||(g(!0),_.preventDefault(),t({fieldName:"Name",newValue:n}).then(()=>{b({routeApplicationId:e.appID,partnerId:"2"})}),t({fieldName:"Role",newValue:l}))},children:[jsxRuntime.jsx(Label$2,{htmlFor:"name",children:"Name"}),jsxRuntime.jsx(Input,{id:"name",required:!0,minLength:2,value:n,onChange:_=>o(_.target.value)}),jsxRuntime.jsx(Label$2,{htmlFor:"role",children:"Role"}),jsxRuntime.jsx(Input,{id:"role",required:!0,minLength:2,value:l,onChange:_=>d(_.target.value)}),jsxRuntime.jsx(Button$1,{type:"submit",disabled:f,children:f?"Saving...":"Save"})]})]})},sortChats=(e,t)=>e.unread>0&&t.unread===0?-1:t.unread>0&&e.unread===0?1:e.name.localeCompare(t.name);function ChatLayout({appID:e,inputRef:t,className:n}){const{setHasUnreads:o}=useChat(),{data:l,refetch:d}=useGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationsQuery({routeApplicationId:e}),[f,g]=React.useState(!1),[b,{isLoading:_}]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation(),S=React.useRef(null),[R]=useLazyGetV4PartnerByApplicationIdAccountQuery(),{sendPrompt:C}=useGemini({outputFormat:"text",useProModel:!0}),[E,A]=React.useState(!1),[M]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationPartnerAndPartnerIdMutation(),[I]=usePostV4PartnerByRouteApplicationIdBusinessDevelopmentConversationAndConversationIdReadMutation(),[j]=useLazyGetV4PartnerByRouteApplicationIdBusinessDevelopmentConversationAndConversationIdMessagesQuery(),[q]=useLazyGetV4PartnerByRouteApplicationIdPartnerAndPartnerIdQuery(),[Q,te]=React.useState(!1);React.useEffect(()=>{l&&(oe(dt=>{const It=l.map(Mt=>{var Ke;const Ct=dt.find(Ye=>Ye.conversationID===Mt.ConversationId);return{partner1:Mt.Participant1,partner2:Mt.Participant2,name:((Ke=Mt.Participant)==null?void 0:Ke.PublicName)??"missing public name",unread:(Ct==null?void 0:Ct.unread)??0,pending:Mt.Status!=="Approved",messages:(Ct==null?void 0:Ct.messages)??null,conversationID:Mt.ConversationId,lastMessageTime:Mt.LastMessageTime??null}});return It.sort(sortChats),It}),g(!0),setTimeout(()=>{var dt;return(dt=Le.current)==null?void 0:dt.focus()},50))},[l,e]);const[F,V]=React.useState(void 0),[ne,ae]=React.useState(""),[se,Oe]=React.useState(null),[Ne,oe]=React.useState([]),[$e,Ae]=React.useState(null),je=React.useRef(null),Be=React.useRef(null),[qe,Ve]=React.useState([]),Le=t||Be,He=React.useRef(null),{toast:We}=useToast(),ze=()=>Ne.find(dt=>dt.partner1===(F==null?void 0:F[0])&&dt.partner2===(F==null?void 0:F[1]));function Xe(){const dt=ze();dt&&I({routeApplicationId:e,conversationId:dt.conversationID})}const nt=dt=>Ve(It=>[...It,dt]);React.useEffect(()=>{if(qe.length==0)return;console.log(qe.length,"unprocessedMessages detected");const dt=(Mt,Ct)=>Ct.partner1===Mt.toPartnerID&&Ct.partner2===Mt.fromPartnerID||Ct.partner2===Mt.toPartnerID&&Ct.partner1===Mt.fromPartnerID;let It=!1;qe.forEach(Mt=>{if(!Ne.some(Ct=>dt(Mt,Ct))){console.log("message received for unknown convo ID - need to refetch!"),It=!0;return}oe(Ct=>Ct.map(Ke=>{if(!dt(Mt,Ke))return Ke;const Ye=Ke.messages??[];if(Ye.some(mt=>mt.id===Mt.id))return Ke;let Ze=1;const ct=document.activeElement&&document.activeElement===Le.current;return(F==null?void 0:F[0])==Ke.partner1&&F[1]==Ke.partner2&&ct&&(ct&&(Ze=0,Xe()),setTimeout(()=>{var mt;return(mt=je.current)==null?void 0:mt.scrollIntoView({behavior:"smooth"})},50)),{...Ke,pending:!1,unread:Ke.unread+Ze,messages:[...Ye,Mt]}}).sort(sortChats))}),console.log("need refetch:",It),It&&d(),Ve([])},[qe,Ve,oe,V,F]),React.useEffect(()=>{const dt=new HubConnectionBuilder().withUrl("https://api.randmar.io/hub",{accessTokenFactory:()=>localStorage.getItem("access_token"),headers:{"X-Impersonated-Id":e}}).configureLogging(LogLevel.Information).withAutomaticReconnect().withHubProtocol(new JsonHubProtocol).build();return dt.on("ReceiveMessage",nt),dt.start().catch(It=>console.error("Error connecting to SignalR hub:",It)),Ae(dt),()=>{dt&&dt.stop()}},[e]),React.useEffect(()=>{var It;!F||!ze()||((It=Le.current)==null||It.focus(),setTimeout(()=>{var Mt;return(Mt=je.current)==null?void 0:Mt.scrollIntoView({behavior:"smooth"})},50))},[F]),React.useEffect(()=>{if(!F)return;const dt=ze();dt&&dt.conversationID!==-1&&(async()=>{var It;try{const Ct=((It=(await j({routeApplicationId:e,conversationId:dt.conversationID})).data)==null?void 0:It.map(Ke=>({id:"history"+Ke.MessageId,fromPartnerID:Ke.SenderId,toPartnerID:Ke.SenderId==dt.partner1?dt.partner2:dt.partner1,senderName:Ke.SenderName??"missing name",timestamp:new Date(Ke.SentDate+"Z").getTime(),content:Ke.Content??"no content"})))??[];oe(Ke=>Ke.map(Ye=>Ye.conversationID===dt.conversationID?{...Ye,messages:Ct}:Ye).sort(sortChats))}catch(Mt){console.error("Error fetching conversation messages:",Mt)}})()},[F,j,e]),React.useEffect(()=>{if(!F)return;const dt=ze();if(!dt)return;const It=document.activeElement&&document.activeElement===Le.current;dt.unread>0&&It&&(Xe(),oe(Mt=>Mt.map(Ct=>Ct.partner1===F[0]&&Ct.partner2===F[1]?{...Ct,unread:0}:Ct)))},[F,Ne]);const{sendMessage:Je}=useChat(),st=React.useCallback(dt=>{Je(`We have been talking with another Randmar partner and would like you to have the conversation as context for follow-up questions. Please acknowledge your reception of this chat history (one line summary of recent messages will do) and let me know that you're ready to answer questions: ${JSON.stringify(dt,null,2)}`)},[Je]),et=React.useCallback(async()=>{if(F)try{te(!0);const dt=await R({applicationId:e}),It=F[0]===e?F[1]:F[0],Mt=await q({routeApplicationId:e,partnerId:It,withSpecification:!0}),Ct=buildPartnershipAssistantPrompt(dt.data,Mt.data);Ct?Je(Ct):We({title:"Missing data",description:"We couldn't load enough data to analyze this partnership yet. Please try again shortly.",variant:"destructive"})}catch(dt){console.error("Error preparing partnership analysis:",dt),We({title:"Error",description:"Could not analyze the partnership. Please try again later.",variant:"destructive"})}finally{te(!1)}},[F,R,q,Je,We,e]);React.useEffect(()=>{o(Ne.some(dt=>dt.unread>0))},[Ne,o]);const at=(dt,It)=>{It=It.replace(/\n/g,`
|
|
1160
1160
|
`),console.log("doSend",It),console.log("target",dt);const Mt={id:crypto.randomUUID(),senderName:(lt==null?void 0:lt.Name)??(lt==null?void 0:lt.EmailAddress)??"User",fromPartnerID:e,toPartnerID:dt.partner1===e?dt.partner2:dt.partner1,content:It,timestamp:Date.now()};nt(Mt),$e.invoke("NewMessage",Mt).catch(Ct=>console.error("Error sending message:",Ct)),ae(""),He.current&&(He.current.value="")},tt=()=>{const dt=ne.trim();!Rt||!dt||!F||!$e||(Rt.unread>0&&(Xe(),oe(It=>It.map(Mt=>Mt.partner1===F[0]&&Mt.partner2===F[1]?{...Mt,unread:0}:Mt))),at(Rt,dt))},ot=(dt,It)=>Oe([dt,It]);React.useEffect(()=>{if(se===null)return;const dt=Ne.find(Mt=>Mt.conversationID===se[0]);if(!dt||(V([dt.partner1,dt.partner2]),!$e))return;const It=se[1];Oe(null),It&&at(dt,It)},[se,Ne,V,$e]);const{data:lt,isLoading:Ge}=useGetV4UserQuery();if(!f||Ge)return jsxRuntime.jsx(LoaderCircle,{className:"h-12 w-12 animate-spin mx-auto mb-4"});if(!(lt!=null&<.Name))return jsxRuntime.jsx(UserSetupForm,{appID:(lt==null?void 0:lt.ApplicationId)??""});const $t=async()=>{var dt,It,Mt,Ct,Ke;S.current&&(S.current.disabled=!0),A(!0);try{const Ye=await R({applicationId:e}),Ze=((dt=Ye.data)==null?void 0:dt.About)??"a new business venture",ct=[];(It=Ye.data)!=null&&It.IsManufacturer&&ct.push("Manufacturer"),(Mt=Ye.data)!=null&&Mt.IsReseller&&ct.push("Reseller"),(Ct=Ye.data)!=null&&Ct.IsSalesAgency&&ct.push("Sales Agency");const ft=`
|
|
1161
1161
|
Your task is to draft a ready-to-send opening message from a user to the Randmar team.
|
|
@@ -1221,13 +1221,13 @@ $10 with opportunities under $1,000`:e==="D"?"$15 under $1,500":e==="E"?"Full sh
|
|
|
1221
1221
|
---
|
|
1222
1222
|
${qe}`:je;try{await V({applicationId:e,comment:Ve,emailAddress:Be||void 0}).unwrap(),F({title:"Feedback sent",description:"Thanks for helping us improve."}),_(!1),R(""),E(""),M(!1),j(null)}catch(Le){console.error("Failed to send feedback",Le),F({title:"Feedback could not be sent",description:"Please try again in a moment.",variant:"destructive"})}};return jsxRuntime.jsxs("header",{className:"flex h-16 items-center gap-4 border-b sidebar-foreground bg-sidebar px-6 fixed top-0 right-0 z-50 lg:left-64 left-0 border-sidebar-border",children:[jsxRuntime.jsx(SidebarTrigger,{className:"lg:hidden",children:jsxRuntime.jsx(Menu$1,{className:"h-6 w-6"})}),jsxRuntime.jsx("div",{className:"flex flex-1 items-center gap-4",children:jsxRuntime.jsx("div",{className:"relative w-full max-w-sm",children:jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("button",{type:"button",className:"absolute left-2 top-1/2 -translate-y-1/2",onClick:Oe,"aria-label":"Search",children:jsxRuntime.jsx(Search,{className:"h-4 w-4 text-muted-foreground"})}),jsxRuntime.jsx(Input,{placeholder:l??"Search...",className:"w-full pl-8 bg-white text-black",value:f,onChange:Ae=>g(Ae.target.value),onKeyDown:Ne,ref:d},"topbar-search")]})})}),jsxRuntime.jsxs("div",{className:"flex items-center gap-3",children:[jsxRuntime.jsxs(Dialog,{open:b,onOpenChange:_,children:[jsxRuntime.jsx(DialogTrigger,{asChild:!0,children:jsxRuntime.jsxs(Button$1,{type:"button",variant:"outline",size:"sm",className:"gap-2",children:[jsxRuntime.jsx(MessageSquare,{className:"h-4 w-4"}),"Feedback"]})}),jsxRuntime.jsx(DialogContent,{className:"w-[min(95vw,980px)] max-w-4xl overflow-hidden border border-border/40 bg-background p-0 shadow-[0_35px_120px_rgba(15,23,42,0.45)]",children:jsxRuntime.jsxs("form",{className:"flex max-h-[85vh] flex-col gap-6 overflow-y-auto bg-background p-6 sm:p-8",onSubmit:oe,children:[jsxRuntime.jsxs("div",{className:"relative overflow-hidden rounded-[32px] bg-gradient-to-br from-slate-950 via-slate-900 to-indigo-950 p-6 text-white shadow-[0_20px_45px_rgba(15,23,42,0.55)] sm:p-8",children:[jsxRuntime.jsxs("div",{className:"pointer-events-none absolute inset-0 opacity-70",children:[jsxRuntime.jsx("div",{className:"absolute -left-14 top-10 h-32 w-32 rounded-full bg-white/10 blur-3xl","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"absolute right-0 top-1/2 h-40 w-40 -translate-y-1/2 rounded-full bg-indigo-400/20 blur-3xl","aria-hidden":"true"}),jsxRuntime.jsx("div",{className:"absolute bottom-0 left-1/3 h-44 w-44 translate-y-1/3 rounded-full bg-sky-300/20 blur-3xl","aria-hidden":"true"})]}),jsxRuntime.jsxs("div",{className:"relative flex flex-col gap-5",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 text-xs uppercase tracking-wide text-white/80",children:[jsxRuntime.jsx(Badge,{variant:"outline",className:"w-max border-white/30 bg-white/10 text-white",children:"Partner feedback desk"}),jsxRuntime.jsx("p",{className:"text-white/70",children:"Product & operations review every submission"})]}),jsxRuntime.jsxs(DialogHeader,{className:"space-y-3 text-left text-white",children:[jsxRuntime.jsx(DialogTitle,{className:"text-3xl leading-tight sm:text-4xl",children:"Share your perspective"}),jsxRuntime.jsx(DialogDescription,{className:"text-base text-white/80",children:"Clear context helps us triage, scope, and respond. Please highlight the scenario, desired outcome, and any urgency we should be aware of."})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-3",children:[jsxRuntime.jsxs("div",{className:"space-y-2 rounded-2xl border bg-muted/60 p-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 text-xs text-muted-foreground",children:[jsxRuntime.jsx("p",{className:"font-semibold uppercase tracking-wide text-foreground",children:"Select an intent"}),jsxRuntime.jsx("p",{children:I?`Currently tagged as ${se}.`:"Choosing a category routes the note to the right team."})]}),jsxRuntime.jsx("div",{className:"flex flex-wrap gap-2",children:FEEDBACK_INTENT_OPTIONS.map(Ae=>jsxRuntime.jsx(Button$1,{type:"button",variant:I===Ae.value?"default":"outline",size:"sm",className:cn("rounded-full px-3 text-xs transition-all",I===Ae.value?"shadow-lg shadow-primary/30":"bg-background hover:-translate-y-[1px]"),"aria-pressed":I===Ae.value,onClick:()=>j(je=>je===Ae.value?null:Ae.value),children:Ae.label},Ae.value))}),I&&jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:($e=FEEDBACK_INTENT_OPTIONS.find(Ae=>Ae.value===I))==null?void 0:$e.description})]}),jsxRuntime.jsxs("div",{className:"space-y-2",children:[jsxRuntime.jsx(Label$2,{htmlFor:"topbar-feedback-message",className:"text-sm font-semibold",children:"What should we know?"}),jsxRuntime.jsx(Textarea,{id:"topbar-feedback-message",rows:4,value:S,onChange:Ae=>R(Ae.target.value),maxLength:FEEDBACK_MAX_LENGTH,placeholder:"Describe the situation, expected outcome, and any supporting context.",className:"resize-none rounded-2xl border-2 border-dashed border-muted/80 bg-gradient-to-br from-muted/40 to-background focus-visible:border-primary focus-visible:ring-primary/40"}),jsxRuntime.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[jsxRuntime.jsx("span",{children:ae?`${ae}/${FEEDBACK_MAX_LENGTH} characters`:"Up to 800 characters is plenty."}),jsxRuntime.jsx("span",{children:I?`Intent: ${se}`:"Include context, impact, and urgency if applicable."})]})]})]}),jsxRuntime.jsxs("div",{className:"space-y-3 rounded-2xl border bg-background p-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs(Label$2,{htmlFor:"topbar-feedback-email",className:"flex items-center gap-2 text-sm font-semibold",children:[jsxRuntime.jsx(Mail,{className:"h-4 w-4"}),"Request a follow-up"]}),jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Include an email if you'd like us to provide updates or clarify details."})]}),jsxRuntime.jsx(Switch,{id:"feedback-follow-up",checked:A,onCheckedChange:Ae=>M(!!Ae),"aria-label":"Toggle follow-up preference"})]}),A&&jsxRuntime.jsx(Input,{id:"topbar-feedback-email",type:"email",value:C,onChange:Ae=>E(Ae.target.value),placeholder:"you@example.com"}),jsxRuntime.jsxs("div",{className:"rounded-xl bg-muted px-3 py-2 text-[11px] text-muted-foreground",children:["We use this email solely for this conversation. The page URL you were on (",q,") is attached automatically for added context."]})]}),jsxRuntime.jsx(Separator$1,{}),jsxRuntime.jsxs(DialogFooter,{className:"gap-3",children:[jsxRuntime.jsx(Button$1,{type:"button",variant:"outline",onClick:()=>_(!1),disabled:ne,children:"Cancel"}),jsxRuntime.jsx(Button$1,{type:"submit",disabled:ne,children:ne?"Sending...":"Send Feedback"})]})]})})]}),o,t&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Button$1,{variant:"ghost",size:"icon",className:"h-9 w-9",onClick:t,children:[jsxRuntime.jsx(LogOut,{className:"h-4 w-4 text-sidebar-foreground"}),jsxRuntime.jsx("span",{className:"sr-only",children:"Sign out"})]})})]})]})});Topbar.displayName="Topbar";function ActiveOrdersCard({orders:e,loading:t=!1}){const n=React.useMemo(()=>{if(!e||e.length===0)return{all:{orders:0,amount:0},processing:{orders:0,amount:0},shipped:{orders:0,amount:0},delayed:{orders:0,amount:0}};const l=e.filter(I=>I.DocumentType==="Order"),d=e.filter(I=>I.DocumentType==="Shipment"),f=l.filter(I=>I.WarehouseCode!=="3PLE"),g=f.reduce((I,j)=>I+(j.Quantity||0),0),b=f.reduce((I,j)=>I+(j.ExtendedPrice||0),0),_=l.filter(I=>I.WarehouseCode==="3PLE"),S=_.reduce((I,j)=>I+(j.Quantity||0),0),R=_.reduce((I,j)=>I+(j.ExtendedPrice||0),0),C=d.length,E=d.reduce((I,j)=>I+(j.ExtendedPrice||0),0),A=g+S+C,M=b+R+E;return{all:{orders:A,amount:M},processing:{orders:g,amount:b},shipped:{orders:C,amount:E},delayed:{orders:S,amount:R}}},[e]),o=[{name:"All",icon:Package,color:"bg-blue-500",textColor:"text-blue-600",orders:n.all.orders,amount:n.all.amount},{name:"Processing",icon:RefreshCcw,color:"bg-yellow-500",textColor:"text-yellow-600",orders:n.processing.orders,amount:n.processing.amount},{name:"Shipped",icon:Truck,color:"bg-green-500",textColor:"text-green-600",orders:n.shipped.orders,amount:n.shipped.amount},{name:"Delayed",icon:CircleAlert,color:"bg-red-500",textColor:"text-red-600",orders:n.delayed.orders,amount:n.delayed.amount}];return t?jsxRuntime.jsxs(Card,{className:"@container",children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:[1,2,3,4].map(l=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:"bg-slate-200 dark:bg-slate-700 h-[3px]"}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-8 w-8 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-7 w-12"})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx(Skeleton,{className:"h-3 w-16 mb-2"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]})]})]},l))})]}):jsxRuntime.jsxs(Card,{className:"@container",children:[jsxRuntime.jsx(CardHeader,{className:"pb-0",children:jsxRuntime.jsx(CardTitle,{className:"text-lg font-bold",children:"Active Orders"})}),jsxRuntime.jsx("div",{className:"grid grid-cols-1 @sm:grid-cols-2 gap-4 p-4",children:o.map(l=>jsxRuntime.jsxs("div",{className:"overflow-hidden rounded-md border",children:[jsxRuntime.jsx("div",{className:`${l.color} bg-opacity-60 h-[3px]`}),jsxRuntime.jsxs("div",{className:"p-6 border border-t-0",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-center mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-base",children:l.name}),jsxRuntime.jsx("div",{className:`${l.color} bg-opacity-90 p-2 rounded-full`,children:jsxRuntime.jsx(l.icon,{className:"size-4 shrink-0 text-white"})})]}),jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Orders"}),jsxRuntime.jsx("p",{className:"text-xl font-bold",children:l.orders})]}),jsxRuntime.jsxs("div",{className:"text-end",children:[jsxRuntime.jsx("p",{className:"text-xs text-muted-foreground",children:"Total Amount"}),jsxRuntime.jsx("p",{className:"text-base font-semibold",children:formatMoney(l.amount)})]})]})]})]},l.name))})]})}var __create=Object.create,__getProtoOf=Object.getPrototypeOf,__defProp=Object.defineProperty,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__toESM=(e,t,n)=>{n=e!=null?__create(__getProtoOf(e)):{};const o=__defProp(n,"default",{value:e,enumerable:!0});for(let l of __getOwnPropNames(e))__hasOwnProp.call(o,l)||__defProp(o,l,{get:()=>e[l],enumerable:!0});return o},__commonJS=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),require_xhtml=__commonJS((e,t)=>{t.exports={quot:'"',amp:"&",apos:"'",lt:"<",gt:">",nbsp:" ",iexcl:"¡",cent:"¢",pound:"£",curren:"¤",yen:"¥",brvbar:"¦",sect:"§",uml:"¨",copy:"©",ordf:"ª",laquo:"«",not:"¬",shy:"",reg:"®",macr:"¯",deg:"°",plusmn:"±",sup2:"²",sup3:"³",acute:"´",micro:"µ",para:"¶",middot:"·",cedil:"¸",sup1:"¹",ordm:"º",raquo:"»",frac14:"¼",frac12:"½",frac34:"¾",iquest:"¿",Agrave:"À",Aacute:"Á",Acirc:"Â",Atilde:"Ã",Auml:"Ä",Aring:"Å",AElig:"Æ",Ccedil:"Ç",Egrave:"È",Eacute:"É",Ecirc:"Ê",Euml:"Ë",Igrave:"Ì",Iacute:"Í",Icirc:"Î",Iuml:"Ï",ETH:"Ð",Ntilde:"Ñ",Ograve:"Ò",Oacute:"Ó",Ocirc:"Ô",Otilde:"Õ",Ouml:"Ö",times:"×",Oslash:"Ø",Ugrave:"Ù",Uacute:"Ú",Ucirc:"Û",Uuml:"Ü",Yacute:"Ý",THORN:"Þ",szlig:"ß",agrave:"à",aacute:"á",acirc:"â",atilde:"ã",auml:"ä",aring:"å",aelig:"æ",ccedil:"ç",egrave:"è",eacute:"é",ecirc:"ê",euml:"ë",igrave:"ì",iacute:"í",icirc:"î",iuml:"ï",eth:"ð",ntilde:"ñ",ograve:"ò",oacute:"ó",ocirc:"ô",otilde:"õ",ouml:"ö",divide:"÷",oslash:"ø",ugrave:"ù",uacute:"ú",ucirc:"û",uuml:"ü",yacute:"ý",thorn:"þ",yuml:"ÿ",OElig:"Œ",oelig:"œ",Scaron:"Š",scaron:"š",Yuml:"Ÿ",fnof:"ƒ",circ:"ˆ",tilde:"˜",Alpha:"Α",Beta:"Β",Gamma:"Γ",Delta:"Δ",Epsilon:"Ε",Zeta:"Ζ",Eta:"Η",Theta:"Θ",Iota:"Ι",Kappa:"Κ",Lambda:"Λ",Mu:"Μ",Nu:"Ν",Xi:"Ξ",Omicron:"Ο",Pi:"Π",Rho:"Ρ",Sigma:"Σ",Tau:"Τ",Upsilon:"Υ",Phi:"Φ",Chi:"Χ",Psi:"Ψ",Omega:"Ω",alpha:"α",beta:"β",gamma:"γ",delta:"δ",epsilon:"ε",zeta:"ζ",eta:"η",theta:"θ",iota:"ι",kappa:"κ",lambda:"λ",mu:"μ",nu:"ν",xi:"ξ",omicron:"ο",pi:"π",rho:"ρ",sigmaf:"ς",sigma:"σ",tau:"τ",upsilon:"υ",phi:"φ",chi:"χ",psi:"ψ",omega:"ω",thetasym:"ϑ",upsih:"ϒ",piv:"ϖ",ensp:" ",emsp:" ",thinsp:" ",zwnj:"",zwj:"",lrm:"",rlm:"",ndash:"–",mdash:"—",lsquo:"‘",rsquo:"’",sbquo:"‚",ldquo:"“",rdquo:"”",bdquo:"„",dagger:"†",Dagger:"‡",bull:"•",hellip:"…",permil:"‰",prime:"′",Prime:"″",lsaquo:"‹",rsaquo:"›",oline:"‾",frasl:"⁄",euro:"€",image:"ℑ",weierp:"℘",real:"ℜ",trade:"™",alefsym:"ℵ",larr:"←",uarr:"↑",rarr:"→",darr:"↓",harr:"↔",crarr:"↵",lArr:"⇐",uArr:"⇑",rArr:"⇒",dArr:"⇓",hArr:"⇔",forall:"∀",part:"∂",exist:"∃",empty:"∅",nabla:"∇",isin:"∈",notin:"∉",ni:"∋",prod:"∏",sum:"∑",minus:"−",lowast:"∗",radic:"√",prop:"∝",infin:"∞",ang:"∠",and:"∧",or:"∨",cap:"∩",cup:"∪",int:"∫",there4:"∴",sim:"∼",cong:"≅",asymp:"≈",ne:"≠",equiv:"≡",le:"≤",ge:"≥",sub:"⊂",sup:"⊃",nsub:"⊄",sube:"⊆",supe:"⊇",oplus:"⊕",otimes:"⊗",perp:"⊥",sdot:"⋅",lceil:"⌈",rceil:"⌉",lfloor:"⌊",rfloor:"⌋",lang:"〈",rang:"〉",loz:"◊",spades:"♠",clubs:"♣",hearts:"♥",diams:"♦"}}),require_acorn=__commonJS((e,t)=>{(function(n,o){typeof e=="object"&&typeof t<"u"?o(e):typeof define=="function"&&define.amd?define(["exports"],o):(n=typeof globalThis<"u"?globalThis:n||self,o(n.acorn={}))})(e,function(n){var o=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],l=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],d="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",f="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",g={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},b="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",_={5:b,"5module":b+" export import",6:b+" const class extends export import super"},S=/^in(stanceof)?$/,R=new RegExp("["+f+"]"),C=new RegExp("["+f+d+"]");function E(z,ge){for(var Fe=65536,Ue=0;Ue<ge.length;Ue+=2){if(Fe+=ge[Ue],Fe>z)return!1;if(Fe+=ge[Ue+1],Fe>=z)return!0}return!1}function A(z,ge){return z<65?z===36:z<91?!0:z<97?z===95:z<123?!0:z<=65535?z>=170&&R.test(String.fromCharCode(z)):ge===!1?!1:E(z,l)}function M(z,ge){return z<48?z===36:z<58?!0:z<65?!1:z<91?!0:z<97?z===95:z<123?!0:z<=65535?z>=170&&C.test(String.fromCharCode(z)):ge===!1?!1:E(z,l)||E(z,o)}var I=function(ge,Fe){Fe===void 0&&(Fe={}),this.label=ge,this.keyword=Fe.keyword,this.beforeExpr=!!Fe.beforeExpr,this.startsExpr=!!Fe.startsExpr,this.isLoop=!!Fe.isLoop,this.isAssign=!!Fe.isAssign,this.prefix=!!Fe.prefix,this.postfix=!!Fe.postfix,this.binop=Fe.binop||null,this.updateContext=null};function j(z,ge){return new I(z,{beforeExpr:!0,binop:ge})}var q={beforeExpr:!0},Q={startsExpr:!0},te={};function F(z,ge){return ge===void 0&&(ge={}),ge.keyword=z,te[z]=new I(z,ge)}var V={num:new I("num",Q),regexp:new I("regexp",Q),string:new I("string",Q),name:new I("name",Q),privateId:new I("privateId",Q),eof:new I("eof"),bracketL:new I("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new I("]"),braceL:new I("{",{beforeExpr:!0,startsExpr:!0}),braceR:new I("}"),parenL:new I("(",{beforeExpr:!0,startsExpr:!0}),parenR:new I(")"),comma:new I(",",q),semi:new I(";",q),colon:new I(":",q),dot:new I("."),question:new I("?",q),questionDot:new I("?."),arrow:new I("=>",q),template:new I("template"),invalidTemplate:new I("invalidTemplate"),ellipsis:new I("...",q),backQuote:new I("`",Q),dollarBraceL:new I("${",{beforeExpr:!0,startsExpr:!0}),eq:new I("=",{beforeExpr:!0,isAssign:!0}),assign:new I("_=",{beforeExpr:!0,isAssign:!0}),incDec:new I("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new I("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:j("||",1),logicalAND:j("&&",2),bitwiseOR:j("|",3),bitwiseXOR:j("^",4),bitwiseAND:j("&",5),equality:j("==/!=/===/!==",6),relational:j("</>/<=/>=",7),bitShift:j("<</>>/>>>",8),plusMin:new I("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:j("%",10),star:j("*",10),slash:j("/",10),starstar:new I("**",{beforeExpr:!0}),coalesce:j("??",1),_break:F("break"),_case:F("case",q),_catch:F("catch"),_continue:F("continue"),_debugger:F("debugger"),_default:F("default",q),_do:F("do",{isLoop:!0,beforeExpr:!0}),_else:F("else",q),_finally:F("finally"),_for:F("for",{isLoop:!0}),_function:F("function",Q),_if:F("if"),_return:F("return",q),_switch:F("switch"),_throw:F("throw",q),_try:F("try"),_var:F("var"),_const:F("const"),_while:F("while",{isLoop:!0}),_with:F("with"),_new:F("new",{beforeExpr:!0,startsExpr:!0}),_this:F("this",Q),_super:F("super",Q),_class:F("class",Q),_extends:F("extends",q),_export:F("export"),_import:F("import",Q),_null:F("null",Q),_true:F("true",Q),_false:F("false",Q),_in:F("in",{beforeExpr:!0,binop:7}),_instanceof:F("instanceof",{beforeExpr:!0,binop:7}),_typeof:F("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:F("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:F("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},ne=/\r\n?|\n|\u2028|\u2029/,ae=new RegExp(ne.source,"g");function se(z){return z===10||z===13||z===8232||z===8233}function Oe(z,ge,Fe){Fe===void 0&&(Fe=z.length);for(var Ue=ge;Ue<Fe;Ue++){var Qe=z.charCodeAt(Ue);if(se(Qe))return Ue<Fe-1&&Qe===13&&z.charCodeAt(Ue+1)===10?Ue+2:Ue+1}return-1}var Ne=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,oe=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,$e=Object.prototype,Ae=$e.hasOwnProperty,je=$e.toString,Be=Object.hasOwn||function(z,ge){return Ae.call(z,ge)},qe=Array.isArray||function(z){return je.call(z)==="[object Array]"},Ve=Object.create(null);function Le(z){return Ve[z]||(Ve[z]=new RegExp("^(?:"+z.replace(/ /g,"|")+")$"))}function He(z){return z<=65535?String.fromCharCode(z):(z-=65536,String.fromCharCode((z>>10)+55296,(z&1023)+56320))}var We=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,ze=function(ge,Fe){this.line=ge,this.column=Fe};ze.prototype.offset=function(ge){return new ze(this.line,this.column+ge)};var Xe=function(ge,Fe,Ue){this.start=Fe,this.end=Ue,ge.sourceFile!==null&&(this.source=ge.sourceFile)};function nt(z,ge){for(var Fe=1,Ue=0;;){var Qe=Oe(z,Ue,ge);if(Qe<0)return new ze(Fe,ge-Ue);++Fe,Ue=Qe}}var Je={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},st=!1;function et(z){var ge={};for(var Fe in Je)ge[Fe]=z&&Be(z,Fe)?z[Fe]:Je[Fe];if(ge.ecmaVersion==="latest"?ge.ecmaVersion=1e8:ge.ecmaVersion==null?(!st&&typeof console=="object"&&console.warn&&(st=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
1223
1223
|
Defaulting to 2020, but this will stop working in the future.`)),ge.ecmaVersion=11):ge.ecmaVersion>=2015&&(ge.ecmaVersion-=2009),ge.allowReserved==null&&(ge.allowReserved=ge.ecmaVersion<5),(!z||z.allowHashBang==null)&&(ge.allowHashBang=ge.ecmaVersion>=14),qe(ge.onToken)){var Ue=ge.onToken;ge.onToken=function(Qe){return Ue.push(Qe)}}return qe(ge.onComment)&&(ge.onComment=at(ge,ge.onComment)),ge}function at(z,ge){return function(Fe,Ue,Qe,ut,pt,Vt){var Ft={type:Fe?"Block":"Line",value:Ue,start:Qe,end:ut};z.locations&&(Ft.loc=new Xe(this,pt,Vt)),z.ranges&&(Ft.range=[Qe,ut]),ge.push(Ft)}}var tt=1,ot=2,lt=4,Ge=8,$t=16,rt=32,Rt=64,dt=128,It=256,Mt=tt|ot|It;function Ct(z,ge){return ot|(z?lt:0)|(ge?Ge:0)}var Ke=0,Ye=1,Ze=2,ct=3,mt=4,ft=5,yt=function(ge,Fe,Ue){this.options=ge=et(ge),this.sourceFile=ge.sourceFile,this.keywords=Le(_[ge.ecmaVersion>=6?6:ge.sourceType==="module"?"5module":5]);var Qe="";ge.allowReserved!==!0&&(Qe=g[ge.ecmaVersion>=6?6:ge.ecmaVersion===5?5:3],ge.sourceType==="module"&&(Qe+=" await")),this.reservedWords=Le(Qe);var ut=(Qe?Qe+" ":"")+g.strict;this.reservedWordsStrict=Le(ut),this.reservedWordsStrictBind=Le(ut+" "+g.strictBind),this.input=String(Fe),this.containsEsc=!1,Ue?(this.pos=Ue,this.lineStart=this.input.lastIndexOf(`
|
|
1224
|
-
`,Ue-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ne).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=V.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=ge.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&ge.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(tt),this.regexpState=null,this.privateNameStack=[]},Ht={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};yt.prototype.parse=function(){var ge=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(ge)},Ht.inFunction.get=function(){return(this.currentVarScope().flags&ot)>0},Ht.inGenerator.get=function(){return(this.currentVarScope().flags&Ge)>0&&!this.currentVarScope().inClassFieldInit},Ht.inAsync.get=function(){return(this.currentVarScope().flags<)>0&&!this.currentVarScope().inClassFieldInit},Ht.canAwait.get=function(){for(var z=this.scopeStack.length-1;z>=0;z--){var ge=this.scopeStack[z];if(ge.inClassFieldInit||ge.flags&It)return!1;if(ge.flags&ot)return(ge.flags<)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ht.allowSuper.get=function(){var z=this.currentThisScope(),ge=z.flags,Fe=z.inClassFieldInit;return(ge&Rt)>0||Fe||this.options.allowSuperOutsideMethod},Ht.allowDirectSuper.get=function(){return(this.currentThisScope().flags&dt)>0},Ht.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ht.allowNewDotTarget.get=function(){var z=this.currentThisScope(),ge=z.flags,Fe=z.inClassFieldInit;return(ge&(ot|It))>0||Fe},Ht.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&It)>0},yt.extend=function(){for(var ge=[],Fe=arguments.length;Fe--;)ge[Fe]=arguments[Fe];for(var Ue=this,Qe=0;Qe<ge.length;Qe++)Ue=ge[Qe](Ue);return Ue},yt.parse=function(ge,Fe){return new this(Fe,ge).parse()},yt.parseExpressionAt=function(ge,Fe,Ue){var Qe=new this(Ue,ge,Fe);return Qe.nextToken(),Qe.parseExpression()},yt.tokenizer=function(ge,Fe){return new this(Fe,ge)},Object.defineProperties(yt.prototype,Ht);var Kt=yt.prototype,un=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Kt.strictDirective=function(z){if(this.options.ecmaVersion<5)return!1;for(;;){oe.lastIndex=z,z+=oe.exec(this.input)[0].length;var ge=un.exec(this.input.slice(z));if(!ge)return!1;if((ge[1]||ge[2])==="use strict"){oe.lastIndex=z+ge[0].length;var Fe=oe.exec(this.input),Ue=Fe.index+Fe[0].length,Qe=this.input.charAt(Ue);return Qe===";"||Qe==="}"||ne.test(Fe[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Qe)||Qe==="!"&&this.input.charAt(Ue+1)==="=")}z+=ge[0].length,oe.lastIndex=z,z+=oe.exec(this.input)[0].length,this.input[z]===";"&&z++}},Kt.eat=function(z){return this.type===z?(this.next(),!0):!1},Kt.isContextual=function(z){return this.type===V.name&&this.value===z&&!this.containsEsc},Kt.eatContextual=function(z){return this.isContextual(z)?(this.next(),!0):!1},Kt.expectContextual=function(z){this.eatContextual(z)||this.unexpected()},Kt.canInsertSemicolon=function(){return this.type===V.eof||this.type===V.braceR||ne.test(this.input.slice(this.lastTokEnd,this.start))},Kt.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Kt.semicolon=function(){!this.eat(V.semi)&&!this.insertSemicolon()&&this.unexpected()},Kt.afterTrailingComma=function(z,ge){if(this.type===z)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),ge||this.next(),!0},Kt.expect=function(z){this.eat(z)||this.unexpected()},Kt.unexpected=function(z){this.raise(z??this.start,"Unexpected token")};var hn=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Kt.checkPatternErrors=function(z,ge){if(z){z.trailingComma>-1&&this.raiseRecoverable(z.trailingComma,"Comma is not permitted after the rest element");var Fe=ge?z.parenthesizedAssign:z.parenthesizedBind;Fe>-1&&this.raiseRecoverable(Fe,ge?"Assigning to rvalue":"Parenthesized pattern")}},Kt.checkExpressionErrors=function(z,ge){if(!z)return!1;var Fe=z.shorthandAssign,Ue=z.doubleProto;if(!ge)return Fe>=0||Ue>=0;Fe>=0&&this.raise(Fe,"Shorthand property assignments are valid only in destructuring patterns"),Ue>=0&&this.raiseRecoverable(Ue,"Redefinition of __proto__ property")},Kt.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Kt.isSimpleAssignTarget=function(z){return z.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(z.expression):z.type==="Identifier"||z.type==="MemberExpression"};var qt=yt.prototype;qt.parseTopLevel=function(z){var ge=Object.create(null);for(z.body||(z.body=[]);this.type!==V.eof;){var Fe=this.parseStatement(null,!0,ge);z.body.push(Fe)}if(this.inModule)for(var Ue=0,Qe=Object.keys(this.undefinedExports);Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.raiseRecoverable(this.undefinedExports[ut].start,"Export '"+ut+"' is not defined")}return this.adaptDirectivePrologue(z.body),this.next(),z.sourceType=this.options.sourceType,this.finishNode(z,"Program")};var An={kind:"loop"},xn={kind:"switch"};qt.isLet=function(z){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;oe.lastIndex=this.pos;var ge=oe.exec(this.input),Fe=this.pos+ge[0].length,Ue=this.input.charCodeAt(Fe);if(Ue===91||Ue===92)return!0;if(z)return!1;if(Ue===123||Ue>55295&&Ue<56320)return!0;if(A(Ue,!0)){for(var Qe=Fe+1;M(Ue=this.input.charCodeAt(Qe),!0);)++Qe;if(Ue===92||Ue>55295&&Ue<56320)return!0;var ut=this.input.slice(Fe,Qe);if(!S.test(ut))return!0}return!1},qt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;oe.lastIndex=this.pos;var z=oe.exec(this.input),ge=this.pos+z[0].length,Fe;return!ne.test(this.input.slice(this.pos,ge))&&this.input.slice(ge,ge+8)==="function"&&(ge+8===this.input.length||!(M(Fe=this.input.charCodeAt(ge+8))||Fe>55295&&Fe<56320))},qt.parseStatement=function(z,ge,Fe){var Ue=this.type,Qe=this.startNode(),ut;switch(this.isLet(z)&&(Ue=V._var,ut="let"),Ue){case V._break:case V._continue:return this.parseBreakContinueStatement(Qe,Ue.keyword);case V._debugger:return this.parseDebuggerStatement(Qe);case V._do:return this.parseDoStatement(Qe);case V._for:return this.parseForStatement(Qe);case V._function:return z&&(this.strict||z!=="if"&&z!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(Qe,!1,!z);case V._class:return z&&this.unexpected(),this.parseClass(Qe,!0);case V._if:return this.parseIfStatement(Qe);case V._return:return this.parseReturnStatement(Qe);case V._switch:return this.parseSwitchStatement(Qe);case V._throw:return this.parseThrowStatement(Qe);case V._try:return this.parseTryStatement(Qe);case V._const:case V._var:return ut=ut||this.value,z&&ut!=="var"&&this.unexpected(),this.parseVarStatement(Qe,ut);case V._while:return this.parseWhileStatement(Qe);case V._with:return this.parseWithStatement(Qe);case V.braceL:return this.parseBlock(!0,Qe);case V.semi:return this.parseEmptyStatement(Qe);case V._export:case V._import:if(this.options.ecmaVersion>10&&Ue===V._import){oe.lastIndex=this.pos;var pt=oe.exec(this.input),Vt=this.pos+pt[0].length,Ft=this.input.charCodeAt(Vt);if(Ft===40||Ft===46)return this.parseExpressionStatement(Qe,this.parseExpression())}return this.options.allowImportExportEverywhere||(ge||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),Ue===V._import?this.parseImport(Qe):this.parseExport(Qe,Fe);default:if(this.isAsyncFunction())return z&&this.unexpected(),this.next(),this.parseFunctionStatement(Qe,!0,!z);var nn=this.value,Qt=this.parseExpression();return Ue===V.name&&Qt.type==="Identifier"&&this.eat(V.colon)?this.parseLabeledStatement(Qe,nn,Qt,z):this.parseExpressionStatement(Qe,Qt)}},qt.parseBreakContinueStatement=function(z,ge){var Fe=ge==="break";this.next(),this.eat(V.semi)||this.insertSemicolon()?z.label=null:this.type!==V.name?this.unexpected():(z.label=this.parseIdent(),this.semicolon());for(var Ue=0;Ue<this.labels.length;++Ue){var Qe=this.labels[Ue];if((z.label==null||Qe.name===z.label.name)&&(Qe.kind!=null&&(Fe||Qe.kind==="loop")||z.label&&Fe))break}return Ue===this.labels.length&&this.raise(z.start,"Unsyntactic "+ge),this.finishNode(z,Fe?"BreakStatement":"ContinueStatement")},qt.parseDebuggerStatement=function(z){return this.next(),this.semicolon(),this.finishNode(z,"DebuggerStatement")},qt.parseDoStatement=function(z){return this.next(),this.labels.push(An),z.body=this.parseStatement("do"),this.labels.pop(),this.expect(V._while),z.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(V.semi):this.semicolon(),this.finishNode(z,"DoWhileStatement")},qt.parseForStatement=function(z){this.next();var ge=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(An),this.enterScope(0),this.expect(V.parenL),this.type===V.semi)return ge>-1&&this.unexpected(ge),this.parseFor(z,null);var Fe=this.isLet();if(this.type===V._var||this.type===V._const||Fe){var Ue=this.startNode(),Qe=Fe?"let":this.value;return this.next(),this.parseVar(Ue,!0,Qe),this.finishNode(Ue,"VariableDeclaration"),(this.type===V._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Ue.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===V._in?ge>-1&&this.unexpected(ge):z.await=ge>-1),this.parseForIn(z,Ue)):(ge>-1&&this.unexpected(ge),this.parseFor(z,Ue))}var ut=this.isContextual("let"),pt=!1,Vt=this.containsEsc,Ft=new hn,nn=this.start,Qt=ge>-1?this.parseExprSubscripts(Ft,"await"):this.parseExpression(!0,Ft);return this.type===V._in||(pt=this.options.ecmaVersion>=6&&this.isContextual("of"))?(ge>-1?(this.type===V._in&&this.unexpected(ge),z.await=!0):pt&&this.options.ecmaVersion>=8&&(Qt.start===nn&&!Vt&&Qt.type==="Identifier"&&Qt.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(z.await=!1)),ut&&pt&&this.raise(Qt.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Qt,!1,Ft),this.checkLValPattern(Qt),this.parseForIn(z,Qt)):(this.checkExpressionErrors(Ft,!0),ge>-1&&this.unexpected(ge),this.parseFor(z,Qt))},qt.parseFunctionStatement=function(z,ge,Fe){return this.next(),this.parseFunction(z,vn|(Fe?0:Pn),!1,ge)},qt.parseIfStatement=function(z){return this.next(),z.test=this.parseParenExpression(),z.consequent=this.parseStatement("if"),z.alternate=this.eat(V._else)?this.parseStatement("if"):null,this.finishNode(z,"IfStatement")},qt.parseReturnStatement=function(z){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(V.semi)||this.insertSemicolon()?z.argument=null:(z.argument=this.parseExpression(),this.semicolon()),this.finishNode(z,"ReturnStatement")},qt.parseSwitchStatement=function(z){this.next(),z.discriminant=this.parseParenExpression(),z.cases=[],this.expect(V.braceL),this.labels.push(xn),this.enterScope(0);for(var ge,Fe=!1;this.type!==V.braceR;)if(this.type===V._case||this.type===V._default){var Ue=this.type===V._case;ge&&this.finishNode(ge,"SwitchCase"),z.cases.push(ge=this.startNode()),ge.consequent=[],this.next(),Ue?ge.test=this.parseExpression():(Fe&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),Fe=!0,ge.test=null),this.expect(V.colon)}else ge||this.unexpected(),ge.consequent.push(this.parseStatement(null));return this.exitScope(),ge&&this.finishNode(ge,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(z,"SwitchStatement")},qt.parseThrowStatement=function(z){return this.next(),ne.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),z.argument=this.parseExpression(),this.semicolon(),this.finishNode(z,"ThrowStatement")};var Rn=[];qt.parseCatchClauseParam=function(){var z=this.parseBindingAtom(),ge=z.type==="Identifier";return this.enterScope(ge?rt:0),this.checkLValPattern(z,ge?mt:Ze),this.expect(V.parenR),z},qt.parseTryStatement=function(z){if(this.next(),z.block=this.parseBlock(),z.handler=null,this.type===V._catch){var ge=this.startNode();this.next(),this.eat(V.parenL)?ge.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),ge.param=null,this.enterScope(0)),ge.body=this.parseBlock(!1),this.exitScope(),z.handler=this.finishNode(ge,"CatchClause")}return z.finalizer=this.eat(V._finally)?this.parseBlock():null,!z.handler&&!z.finalizer&&this.raise(z.start,"Missing catch or finally clause"),this.finishNode(z,"TryStatement")},qt.parseVarStatement=function(z,ge,Fe){return this.next(),this.parseVar(z,!1,ge,Fe),this.semicolon(),this.finishNode(z,"VariableDeclaration")},qt.parseWhileStatement=function(z){return this.next(),z.test=this.parseParenExpression(),this.labels.push(An),z.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(z,"WhileStatement")},qt.parseWithStatement=function(z){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),z.object=this.parseParenExpression(),z.body=this.parseStatement("with"),this.finishNode(z,"WithStatement")},qt.parseEmptyStatement=function(z){return this.next(),this.finishNode(z,"EmptyStatement")},qt.parseLabeledStatement=function(z,ge,Fe,Ue){for(var Qe=0,ut=this.labels;Qe<ut.length;Qe+=1){var pt=ut[Qe];pt.name===ge&&this.raise(Fe.start,"Label '"+ge+"' is already declared")}for(var Vt=this.type.isLoop?"loop":this.type===V._switch?"switch":null,Ft=this.labels.length-1;Ft>=0;Ft--){var nn=this.labels[Ft];if(nn.statementStart===z.start)nn.statementStart=this.start,nn.kind=Vt;else break}return this.labels.push({name:ge,kind:Vt,statementStart:this.start}),z.body=this.parseStatement(Ue?Ue.indexOf("label")===-1?Ue+"label":Ue:"label"),this.labels.pop(),z.label=Fe,this.finishNode(z,"LabeledStatement")},qt.parseExpressionStatement=function(z,ge){return z.expression=ge,this.semicolon(),this.finishNode(z,"ExpressionStatement")},qt.parseBlock=function(z,ge,Fe){for(z===void 0&&(z=!0),ge===void 0&&(ge=this.startNode()),ge.body=[],this.expect(V.braceL),z&&this.enterScope(0);this.type!==V.braceR;){var Ue=this.parseStatement(null);ge.body.push(Ue)}return Fe&&(this.strict=!1),this.next(),z&&this.exitScope(),this.finishNode(ge,"BlockStatement")},qt.parseFor=function(z,ge){return z.init=ge,this.expect(V.semi),z.test=this.type===V.semi?null:this.parseExpression(),this.expect(V.semi),z.update=this.type===V.parenR?null:this.parseExpression(),this.expect(V.parenR),z.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(z,"ForStatement")},qt.parseForIn=function(z,ge){var Fe=this.type===V._in;return this.next(),ge.type==="VariableDeclaration"&&ge.declarations[0].init!=null&&(!Fe||this.options.ecmaVersion<8||this.strict||ge.kind!=="var"||ge.declarations[0].id.type!=="Identifier")&&this.raise(ge.start,(Fe?"for-in":"for-of")+" loop variable declaration may not have an initializer"),z.left=ge,z.right=Fe?this.parseExpression():this.parseMaybeAssign(),this.expect(V.parenR),z.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(z,Fe?"ForInStatement":"ForOfStatement")},qt.parseVar=function(z,ge,Fe,Ue){for(z.declarations=[],z.kind=Fe;;){var Qe=this.startNode();if(this.parseVarId(Qe,Fe),this.eat(V.eq)?Qe.init=this.parseMaybeAssign(ge):!Ue&&Fe==="const"&&!(this.type===V._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!Ue&&Qe.id.type!=="Identifier"&&!(ge&&(this.type===V._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):Qe.init=null,z.declarations.push(this.finishNode(Qe,"VariableDeclarator")),!this.eat(V.comma))break}return z},qt.parseVarId=function(z,ge){z.id=this.parseBindingAtom(),this.checkLValPattern(z.id,ge==="var"?Ye:Ze,!1)};var vn=1,Pn=2,Mn=4;qt.parseFunction=function(z,ge,Fe,Ue,Qe){this.initFunction(z),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Ue)&&(this.type===V.star&&ge&Pn&&this.unexpected(),z.generator=this.eat(V.star)),this.options.ecmaVersion>=8&&(z.async=!!Ue),ge&vn&&(z.id=ge&Mn&&this.type!==V.name?null:this.parseIdent(),z.id&&!(ge&Pn)&&this.checkLValSimple(z.id,this.strict||z.generator||z.async?this.treatFunctionsAsVar?Ye:Ze:ct));var ut=this.yieldPos,pt=this.awaitPos,Vt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ct(z.async,z.generator)),ge&vn||(z.id=this.type===V.name?this.parseIdent():null),this.parseFunctionParams(z),this.parseFunctionBody(z,Fe,!1,Qe),this.yieldPos=ut,this.awaitPos=pt,this.awaitIdentPos=Vt,this.finishNode(z,ge&vn?"FunctionDeclaration":"FunctionExpression")},qt.parseFunctionParams=function(z){this.expect(V.parenL),z.params=this.parseBindingList(V.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},qt.parseClass=function(z,ge){this.next();var Fe=this.strict;this.strict=!0,this.parseClassId(z,ge),this.parseClassSuper(z);var Ue=this.enterClassBody(),Qe=this.startNode(),ut=!1;for(Qe.body=[],this.expect(V.braceL);this.type!==V.braceR;){var pt=this.parseClassElement(z.superClass!==null);pt&&(Qe.body.push(pt),pt.type==="MethodDefinition"&&pt.kind==="constructor"?(ut&&this.raiseRecoverable(pt.start,"Duplicate constructor in the same class"),ut=!0):pt.key&&pt.key.type==="PrivateIdentifier"&&$n(Ue,pt)&&this.raiseRecoverable(pt.key.start,"Identifier '#"+pt.key.name+"' has already been declared"))}return this.strict=Fe,this.next(),z.body=this.finishNode(Qe,"ClassBody"),this.exitClassBody(),this.finishNode(z,ge?"ClassDeclaration":"ClassExpression")},qt.parseClassElement=function(z){if(this.eat(V.semi))return null;var ge=this.options.ecmaVersion,Fe=this.startNode(),Ue="",Qe=!1,ut=!1,pt="method",Vt=!1;if(this.eatContextual("static")){if(ge>=13&&this.eat(V.braceL))return this.parseClassStaticBlock(Fe),Fe;this.isClassElementNameStart()||this.type===V.star?Vt=!0:Ue="static"}if(Fe.static=Vt,!Ue&&ge>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===V.star)&&!this.canInsertSemicolon()?ut=!0:Ue="async"),!Ue&&(ge>=9||!ut)&&this.eat(V.star)&&(Qe=!0),!Ue&&!ut&&!Qe){var Ft=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?pt=Ft:Ue=Ft)}if(Ue?(Fe.computed=!1,Fe.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Fe.key.name=Ue,this.finishNode(Fe.key,"Identifier")):this.parseClassElementName(Fe),ge<13||this.type===V.parenL||pt!=="method"||Qe||ut){var nn=!Fe.static&&Vn(Fe,"constructor"),Qt=nn&&z;nn&&pt!=="method"&&this.raise(Fe.key.start,"Constructor can't have get/set modifier"),Fe.kind=nn?"constructor":pt,this.parseClassMethod(Fe,Qe,ut,Qt)}else this.parseClassField(Fe);return Fe},qt.isClassElementNameStart=function(){return this.type===V.name||this.type===V.privateId||this.type===V.num||this.type===V.string||this.type===V.bracketL||this.type.keyword},qt.parseClassElementName=function(z){this.type===V.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),z.computed=!1,z.key=this.parsePrivateIdent()):this.parsePropertyName(z)},qt.parseClassMethod=function(z,ge,Fe,Ue){var Qe=z.key;z.kind==="constructor"?(ge&&this.raise(Qe.start,"Constructor can't be a generator"),Fe&&this.raise(Qe.start,"Constructor can't be an async method")):z.static&&Vn(z,"prototype")&&this.raise(Qe.start,"Classes may not have a static property named prototype");var ut=z.value=this.parseMethod(ge,Fe,Ue);return z.kind==="get"&&ut.params.length!==0&&this.raiseRecoverable(ut.start,"getter should have no params"),z.kind==="set"&&ut.params.length!==1&&this.raiseRecoverable(ut.start,"setter should have exactly one param"),z.kind==="set"&&ut.params[0].type==="RestElement"&&this.raiseRecoverable(ut.params[0].start,"Setter cannot use rest params"),this.finishNode(z,"MethodDefinition")},qt.parseClassField=function(z){if(Vn(z,"constructor")?this.raise(z.key.start,"Classes can't have a field named 'constructor'"):z.static&&Vn(z,"prototype")&&this.raise(z.key.start,"Classes can't have a static field named 'prototype'"),this.eat(V.eq)){var ge=this.currentThisScope(),Fe=ge.inClassFieldInit;ge.inClassFieldInit=!0,z.value=this.parseMaybeAssign(),ge.inClassFieldInit=Fe}else z.value=null;return this.semicolon(),this.finishNode(z,"PropertyDefinition")},qt.parseClassStaticBlock=function(z){z.body=[];var ge=this.labels;for(this.labels=[],this.enterScope(It|Rt);this.type!==V.braceR;){var Fe=this.parseStatement(null);z.body.push(Fe)}return this.next(),this.exitScope(),this.labels=ge,this.finishNode(z,"StaticBlock")},qt.parseClassId=function(z,ge){this.type===V.name?(z.id=this.parseIdent(),ge&&this.checkLValSimple(z.id,Ze,!1)):(ge===!0&&this.unexpected(),z.id=null)},qt.parseClassSuper=function(z){z.superClass=this.eat(V._extends)?this.parseExprSubscripts(null,!1):null},qt.enterClassBody=function(){var z={declared:Object.create(null),used:[]};return this.privateNameStack.push(z),z.declared},qt.exitClassBody=function(){var z=this.privateNameStack.pop(),ge=z.declared,Fe=z.used;if(this.options.checkPrivateFields)for(var Ue=this.privateNameStack.length,Qe=Ue===0?null:this.privateNameStack[Ue-1],ut=0;ut<Fe.length;++ut){var pt=Fe[ut];Be(ge,pt.name)||(Qe?Qe.used.push(pt):this.raiseRecoverable(pt.start,"Private field '#"+pt.name+"' must be declared in an enclosing class"))}};function $n(z,ge){var Fe=ge.key.name,Ue=z[Fe],Qe="true";return ge.type==="MethodDefinition"&&(ge.kind==="get"||ge.kind==="set")&&(Qe=(ge.static?"s":"i")+ge.kind),Ue==="iget"&&Qe==="iset"||Ue==="iset"&&Qe==="iget"||Ue==="sget"&&Qe==="sset"||Ue==="sset"&&Qe==="sget"?(z[Fe]="true",!1):Ue?!0:(z[Fe]=Qe,!1)}function Vn(z,ge){var Fe=z.computed,Ue=z.key;return!Fe&&(Ue.type==="Identifier"&&Ue.name===ge||Ue.type==="Literal"&&Ue.value===ge)}qt.parseExportAllDeclaration=function(z,ge){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(z.exported=this.parseModuleExportName(),this.checkExport(ge,z.exported,this.lastTokStart)):z.exported=null),this.expectContextual("from"),this.type!==V.string&&this.unexpected(),z.source=this.parseExprAtom(),this.semicolon(),this.finishNode(z,"ExportAllDeclaration")},qt.parseExport=function(z,ge){if(this.next(),this.eat(V.star))return this.parseExportAllDeclaration(z,ge);if(this.eat(V._default))return this.checkExport(ge,"default",this.lastTokStart),z.declaration=this.parseExportDefaultDeclaration(),this.finishNode(z,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())z.declaration=this.parseExportDeclaration(z),z.declaration.type==="VariableDeclaration"?this.checkVariableExport(ge,z.declaration.declarations):this.checkExport(ge,z.declaration.id,z.declaration.id.start),z.specifiers=[],z.source=null;else{if(z.declaration=null,z.specifiers=this.parseExportSpecifiers(ge),this.eatContextual("from"))this.type!==V.string&&this.unexpected(),z.source=this.parseExprAtom();else{for(var Fe=0,Ue=z.specifiers;Fe<Ue.length;Fe+=1){var Qe=Ue[Fe];this.checkUnreserved(Qe.local),this.checkLocalExport(Qe.local),Qe.local.type==="Literal"&&this.raise(Qe.local.start,"A string literal cannot be used as an exported binding without `from`.")}z.source=null}this.semicolon()}return this.finishNode(z,"ExportNamedDeclaration")},qt.parseExportDeclaration=function(z){return this.parseStatement(null)},qt.parseExportDefaultDeclaration=function(){var z;if(this.type===V._function||(z=this.isAsyncFunction())){var ge=this.startNode();return this.next(),z&&this.next(),this.parseFunction(ge,vn|Mn,!1,z)}else if(this.type===V._class){var Fe=this.startNode();return this.parseClass(Fe,"nullableID")}else{var Ue=this.parseMaybeAssign();return this.semicolon(),Ue}},qt.checkExport=function(z,ge,Fe){z&&(typeof ge!="string"&&(ge=ge.type==="Identifier"?ge.name:ge.value),Be(z,ge)&&this.raiseRecoverable(Fe,"Duplicate export '"+ge+"'"),z[ge]=!0)},qt.checkPatternExport=function(z,ge){var Fe=ge.type;if(Fe==="Identifier")this.checkExport(z,ge,ge.start);else if(Fe==="ObjectPattern")for(var Ue=0,Qe=ge.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.checkPatternExport(z,ut)}else if(Fe==="ArrayPattern")for(var pt=0,Vt=ge.elements;pt<Vt.length;pt+=1){var Ft=Vt[pt];Ft&&this.checkPatternExport(z,Ft)}else Fe==="Property"?this.checkPatternExport(z,ge.value):Fe==="AssignmentPattern"?this.checkPatternExport(z,ge.left):Fe==="RestElement"&&this.checkPatternExport(z,ge.argument)},qt.checkVariableExport=function(z,ge){if(z)for(var Fe=0,Ue=ge;Fe<Ue.length;Fe+=1){var Qe=Ue[Fe];this.checkPatternExport(z,Qe.id)}},qt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},qt.parseExportSpecifier=function(z){var ge=this.startNode();return ge.local=this.parseModuleExportName(),ge.exported=this.eatContextual("as")?this.parseModuleExportName():ge.local,this.checkExport(z,ge.exported,ge.exported.start),this.finishNode(ge,"ExportSpecifier")},qt.parseExportSpecifiers=function(z){var ge=[],Fe=!0;for(this.expect(V.braceL);!this.eat(V.braceR);){if(Fe)Fe=!1;else if(this.expect(V.comma),this.afterTrailingComma(V.braceR))break;ge.push(this.parseExportSpecifier(z))}return ge},qt.parseImport=function(z){return this.next(),this.type===V.string?(z.specifiers=Rn,z.source=this.parseExprAtom()):(z.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),z.source=this.type===V.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(z,"ImportDeclaration")},qt.parseImportSpecifier=function(){var z=this.startNode();return z.imported=this.parseModuleExportName(),this.eatContextual("as")?z.local=this.parseIdent():(this.checkUnreserved(z.imported),z.local=z.imported),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportSpecifier")},qt.parseImportDefaultSpecifier=function(){var z=this.startNode();return z.local=this.parseIdent(),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportDefaultSpecifier")},qt.parseImportNamespaceSpecifier=function(){var z=this.startNode();return this.next(),this.expectContextual("as"),z.local=this.parseIdent(),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportNamespaceSpecifier")},qt.parseImportSpecifiers=function(){var z=[],ge=!0;if(this.type===V.name&&(z.push(this.parseImportDefaultSpecifier()),!this.eat(V.comma)))return z;if(this.type===V.star)return z.push(this.parseImportNamespaceSpecifier()),z;for(this.expect(V.braceL);!this.eat(V.braceR);){if(ge)ge=!1;else if(this.expect(V.comma),this.afterTrailingComma(V.braceR))break;z.push(this.parseImportSpecifier())}return z},qt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===V.string){var z=this.parseLiteral(this.value);return We.test(z.value)&&this.raise(z.start,"An export name cannot include a lone surrogate."),z}return this.parseIdent(!0)},qt.adaptDirectivePrologue=function(z){for(var ge=0;ge<z.length&&this.isDirectiveCandidate(z[ge]);++ge)z[ge].directive=z[ge].expression.raw.slice(1,-1)},qt.isDirectiveCandidate=function(z){return this.options.ecmaVersion>=5&&z.type==="ExpressionStatement"&&z.expression.type==="Literal"&&typeof z.expression.value=="string"&&(this.input[z.start]==='"'||this.input[z.start]==="'")};var Jt=yt.prototype;Jt.toAssignable=function(z,ge,Fe){if(this.options.ecmaVersion>=6&&z)switch(z.type){case"Identifier":this.inAsync&&z.name==="await"&&this.raise(z.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":z.type="ObjectPattern",Fe&&this.checkPatternErrors(Fe,!0);for(var Ue=0,Qe=z.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.toAssignable(ut,ge),ut.type==="RestElement"&&(ut.argument.type==="ArrayPattern"||ut.argument.type==="ObjectPattern")&&this.raise(ut.argument.start,"Unexpected token")}break;case"Property":z.kind!=="init"&&this.raise(z.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(z.value,ge);break;case"ArrayExpression":z.type="ArrayPattern",Fe&&this.checkPatternErrors(Fe,!0),this.toAssignableList(z.elements,ge);break;case"SpreadElement":z.type="RestElement",this.toAssignable(z.argument,ge),z.argument.type==="AssignmentPattern"&&this.raise(z.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":z.operator!=="="&&this.raise(z.left.end,"Only '=' operator can be used for specifying default value."),z.type="AssignmentPattern",delete z.operator,this.toAssignable(z.left,ge);break;case"ParenthesizedExpression":this.toAssignable(z.expression,ge,Fe);break;case"ChainExpression":this.raiseRecoverable(z.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!ge)break;default:this.raise(z.start,"Assigning to rvalue")}else Fe&&this.checkPatternErrors(Fe,!0);return z},Jt.toAssignableList=function(z,ge){for(var Fe=z.length,Ue=0;Ue<Fe;Ue++){var Qe=z[Ue];Qe&&this.toAssignable(Qe,ge)}if(Fe){var ut=z[Fe-1];this.options.ecmaVersion===6&&ge&&ut&&ut.type==="RestElement"&&ut.argument.type!=="Identifier"&&this.unexpected(ut.argument.start)}return z},Jt.parseSpread=function(z){var ge=this.startNode();return this.next(),ge.argument=this.parseMaybeAssign(!1,z),this.finishNode(ge,"SpreadElement")},Jt.parseRestBinding=function(){var z=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==V.name&&this.unexpected(),z.argument=this.parseBindingAtom(),this.finishNode(z,"RestElement")},Jt.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case V.bracketL:var z=this.startNode();return this.next(),z.elements=this.parseBindingList(V.bracketR,!0,!0),this.finishNode(z,"ArrayPattern");case V.braceL:return this.parseObj(!0)}return this.parseIdent()},Jt.parseBindingList=function(z,ge,Fe,Ue){for(var Qe=[],ut=!0;!this.eat(z);)if(ut?ut=!1:this.expect(V.comma),ge&&this.type===V.comma)Qe.push(null);else{if(Fe&&this.afterTrailingComma(z))break;if(this.type===V.ellipsis){var pt=this.parseRestBinding();this.parseBindingListItem(pt),Qe.push(pt),this.type===V.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(z);break}else Qe.push(this.parseAssignableListItem(Ue))}return Qe},Jt.parseAssignableListItem=function(z){var ge=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(ge),ge},Jt.parseBindingListItem=function(z){return z},Jt.parseMaybeDefault=function(z,ge,Fe){if(Fe=Fe||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(V.eq))return Fe;var Ue=this.startNodeAt(z,ge);return Ue.left=Fe,Ue.right=this.parseMaybeAssign(),this.finishNode(Ue,"AssignmentPattern")},Jt.checkLValSimple=function(z,ge,Fe){ge===void 0&&(ge=Ke);var Ue=ge!==Ke;switch(z.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(z.name)&&this.raiseRecoverable(z.start,(Ue?"Binding ":"Assigning to ")+z.name+" in strict mode"),Ue&&(ge===Ze&&z.name==="let"&&this.raiseRecoverable(z.start,"let is disallowed as a lexically bound name"),Fe&&(Be(Fe,z.name)&&this.raiseRecoverable(z.start,"Argument name clash"),Fe[z.name]=!0),ge!==ft&&this.declareName(z.name,ge,z.start));break;case"ChainExpression":this.raiseRecoverable(z.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":Ue&&this.raiseRecoverable(z.start,"Binding member expression");break;case"ParenthesizedExpression":return Ue&&this.raiseRecoverable(z.start,"Binding parenthesized expression"),this.checkLValSimple(z.expression,ge,Fe);default:this.raise(z.start,(Ue?"Binding":"Assigning to")+" rvalue")}},Jt.checkLValPattern=function(z,ge,Fe){switch(ge===void 0&&(ge=Ke),z.type){case"ObjectPattern":for(var Ue=0,Qe=z.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.checkLValInnerPattern(ut,ge,Fe)}break;case"ArrayPattern":for(var pt=0,Vt=z.elements;pt<Vt.length;pt+=1){var Ft=Vt[pt];Ft&&this.checkLValInnerPattern(Ft,ge,Fe)}break;default:this.checkLValSimple(z,ge,Fe)}},Jt.checkLValInnerPattern=function(z,ge,Fe){switch(ge===void 0&&(ge=Ke),z.type){case"Property":this.checkLValInnerPattern(z.value,ge,Fe);break;case"AssignmentPattern":this.checkLValPattern(z.left,ge,Fe);break;case"RestElement":this.checkLValPattern(z.argument,ge,Fe);break;default:this.checkLValPattern(z,ge,Fe)}};var Zt=function(ge,Fe,Ue,Qe,ut){this.token=ge,this.isExpr=!!Fe,this.preserveSpace=!!Ue,this.override=Qe,this.generator=!!ut},Ut={b_stat:new Zt("{",!1),b_expr:new Zt("{",!0),b_tmpl:new Zt("${",!1),p_stat:new Zt("(",!1),p_expr:new Zt("(",!0),q_tmpl:new Zt("`",!0,!0,function(z){return z.tryReadTemplateToken()}),f_stat:new Zt("function",!1),f_expr:new Zt("function",!0),f_expr_gen:new Zt("function",!0,!1,null,!0),f_gen:new Zt("function",!1,!1,null,!0)},tn=yt.prototype;tn.initialContext=function(){return[Ut.b_stat]},tn.curContext=function(){return this.context[this.context.length-1]},tn.braceIsBlock=function(z){var ge=this.curContext();return ge===Ut.f_expr||ge===Ut.f_stat?!0:z===V.colon&&(ge===Ut.b_stat||ge===Ut.b_expr)?!ge.isExpr:z===V._return||z===V.name&&this.exprAllowed?ne.test(this.input.slice(this.lastTokEnd,this.start)):z===V._else||z===V.semi||z===V.eof||z===V.parenR||z===V.arrow?!0:z===V.braceL?ge===Ut.b_stat:z===V._var||z===V._const||z===V.name?!1:!this.exprAllowed},tn.inGeneratorContext=function(){for(var z=this.context.length-1;z>=1;z--){var ge=this.context[z];if(ge.token==="function")return ge.generator}return!1},tn.updateContext=function(z){var ge,Fe=this.type;Fe.keyword&&z===V.dot?this.exprAllowed=!1:(ge=Fe.updateContext)?ge.call(this,z):this.exprAllowed=Fe.beforeExpr},tn.overrideContext=function(z){this.curContext()!==z&&(this.context[this.context.length-1]=z)},V.parenR.updateContext=V.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var z=this.context.pop();z===Ut.b_stat&&this.curContext().token==="function"&&(z=this.context.pop()),this.exprAllowed=!z.isExpr},V.braceL.updateContext=function(z){this.context.push(this.braceIsBlock(z)?Ut.b_stat:Ut.b_expr),this.exprAllowed=!0},V.dollarBraceL.updateContext=function(){this.context.push(Ut.b_tmpl),this.exprAllowed=!0},V.parenL.updateContext=function(z){var ge=z===V._if||z===V._for||z===V._with||z===V._while;this.context.push(ge?Ut.p_stat:Ut.p_expr),this.exprAllowed=!0},V.incDec.updateContext=function(){},V._function.updateContext=V._class.updateContext=function(z){z.beforeExpr&&z!==V._else&&!(z===V.semi&&this.curContext()!==Ut.p_stat)&&!(z===V._return&&ne.test(this.input.slice(this.lastTokEnd,this.start)))&&!((z===V.colon||z===V.braceL)&&this.curContext()===Ut.b_stat)?this.context.push(Ut.f_expr):this.context.push(Ut.f_stat),this.exprAllowed=!1},V.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},V.backQuote.updateContext=function(){this.curContext()===Ut.q_tmpl?this.context.pop():this.context.push(Ut.q_tmpl),this.exprAllowed=!1},V.star.updateContext=function(z){if(z===V._function){var ge=this.context.length-1;this.context[ge]===Ut.f_expr?this.context[ge]=Ut.f_expr_gen:this.context[ge]=Ut.f_gen}this.exprAllowed=!0},V.name.updateContext=function(z){var ge=!1;this.options.ecmaVersion>=6&&z!==V.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(ge=!0),this.exprAllowed=ge};var Yt=yt.prototype;Yt.checkPropClash=function(z,ge,Fe){if(!(this.options.ecmaVersion>=9&&z.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(z.computed||z.method||z.shorthand))){var Ue=z.key,Qe;switch(Ue.type){case"Identifier":Qe=Ue.name;break;case"Literal":Qe=String(Ue.value);break;default:return}var ut=z.kind;if(this.options.ecmaVersion>=6){Qe==="__proto__"&&ut==="init"&&(ge.proto&&(Fe?Fe.doubleProto<0&&(Fe.doubleProto=Ue.start):this.raiseRecoverable(Ue.start,"Redefinition of __proto__ property")),ge.proto=!0);return}Qe="$"+Qe;var pt=ge[Qe];if(pt){var Vt;ut==="init"?Vt=this.strict&&pt.init||pt.get||pt.set:Vt=pt.init||pt[ut],Vt&&this.raiseRecoverable(Ue.start,"Redefinition of property")}else pt=ge[Qe]={init:!1,get:!1,set:!1};pt[ut]=!0}},Yt.parseExpression=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseMaybeAssign(z,ge);if(this.type===V.comma){var ut=this.startNodeAt(Fe,Ue);for(ut.expressions=[Qe];this.eat(V.comma);)ut.expressions.push(this.parseMaybeAssign(z,ge));return this.finishNode(ut,"SequenceExpression")}return Qe},Yt.parseMaybeAssign=function(z,ge,Fe){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(z);this.exprAllowed=!1}var Ue=!1,Qe=-1,ut=-1,pt=-1;ge?(Qe=ge.parenthesizedAssign,ut=ge.trailingComma,pt=ge.doubleProto,ge.parenthesizedAssign=ge.trailingComma=-1):(ge=new hn,Ue=!0);var Vt=this.start,Ft=this.startLoc;(this.type===V.parenL||this.type===V.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=z==="await");var nn=this.parseMaybeConditional(z,ge);if(Fe&&(nn=Fe.call(this,nn,Vt,Ft)),this.type.isAssign){var Qt=this.startNodeAt(Vt,Ft);return Qt.operator=this.value,this.type===V.eq&&(nn=this.toAssignable(nn,!1,ge)),Ue||(ge.parenthesizedAssign=ge.trailingComma=ge.doubleProto=-1),ge.shorthandAssign>=nn.start&&(ge.shorthandAssign=-1),this.type===V.eq?this.checkLValPattern(nn):this.checkLValSimple(nn),Qt.left=nn,this.next(),Qt.right=this.parseMaybeAssign(z),pt>-1&&(ge.doubleProto=pt),this.finishNode(Qt,"AssignmentExpression")}else Ue&&this.checkExpressionErrors(ge,!0);return Qe>-1&&(ge.parenthesizedAssign=Qe),ut>-1&&(ge.trailingComma=ut),nn},Yt.parseMaybeConditional=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseExprOps(z,ge);if(this.checkExpressionErrors(ge))return Qe;if(this.eat(V.question)){var ut=this.startNodeAt(Fe,Ue);return ut.test=Qe,ut.consequent=this.parseMaybeAssign(),this.expect(V.colon),ut.alternate=this.parseMaybeAssign(z),this.finishNode(ut,"ConditionalExpression")}return Qe},Yt.parseExprOps=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseMaybeUnary(ge,!1,!1,z);return this.checkExpressionErrors(ge)||Qe.start===Fe&&Qe.type==="ArrowFunctionExpression"?Qe:this.parseExprOp(Qe,Fe,Ue,-1,z)},Yt.parseExprOp=function(z,ge,Fe,Ue,Qe){var ut=this.type.binop;if(ut!=null&&(!Qe||this.type!==V._in)&&ut>Ue){var pt=this.type===V.logicalOR||this.type===V.logicalAND,Vt=this.type===V.coalesce;Vt&&(ut=V.logicalAND.binop);var Ft=this.value;this.next();var nn=this.start,Qt=this.startLoc,_n=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Qe),nn,Qt,ut,Qe),Gn=this.buildBinary(ge,Fe,z,_n,Ft,pt||Vt);return(pt&&this.type===V.coalesce||Vt&&(this.type===V.logicalOR||this.type===V.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(Gn,ge,Fe,Ue,Qe)}return z},Yt.buildBinary=function(z,ge,Fe,Ue,Qe,ut){Ue.type==="PrivateIdentifier"&&this.raise(Ue.start,"Private identifier can only be left side of binary expression");var pt=this.startNodeAt(z,ge);return pt.left=Fe,pt.operator=Qe,pt.right=Ue,this.finishNode(pt,ut?"LogicalExpression":"BinaryExpression")},Yt.parseMaybeUnary=function(z,ge,Fe,Ue){var Qe=this.start,ut=this.startLoc,pt;if(this.isContextual("await")&&this.canAwait)pt=this.parseAwait(Ue),ge=!0;else if(this.type.prefix){var Vt=this.startNode(),Ft=this.type===V.incDec;Vt.operator=this.value,Vt.prefix=!0,this.next(),Vt.argument=this.parseMaybeUnary(null,!0,Ft,Ue),this.checkExpressionErrors(z,!0),Ft?this.checkLValSimple(Vt.argument):this.strict&&Vt.operator==="delete"&&an(Vt.argument)?this.raiseRecoverable(Vt.start,"Deleting local variable in strict mode"):Vt.operator==="delete"&&mn(Vt.argument)?this.raiseRecoverable(Vt.start,"Private fields can not be deleted"):ge=!0,pt=this.finishNode(Vt,Ft?"UpdateExpression":"UnaryExpression")}else if(!ge&&this.type===V.privateId)(Ue||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),pt=this.parsePrivateIdent(),this.type!==V._in&&this.unexpected();else{if(pt=this.parseExprSubscripts(z,Ue),this.checkExpressionErrors(z))return pt;for(;this.type.postfix&&!this.canInsertSemicolon();){var nn=this.startNodeAt(Qe,ut);nn.operator=this.value,nn.prefix=!1,nn.argument=pt,this.checkLValSimple(pt),this.next(),pt=this.finishNode(nn,"UpdateExpression")}}if(!Fe&&this.eat(V.starstar))if(ge)this.unexpected(this.lastTokStart);else return this.buildBinary(Qe,ut,pt,this.parseMaybeUnary(null,!1,!1,Ue),"**",!1);else return pt};function an(z){return z.type==="Identifier"||z.type==="ParenthesizedExpression"&&an(z.expression)}function mn(z){return z.type==="MemberExpression"&&z.property.type==="PrivateIdentifier"||z.type==="ChainExpression"&&mn(z.expression)||z.type==="ParenthesizedExpression"&&mn(z.expression)}Yt.parseExprSubscripts=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseExprAtom(z,ge);if(Qe.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Qe;var ut=this.parseSubscripts(Qe,Fe,Ue,!1,ge);return z&&ut.type==="MemberExpression"&&(z.parenthesizedAssign>=ut.start&&(z.parenthesizedAssign=-1),z.parenthesizedBind>=ut.start&&(z.parenthesizedBind=-1),z.trailingComma>=ut.start&&(z.trailingComma=-1)),ut},Yt.parseSubscripts=function(z,ge,Fe,Ue,Qe){for(var ut=this.options.ecmaVersion>=8&&z.type==="Identifier"&&z.name==="async"&&this.lastTokEnd===z.end&&!this.canInsertSemicolon()&&z.end-z.start===5&&this.potentialArrowAt===z.start,pt=!1;;){var Vt=this.parseSubscript(z,ge,Fe,Ue,ut,pt,Qe);if(Vt.optional&&(pt=!0),Vt===z||Vt.type==="ArrowFunctionExpression"){if(pt){var Ft=this.startNodeAt(ge,Fe);Ft.expression=Vt,Vt=this.finishNode(Ft,"ChainExpression")}return Vt}z=Vt}},Yt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(V.arrow)},Yt.parseSubscriptAsyncArrow=function(z,ge,Fe,Ue){return this.parseArrowExpression(this.startNodeAt(z,ge),Fe,!0,Ue)},Yt.parseSubscript=function(z,ge,Fe,Ue,Qe,ut,pt){var Vt=this.options.ecmaVersion>=11,Ft=Vt&&this.eat(V.questionDot);Ue&&Ft&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var nn=this.eat(V.bracketL);if(nn||Ft&&this.type!==V.parenL&&this.type!==V.backQuote||this.eat(V.dot)){var Qt=this.startNodeAt(ge,Fe);Qt.object=z,nn?(Qt.property=this.parseExpression(),this.expect(V.bracketR)):this.type===V.privateId&&z.type!=="Super"?Qt.property=this.parsePrivateIdent():Qt.property=this.parseIdent(this.options.allowReserved!=="never"),Qt.computed=!!nn,Vt&&(Qt.optional=Ft),z=this.finishNode(Qt,"MemberExpression")}else if(!Ue&&this.eat(V.parenL)){var _n=new hn,Gn=this.yieldPos,rr=this.awaitPos,Yn=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var gr=this.parseExprList(V.parenR,this.options.ecmaVersion>=8,!1,_n);if(Qe&&!Ft&&this.shouldParseAsyncArrow())return this.checkPatternErrors(_n,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=Gn,this.awaitPos=rr,this.awaitIdentPos=Yn,this.parseSubscriptAsyncArrow(ge,Fe,gr,pt);this.checkExpressionErrors(_n,!0),this.yieldPos=Gn||this.yieldPos,this.awaitPos=rr||this.awaitPos,this.awaitIdentPos=Yn||this.awaitIdentPos;var Jn=this.startNodeAt(ge,Fe);Jn.callee=z,Jn.arguments=gr,Vt&&(Jn.optional=Ft),z=this.finishNode(Jn,"CallExpression")}else if(this.type===V.backQuote){(Ft||ut)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Xn=this.startNodeAt(ge,Fe);Xn.tag=z,Xn.quasi=this.parseTemplate({isTagged:!0}),z=this.finishNode(Xn,"TaggedTemplateExpression")}return z},Yt.parseExprAtom=function(z,ge,Fe){this.type===V.slash&&this.readRegexp();var Ue,Qe=this.potentialArrowAt===this.start;switch(this.type){case V._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),Ue=this.startNode(),this.next(),this.type===V.parenL&&!this.allowDirectSuper&&this.raise(Ue.start,"super() call outside constructor of a subclass"),this.type!==V.dot&&this.type!==V.bracketL&&this.type!==V.parenL&&this.unexpected(),this.finishNode(Ue,"Super");case V._this:return Ue=this.startNode(),this.next(),this.finishNode(Ue,"ThisExpression");case V.name:var ut=this.start,pt=this.startLoc,Vt=this.containsEsc,Ft=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Vt&&Ft.name==="async"&&!this.canInsertSemicolon()&&this.eat(V._function))return this.overrideContext(Ut.f_expr),this.parseFunction(this.startNodeAt(ut,pt),0,!1,!0,ge);if(Qe&&!this.canInsertSemicolon()){if(this.eat(V.arrow))return this.parseArrowExpression(this.startNodeAt(ut,pt),[Ft],!1,ge);if(this.options.ecmaVersion>=8&&Ft.name==="async"&&this.type===V.name&&!Vt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return Ft=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(V.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(ut,pt),[Ft],!0,ge)}return Ft;case V.regexp:var nn=this.value;return Ue=this.parseLiteral(nn.value),Ue.regex={pattern:nn.pattern,flags:nn.flags},Ue;case V.num:case V.string:return this.parseLiteral(this.value);case V._null:case V._true:case V._false:return Ue=this.startNode(),Ue.value=this.type===V._null?null:this.type===V._true,Ue.raw=this.type.keyword,this.next(),this.finishNode(Ue,"Literal");case V.parenL:var Qt=this.start,_n=this.parseParenAndDistinguishExpression(Qe,ge);return z&&(z.parenthesizedAssign<0&&!this.isSimpleAssignTarget(_n)&&(z.parenthesizedAssign=Qt),z.parenthesizedBind<0&&(z.parenthesizedBind=Qt)),_n;case V.bracketL:return Ue=this.startNode(),this.next(),Ue.elements=this.parseExprList(V.bracketR,!0,!0,z),this.finishNode(Ue,"ArrayExpression");case V.braceL:return this.overrideContext(Ut.b_expr),this.parseObj(!1,z);case V._function:return Ue=this.startNode(),this.next(),this.parseFunction(Ue,0);case V._class:return this.parseClass(this.startNode(),!1);case V._new:return this.parseNew();case V.backQuote:return this.parseTemplate();case V._import:return this.options.ecmaVersion>=11?this.parseExprImport(Fe):this.unexpected();default:return this.parseExprAtomDefault()}},Yt.parseExprAtomDefault=function(){this.unexpected()},Yt.parseExprImport=function(z){var ge=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===V.parenL&&!z)return this.parseDynamicImport(ge);if(this.type===V.dot){var Fe=this.startNodeAt(ge.start,ge.loc&&ge.loc.start);return Fe.name="import",ge.meta=this.finishNode(Fe,"Identifier"),this.parseImportMeta(ge)}else this.unexpected()},Yt.parseDynamicImport=function(z){if(this.next(),z.source=this.parseMaybeAssign(),!this.eat(V.parenR)){var ge=this.start;this.eat(V.comma)&&this.eat(V.parenR)?this.raiseRecoverable(ge,"Trailing comma is not allowed in import()"):this.unexpected(ge)}return this.finishNode(z,"ImportExpression")},Yt.parseImportMeta=function(z){this.next();var ge=this.containsEsc;return z.property=this.parseIdent(!0),z.property.name!=="meta"&&this.raiseRecoverable(z.property.start,"The only valid meta property for import is 'import.meta'"),ge&&this.raiseRecoverable(z.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(z.start,"Cannot use 'import.meta' outside a module"),this.finishNode(z,"MetaProperty")},Yt.parseLiteral=function(z){var ge=this.startNode();return ge.value=z,ge.raw=this.input.slice(this.start,this.end),ge.raw.charCodeAt(ge.raw.length-1)===110&&(ge.bigint=ge.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(ge,"Literal")},Yt.parseParenExpression=function(){this.expect(V.parenL);var z=this.parseExpression();return this.expect(V.parenR),z},Yt.shouldParseArrow=function(z){return!this.canInsertSemicolon()},Yt.parseParenAndDistinguishExpression=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe,ut=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var pt=this.start,Vt=this.startLoc,Ft=[],nn=!0,Qt=!1,_n=new hn,Gn=this.yieldPos,rr=this.awaitPos,Yn;for(this.yieldPos=0,this.awaitPos=0;this.type!==V.parenR;)if(nn?nn=!1:this.expect(V.comma),ut&&this.afterTrailingComma(V.parenR,!0)){Qt=!0;break}else if(this.type===V.ellipsis){Yn=this.start,Ft.push(this.parseParenItem(this.parseRestBinding())),this.type===V.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Ft.push(this.parseMaybeAssign(!1,_n,this.parseParenItem));var gr=this.lastTokEnd,Jn=this.lastTokEndLoc;if(this.expect(V.parenR),z&&this.shouldParseArrow(Ft)&&this.eat(V.arrow))return this.checkPatternErrors(_n,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Gn,this.awaitPos=rr,this.parseParenArrowList(Fe,Ue,Ft,ge);(!Ft.length||Qt)&&this.unexpected(this.lastTokStart),Yn&&this.unexpected(Yn),this.checkExpressionErrors(_n,!0),this.yieldPos=Gn||this.yieldPos,this.awaitPos=rr||this.awaitPos,Ft.length>1?(Qe=this.startNodeAt(pt,Vt),Qe.expressions=Ft,this.finishNodeAt(Qe,"SequenceExpression",gr,Jn)):Qe=Ft[0]}else Qe=this.parseParenExpression();if(this.options.preserveParens){var Xn=this.startNodeAt(Fe,Ue);return Xn.expression=Qe,this.finishNode(Xn,"ParenthesizedExpression")}else return Qe},Yt.parseParenItem=function(z){return z},Yt.parseParenArrowList=function(z,ge,Fe,Ue){return this.parseArrowExpression(this.startNodeAt(z,ge),Fe,!1,Ue)};var On=[];Yt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var z=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===V.dot){var ge=this.startNodeAt(z.start,z.loc&&z.loc.start);ge.name="new",z.meta=this.finishNode(ge,"Identifier"),this.next();var Fe=this.containsEsc;return z.property=this.parseIdent(!0),z.property.name!=="target"&&this.raiseRecoverable(z.property.start,"The only valid meta property for new is 'new.target'"),Fe&&this.raiseRecoverable(z.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(z.start,"'new.target' can only be used in functions and class static block"),this.finishNode(z,"MetaProperty")}var Ue=this.start,Qe=this.startLoc;return z.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Ue,Qe,!0,!1),this.eat(V.parenL)?z.arguments=this.parseExprList(V.parenR,this.options.ecmaVersion>=8,!1):z.arguments=On,this.finishNode(z,"NewExpression")},Yt.parseTemplateElement=function(z){var ge=z.isTagged,Fe=this.startNode();return this.type===V.invalidTemplate?(ge||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),Fe.value={raw:this.value.replace(/\r\n?/g,`
|
|
1224
|
+
`,Ue-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(ne).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=V.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=!0,this.inModule=ge.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=!1,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&ge.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(tt),this.regexpState=null,this.privateNameStack=[]},Ht={inFunction:{configurable:!0},inGenerator:{configurable:!0},inAsync:{configurable:!0},canAwait:{configurable:!0},allowSuper:{configurable:!0},allowDirectSuper:{configurable:!0},treatFunctionsAsVar:{configurable:!0},allowNewDotTarget:{configurable:!0},inClassStaticBlock:{configurable:!0}};yt.prototype.parse=function(){var ge=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(ge)},Ht.inFunction.get=function(){return(this.currentVarScope().flags&ot)>0},Ht.inGenerator.get=function(){return(this.currentVarScope().flags&Ge)>0&&!this.currentVarScope().inClassFieldInit},Ht.inAsync.get=function(){return(this.currentVarScope().flags<)>0&&!this.currentVarScope().inClassFieldInit},Ht.canAwait.get=function(){for(var z=this.scopeStack.length-1;z>=0;z--){var ge=this.scopeStack[z];if(ge.inClassFieldInit||ge.flags&It)return!1;if(ge.flags&ot)return(ge.flags<)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction},Ht.allowSuper.get=function(){var z=this.currentThisScope(),ge=z.flags,Fe=z.inClassFieldInit;return(ge&Rt)>0||Fe||this.options.allowSuperOutsideMethod},Ht.allowDirectSuper.get=function(){return(this.currentThisScope().flags&dt)>0},Ht.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())},Ht.allowNewDotTarget.get=function(){var z=this.currentThisScope(),ge=z.flags,Fe=z.inClassFieldInit;return(ge&(ot|It))>0||Fe},Ht.inClassStaticBlock.get=function(){return(this.currentVarScope().flags&It)>0},yt.extend=function(){for(var ge=[],Fe=arguments.length;Fe--;)ge[Fe]=arguments[Fe];for(var Ue=this,Qe=0;Qe<ge.length;Qe++)Ue=ge[Qe](Ue);return Ue},yt.parse=function(ge,Fe){return new this(Fe,ge).parse()},yt.parseExpressionAt=function(ge,Fe,Ue){var Qe=new this(Ue,ge,Fe);return Qe.nextToken(),Qe.parseExpression()},yt.tokenizer=function(ge,Fe){return new this(Fe,ge)},Object.defineProperties(yt.prototype,Ht);var Kt=yt.prototype,un=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;Kt.strictDirective=function(z){if(this.options.ecmaVersion<5)return!1;for(;;){oe.lastIndex=z,z+=oe.exec(this.input)[0].length;var ge=un.exec(this.input.slice(z));if(!ge)return!1;if((ge[1]||ge[2])==="use strict"){oe.lastIndex=z+ge[0].length;var Fe=oe.exec(this.input),Ue=Fe.index+Fe[0].length,Qe=this.input.charAt(Ue);return Qe===";"||Qe==="}"||ne.test(Fe[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(Qe)||Qe==="!"&&this.input.charAt(Ue+1)==="=")}z+=ge[0].length,oe.lastIndex=z,z+=oe.exec(this.input)[0].length,this.input[z]===";"&&z++}},Kt.eat=function(z){return this.type===z?(this.next(),!0):!1},Kt.isContextual=function(z){return this.type===V.name&&this.value===z&&!this.containsEsc},Kt.eatContextual=function(z){return this.isContextual(z)?(this.next(),!0):!1},Kt.expectContextual=function(z){this.eatContextual(z)||this.unexpected()},Kt.canInsertSemicolon=function(){return this.type===V.eof||this.type===V.braceR||ne.test(this.input.slice(this.lastTokEnd,this.start))},Kt.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),!0},Kt.semicolon=function(){!this.eat(V.semi)&&!this.insertSemicolon()&&this.unexpected()},Kt.afterTrailingComma=function(z,ge){if(this.type===z)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),ge||this.next(),!0},Kt.expect=function(z){this.eat(z)||this.unexpected()},Kt.unexpected=function(z){this.raise(z??this.start,"Unexpected token")};var hn=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1};Kt.checkPatternErrors=function(z,ge){if(z){z.trailingComma>-1&&this.raiseRecoverable(z.trailingComma,"Comma is not permitted after the rest element");var Fe=ge?z.parenthesizedAssign:z.parenthesizedBind;Fe>-1&&this.raiseRecoverable(Fe,ge?"Assigning to rvalue":"Parenthesized pattern")}},Kt.checkExpressionErrors=function(z,ge){if(!z)return!1;var Fe=z.shorthandAssign,Ue=z.doubleProto;if(!ge)return Fe>=0||Ue>=0;Fe>=0&&this.raise(Fe,"Shorthand property assignments are valid only in destructuring patterns"),Ue>=0&&this.raiseRecoverable(Ue,"Redefinition of __proto__ property")},Kt.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value")},Kt.isSimpleAssignTarget=function(z){return z.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(z.expression):z.type==="Identifier"||z.type==="MemberExpression"};var qt=yt.prototype;qt.parseTopLevel=function(z){var ge=Object.create(null);for(z.body||(z.body=[]);this.type!==V.eof;){var Fe=this.parseStatement(null,!0,ge);z.body.push(Fe)}if(this.inModule)for(var Ue=0,Qe=Object.keys(this.undefinedExports);Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.raiseRecoverable(this.undefinedExports[ut].start,"Export '"+ut+"' is not defined")}return this.adaptDirectivePrologue(z.body),this.next(),z.sourceType=this.options.sourceType,this.finishNode(z,"Program")};var An={kind:"loop"},xn={kind:"switch"};qt.isLet=function(z){if(this.options.ecmaVersion<6||!this.isContextual("let"))return!1;oe.lastIndex=this.pos;var ge=oe.exec(this.input),Fe=this.pos+ge[0].length,Ue=this.input.charCodeAt(Fe);if(Ue===91||Ue===92)return!0;if(z)return!1;if(Ue===123||Ue>55295&&Ue<56320)return!0;if(A(Ue,!0)){for(var Qe=Fe+1;M(Ue=this.input.charCodeAt(Qe),!0);)++Qe;if(Ue===92||Ue>55295&&Ue<56320)return!0;var ut=this.input.slice(Fe,Qe);if(!S.test(ut))return!0}return!1},qt.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return!1;oe.lastIndex=this.pos;var z=oe.exec(this.input),ge=this.pos+z[0].length,Fe;return!ne.test(this.input.slice(this.pos,ge))&&this.input.slice(ge,ge+8)==="function"&&(ge+8===this.input.length||!(M(Fe=this.input.charCodeAt(ge+8))||Fe>55295&&Fe<56320))},qt.parseStatement=function(z,ge,Fe){var Ue=this.type,Qe=this.startNode(),ut;switch(this.isLet(z)&&(Ue=V._var,ut="let"),Ue){case V._break:case V._continue:return this.parseBreakContinueStatement(Qe,Ue.keyword);case V._debugger:return this.parseDebuggerStatement(Qe);case V._do:return this.parseDoStatement(Qe);case V._for:return this.parseForStatement(Qe);case V._function:return z&&(this.strict||z!=="if"&&z!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(Qe,!1,!z);case V._class:return z&&this.unexpected(),this.parseClass(Qe,!0);case V._if:return this.parseIfStatement(Qe);case V._return:return this.parseReturnStatement(Qe);case V._switch:return this.parseSwitchStatement(Qe);case V._throw:return this.parseThrowStatement(Qe);case V._try:return this.parseTryStatement(Qe);case V._const:case V._var:return ut=ut||this.value,z&&ut!=="var"&&this.unexpected(),this.parseVarStatement(Qe,ut);case V._while:return this.parseWhileStatement(Qe);case V._with:return this.parseWithStatement(Qe);case V.braceL:return this.parseBlock(!0,Qe);case V.semi:return this.parseEmptyStatement(Qe);case V._export:case V._import:if(this.options.ecmaVersion>10&&Ue===V._import){oe.lastIndex=this.pos;var pt=oe.exec(this.input),Vt=this.pos+pt[0].length,Ft=this.input.charCodeAt(Vt);if(Ft===40||Ft===46)return this.parseExpressionStatement(Qe,this.parseExpression())}return this.options.allowImportExportEverywhere||(ge||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),Ue===V._import?this.parseImport(Qe):this.parseExport(Qe,Fe);default:if(this.isAsyncFunction())return z&&this.unexpected(),this.next(),this.parseFunctionStatement(Qe,!0,!z);var nn=this.value,Zt=this.parseExpression();return Ue===V.name&&Zt.type==="Identifier"&&this.eat(V.colon)?this.parseLabeledStatement(Qe,nn,Zt,z):this.parseExpressionStatement(Qe,Zt)}},qt.parseBreakContinueStatement=function(z,ge){var Fe=ge==="break";this.next(),this.eat(V.semi)||this.insertSemicolon()?z.label=null:this.type!==V.name?this.unexpected():(z.label=this.parseIdent(),this.semicolon());for(var Ue=0;Ue<this.labels.length;++Ue){var Qe=this.labels[Ue];if((z.label==null||Qe.name===z.label.name)&&(Qe.kind!=null&&(Fe||Qe.kind==="loop")||z.label&&Fe))break}return Ue===this.labels.length&&this.raise(z.start,"Unsyntactic "+ge),this.finishNode(z,Fe?"BreakStatement":"ContinueStatement")},qt.parseDebuggerStatement=function(z){return this.next(),this.semicolon(),this.finishNode(z,"DebuggerStatement")},qt.parseDoStatement=function(z){return this.next(),this.labels.push(An),z.body=this.parseStatement("do"),this.labels.pop(),this.expect(V._while),z.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(V.semi):this.semicolon(),this.finishNode(z,"DoWhileStatement")},qt.parseForStatement=function(z){this.next();var ge=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(An),this.enterScope(0),this.expect(V.parenL),this.type===V.semi)return ge>-1&&this.unexpected(ge),this.parseFor(z,null);var Fe=this.isLet();if(this.type===V._var||this.type===V._const||Fe){var Ue=this.startNode(),Qe=Fe?"let":this.value;return this.next(),this.parseVar(Ue,!0,Qe),this.finishNode(Ue,"VariableDeclaration"),(this.type===V._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&Ue.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===V._in?ge>-1&&this.unexpected(ge):z.await=ge>-1),this.parseForIn(z,Ue)):(ge>-1&&this.unexpected(ge),this.parseFor(z,Ue))}var ut=this.isContextual("let"),pt=!1,Vt=this.containsEsc,Ft=new hn,nn=this.start,Zt=ge>-1?this.parseExprSubscripts(Ft,"await"):this.parseExpression(!0,Ft);return this.type===V._in||(pt=this.options.ecmaVersion>=6&&this.isContextual("of"))?(ge>-1?(this.type===V._in&&this.unexpected(ge),z.await=!0):pt&&this.options.ecmaVersion>=8&&(Zt.start===nn&&!Vt&&Zt.type==="Identifier"&&Zt.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(z.await=!1)),ut&&pt&&this.raise(Zt.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(Zt,!1,Ft),this.checkLValPattern(Zt),this.parseForIn(z,Zt)):(this.checkExpressionErrors(Ft,!0),ge>-1&&this.unexpected(ge),this.parseFor(z,Zt))},qt.parseFunctionStatement=function(z,ge,Fe){return this.next(),this.parseFunction(z,vn|(Fe?0:Pn),!1,ge)},qt.parseIfStatement=function(z){return this.next(),z.test=this.parseParenExpression(),z.consequent=this.parseStatement("if"),z.alternate=this.eat(V._else)?this.parseStatement("if"):null,this.finishNode(z,"IfStatement")},qt.parseReturnStatement=function(z){return!this.inFunction&&!this.options.allowReturnOutsideFunction&&this.raise(this.start,"'return' outside of function"),this.next(),this.eat(V.semi)||this.insertSemicolon()?z.argument=null:(z.argument=this.parseExpression(),this.semicolon()),this.finishNode(z,"ReturnStatement")},qt.parseSwitchStatement=function(z){this.next(),z.discriminant=this.parseParenExpression(),z.cases=[],this.expect(V.braceL),this.labels.push(xn),this.enterScope(0);for(var ge,Fe=!1;this.type!==V.braceR;)if(this.type===V._case||this.type===V._default){var Ue=this.type===V._case;ge&&this.finishNode(ge,"SwitchCase"),z.cases.push(ge=this.startNode()),ge.consequent=[],this.next(),Ue?ge.test=this.parseExpression():(Fe&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),Fe=!0,ge.test=null),this.expect(V.colon)}else ge||this.unexpected(),ge.consequent.push(this.parseStatement(null));return this.exitScope(),ge&&this.finishNode(ge,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(z,"SwitchStatement")},qt.parseThrowStatement=function(z){return this.next(),ne.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),z.argument=this.parseExpression(),this.semicolon(),this.finishNode(z,"ThrowStatement")};var Rn=[];qt.parseCatchClauseParam=function(){var z=this.parseBindingAtom(),ge=z.type==="Identifier";return this.enterScope(ge?rt:0),this.checkLValPattern(z,ge?mt:Ze),this.expect(V.parenR),z},qt.parseTryStatement=function(z){if(this.next(),z.block=this.parseBlock(),z.handler=null,this.type===V._catch){var ge=this.startNode();this.next(),this.eat(V.parenL)?ge.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),ge.param=null,this.enterScope(0)),ge.body=this.parseBlock(!1),this.exitScope(),z.handler=this.finishNode(ge,"CatchClause")}return z.finalizer=this.eat(V._finally)?this.parseBlock():null,!z.handler&&!z.finalizer&&this.raise(z.start,"Missing catch or finally clause"),this.finishNode(z,"TryStatement")},qt.parseVarStatement=function(z,ge,Fe){return this.next(),this.parseVar(z,!1,ge,Fe),this.semicolon(),this.finishNode(z,"VariableDeclaration")},qt.parseWhileStatement=function(z){return this.next(),z.test=this.parseParenExpression(),this.labels.push(An),z.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(z,"WhileStatement")},qt.parseWithStatement=function(z){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),z.object=this.parseParenExpression(),z.body=this.parseStatement("with"),this.finishNode(z,"WithStatement")},qt.parseEmptyStatement=function(z){return this.next(),this.finishNode(z,"EmptyStatement")},qt.parseLabeledStatement=function(z,ge,Fe,Ue){for(var Qe=0,ut=this.labels;Qe<ut.length;Qe+=1){var pt=ut[Qe];pt.name===ge&&this.raise(Fe.start,"Label '"+ge+"' is already declared")}for(var Vt=this.type.isLoop?"loop":this.type===V._switch?"switch":null,Ft=this.labels.length-1;Ft>=0;Ft--){var nn=this.labels[Ft];if(nn.statementStart===z.start)nn.statementStart=this.start,nn.kind=Vt;else break}return this.labels.push({name:ge,kind:Vt,statementStart:this.start}),z.body=this.parseStatement(Ue?Ue.indexOf("label")===-1?Ue+"label":Ue:"label"),this.labels.pop(),z.label=Fe,this.finishNode(z,"LabeledStatement")},qt.parseExpressionStatement=function(z,ge){return z.expression=ge,this.semicolon(),this.finishNode(z,"ExpressionStatement")},qt.parseBlock=function(z,ge,Fe){for(z===void 0&&(z=!0),ge===void 0&&(ge=this.startNode()),ge.body=[],this.expect(V.braceL),z&&this.enterScope(0);this.type!==V.braceR;){var Ue=this.parseStatement(null);ge.body.push(Ue)}return Fe&&(this.strict=!1),this.next(),z&&this.exitScope(),this.finishNode(ge,"BlockStatement")},qt.parseFor=function(z,ge){return z.init=ge,this.expect(V.semi),z.test=this.type===V.semi?null:this.parseExpression(),this.expect(V.semi),z.update=this.type===V.parenR?null:this.parseExpression(),this.expect(V.parenR),z.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(z,"ForStatement")},qt.parseForIn=function(z,ge){var Fe=this.type===V._in;return this.next(),ge.type==="VariableDeclaration"&&ge.declarations[0].init!=null&&(!Fe||this.options.ecmaVersion<8||this.strict||ge.kind!=="var"||ge.declarations[0].id.type!=="Identifier")&&this.raise(ge.start,(Fe?"for-in":"for-of")+" loop variable declaration may not have an initializer"),z.left=ge,z.right=Fe?this.parseExpression():this.parseMaybeAssign(),this.expect(V.parenR),z.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(z,Fe?"ForInStatement":"ForOfStatement")},qt.parseVar=function(z,ge,Fe,Ue){for(z.declarations=[],z.kind=Fe;;){var Qe=this.startNode();if(this.parseVarId(Qe,Fe),this.eat(V.eq)?Qe.init=this.parseMaybeAssign(ge):!Ue&&Fe==="const"&&!(this.type===V._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!Ue&&Qe.id.type!=="Identifier"&&!(ge&&(this.type===V._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):Qe.init=null,z.declarations.push(this.finishNode(Qe,"VariableDeclarator")),!this.eat(V.comma))break}return z},qt.parseVarId=function(z,ge){z.id=this.parseBindingAtom(),this.checkLValPattern(z.id,ge==="var"?Ye:Ze,!1)};var vn=1,Pn=2,Mn=4;qt.parseFunction=function(z,ge,Fe,Ue,Qe){this.initFunction(z),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!Ue)&&(this.type===V.star&&ge&Pn&&this.unexpected(),z.generator=this.eat(V.star)),this.options.ecmaVersion>=8&&(z.async=!!Ue),ge&vn&&(z.id=ge&Mn&&this.type!==V.name?null:this.parseIdent(),z.id&&!(ge&Pn)&&this.checkLValSimple(z.id,this.strict||z.generator||z.async?this.treatFunctionsAsVar?Ye:Ze:ct));var ut=this.yieldPos,pt=this.awaitPos,Vt=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ct(z.async,z.generator)),ge&vn||(z.id=this.type===V.name?this.parseIdent():null),this.parseFunctionParams(z),this.parseFunctionBody(z,Fe,!1,Qe),this.yieldPos=ut,this.awaitPos=pt,this.awaitIdentPos=Vt,this.finishNode(z,ge&vn?"FunctionDeclaration":"FunctionExpression")},qt.parseFunctionParams=function(z){this.expect(V.parenL),z.params=this.parseBindingList(V.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams()},qt.parseClass=function(z,ge){this.next();var Fe=this.strict;this.strict=!0,this.parseClassId(z,ge),this.parseClassSuper(z);var Ue=this.enterClassBody(),Qe=this.startNode(),ut=!1;for(Qe.body=[],this.expect(V.braceL);this.type!==V.braceR;){var pt=this.parseClassElement(z.superClass!==null);pt&&(Qe.body.push(pt),pt.type==="MethodDefinition"&&pt.kind==="constructor"?(ut&&this.raiseRecoverable(pt.start,"Duplicate constructor in the same class"),ut=!0):pt.key&&pt.key.type==="PrivateIdentifier"&&$n(Ue,pt)&&this.raiseRecoverable(pt.key.start,"Identifier '#"+pt.key.name+"' has already been declared"))}return this.strict=Fe,this.next(),z.body=this.finishNode(Qe,"ClassBody"),this.exitClassBody(),this.finishNode(z,ge?"ClassDeclaration":"ClassExpression")},qt.parseClassElement=function(z){if(this.eat(V.semi))return null;var ge=this.options.ecmaVersion,Fe=this.startNode(),Ue="",Qe=!1,ut=!1,pt="method",Vt=!1;if(this.eatContextual("static")){if(ge>=13&&this.eat(V.braceL))return this.parseClassStaticBlock(Fe),Fe;this.isClassElementNameStart()||this.type===V.star?Vt=!0:Ue="static"}if(Fe.static=Vt,!Ue&&ge>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===V.star)&&!this.canInsertSemicolon()?ut=!0:Ue="async"),!Ue&&(ge>=9||!ut)&&this.eat(V.star)&&(Qe=!0),!Ue&&!ut&&!Qe){var Ft=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?pt=Ft:Ue=Ft)}if(Ue?(Fe.computed=!1,Fe.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),Fe.key.name=Ue,this.finishNode(Fe.key,"Identifier")):this.parseClassElementName(Fe),ge<13||this.type===V.parenL||pt!=="method"||Qe||ut){var nn=!Fe.static&&Vn(Fe,"constructor"),Zt=nn&&z;nn&&pt!=="method"&&this.raise(Fe.key.start,"Constructor can't have get/set modifier"),Fe.kind=nn?"constructor":pt,this.parseClassMethod(Fe,Qe,ut,Zt)}else this.parseClassField(Fe);return Fe},qt.isClassElementNameStart=function(){return this.type===V.name||this.type===V.privateId||this.type===V.num||this.type===V.string||this.type===V.bracketL||this.type.keyword},qt.parseClassElementName=function(z){this.type===V.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),z.computed=!1,z.key=this.parsePrivateIdent()):this.parsePropertyName(z)},qt.parseClassMethod=function(z,ge,Fe,Ue){var Qe=z.key;z.kind==="constructor"?(ge&&this.raise(Qe.start,"Constructor can't be a generator"),Fe&&this.raise(Qe.start,"Constructor can't be an async method")):z.static&&Vn(z,"prototype")&&this.raise(Qe.start,"Classes may not have a static property named prototype");var ut=z.value=this.parseMethod(ge,Fe,Ue);return z.kind==="get"&&ut.params.length!==0&&this.raiseRecoverable(ut.start,"getter should have no params"),z.kind==="set"&&ut.params.length!==1&&this.raiseRecoverable(ut.start,"setter should have exactly one param"),z.kind==="set"&&ut.params[0].type==="RestElement"&&this.raiseRecoverable(ut.params[0].start,"Setter cannot use rest params"),this.finishNode(z,"MethodDefinition")},qt.parseClassField=function(z){if(Vn(z,"constructor")?this.raise(z.key.start,"Classes can't have a field named 'constructor'"):z.static&&Vn(z,"prototype")&&this.raise(z.key.start,"Classes can't have a static field named 'prototype'"),this.eat(V.eq)){var ge=this.currentThisScope(),Fe=ge.inClassFieldInit;ge.inClassFieldInit=!0,z.value=this.parseMaybeAssign(),ge.inClassFieldInit=Fe}else z.value=null;return this.semicolon(),this.finishNode(z,"PropertyDefinition")},qt.parseClassStaticBlock=function(z){z.body=[];var ge=this.labels;for(this.labels=[],this.enterScope(It|Rt);this.type!==V.braceR;){var Fe=this.parseStatement(null);z.body.push(Fe)}return this.next(),this.exitScope(),this.labels=ge,this.finishNode(z,"StaticBlock")},qt.parseClassId=function(z,ge){this.type===V.name?(z.id=this.parseIdent(),ge&&this.checkLValSimple(z.id,Ze,!1)):(ge===!0&&this.unexpected(),z.id=null)},qt.parseClassSuper=function(z){z.superClass=this.eat(V._extends)?this.parseExprSubscripts(null,!1):null},qt.enterClassBody=function(){var z={declared:Object.create(null),used:[]};return this.privateNameStack.push(z),z.declared},qt.exitClassBody=function(){var z=this.privateNameStack.pop(),ge=z.declared,Fe=z.used;if(this.options.checkPrivateFields)for(var Ue=this.privateNameStack.length,Qe=Ue===0?null:this.privateNameStack[Ue-1],ut=0;ut<Fe.length;++ut){var pt=Fe[ut];Be(ge,pt.name)||(Qe?Qe.used.push(pt):this.raiseRecoverable(pt.start,"Private field '#"+pt.name+"' must be declared in an enclosing class"))}};function $n(z,ge){var Fe=ge.key.name,Ue=z[Fe],Qe="true";return ge.type==="MethodDefinition"&&(ge.kind==="get"||ge.kind==="set")&&(Qe=(ge.static?"s":"i")+ge.kind),Ue==="iget"&&Qe==="iset"||Ue==="iset"&&Qe==="iget"||Ue==="sget"&&Qe==="sset"||Ue==="sset"&&Qe==="sget"?(z[Fe]="true",!1):Ue?!0:(z[Fe]=Qe,!1)}function Vn(z,ge){var Fe=z.computed,Ue=z.key;return!Fe&&(Ue.type==="Identifier"&&Ue.name===ge||Ue.type==="Literal"&&Ue.value===ge)}qt.parseExportAllDeclaration=function(z,ge){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(z.exported=this.parseModuleExportName(),this.checkExport(ge,z.exported,this.lastTokStart)):z.exported=null),this.expectContextual("from"),this.type!==V.string&&this.unexpected(),z.source=this.parseExprAtom(),this.semicolon(),this.finishNode(z,"ExportAllDeclaration")},qt.parseExport=function(z,ge){if(this.next(),this.eat(V.star))return this.parseExportAllDeclaration(z,ge);if(this.eat(V._default))return this.checkExport(ge,"default",this.lastTokStart),z.declaration=this.parseExportDefaultDeclaration(),this.finishNode(z,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())z.declaration=this.parseExportDeclaration(z),z.declaration.type==="VariableDeclaration"?this.checkVariableExport(ge,z.declaration.declarations):this.checkExport(ge,z.declaration.id,z.declaration.id.start),z.specifiers=[],z.source=null;else{if(z.declaration=null,z.specifiers=this.parseExportSpecifiers(ge),this.eatContextual("from"))this.type!==V.string&&this.unexpected(),z.source=this.parseExprAtom();else{for(var Fe=0,Ue=z.specifiers;Fe<Ue.length;Fe+=1){var Qe=Ue[Fe];this.checkUnreserved(Qe.local),this.checkLocalExport(Qe.local),Qe.local.type==="Literal"&&this.raise(Qe.local.start,"A string literal cannot be used as an exported binding without `from`.")}z.source=null}this.semicolon()}return this.finishNode(z,"ExportNamedDeclaration")},qt.parseExportDeclaration=function(z){return this.parseStatement(null)},qt.parseExportDefaultDeclaration=function(){var z;if(this.type===V._function||(z=this.isAsyncFunction())){var ge=this.startNode();return this.next(),z&&this.next(),this.parseFunction(ge,vn|Mn,!1,z)}else if(this.type===V._class){var Fe=this.startNode();return this.parseClass(Fe,"nullableID")}else{var Ue=this.parseMaybeAssign();return this.semicolon(),Ue}},qt.checkExport=function(z,ge,Fe){z&&(typeof ge!="string"&&(ge=ge.type==="Identifier"?ge.name:ge.value),Be(z,ge)&&this.raiseRecoverable(Fe,"Duplicate export '"+ge+"'"),z[ge]=!0)},qt.checkPatternExport=function(z,ge){var Fe=ge.type;if(Fe==="Identifier")this.checkExport(z,ge,ge.start);else if(Fe==="ObjectPattern")for(var Ue=0,Qe=ge.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.checkPatternExport(z,ut)}else if(Fe==="ArrayPattern")for(var pt=0,Vt=ge.elements;pt<Vt.length;pt+=1){var Ft=Vt[pt];Ft&&this.checkPatternExport(z,Ft)}else Fe==="Property"?this.checkPatternExport(z,ge.value):Fe==="AssignmentPattern"?this.checkPatternExport(z,ge.left):Fe==="RestElement"&&this.checkPatternExport(z,ge.argument)},qt.checkVariableExport=function(z,ge){if(z)for(var Fe=0,Ue=ge;Fe<Ue.length;Fe+=1){var Qe=Ue[Fe];this.checkPatternExport(z,Qe.id)}},qt.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()},qt.parseExportSpecifier=function(z){var ge=this.startNode();return ge.local=this.parseModuleExportName(),ge.exported=this.eatContextual("as")?this.parseModuleExportName():ge.local,this.checkExport(z,ge.exported,ge.exported.start),this.finishNode(ge,"ExportSpecifier")},qt.parseExportSpecifiers=function(z){var ge=[],Fe=!0;for(this.expect(V.braceL);!this.eat(V.braceR);){if(Fe)Fe=!1;else if(this.expect(V.comma),this.afterTrailingComma(V.braceR))break;ge.push(this.parseExportSpecifier(z))}return ge},qt.parseImport=function(z){return this.next(),this.type===V.string?(z.specifiers=Rn,z.source=this.parseExprAtom()):(z.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),z.source=this.type===V.string?this.parseExprAtom():this.unexpected()),this.semicolon(),this.finishNode(z,"ImportDeclaration")},qt.parseImportSpecifier=function(){var z=this.startNode();return z.imported=this.parseModuleExportName(),this.eatContextual("as")?z.local=this.parseIdent():(this.checkUnreserved(z.imported),z.local=z.imported),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportSpecifier")},qt.parseImportDefaultSpecifier=function(){var z=this.startNode();return z.local=this.parseIdent(),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportDefaultSpecifier")},qt.parseImportNamespaceSpecifier=function(){var z=this.startNode();return this.next(),this.expectContextual("as"),z.local=this.parseIdent(),this.checkLValSimple(z.local,Ze),this.finishNode(z,"ImportNamespaceSpecifier")},qt.parseImportSpecifiers=function(){var z=[],ge=!0;if(this.type===V.name&&(z.push(this.parseImportDefaultSpecifier()),!this.eat(V.comma)))return z;if(this.type===V.star)return z.push(this.parseImportNamespaceSpecifier()),z;for(this.expect(V.braceL);!this.eat(V.braceR);){if(ge)ge=!1;else if(this.expect(V.comma),this.afterTrailingComma(V.braceR))break;z.push(this.parseImportSpecifier())}return z},qt.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===V.string){var z=this.parseLiteral(this.value);return We.test(z.value)&&this.raise(z.start,"An export name cannot include a lone surrogate."),z}return this.parseIdent(!0)},qt.adaptDirectivePrologue=function(z){for(var ge=0;ge<z.length&&this.isDirectiveCandidate(z[ge]);++ge)z[ge].directive=z[ge].expression.raw.slice(1,-1)},qt.isDirectiveCandidate=function(z){return this.options.ecmaVersion>=5&&z.type==="ExpressionStatement"&&z.expression.type==="Literal"&&typeof z.expression.value=="string"&&(this.input[z.start]==='"'||this.input[z.start]==="'")};var Jt=yt.prototype;Jt.toAssignable=function(z,ge,Fe){if(this.options.ecmaVersion>=6&&z)switch(z.type){case"Identifier":this.inAsync&&z.name==="await"&&this.raise(z.start,"Cannot use 'await' as identifier inside an async function");break;case"ObjectPattern":case"ArrayPattern":case"AssignmentPattern":case"RestElement":break;case"ObjectExpression":z.type="ObjectPattern",Fe&&this.checkPatternErrors(Fe,!0);for(var Ue=0,Qe=z.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.toAssignable(ut,ge),ut.type==="RestElement"&&(ut.argument.type==="ArrayPattern"||ut.argument.type==="ObjectPattern")&&this.raise(ut.argument.start,"Unexpected token")}break;case"Property":z.kind!=="init"&&this.raise(z.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(z.value,ge);break;case"ArrayExpression":z.type="ArrayPattern",Fe&&this.checkPatternErrors(Fe,!0),this.toAssignableList(z.elements,ge);break;case"SpreadElement":z.type="RestElement",this.toAssignable(z.argument,ge),z.argument.type==="AssignmentPattern"&&this.raise(z.argument.start,"Rest elements cannot have a default value");break;case"AssignmentExpression":z.operator!=="="&&this.raise(z.left.end,"Only '=' operator can be used for specifying default value."),z.type="AssignmentPattern",delete z.operator,this.toAssignable(z.left,ge);break;case"ParenthesizedExpression":this.toAssignable(z.expression,ge,Fe);break;case"ChainExpression":this.raiseRecoverable(z.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":if(!ge)break;default:this.raise(z.start,"Assigning to rvalue")}else Fe&&this.checkPatternErrors(Fe,!0);return z},Jt.toAssignableList=function(z,ge){for(var Fe=z.length,Ue=0;Ue<Fe;Ue++){var Qe=z[Ue];Qe&&this.toAssignable(Qe,ge)}if(Fe){var ut=z[Fe-1];this.options.ecmaVersion===6&&ge&&ut&&ut.type==="RestElement"&&ut.argument.type!=="Identifier"&&this.unexpected(ut.argument.start)}return z},Jt.parseSpread=function(z){var ge=this.startNode();return this.next(),ge.argument=this.parseMaybeAssign(!1,z),this.finishNode(ge,"SpreadElement")},Jt.parseRestBinding=function(){var z=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==V.name&&this.unexpected(),z.argument=this.parseBindingAtom(),this.finishNode(z,"RestElement")},Jt.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case V.bracketL:var z=this.startNode();return this.next(),z.elements=this.parseBindingList(V.bracketR,!0,!0),this.finishNode(z,"ArrayPattern");case V.braceL:return this.parseObj(!0)}return this.parseIdent()},Jt.parseBindingList=function(z,ge,Fe,Ue){for(var Qe=[],ut=!0;!this.eat(z);)if(ut?ut=!1:this.expect(V.comma),ge&&this.type===V.comma)Qe.push(null);else{if(Fe&&this.afterTrailingComma(z))break;if(this.type===V.ellipsis){var pt=this.parseRestBinding();this.parseBindingListItem(pt),Qe.push(pt),this.type===V.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(z);break}else Qe.push(this.parseAssignableListItem(Ue))}return Qe},Jt.parseAssignableListItem=function(z){var ge=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(ge),ge},Jt.parseBindingListItem=function(z){return z},Jt.parseMaybeDefault=function(z,ge,Fe){if(Fe=Fe||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(V.eq))return Fe;var Ue=this.startNodeAt(z,ge);return Ue.left=Fe,Ue.right=this.parseMaybeAssign(),this.finishNode(Ue,"AssignmentPattern")},Jt.checkLValSimple=function(z,ge,Fe){ge===void 0&&(ge=Ke);var Ue=ge!==Ke;switch(z.type){case"Identifier":this.strict&&this.reservedWordsStrictBind.test(z.name)&&this.raiseRecoverable(z.start,(Ue?"Binding ":"Assigning to ")+z.name+" in strict mode"),Ue&&(ge===Ze&&z.name==="let"&&this.raiseRecoverable(z.start,"let is disallowed as a lexically bound name"),Fe&&(Be(Fe,z.name)&&this.raiseRecoverable(z.start,"Argument name clash"),Fe[z.name]=!0),ge!==ft&&this.declareName(z.name,ge,z.start));break;case"ChainExpression":this.raiseRecoverable(z.start,"Optional chaining cannot appear in left-hand side");break;case"MemberExpression":Ue&&this.raiseRecoverable(z.start,"Binding member expression");break;case"ParenthesizedExpression":return Ue&&this.raiseRecoverable(z.start,"Binding parenthesized expression"),this.checkLValSimple(z.expression,ge,Fe);default:this.raise(z.start,(Ue?"Binding":"Assigning to")+" rvalue")}},Jt.checkLValPattern=function(z,ge,Fe){switch(ge===void 0&&(ge=Ke),z.type){case"ObjectPattern":for(var Ue=0,Qe=z.properties;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.checkLValInnerPattern(ut,ge,Fe)}break;case"ArrayPattern":for(var pt=0,Vt=z.elements;pt<Vt.length;pt+=1){var Ft=Vt[pt];Ft&&this.checkLValInnerPattern(Ft,ge,Fe)}break;default:this.checkLValSimple(z,ge,Fe)}},Jt.checkLValInnerPattern=function(z,ge,Fe){switch(ge===void 0&&(ge=Ke),z.type){case"Property":this.checkLValInnerPattern(z.value,ge,Fe);break;case"AssignmentPattern":this.checkLValPattern(z.left,ge,Fe);break;case"RestElement":this.checkLValPattern(z.argument,ge,Fe);break;default:this.checkLValPattern(z,ge,Fe)}};var Qt=function(ge,Fe,Ue,Qe,ut){this.token=ge,this.isExpr=!!Fe,this.preserveSpace=!!Ue,this.override=Qe,this.generator=!!ut},Ut={b_stat:new Qt("{",!1),b_expr:new Qt("{",!0),b_tmpl:new Qt("${",!1),p_stat:new Qt("(",!1),p_expr:new Qt("(",!0),q_tmpl:new Qt("`",!0,!0,function(z){return z.tryReadTemplateToken()}),f_stat:new Qt("function",!1),f_expr:new Qt("function",!0),f_expr_gen:new Qt("function",!0,!1,null,!0),f_gen:new Qt("function",!1,!1,null,!0)},tn=yt.prototype;tn.initialContext=function(){return[Ut.b_stat]},tn.curContext=function(){return this.context[this.context.length-1]},tn.braceIsBlock=function(z){var ge=this.curContext();return ge===Ut.f_expr||ge===Ut.f_stat?!0:z===V.colon&&(ge===Ut.b_stat||ge===Ut.b_expr)?!ge.isExpr:z===V._return||z===V.name&&this.exprAllowed?ne.test(this.input.slice(this.lastTokEnd,this.start)):z===V._else||z===V.semi||z===V.eof||z===V.parenR||z===V.arrow?!0:z===V.braceL?ge===Ut.b_stat:z===V._var||z===V._const||z===V.name?!1:!this.exprAllowed},tn.inGeneratorContext=function(){for(var z=this.context.length-1;z>=1;z--){var ge=this.context[z];if(ge.token==="function")return ge.generator}return!1},tn.updateContext=function(z){var ge,Fe=this.type;Fe.keyword&&z===V.dot?this.exprAllowed=!1:(ge=Fe.updateContext)?ge.call(this,z):this.exprAllowed=Fe.beforeExpr},tn.overrideContext=function(z){this.curContext()!==z&&(this.context[this.context.length-1]=z)},V.parenR.updateContext=V.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=!0;return}var z=this.context.pop();z===Ut.b_stat&&this.curContext().token==="function"&&(z=this.context.pop()),this.exprAllowed=!z.isExpr},V.braceL.updateContext=function(z){this.context.push(this.braceIsBlock(z)?Ut.b_stat:Ut.b_expr),this.exprAllowed=!0},V.dollarBraceL.updateContext=function(){this.context.push(Ut.b_tmpl),this.exprAllowed=!0},V.parenL.updateContext=function(z){var ge=z===V._if||z===V._for||z===V._with||z===V._while;this.context.push(ge?Ut.p_stat:Ut.p_expr),this.exprAllowed=!0},V.incDec.updateContext=function(){},V._function.updateContext=V._class.updateContext=function(z){z.beforeExpr&&z!==V._else&&!(z===V.semi&&this.curContext()!==Ut.p_stat)&&!(z===V._return&&ne.test(this.input.slice(this.lastTokEnd,this.start)))&&!((z===V.colon||z===V.braceL)&&this.curContext()===Ut.b_stat)?this.context.push(Ut.f_expr):this.context.push(Ut.f_stat),this.exprAllowed=!1},V.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=!0},V.backQuote.updateContext=function(){this.curContext()===Ut.q_tmpl?this.context.pop():this.context.push(Ut.q_tmpl),this.exprAllowed=!1},V.star.updateContext=function(z){if(z===V._function){var ge=this.context.length-1;this.context[ge]===Ut.f_expr?this.context[ge]=Ut.f_expr_gen:this.context[ge]=Ut.f_gen}this.exprAllowed=!0},V.name.updateContext=function(z){var ge=!1;this.options.ecmaVersion>=6&&z!==V.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(ge=!0),this.exprAllowed=ge};var Yt=yt.prototype;Yt.checkPropClash=function(z,ge,Fe){if(!(this.options.ecmaVersion>=9&&z.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(z.computed||z.method||z.shorthand))){var Ue=z.key,Qe;switch(Ue.type){case"Identifier":Qe=Ue.name;break;case"Literal":Qe=String(Ue.value);break;default:return}var ut=z.kind;if(this.options.ecmaVersion>=6){Qe==="__proto__"&&ut==="init"&&(ge.proto&&(Fe?Fe.doubleProto<0&&(Fe.doubleProto=Ue.start):this.raiseRecoverable(Ue.start,"Redefinition of __proto__ property")),ge.proto=!0);return}Qe="$"+Qe;var pt=ge[Qe];if(pt){var Vt;ut==="init"?Vt=this.strict&&pt.init||pt.get||pt.set:Vt=pt.init||pt[ut],Vt&&this.raiseRecoverable(Ue.start,"Redefinition of property")}else pt=ge[Qe]={init:!1,get:!1,set:!1};pt[ut]=!0}},Yt.parseExpression=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseMaybeAssign(z,ge);if(this.type===V.comma){var ut=this.startNodeAt(Fe,Ue);for(ut.expressions=[Qe];this.eat(V.comma);)ut.expressions.push(this.parseMaybeAssign(z,ge));return this.finishNode(ut,"SequenceExpression")}return Qe},Yt.parseMaybeAssign=function(z,ge,Fe){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(z);this.exprAllowed=!1}var Ue=!1,Qe=-1,ut=-1,pt=-1;ge?(Qe=ge.parenthesizedAssign,ut=ge.trailingComma,pt=ge.doubleProto,ge.parenthesizedAssign=ge.trailingComma=-1):(ge=new hn,Ue=!0);var Vt=this.start,Ft=this.startLoc;(this.type===V.parenL||this.type===V.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=z==="await");var nn=this.parseMaybeConditional(z,ge);if(Fe&&(nn=Fe.call(this,nn,Vt,Ft)),this.type.isAssign){var Zt=this.startNodeAt(Vt,Ft);return Zt.operator=this.value,this.type===V.eq&&(nn=this.toAssignable(nn,!1,ge)),Ue||(ge.parenthesizedAssign=ge.trailingComma=ge.doubleProto=-1),ge.shorthandAssign>=nn.start&&(ge.shorthandAssign=-1),this.type===V.eq?this.checkLValPattern(nn):this.checkLValSimple(nn),Zt.left=nn,this.next(),Zt.right=this.parseMaybeAssign(z),pt>-1&&(ge.doubleProto=pt),this.finishNode(Zt,"AssignmentExpression")}else Ue&&this.checkExpressionErrors(ge,!0);return Qe>-1&&(ge.parenthesizedAssign=Qe),ut>-1&&(ge.trailingComma=ut),nn},Yt.parseMaybeConditional=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseExprOps(z,ge);if(this.checkExpressionErrors(ge))return Qe;if(this.eat(V.question)){var ut=this.startNodeAt(Fe,Ue);return ut.test=Qe,ut.consequent=this.parseMaybeAssign(),this.expect(V.colon),ut.alternate=this.parseMaybeAssign(z),this.finishNode(ut,"ConditionalExpression")}return Qe},Yt.parseExprOps=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseMaybeUnary(ge,!1,!1,z);return this.checkExpressionErrors(ge)||Qe.start===Fe&&Qe.type==="ArrowFunctionExpression"?Qe:this.parseExprOp(Qe,Fe,Ue,-1,z)},Yt.parseExprOp=function(z,ge,Fe,Ue,Qe){var ut=this.type.binop;if(ut!=null&&(!Qe||this.type!==V._in)&&ut>Ue){var pt=this.type===V.logicalOR||this.type===V.logicalAND,Vt=this.type===V.coalesce;Vt&&(ut=V.logicalAND.binop);var Ft=this.value;this.next();var nn=this.start,Zt=this.startLoc,_n=this.parseExprOp(this.parseMaybeUnary(null,!1,!1,Qe),nn,Zt,ut,Qe),Gn=this.buildBinary(ge,Fe,z,_n,Ft,pt||Vt);return(pt&&this.type===V.coalesce||Vt&&(this.type===V.logicalOR||this.type===V.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(Gn,ge,Fe,Ue,Qe)}return z},Yt.buildBinary=function(z,ge,Fe,Ue,Qe,ut){Ue.type==="PrivateIdentifier"&&this.raise(Ue.start,"Private identifier can only be left side of binary expression");var pt=this.startNodeAt(z,ge);return pt.left=Fe,pt.operator=Qe,pt.right=Ue,this.finishNode(pt,ut?"LogicalExpression":"BinaryExpression")},Yt.parseMaybeUnary=function(z,ge,Fe,Ue){var Qe=this.start,ut=this.startLoc,pt;if(this.isContextual("await")&&this.canAwait)pt=this.parseAwait(Ue),ge=!0;else if(this.type.prefix){var Vt=this.startNode(),Ft=this.type===V.incDec;Vt.operator=this.value,Vt.prefix=!0,this.next(),Vt.argument=this.parseMaybeUnary(null,!0,Ft,Ue),this.checkExpressionErrors(z,!0),Ft?this.checkLValSimple(Vt.argument):this.strict&&Vt.operator==="delete"&&an(Vt.argument)?this.raiseRecoverable(Vt.start,"Deleting local variable in strict mode"):Vt.operator==="delete"&&mn(Vt.argument)?this.raiseRecoverable(Vt.start,"Private fields can not be deleted"):ge=!0,pt=this.finishNode(Vt,Ft?"UpdateExpression":"UnaryExpression")}else if(!ge&&this.type===V.privateId)(Ue||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),pt=this.parsePrivateIdent(),this.type!==V._in&&this.unexpected();else{if(pt=this.parseExprSubscripts(z,Ue),this.checkExpressionErrors(z))return pt;for(;this.type.postfix&&!this.canInsertSemicolon();){var nn=this.startNodeAt(Qe,ut);nn.operator=this.value,nn.prefix=!1,nn.argument=pt,this.checkLValSimple(pt),this.next(),pt=this.finishNode(nn,"UpdateExpression")}}if(!Fe&&this.eat(V.starstar))if(ge)this.unexpected(this.lastTokStart);else return this.buildBinary(Qe,ut,pt,this.parseMaybeUnary(null,!1,!1,Ue),"**",!1);else return pt};function an(z){return z.type==="Identifier"||z.type==="ParenthesizedExpression"&&an(z.expression)}function mn(z){return z.type==="MemberExpression"&&z.property.type==="PrivateIdentifier"||z.type==="ChainExpression"&&mn(z.expression)||z.type==="ParenthesizedExpression"&&mn(z.expression)}Yt.parseExprSubscripts=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe=this.parseExprAtom(z,ge);if(Qe.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return Qe;var ut=this.parseSubscripts(Qe,Fe,Ue,!1,ge);return z&&ut.type==="MemberExpression"&&(z.parenthesizedAssign>=ut.start&&(z.parenthesizedAssign=-1),z.parenthesizedBind>=ut.start&&(z.parenthesizedBind=-1),z.trailingComma>=ut.start&&(z.trailingComma=-1)),ut},Yt.parseSubscripts=function(z,ge,Fe,Ue,Qe){for(var ut=this.options.ecmaVersion>=8&&z.type==="Identifier"&&z.name==="async"&&this.lastTokEnd===z.end&&!this.canInsertSemicolon()&&z.end-z.start===5&&this.potentialArrowAt===z.start,pt=!1;;){var Vt=this.parseSubscript(z,ge,Fe,Ue,ut,pt,Qe);if(Vt.optional&&(pt=!0),Vt===z||Vt.type==="ArrowFunctionExpression"){if(pt){var Ft=this.startNodeAt(ge,Fe);Ft.expression=Vt,Vt=this.finishNode(Ft,"ChainExpression")}return Vt}z=Vt}},Yt.shouldParseAsyncArrow=function(){return!this.canInsertSemicolon()&&this.eat(V.arrow)},Yt.parseSubscriptAsyncArrow=function(z,ge,Fe,Ue){return this.parseArrowExpression(this.startNodeAt(z,ge),Fe,!0,Ue)},Yt.parseSubscript=function(z,ge,Fe,Ue,Qe,ut,pt){var Vt=this.options.ecmaVersion>=11,Ft=Vt&&this.eat(V.questionDot);Ue&&Ft&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var nn=this.eat(V.bracketL);if(nn||Ft&&this.type!==V.parenL&&this.type!==V.backQuote||this.eat(V.dot)){var Zt=this.startNodeAt(ge,Fe);Zt.object=z,nn?(Zt.property=this.parseExpression(),this.expect(V.bracketR)):this.type===V.privateId&&z.type!=="Super"?Zt.property=this.parsePrivateIdent():Zt.property=this.parseIdent(this.options.allowReserved!=="never"),Zt.computed=!!nn,Vt&&(Zt.optional=Ft),z=this.finishNode(Zt,"MemberExpression")}else if(!Ue&&this.eat(V.parenL)){var _n=new hn,Gn=this.yieldPos,rr=this.awaitPos,Yn=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var gr=this.parseExprList(V.parenR,this.options.ecmaVersion>=8,!1,_n);if(Qe&&!Ft&&this.shouldParseAsyncArrow())return this.checkPatternErrors(_n,!1),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=Gn,this.awaitPos=rr,this.awaitIdentPos=Yn,this.parseSubscriptAsyncArrow(ge,Fe,gr,pt);this.checkExpressionErrors(_n,!0),this.yieldPos=Gn||this.yieldPos,this.awaitPos=rr||this.awaitPos,this.awaitIdentPos=Yn||this.awaitIdentPos;var Jn=this.startNodeAt(ge,Fe);Jn.callee=z,Jn.arguments=gr,Vt&&(Jn.optional=Ft),z=this.finishNode(Jn,"CallExpression")}else if(this.type===V.backQuote){(Ft||ut)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var Xn=this.startNodeAt(ge,Fe);Xn.tag=z,Xn.quasi=this.parseTemplate({isTagged:!0}),z=this.finishNode(Xn,"TaggedTemplateExpression")}return z},Yt.parseExprAtom=function(z,ge,Fe){this.type===V.slash&&this.readRegexp();var Ue,Qe=this.potentialArrowAt===this.start;switch(this.type){case V._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),Ue=this.startNode(),this.next(),this.type===V.parenL&&!this.allowDirectSuper&&this.raise(Ue.start,"super() call outside constructor of a subclass"),this.type!==V.dot&&this.type!==V.bracketL&&this.type!==V.parenL&&this.unexpected(),this.finishNode(Ue,"Super");case V._this:return Ue=this.startNode(),this.next(),this.finishNode(Ue,"ThisExpression");case V.name:var ut=this.start,pt=this.startLoc,Vt=this.containsEsc,Ft=this.parseIdent(!1);if(this.options.ecmaVersion>=8&&!Vt&&Ft.name==="async"&&!this.canInsertSemicolon()&&this.eat(V._function))return this.overrideContext(Ut.f_expr),this.parseFunction(this.startNodeAt(ut,pt),0,!1,!0,ge);if(Qe&&!this.canInsertSemicolon()){if(this.eat(V.arrow))return this.parseArrowExpression(this.startNodeAt(ut,pt),[Ft],!1,ge);if(this.options.ecmaVersion>=8&&Ft.name==="async"&&this.type===V.name&&!Vt&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return Ft=this.parseIdent(!1),(this.canInsertSemicolon()||!this.eat(V.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(ut,pt),[Ft],!0,ge)}return Ft;case V.regexp:var nn=this.value;return Ue=this.parseLiteral(nn.value),Ue.regex={pattern:nn.pattern,flags:nn.flags},Ue;case V.num:case V.string:return this.parseLiteral(this.value);case V._null:case V._true:case V._false:return Ue=this.startNode(),Ue.value=this.type===V._null?null:this.type===V._true,Ue.raw=this.type.keyword,this.next(),this.finishNode(Ue,"Literal");case V.parenL:var Zt=this.start,_n=this.parseParenAndDistinguishExpression(Qe,ge);return z&&(z.parenthesizedAssign<0&&!this.isSimpleAssignTarget(_n)&&(z.parenthesizedAssign=Zt),z.parenthesizedBind<0&&(z.parenthesizedBind=Zt)),_n;case V.bracketL:return Ue=this.startNode(),this.next(),Ue.elements=this.parseExprList(V.bracketR,!0,!0,z),this.finishNode(Ue,"ArrayExpression");case V.braceL:return this.overrideContext(Ut.b_expr),this.parseObj(!1,z);case V._function:return Ue=this.startNode(),this.next(),this.parseFunction(Ue,0);case V._class:return this.parseClass(this.startNode(),!1);case V._new:return this.parseNew();case V.backQuote:return this.parseTemplate();case V._import:return this.options.ecmaVersion>=11?this.parseExprImport(Fe):this.unexpected();default:return this.parseExprAtomDefault()}},Yt.parseExprAtomDefault=function(){this.unexpected()},Yt.parseExprImport=function(z){var ge=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===V.parenL&&!z)return this.parseDynamicImport(ge);if(this.type===V.dot){var Fe=this.startNodeAt(ge.start,ge.loc&&ge.loc.start);return Fe.name="import",ge.meta=this.finishNode(Fe,"Identifier"),this.parseImportMeta(ge)}else this.unexpected()},Yt.parseDynamicImport=function(z){if(this.next(),z.source=this.parseMaybeAssign(),!this.eat(V.parenR)){var ge=this.start;this.eat(V.comma)&&this.eat(V.parenR)?this.raiseRecoverable(ge,"Trailing comma is not allowed in import()"):this.unexpected(ge)}return this.finishNode(z,"ImportExpression")},Yt.parseImportMeta=function(z){this.next();var ge=this.containsEsc;return z.property=this.parseIdent(!0),z.property.name!=="meta"&&this.raiseRecoverable(z.property.start,"The only valid meta property for import is 'import.meta'"),ge&&this.raiseRecoverable(z.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(z.start,"Cannot use 'import.meta' outside a module"),this.finishNode(z,"MetaProperty")},Yt.parseLiteral=function(z){var ge=this.startNode();return ge.value=z,ge.raw=this.input.slice(this.start,this.end),ge.raw.charCodeAt(ge.raw.length-1)===110&&(ge.bigint=ge.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(ge,"Literal")},Yt.parseParenExpression=function(){this.expect(V.parenL);var z=this.parseExpression();return this.expect(V.parenR),z},Yt.shouldParseArrow=function(z){return!this.canInsertSemicolon()},Yt.parseParenAndDistinguishExpression=function(z,ge){var Fe=this.start,Ue=this.startLoc,Qe,ut=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var pt=this.start,Vt=this.startLoc,Ft=[],nn=!0,Zt=!1,_n=new hn,Gn=this.yieldPos,rr=this.awaitPos,Yn;for(this.yieldPos=0,this.awaitPos=0;this.type!==V.parenR;)if(nn?nn=!1:this.expect(V.comma),ut&&this.afterTrailingComma(V.parenR,!0)){Zt=!0;break}else if(this.type===V.ellipsis){Yn=this.start,Ft.push(this.parseParenItem(this.parseRestBinding())),this.type===V.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else Ft.push(this.parseMaybeAssign(!1,_n,this.parseParenItem));var gr=this.lastTokEnd,Jn=this.lastTokEndLoc;if(this.expect(V.parenR),z&&this.shouldParseArrow(Ft)&&this.eat(V.arrow))return this.checkPatternErrors(_n,!1),this.checkYieldAwaitInDefaultParams(),this.yieldPos=Gn,this.awaitPos=rr,this.parseParenArrowList(Fe,Ue,Ft,ge);(!Ft.length||Zt)&&this.unexpected(this.lastTokStart),Yn&&this.unexpected(Yn),this.checkExpressionErrors(_n,!0),this.yieldPos=Gn||this.yieldPos,this.awaitPos=rr||this.awaitPos,Ft.length>1?(Qe=this.startNodeAt(pt,Vt),Qe.expressions=Ft,this.finishNodeAt(Qe,"SequenceExpression",gr,Jn)):Qe=Ft[0]}else Qe=this.parseParenExpression();if(this.options.preserveParens){var Xn=this.startNodeAt(Fe,Ue);return Xn.expression=Qe,this.finishNode(Xn,"ParenthesizedExpression")}else return Qe},Yt.parseParenItem=function(z){return z},Yt.parseParenArrowList=function(z,ge,Fe,Ue){return this.parseArrowExpression(this.startNodeAt(z,ge),Fe,!1,Ue)};var On=[];Yt.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var z=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===V.dot){var ge=this.startNodeAt(z.start,z.loc&&z.loc.start);ge.name="new",z.meta=this.finishNode(ge,"Identifier"),this.next();var Fe=this.containsEsc;return z.property=this.parseIdent(!0),z.property.name!=="target"&&this.raiseRecoverable(z.property.start,"The only valid meta property for new is 'new.target'"),Fe&&this.raiseRecoverable(z.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(z.start,"'new.target' can only be used in functions and class static block"),this.finishNode(z,"MetaProperty")}var Ue=this.start,Qe=this.startLoc;return z.callee=this.parseSubscripts(this.parseExprAtom(null,!1,!0),Ue,Qe,!0,!1),this.eat(V.parenL)?z.arguments=this.parseExprList(V.parenR,this.options.ecmaVersion>=8,!1):z.arguments=On,this.finishNode(z,"NewExpression")},Yt.parseTemplateElement=function(z){var ge=z.isTagged,Fe=this.startNode();return this.type===V.invalidTemplate?(ge||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),Fe.value={raw:this.value.replace(/\r\n?/g,`
|
|
1225
1225
|
`),cooked:null}):Fe.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
|
|
1226
|
-
`),cooked:this.value},this.next(),Fe.tail=this.type===V.backQuote,this.finishNode(Fe,"TemplateElement")},Yt.parseTemplate=function(z){z===void 0&&(z={});var ge=z.isTagged;ge===void 0&&(ge=!1);var Fe=this.startNode();this.next(),Fe.expressions=[];var Ue=this.parseTemplateElement({isTagged:ge});for(Fe.quasis=[Ue];!Ue.tail;)this.type===V.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(V.dollarBraceL),Fe.expressions.push(this.parseExpression()),this.expect(V.braceR),Fe.quasis.push(Ue=this.parseTemplateElement({isTagged:ge}));return this.next(),this.finishNode(Fe,"TemplateLiteral")},Yt.isAsyncProp=function(z){return!z.computed&&z.key.type==="Identifier"&&z.key.name==="async"&&(this.type===V.name||this.type===V.num||this.type===V.string||this.type===V.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===V.star)&&!ne.test(this.input.slice(this.lastTokEnd,this.start))},Yt.parseObj=function(z,ge){var Fe=this.startNode(),Ue=!0,Qe={};for(Fe.properties=[],this.next();!this.eat(V.braceR);){if(Ue)Ue=!1;else if(this.expect(V.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(V.braceR))break;var ut=this.parseProperty(z,ge);z||this.checkPropClash(ut,Qe,ge),Fe.properties.push(ut)}return this.finishNode(Fe,z?"ObjectPattern":"ObjectExpression")},Yt.parseProperty=function(z,ge){var Fe=this.startNode(),Ue,Qe,ut,pt;if(this.options.ecmaVersion>=9&&this.eat(V.ellipsis))return z?(Fe.argument=this.parseIdent(!1),this.type===V.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(Fe,"RestElement")):(Fe.argument=this.parseMaybeAssign(!1,ge),this.type===V.comma&&ge&&ge.trailingComma<0&&(ge.trailingComma=this.start),this.finishNode(Fe,"SpreadElement"));this.options.ecmaVersion>=6&&(Fe.method=!1,Fe.shorthand=!1,(z||ge)&&(ut=this.start,pt=this.startLoc),z||(Ue=this.eat(V.star)));var Vt=this.containsEsc;return this.parsePropertyName(Fe),!z&&!Vt&&this.options.ecmaVersion>=8&&!Ue&&this.isAsyncProp(Fe)?(Qe=!0,Ue=this.options.ecmaVersion>=9&&this.eat(V.star),this.parsePropertyName(Fe)):Qe=!1,this.parsePropertyValue(Fe,z,Ue,Qe,ut,pt,ge,Vt),this.finishNode(Fe,"Property")},Yt.parseGetterSetter=function(z){z.kind=z.key.name,this.parsePropertyName(z),z.value=this.parseMethod(!1);var ge=z.kind==="get"?0:1;if(z.value.params.length!==ge){var Fe=z.value.start;z.kind==="get"?this.raiseRecoverable(Fe,"getter should have no params"):this.raiseRecoverable(Fe,"setter should have exactly one param")}else z.kind==="set"&&z.value.params[0].type==="RestElement"&&this.raiseRecoverable(z.value.params[0].start,"Setter cannot use rest params")},Yt.parsePropertyValue=function(z,ge,Fe,Ue,Qe,ut,pt,Vt){(Fe||Ue)&&this.type===V.colon&&this.unexpected(),this.eat(V.colon)?(z.value=ge?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,pt),z.kind="init"):this.options.ecmaVersion>=6&&this.type===V.parenL?(ge&&this.unexpected(),z.kind="init",z.method=!0,z.value=this.parseMethod(Fe,Ue)):!ge&&!Vt&&this.options.ecmaVersion>=5&&!z.computed&&z.key.type==="Identifier"&&(z.key.name==="get"||z.key.name==="set")&&this.type!==V.comma&&this.type!==V.braceR&&this.type!==V.eq?((Fe||Ue)&&this.unexpected(),this.parseGetterSetter(z)):this.options.ecmaVersion>=6&&!z.computed&&z.key.type==="Identifier"?((Fe||Ue)&&this.unexpected(),this.checkUnreserved(z.key),z.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=Qe),z.kind="init",ge?z.value=this.parseMaybeDefault(Qe,ut,this.copyNode(z.key)):this.type===V.eq&&pt?(pt.shorthandAssign<0&&(pt.shorthandAssign=this.start),z.value=this.parseMaybeDefault(Qe,ut,this.copyNode(z.key))):z.value=this.copyNode(z.key),z.shorthand=!0):this.unexpected()},Yt.parsePropertyName=function(z){if(this.options.ecmaVersion>=6){if(this.eat(V.bracketL))return z.computed=!0,z.key=this.parseMaybeAssign(),this.expect(V.bracketR),z.key;z.computed=!1}return z.key=this.type===V.num||this.type===V.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},Yt.initFunction=function(z){z.id=null,this.options.ecmaVersion>=6&&(z.generator=z.expression=!1),this.options.ecmaVersion>=8&&(z.async=!1)},Yt.parseMethod=function(z,ge,Fe){var Ue=this.startNode(),Qe=this.yieldPos,ut=this.awaitPos,pt=this.awaitIdentPos;return this.initFunction(Ue),this.options.ecmaVersion>=6&&(Ue.generator=z),this.options.ecmaVersion>=8&&(Ue.async=!!ge),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ct(ge,Ue.generator)|Rt|(Fe?dt:0)),this.expect(V.parenL),Ue.params=this.parseBindingList(V.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Ue,!1,!0,!1),this.yieldPos=Qe,this.awaitPos=ut,this.awaitIdentPos=pt,this.finishNode(Ue,"FunctionExpression")},Yt.parseArrowExpression=function(z,ge,Fe,Ue){var Qe=this.yieldPos,ut=this.awaitPos,pt=this.awaitIdentPos;return this.enterScope(Ct(Fe,!1)|$t),this.initFunction(z),this.options.ecmaVersion>=8&&(z.async=!!Fe),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,z.params=this.toAssignableList(ge,!0),this.parseFunctionBody(z,!0,!1,Ue),this.yieldPos=Qe,this.awaitPos=ut,this.awaitIdentPos=pt,this.finishNode(z,"ArrowFunctionExpression")},Yt.parseFunctionBody=function(z,ge,Fe,Ue){var Qe=ge&&this.type!==V.braceL,ut=this.strict,pt=!1;if(Qe)z.body=this.parseMaybeAssign(Ue),z.expression=!0,this.checkParams(z,!1);else{var Vt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(z.params);(!ut||Vt)&&(pt=this.strictDirective(this.end),pt&&Vt&&this.raiseRecoverable(z.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var Ft=this.labels;this.labels=[],pt&&(this.strict=!0),this.checkParams(z,!ut&&!pt&&!ge&&!Fe&&this.isSimpleParamList(z.params)),this.strict&&z.id&&this.checkLValSimple(z.id,ft),z.body=this.parseBlock(!1,void 0,pt&&!ut),z.expression=!1,this.adaptDirectivePrologue(z.body.body),this.labels=Ft}this.exitScope()},Yt.isSimpleParamList=function(z){for(var ge=0,Fe=z;ge<Fe.length;ge+=1){var Ue=Fe[ge];if(Ue.type!=="Identifier")return!1}return!0},Yt.checkParams=function(z,ge){for(var Fe=Object.create(null),Ue=0,Qe=z.params;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.checkLValInnerPattern(ut,Ye,ge?null:Fe)}},Yt.parseExprList=function(z,ge,Fe,Ue){for(var Qe=[],ut=!0;!this.eat(z);){if(ut)ut=!1;else if(this.expect(V.comma),ge&&this.afterTrailingComma(z))break;var pt=void 0;Fe&&this.type===V.comma?pt=null:this.type===V.ellipsis?(pt=this.parseSpread(Ue),Ue&&this.type===V.comma&&Ue.trailingComma<0&&(Ue.trailingComma=this.start)):pt=this.parseMaybeAssign(!1,Ue),Qe.push(pt)}return Qe},Yt.checkUnreserved=function(z){var ge=z.start,Fe=z.end,Ue=z.name;if(this.inGenerator&&Ue==="yield"&&this.raiseRecoverable(ge,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&Ue==="await"&&this.raiseRecoverable(ge,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&Ue==="arguments"&&this.raiseRecoverable(ge,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(Ue==="arguments"||Ue==="await")&&this.raise(ge,"Cannot use "+Ue+" in class static initialization block"),this.keywords.test(Ue)&&this.raise(ge,"Unexpected keyword '"+Ue+"'"),!(this.options.ecmaVersion<6&&this.input.slice(ge,Fe).indexOf("\\")!==-1)){var Qe=this.strict?this.reservedWordsStrict:this.reservedWords;Qe.test(Ue)&&(!this.inAsync&&Ue==="await"&&this.raiseRecoverable(ge,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(ge,"The keyword '"+Ue+"' is reserved"))}},Yt.parseIdent=function(z){var ge=this.parseIdentNode();return this.next(!!z),this.finishNode(ge,"Identifier"),z||(this.checkUnreserved(ge),ge.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=ge.start)),ge},Yt.parseIdentNode=function(){var z=this.startNode();return this.type===V.name?z.name=this.value:this.type.keyword?(z.name=this.type.keyword,(z.name==="class"||z.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=V.name):this.unexpected(),z},Yt.parsePrivateIdent=function(){var z=this.startNode();return this.type===V.privateId?z.name=this.value:this.unexpected(),this.next(),this.finishNode(z,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(z.start,"Private field '#"+z.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(z)),z},Yt.parseYield=function(z){this.yieldPos||(this.yieldPos=this.start);var ge=this.startNode();return this.next(),this.type===V.semi||this.canInsertSemicolon()||this.type!==V.star&&!this.type.startsExpr?(ge.delegate=!1,ge.argument=null):(ge.delegate=this.eat(V.star),ge.argument=this.parseMaybeAssign(z)),this.finishNode(ge,"YieldExpression")},Yt.parseAwait=function(z){this.awaitPos||(this.awaitPos=this.start);var ge=this.startNode();return this.next(),ge.argument=this.parseMaybeUnary(null,!0,!1,z),this.finishNode(ge,"AwaitExpression")};var Fn=yt.prototype;Fn.raise=function(z,ge){var Fe=nt(this.input,z);ge+=" ("+Fe.line+":"+Fe.column+")";var Ue=new SyntaxError(ge);throw Ue.pos=z,Ue.loc=Fe,Ue.raisedAt=this.pos,Ue},Fn.raiseRecoverable=Fn.raise,Fn.curPosition=function(){if(this.options.locations)return new ze(this.curLine,this.pos-this.lineStart)};var Cn=yt.prototype,Bn=function(ge){this.flags=ge,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};Cn.enterScope=function(z){this.scopeStack.push(new Bn(z))},Cn.exitScope=function(){this.scopeStack.pop()},Cn.treatFunctionsAsVarInScope=function(z){return z.flags&ot||!this.inModule&&z.flags&tt},Cn.declareName=function(z,ge,Fe){var Ue=!1;if(ge===Ze){var Qe=this.currentScope();Ue=Qe.lexical.indexOf(z)>-1||Qe.functions.indexOf(z)>-1||Qe.var.indexOf(z)>-1,Qe.lexical.push(z),this.inModule&&Qe.flags&tt&&delete this.undefinedExports[z]}else if(ge===mt){var ut=this.currentScope();ut.lexical.push(z)}else if(ge===ct){var pt=this.currentScope();this.treatFunctionsAsVar?Ue=pt.lexical.indexOf(z)>-1:Ue=pt.lexical.indexOf(z)>-1||pt.var.indexOf(z)>-1,pt.functions.push(z)}else for(var Vt=this.scopeStack.length-1;Vt>=0;--Vt){var Ft=this.scopeStack[Vt];if(Ft.lexical.indexOf(z)>-1&&!(Ft.flags&rt&&Ft.lexical[0]===z)||!this.treatFunctionsAsVarInScope(Ft)&&Ft.functions.indexOf(z)>-1){Ue=!0;break}if(Ft.var.push(z),this.inModule&&Ft.flags&tt&&delete this.undefinedExports[z],Ft.flags&Mt)break}Ue&&this.raiseRecoverable(Fe,"Identifier '"+z+"' has already been declared")},Cn.checkLocalExport=function(z){this.scopeStack[0].lexical.indexOf(z.name)===-1&&this.scopeStack[0].var.indexOf(z.name)===-1&&(this.undefinedExports[z.name]=z)},Cn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Cn.currentVarScope=function(){for(var z=this.scopeStack.length-1;;z--){var ge=this.scopeStack[z];if(ge.flags&Mt)return ge}},Cn.currentThisScope=function(){for(var z=this.scopeStack.length-1;;z--){var ge=this.scopeStack[z];if(ge.flags&Mt&&!(ge.flags&$t))return ge}};var qn=function(ge,Fe,Ue){this.type="",this.start=Fe,this.end=0,ge.options.locations&&(this.loc=new Xe(ge,Ue)),ge.options.directSourceFile&&(this.sourceFile=ge.options.directSourceFile),ge.options.ranges&&(this.range=[Fe,0])},Un=yt.prototype;Un.startNode=function(){return new qn(this,this.start,this.startLoc)},Un.startNodeAt=function(z,ge){return new qn(this,z,ge)};function sr(z,ge,Fe,Ue){return z.type=ge,z.end=Fe,this.options.locations&&(z.loc.end=Ue),this.options.ranges&&(z.range[1]=Fe),z}Un.finishNode=function(z,ge){return sr.call(this,z,ge,this.lastTokEnd,this.lastTokEndLoc)},Un.finishNodeAt=function(z,ge,Fe,Ue){return sr.call(this,z,ge,Fe,Ue)},Un.copyNode=function(z){var ge=new qn(this,z.start,this.startLoc);for(var Fe in z)ge[Fe]=z[Fe];return ge};var wn="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Dn=wn+" Extended_Pictographic",Zn=Dn,er=Zn+" EBase EComp EMod EPres ExtPict",Kn=er,or=Kn,kn={9:wn,10:Dn,11:Zn,12:er,13:Kn,14:or},lr="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",cr={9:"",10:"",11:"",12:"",13:"",14:lr},tr="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",nr="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ur=nr+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Xt=ur+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",it=Xt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Dt=it+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Wt=Dt+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",pn={9:nr,10:ur,11:Xt,12:it,13:Dt,14:Wt},bn={};function gn(z){var ge=bn[z]={binary:Le(kn[z]+" "+tr),binaryOfStrings:Le(cr[z]),nonBinary:{General_Category:Le(tr),Script:Le(pn[z])}};ge.nonBinary.Script_Extensions=ge.nonBinary.Script,ge.nonBinary.gc=ge.nonBinary.General_Category,ge.nonBinary.sc=ge.nonBinary.Script,ge.nonBinary.scx=ge.nonBinary.Script_Extensions}for(var Sn=0,In=[9,10,11,12,13,14];Sn<In.length;Sn+=1){var Hn=In[Sn];gn(Hn)}var zt=yt.prototype,yn=function(ge,Fe){this.parent=ge,this.base=Fe||this};yn.prototype.separatedFrom=function(ge){for(var Fe=this;Fe;Fe=Fe.parent)for(var Ue=ge;Ue;Ue=Ue.parent)if(Fe.base===Ue.base&&Fe!==Ue)return!0;return!1},yn.prototype.sibling=function(){return new yn(this.parent,this.base)};var En=function(ge){this.parser=ge,this.validFlags="gim"+(ge.options.ecmaVersion>=6?"uy":"")+(ge.options.ecmaVersion>=9?"s":"")+(ge.options.ecmaVersion>=13?"d":"")+(ge.options.ecmaVersion>=15?"v":""),this.unicodeProperties=bn[ge.options.ecmaVersion>=14?14:ge.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};En.prototype.reset=function(ge,Fe,Ue){var Qe=Ue.indexOf("v")!==-1,ut=Ue.indexOf("u")!==-1;this.start=ge|0,this.source=Fe+"",this.flags=Ue,Qe&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=ut&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=ut&&this.parser.options.ecmaVersion>=9)},En.prototype.raise=function(ge){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+ge)},En.prototype.at=function(ge,Fe){Fe===void 0&&(Fe=!1);var Ue=this.source,Qe=Ue.length;if(ge>=Qe)return-1;var ut=Ue.charCodeAt(ge);if(!(Fe||this.switchU)||ut<=55295||ut>=57344||ge+1>=Qe)return ut;var pt=Ue.charCodeAt(ge+1);return pt>=56320&&pt<=57343?(ut<<10)+pt-56613888:ut},En.prototype.nextIndex=function(ge,Fe){Fe===void 0&&(Fe=!1);var Ue=this.source,Qe=Ue.length;if(ge>=Qe)return Qe;var ut=Ue.charCodeAt(ge),pt;return!(Fe||this.switchU)||ut<=55295||ut>=57344||ge+1>=Qe||(pt=Ue.charCodeAt(ge+1))<56320||pt>57343?ge+1:ge+2},En.prototype.current=function(ge){return ge===void 0&&(ge=!1),this.at(this.pos,ge)},En.prototype.lookahead=function(ge){return ge===void 0&&(ge=!1),this.at(this.nextIndex(this.pos,ge),ge)},En.prototype.advance=function(ge){ge===void 0&&(ge=!1),this.pos=this.nextIndex(this.pos,ge)},En.prototype.eat=function(ge,Fe){return Fe===void 0&&(Fe=!1),this.current(Fe)===ge?(this.advance(Fe),!0):!1},En.prototype.eatChars=function(ge,Fe){Fe===void 0&&(Fe=!1);for(var Ue=this.pos,Qe=0,ut=ge;Qe<ut.length;Qe+=1){var pt=ut[Qe],Vt=this.at(Ue,Fe);if(Vt===-1||Vt!==pt)return!1;Ue=this.nextIndex(Ue,Fe)}return this.pos=Ue,!0},zt.validateRegExpFlags=function(z){for(var ge=z.validFlags,Fe=z.flags,Ue=!1,Qe=!1,ut=0;ut<Fe.length;ut++){var pt=Fe.charAt(ut);ge.indexOf(pt)===-1&&this.raise(z.start,"Invalid regular expression flag"),Fe.indexOf(pt,ut+1)>-1&&this.raise(z.start,"Duplicate regular expression flag"),pt==="u"&&(Ue=!0),pt==="v"&&(Qe=!0)}this.options.ecmaVersion>=15&&Ue&&Qe&&this.raise(z.start,"Invalid regular expression flag")};function dr(z){for(var ge in z)return!0;return!1}zt.validateRegExpPattern=function(z){this.regexp_pattern(z),!z.switchN&&this.options.ecmaVersion>=9&&dr(z.groupNames)&&(z.switchN=!0,this.regexp_pattern(z))},zt.regexp_pattern=function(z){z.pos=0,z.lastIntValue=0,z.lastStringValue="",z.lastAssertionIsQuantifiable=!1,z.numCapturingParens=0,z.maxBackReference=0,z.groupNames=Object.create(null),z.backReferenceNames.length=0,z.branchID=null,this.regexp_disjunction(z),z.pos!==z.source.length&&(z.eat(41)&&z.raise("Unmatched ')'"),(z.eat(93)||z.eat(125))&&z.raise("Lone quantifier brackets")),z.maxBackReference>z.numCapturingParens&&z.raise("Invalid escape");for(var ge=0,Fe=z.backReferenceNames;ge<Fe.length;ge+=1){var Ue=Fe[ge];z.groupNames[Ue]||z.raise("Invalid named capture referenced")}},zt.regexp_disjunction=function(z){var ge=this.options.ecmaVersion>=16;for(ge&&(z.branchID=new yn(z.branchID,null)),this.regexp_alternative(z);z.eat(124);)ge&&(z.branchID=z.branchID.sibling()),this.regexp_alternative(z);ge&&(z.branchID=z.branchID.parent),this.regexp_eatQuantifier(z,!0)&&z.raise("Nothing to repeat"),z.eat(123)&&z.raise("Lone quantifier brackets")},zt.regexp_alternative=function(z){for(;z.pos<z.source.length&&this.regexp_eatTerm(z););},zt.regexp_eatTerm=function(z){return this.regexp_eatAssertion(z)?(z.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(z)&&z.switchU&&z.raise("Invalid quantifier"),!0):(z.switchU?this.regexp_eatAtom(z):this.regexp_eatExtendedAtom(z))?(this.regexp_eatQuantifier(z),!0):!1},zt.regexp_eatAssertion=function(z){var ge=z.pos;if(z.lastAssertionIsQuantifiable=!1,z.eat(94)||z.eat(36))return!0;if(z.eat(92)){if(z.eat(66)||z.eat(98))return!0;z.pos=ge}if(z.eat(40)&&z.eat(63)){var Fe=!1;if(this.options.ecmaVersion>=9&&(Fe=z.eat(60)),z.eat(61)||z.eat(33))return this.regexp_disjunction(z),z.eat(41)||z.raise("Unterminated group"),z.lastAssertionIsQuantifiable=!Fe,!0}return z.pos=ge,!1},zt.regexp_eatQuantifier=function(z,ge){return ge===void 0&&(ge=!1),this.regexp_eatQuantifierPrefix(z,ge)?(z.eat(63),!0):!1},zt.regexp_eatQuantifierPrefix=function(z,ge){return z.eat(42)||z.eat(43)||z.eat(63)||this.regexp_eatBracedQuantifier(z,ge)},zt.regexp_eatBracedQuantifier=function(z,ge){var Fe=z.pos;if(z.eat(123)){var Ue=0,Qe=-1;if(this.regexp_eatDecimalDigits(z)&&(Ue=z.lastIntValue,z.eat(44)&&this.regexp_eatDecimalDigits(z)&&(Qe=z.lastIntValue),z.eat(125)))return Qe!==-1&&Qe<Ue&&!ge&&z.raise("numbers out of order in {} quantifier"),!0;z.switchU&&!ge&&z.raise("Incomplete quantifier"),z.pos=Fe}return!1},zt.regexp_eatAtom=function(z){return this.regexp_eatPatternCharacters(z)||z.eat(46)||this.regexp_eatReverseSolidusAtomEscape(z)||this.regexp_eatCharacterClass(z)||this.regexp_eatUncapturingGroup(z)||this.regexp_eatCapturingGroup(z)},zt.regexp_eatReverseSolidusAtomEscape=function(z){var ge=z.pos;if(z.eat(92)){if(this.regexp_eatAtomEscape(z))return!0;z.pos=ge}return!1},zt.regexp_eatUncapturingGroup=function(z){var ge=z.pos;if(z.eat(40)){if(z.eat(63)&&z.eat(58)){if(this.regexp_disjunction(z),z.eat(41))return!0;z.raise("Unterminated group")}z.pos=ge}return!1},zt.regexp_eatCapturingGroup=function(z){if(z.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(z):z.current()===63&&z.raise("Invalid group"),this.regexp_disjunction(z),z.eat(41))return z.numCapturingParens+=1,!0;z.raise("Unterminated group")}return!1},zt.regexp_eatExtendedAtom=function(z){return z.eat(46)||this.regexp_eatReverseSolidusAtomEscape(z)||this.regexp_eatCharacterClass(z)||this.regexp_eatUncapturingGroup(z)||this.regexp_eatCapturingGroup(z)||this.regexp_eatInvalidBracedQuantifier(z)||this.regexp_eatExtendedPatternCharacter(z)},zt.regexp_eatInvalidBracedQuantifier=function(z){return this.regexp_eatBracedQuantifier(z,!0)&&z.raise("Nothing to repeat"),!1},zt.regexp_eatSyntaxCharacter=function(z){var ge=z.current();return Rr(ge)?(z.lastIntValue=ge,z.advance(),!0):!1};function Rr(z){return z===36||z>=40&&z<=43||z===46||z===63||z>=91&&z<=94||z>=123&&z<=125}zt.regexp_eatPatternCharacters=function(z){for(var ge=z.pos,Fe=0;(Fe=z.current())!==-1&&!Rr(Fe);)z.advance();return z.pos!==ge},zt.regexp_eatExtendedPatternCharacter=function(z){var ge=z.current();return ge!==-1&&ge!==36&&!(ge>=40&&ge<=43)&&ge!==46&&ge!==63&&ge!==91&&ge!==94&&ge!==124?(z.advance(),!0):!1},zt.regexp_groupSpecifier=function(z){if(z.eat(63)){this.regexp_eatGroupName(z)||z.raise("Invalid group");var ge=this.options.ecmaVersion>=16,Fe=z.groupNames[z.lastStringValue];if(Fe)if(ge)for(var Ue=0,Qe=Fe;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];ut.separatedFrom(z.branchID)||z.raise("Duplicate capture group name")}else z.raise("Duplicate capture group name");ge?(Fe||(z.groupNames[z.lastStringValue]=[])).push(z.branchID):z.groupNames[z.lastStringValue]=!0}},zt.regexp_eatGroupName=function(z){if(z.lastStringValue="",z.eat(60)){if(this.regexp_eatRegExpIdentifierName(z)&&z.eat(62))return!0;z.raise("Invalid capture group name")}return!1},zt.regexp_eatRegExpIdentifierName=function(z){if(z.lastStringValue="",this.regexp_eatRegExpIdentifierStart(z)){for(z.lastStringValue+=He(z.lastIntValue);this.regexp_eatRegExpIdentifierPart(z);)z.lastStringValue+=He(z.lastIntValue);return!0}return!1},zt.regexp_eatRegExpIdentifierStart=function(z){var ge=z.pos,Fe=this.options.ecmaVersion>=11,Ue=z.current(Fe);return z.advance(Fe),Ue===92&&this.regexp_eatRegExpUnicodeEscapeSequence(z,Fe)&&(Ue=z.lastIntValue),Dr(Ue)?(z.lastIntValue=Ue,!0):(z.pos=ge,!1)};function Dr(z){return A(z,!0)||z===36||z===95}zt.regexp_eatRegExpIdentifierPart=function(z){var ge=z.pos,Fe=this.options.ecmaVersion>=11,Ue=z.current(Fe);return z.advance(Fe),Ue===92&&this.regexp_eatRegExpUnicodeEscapeSequence(z,Fe)&&(Ue=z.lastIntValue),Vr(Ue)?(z.lastIntValue=Ue,!0):(z.pos=ge,!1)};function Vr(z){return M(z,!0)||z===36||z===95||z===8204||z===8205}zt.regexp_eatAtomEscape=function(z){return this.regexp_eatBackReference(z)||this.regexp_eatCharacterClassEscape(z)||this.regexp_eatCharacterEscape(z)||z.switchN&&this.regexp_eatKGroupName(z)?!0:(z.switchU&&(z.current()===99&&z.raise("Invalid unicode escape"),z.raise("Invalid escape")),!1)},zt.regexp_eatBackReference=function(z){var ge=z.pos;if(this.regexp_eatDecimalEscape(z)){var Fe=z.lastIntValue;if(z.switchU)return Fe>z.maxBackReference&&(z.maxBackReference=Fe),!0;if(Fe<=z.numCapturingParens)return!0;z.pos=ge}return!1},zt.regexp_eatKGroupName=function(z){if(z.eat(107)){if(this.regexp_eatGroupName(z))return z.backReferenceNames.push(z.lastStringValue),!0;z.raise("Invalid named reference")}return!1},zt.regexp_eatCharacterEscape=function(z){return this.regexp_eatControlEscape(z)||this.regexp_eatCControlLetter(z)||this.regexp_eatZero(z)||this.regexp_eatHexEscapeSequence(z)||this.regexp_eatRegExpUnicodeEscapeSequence(z,!1)||!z.switchU&&this.regexp_eatLegacyOctalEscapeSequence(z)||this.regexp_eatIdentityEscape(z)},zt.regexp_eatCControlLetter=function(z){var ge=z.pos;if(z.eat(99)){if(this.regexp_eatControlLetter(z))return!0;z.pos=ge}return!1},zt.regexp_eatZero=function(z){return z.current()===48&&!pr(z.lookahead())?(z.lastIntValue=0,z.advance(),!0):!1},zt.regexp_eatControlEscape=function(z){var ge=z.current();return ge===116?(z.lastIntValue=9,z.advance(),!0):ge===110?(z.lastIntValue=10,z.advance(),!0):ge===118?(z.lastIntValue=11,z.advance(),!0):ge===102?(z.lastIntValue=12,z.advance(),!0):ge===114?(z.lastIntValue=13,z.advance(),!0):!1},zt.regexp_eatControlLetter=function(z){var ge=z.current();return Pr(ge)?(z.lastIntValue=ge%32,z.advance(),!0):!1};function Pr(z){return z>=65&&z<=90||z>=97&&z<=122}zt.regexp_eatRegExpUnicodeEscapeSequence=function(z,ge){ge===void 0&&(ge=!1);var Fe=z.pos,Ue=ge||z.switchU;if(z.eat(117)){if(this.regexp_eatFixedHexDigits(z,4)){var Qe=z.lastIntValue;if(Ue&&Qe>=55296&&Qe<=56319){var ut=z.pos;if(z.eat(92)&&z.eat(117)&&this.regexp_eatFixedHexDigits(z,4)){var pt=z.lastIntValue;if(pt>=56320&&pt<=57343)return z.lastIntValue=(Qe-55296)*1024+(pt-56320)+65536,!0}z.pos=ut,z.lastIntValue=Qe}return!0}if(Ue&&z.eat(123)&&this.regexp_eatHexDigits(z)&&z.eat(125)&&Br(z.lastIntValue))return!0;Ue&&z.raise("Invalid unicode escape"),z.pos=Fe}return!1};function Br(z){return z>=0&&z<=1114111}zt.regexp_eatIdentityEscape=function(z){if(z.switchU)return this.regexp_eatSyntaxCharacter(z)?!0:z.eat(47)?(z.lastIntValue=47,!0):!1;var ge=z.current();return ge!==99&&(!z.switchN||ge!==107)?(z.lastIntValue=ge,z.advance(),!0):!1},zt.regexp_eatDecimalEscape=function(z){z.lastIntValue=0;var ge=z.current();if(ge>=49&&ge<=57){do z.lastIntValue=10*z.lastIntValue+(ge-48),z.advance();while((ge=z.current())>=48&&ge<=57);return!0}return!1};var Cr=0,Ln=1,Nn=2;zt.regexp_eatCharacterClassEscape=function(z){var ge=z.current();if(Lr(ge))return z.lastIntValue=-1,z.advance(),Ln;var Fe=!1;if(z.switchU&&this.options.ecmaVersion>=9&&((Fe=ge===80)||ge===112)){z.lastIntValue=-1,z.advance();var Ue;if(z.eat(123)&&(Ue=this.regexp_eatUnicodePropertyValueExpression(z))&&z.eat(125))return Fe&&Ue===Nn&&z.raise("Invalid property name"),Ue;z.raise("Invalid property name")}return Cr};function Lr(z){return z===100||z===68||z===115||z===83||z===119||z===87}zt.regexp_eatUnicodePropertyValueExpression=function(z){var ge=z.pos;if(this.regexp_eatUnicodePropertyName(z)&&z.eat(61)){var Fe=z.lastStringValue;if(this.regexp_eatUnicodePropertyValue(z)){var Ue=z.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(z,Fe,Ue),Ln}}if(z.pos=ge,this.regexp_eatLoneUnicodePropertyNameOrValue(z)){var Qe=z.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(z,Qe)}return Cr},zt.regexp_validateUnicodePropertyNameAndValue=function(z,ge,Fe){Be(z.unicodeProperties.nonBinary,ge)||z.raise("Invalid property name"),z.unicodeProperties.nonBinary[ge].test(Fe)||z.raise("Invalid property value")},zt.regexp_validateUnicodePropertyNameOrValue=function(z,ge){if(z.unicodeProperties.binary.test(ge))return Ln;if(z.switchV&&z.unicodeProperties.binaryOfStrings.test(ge))return Nn;z.raise("Invalid property name")},zt.regexp_eatUnicodePropertyName=function(z){var ge=0;for(z.lastStringValue="";wr(ge=z.current());)z.lastStringValue+=He(ge),z.advance();return z.lastStringValue!==""};function wr(z){return Pr(z)||z===95}zt.regexp_eatUnicodePropertyValue=function(z){var ge=0;for(z.lastStringValue="";Fr(ge=z.current());)z.lastStringValue+=He(ge),z.advance();return z.lastStringValue!==""};function Fr(z){return wr(z)||pr(z)}zt.regexp_eatLoneUnicodePropertyNameOrValue=function(z){return this.regexp_eatUnicodePropertyValue(z)},zt.regexp_eatCharacterClass=function(z){if(z.eat(91)){var ge=z.eat(94),Fe=this.regexp_classContents(z);return z.eat(93)||z.raise("Unterminated character class"),ge&&Fe===Nn&&z.raise("Negated character class may contain strings"),!0}return!1},zt.regexp_classContents=function(z){return z.current()===93?Ln:z.switchV?this.regexp_classSetExpression(z):(this.regexp_nonEmptyClassRanges(z),Ln)},zt.regexp_nonEmptyClassRanges=function(z){for(;this.regexp_eatClassAtom(z);){var ge=z.lastIntValue;if(z.eat(45)&&this.regexp_eatClassAtom(z)){var Fe=z.lastIntValue;z.switchU&&(ge===-1||Fe===-1)&&z.raise("Invalid character class"),ge!==-1&&Fe!==-1&&ge>Fe&&z.raise("Range out of order in character class")}}},zt.regexp_eatClassAtom=function(z){var ge=z.pos;if(z.eat(92)){if(this.regexp_eatClassEscape(z))return!0;if(z.switchU){var Fe=z.current();(Fe===99||Ar(Fe))&&z.raise("Invalid class escape"),z.raise("Invalid escape")}z.pos=ge}var Ue=z.current();return Ue!==93?(z.lastIntValue=Ue,z.advance(),!0):!1},zt.regexp_eatClassEscape=function(z){var ge=z.pos;if(z.eat(98))return z.lastIntValue=8,!0;if(z.switchU&&z.eat(45))return z.lastIntValue=45,!0;if(!z.switchU&&z.eat(99)){if(this.regexp_eatClassControlLetter(z))return!0;z.pos=ge}return this.regexp_eatCharacterClassEscape(z)||this.regexp_eatCharacterEscape(z)},zt.regexp_classSetExpression=function(z){var ge=Ln,Fe;if(!this.regexp_eatClassSetRange(z))if(Fe=this.regexp_eatClassSetOperand(z)){Fe===Nn&&(ge=Nn);for(var Ue=z.pos;z.eatChars([38,38]);){if(z.current()!==38&&(Fe=this.regexp_eatClassSetOperand(z))){Fe!==Nn&&(ge=Ln);continue}z.raise("Invalid character in character class")}if(Ue!==z.pos)return ge;for(;z.eatChars([45,45]);)this.regexp_eatClassSetOperand(z)||z.raise("Invalid character in character class");if(Ue!==z.pos)return ge}else z.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(z)){if(Fe=this.regexp_eatClassSetOperand(z),!Fe)return ge;Fe===Nn&&(ge=Nn)}},zt.regexp_eatClassSetRange=function(z){var ge=z.pos;if(this.regexp_eatClassSetCharacter(z)){var Fe=z.lastIntValue;if(z.eat(45)&&this.regexp_eatClassSetCharacter(z)){var Ue=z.lastIntValue;return Fe!==-1&&Ue!==-1&&Fe>Ue&&z.raise("Range out of order in character class"),!0}z.pos=ge}return!1},zt.regexp_eatClassSetOperand=function(z){return this.regexp_eatClassSetCharacter(z)?Ln:this.regexp_eatClassStringDisjunction(z)||this.regexp_eatNestedClass(z)},zt.regexp_eatNestedClass=function(z){var ge=z.pos;if(z.eat(91)){var Fe=z.eat(94),Ue=this.regexp_classContents(z);if(z.eat(93))return Fe&&Ue===Nn&&z.raise("Negated character class may contain strings"),Ue;z.pos=ge}if(z.eat(92)){var Qe=this.regexp_eatCharacterClassEscape(z);if(Qe)return Qe;z.pos=ge}return null},zt.regexp_eatClassStringDisjunction=function(z){var ge=z.pos;if(z.eatChars([92,113])){if(z.eat(123)){var Fe=this.regexp_classStringDisjunctionContents(z);if(z.eat(125))return Fe}else z.raise("Invalid escape");z.pos=ge}return null},zt.regexp_classStringDisjunctionContents=function(z){for(var ge=this.regexp_classString(z);z.eat(124);)this.regexp_classString(z)===Nn&&(ge=Nn);return ge},zt.regexp_classString=function(z){for(var ge=0;this.regexp_eatClassSetCharacter(z);)ge++;return ge===1?Ln:Nn},zt.regexp_eatClassSetCharacter=function(z){var ge=z.pos;if(z.eat(92))return this.regexp_eatCharacterEscape(z)||this.regexp_eatClassSetReservedPunctuator(z)?!0:z.eat(98)?(z.lastIntValue=8,!0):(z.pos=ge,!1);var Fe=z.current();return Fe<0||Fe===z.lookahead()&&qr(Fe)||Ur(Fe)?!1:(z.advance(),z.lastIntValue=Fe,!0)};function qr(z){return z===33||z>=35&&z<=38||z>=42&&z<=44||z===46||z>=58&&z<=64||z===94||z===96||z===126}function Ur(z){return z===40||z===41||z===45||z===47||z>=91&&z<=93||z>=123&&z<=125}zt.regexp_eatClassSetReservedPunctuator=function(z){var ge=z.current();return Hr(ge)?(z.lastIntValue=ge,z.advance(),!0):!1};function Hr(z){return z===33||z===35||z===37||z===38||z===44||z===45||z>=58&&z<=62||z===64||z===96||z===126}zt.regexp_eatClassControlLetter=function(z){var ge=z.current();return pr(ge)||ge===95?(z.lastIntValue=ge%32,z.advance(),!0):!1},zt.regexp_eatHexEscapeSequence=function(z){var ge=z.pos;if(z.eat(120)){if(this.regexp_eatFixedHexDigits(z,2))return!0;z.switchU&&z.raise("Invalid escape"),z.pos=ge}return!1},zt.regexp_eatDecimalDigits=function(z){var ge=z.pos,Fe=0;for(z.lastIntValue=0;pr(Fe=z.current());)z.lastIntValue=10*z.lastIntValue+(Fe-48),z.advance();return z.pos!==ge};function pr(z){return z>=48&&z<=57}zt.regexp_eatHexDigits=function(z){var ge=z.pos,Fe=0;for(z.lastIntValue=0;Er(Fe=z.current());)z.lastIntValue=16*z.lastIntValue+Tr(Fe),z.advance();return z.pos!==ge};function Er(z){return z>=48&&z<=57||z>=65&&z<=70||z>=97&&z<=102}function Tr(z){return z>=65&&z<=70?10+(z-65):z>=97&&z<=102?10+(z-97):z-48}zt.regexp_eatLegacyOctalEscapeSequence=function(z){if(this.regexp_eatOctalDigit(z)){var ge=z.lastIntValue;if(this.regexp_eatOctalDigit(z)){var Fe=z.lastIntValue;ge<=3&&this.regexp_eatOctalDigit(z)?z.lastIntValue=ge*64+Fe*8+z.lastIntValue:z.lastIntValue=ge*8+Fe}else z.lastIntValue=ge;return!0}return!1},zt.regexp_eatOctalDigit=function(z){var ge=z.current();return Ar(ge)?(z.lastIntValue=ge-48,z.advance(),!0):(z.lastIntValue=0,!1)};function Ar(z){return z>=48&&z<=55}zt.regexp_eatFixedHexDigits=function(z,ge){var Fe=z.pos;z.lastIntValue=0;for(var Ue=0;Ue<ge;++Ue){var Qe=z.current();if(!Er(Qe))return z.pos=Fe,!1;z.lastIntValue=16*z.lastIntValue+Tr(Qe),z.advance()}return!0};var mr=function(ge){this.type=ge.type,this.value=ge.value,this.start=ge.start,this.end=ge.end,ge.options.locations&&(this.loc=new Xe(ge,ge.startLoc,ge.endLoc)),ge.options.ranges&&(this.range=[ge.start,ge.end])},sn=yt.prototype;sn.next=function(z){!z&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new mr(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},sn.getToken=function(){return this.next(),new mr(this)},typeof Symbol<"u"&&(sn[Symbol.iterator]=function(){var z=this;return{next:function(){var ge=z.getToken();return{done:ge.type===V.eof,value:ge}}}}),sn.nextToken=function(){var z=this.curContext();if((!z||!z.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(V.eof);if(z.override)return z.override(this);this.readToken(this.fullCharCodeAtPos())},sn.readToken=function(z){return A(z,this.options.ecmaVersion>=6)||z===92?this.readWord():this.getTokenFromCode(z)},sn.fullCharCodeAtPos=function(){var z=this.input.charCodeAt(this.pos);if(z<=55295||z>=56320)return z;var ge=this.input.charCodeAt(this.pos+1);return ge<=56319||ge>=57344?z:(z<<10)+ge-56613888},sn.skipBlockComment=function(){var z=this.options.onComment&&this.curPosition(),ge=this.pos,Fe=this.input.indexOf("*/",this.pos+=2);if(Fe===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=Fe+2,this.options.locations)for(var Ue=void 0,Qe=ge;(Ue=Oe(this.input,Qe,this.pos))>-1;)++this.curLine,Qe=this.lineStart=Ue;this.options.onComment&&this.options.onComment(!0,this.input.slice(ge+2,Fe),ge,this.pos,z,this.curPosition())},sn.skipLineComment=function(z){for(var ge=this.pos,Fe=this.options.onComment&&this.curPosition(),Ue=this.input.charCodeAt(this.pos+=z);this.pos<this.input.length&&!se(Ue);)Ue=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(ge+z,this.pos),ge,this.pos,Fe,this.curPosition())},sn.skipSpace=function(){e:for(;this.pos<this.input.length;){var z=this.input.charCodeAt(this.pos);switch(z){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(z>8&&z<14||z>=5760&&Ne.test(String.fromCharCode(z)))++this.pos;else break e}}},sn.finishToken=function(z,ge){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var Fe=this.type;this.type=z,this.value=ge,this.updateContext(Fe)},sn.readToken_dot=function(){var z=this.input.charCodeAt(this.pos+1);if(z>=48&&z<=57)return this.readNumber(!0);var ge=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&z===46&&ge===46?(this.pos+=3,this.finishToken(V.ellipsis)):(++this.pos,this.finishToken(V.dot))},sn.readToken_slash=function(){var z=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):z===61?this.finishOp(V.assign,2):this.finishOp(V.slash,1)},sn.readToken_mult_modulo_exp=function(z){var ge=this.input.charCodeAt(this.pos+1),Fe=1,Ue=z===42?V.star:V.modulo;return this.options.ecmaVersion>=7&&z===42&&ge===42&&(++Fe,Ue=V.starstar,ge=this.input.charCodeAt(this.pos+2)),ge===61?this.finishOp(V.assign,Fe+1):this.finishOp(Ue,Fe)},sn.readToken_pipe_amp=function(z){var ge=this.input.charCodeAt(this.pos+1);if(ge===z){if(this.options.ecmaVersion>=12){var Fe=this.input.charCodeAt(this.pos+2);if(Fe===61)return this.finishOp(V.assign,3)}return this.finishOp(z===124?V.logicalOR:V.logicalAND,2)}return ge===61?this.finishOp(V.assign,2):this.finishOp(z===124?V.bitwiseOR:V.bitwiseAND,1)},sn.readToken_caret=function(){var z=this.input.charCodeAt(this.pos+1);return z===61?this.finishOp(V.assign,2):this.finishOp(V.bitwiseXOR,1)},sn.readToken_plus_min=function(z){var ge=this.input.charCodeAt(this.pos+1);return ge===z?ge===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ne.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(V.incDec,2):ge===61?this.finishOp(V.assign,2):this.finishOp(V.plusMin,1)},sn.readToken_lt_gt=function(z){var ge=this.input.charCodeAt(this.pos+1),Fe=1;return ge===z?(Fe=z===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Fe)===61?this.finishOp(V.assign,Fe+1):this.finishOp(V.bitShift,Fe)):ge===33&&z===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(ge===61&&(Fe=2),this.finishOp(V.relational,Fe))},sn.readToken_eq_excl=function(z){var ge=this.input.charCodeAt(this.pos+1);return ge===61?this.finishOp(V.equality,this.input.charCodeAt(this.pos+2)===61?3:2):z===61&&ge===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(V.arrow)):this.finishOp(z===61?V.eq:V.prefix,1)},sn.readToken_question=function(){var z=this.options.ecmaVersion;if(z>=11){var ge=this.input.charCodeAt(this.pos+1);if(ge===46){var Fe=this.input.charCodeAt(this.pos+2);if(Fe<48||Fe>57)return this.finishOp(V.questionDot,2)}if(ge===63){if(z>=12){var Ue=this.input.charCodeAt(this.pos+2);if(Ue===61)return this.finishOp(V.assign,3)}return this.finishOp(V.coalesce,2)}}return this.finishOp(V.question,1)},sn.readToken_numberSign=function(){var z=this.options.ecmaVersion,ge=35;if(z>=13&&(++this.pos,ge=this.fullCharCodeAtPos(),A(ge,!0)||ge===92))return this.finishToken(V.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+He(ge)+"'")},sn.getTokenFromCode=function(z){switch(z){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(V.parenL);case 41:return++this.pos,this.finishToken(V.parenR);case 59:return++this.pos,this.finishToken(V.semi);case 44:return++this.pos,this.finishToken(V.comma);case 91:return++this.pos,this.finishToken(V.bracketL);case 93:return++this.pos,this.finishToken(V.bracketR);case 123:return++this.pos,this.finishToken(V.braceL);case 125:return++this.pos,this.finishToken(V.braceR);case 58:return++this.pos,this.finishToken(V.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(V.backQuote);case 48:var ge=this.input.charCodeAt(this.pos+1);if(ge===120||ge===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(ge===111||ge===79)return this.readRadixNumber(8);if(ge===98||ge===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(z);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(z);case 124:case 38:return this.readToken_pipe_amp(z);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(z);case 60:case 62:return this.readToken_lt_gt(z);case 61:case 33:return this.readToken_eq_excl(z);case 63:return this.readToken_question();case 126:return this.finishOp(V.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+He(z)+"'")},sn.finishOp=function(z,ge){var Fe=this.input.slice(this.pos,this.pos+ge);return this.pos+=ge,this.finishToken(z,Fe)},sn.readRegexp=function(){for(var z,ge,Fe=this.pos;;){this.pos>=this.input.length&&this.raise(Fe,"Unterminated regular expression");var Ue=this.input.charAt(this.pos);if(ne.test(Ue)&&this.raise(Fe,"Unterminated regular expression"),z)z=!1;else{if(Ue==="[")ge=!0;else if(Ue==="]"&&ge)ge=!1;else if(Ue==="/"&&!ge)break;z=Ue==="\\"}++this.pos}var Qe=this.input.slice(Fe,this.pos);++this.pos;var ut=this.pos,pt=this.readWord1();this.containsEsc&&this.unexpected(ut);var Vt=this.regexpState||(this.regexpState=new En(this));Vt.reset(Fe,Qe,pt),this.validateRegExpFlags(Vt),this.validateRegExpPattern(Vt);var Ft=null;try{Ft=new RegExp(Qe,pt)}catch{}return this.finishToken(V.regexp,{pattern:Qe,flags:pt,value:Ft})},sn.readInt=function(z,ge,Fe){for(var Ue=this.options.ecmaVersion>=12&&ge===void 0,Qe=Fe&&this.input.charCodeAt(this.pos)===48,ut=this.pos,pt=0,Vt=0,Ft=0,nn=ge??1/0;Ft<nn;++Ft,++this.pos){var Qt=this.input.charCodeAt(this.pos),_n=void 0;if(Ue&&Qt===95){Qe&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),Vt===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),Ft===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),Vt=Qt;continue}if(Qt>=97?_n=Qt-97+10:Qt>=65?_n=Qt-65+10:Qt>=48&&Qt<=57?_n=Qt-48:_n=1/0,_n>=z)break;Vt=Qt,pt=pt*z+_n}return Ue&&Vt===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===ut||ge!=null&&this.pos-ut!==ge?null:pt};function Gr(z,ge){return ge?parseInt(z,8):parseFloat(z.replace(/_/g,""))}function Ir(z){return typeof BigInt!="function"?null:BigInt(z.replace(/_/g,""))}sn.readRadixNumber=function(z){var ge=this.pos;this.pos+=2;var Fe=this.readInt(z);return Fe==null&&this.raise(this.start+2,"Expected number in radix "+z),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(Fe=Ir(this.input.slice(ge,this.pos)),++this.pos):A(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(V.num,Fe)},sn.readNumber=function(z){var ge=this.pos;!z&&this.readInt(10,void 0,!0)===null&&this.raise(ge,"Invalid number");var Fe=this.pos-ge>=2&&this.input.charCodeAt(ge)===48;Fe&&this.strict&&this.raise(ge,"Invalid number");var Ue=this.input.charCodeAt(this.pos);if(!Fe&&!z&&this.options.ecmaVersion>=11&&Ue===110){var Qe=Ir(this.input.slice(ge,this.pos));return++this.pos,A(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(V.num,Qe)}Fe&&/[89]/.test(this.input.slice(ge,this.pos))&&(Fe=!1),Ue===46&&!Fe&&(++this.pos,this.readInt(10),Ue=this.input.charCodeAt(this.pos)),(Ue===69||Ue===101)&&!Fe&&(Ue=this.input.charCodeAt(++this.pos),(Ue===43||Ue===45)&&++this.pos,this.readInt(10)===null&&this.raise(ge,"Invalid number")),A(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var ut=Gr(this.input.slice(ge,this.pos),Fe);return this.finishToken(V.num,ut)},sn.readCodePoint=function(){var z=this.input.charCodeAt(this.pos),ge;if(z===123){this.options.ecmaVersion<6&&this.unexpected();var Fe=++this.pos;ge=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,ge>1114111&&this.invalidStringToken(Fe,"Code point out of bounds")}else ge=this.readHexChar(4);return ge},sn.readString=function(z){for(var ge="",Fe=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var Ue=this.input.charCodeAt(this.pos);if(Ue===z)break;Ue===92?(ge+=this.input.slice(Fe,this.pos),ge+=this.readEscapedChar(!1),Fe=this.pos):Ue===8232||Ue===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(se(Ue)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return ge+=this.input.slice(Fe,this.pos++),this.finishToken(V.string,ge)};var Nr={};sn.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(z){if(z===Nr)this.readInvalidTemplateToken();else throw z}this.inTemplateElement=!1},sn.invalidStringToken=function(z,ge){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Nr;this.raise(z,ge)},sn.readTmplToken=function(){for(var z="",ge=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var Fe=this.input.charCodeAt(this.pos);if(Fe===96||Fe===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===V.template||this.type===V.invalidTemplate)?Fe===36?(this.pos+=2,this.finishToken(V.dollarBraceL)):(++this.pos,this.finishToken(V.backQuote)):(z+=this.input.slice(ge,this.pos),this.finishToken(V.template,z));if(Fe===92)z+=this.input.slice(ge,this.pos),z+=this.readEscapedChar(!0),ge=this.pos;else if(se(Fe)){switch(z+=this.input.slice(ge,this.pos),++this.pos,Fe){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:z+=`
|
|
1226
|
+
`),cooked:this.value},this.next(),Fe.tail=this.type===V.backQuote,this.finishNode(Fe,"TemplateElement")},Yt.parseTemplate=function(z){z===void 0&&(z={});var ge=z.isTagged;ge===void 0&&(ge=!1);var Fe=this.startNode();this.next(),Fe.expressions=[];var Ue=this.parseTemplateElement({isTagged:ge});for(Fe.quasis=[Ue];!Ue.tail;)this.type===V.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(V.dollarBraceL),Fe.expressions.push(this.parseExpression()),this.expect(V.braceR),Fe.quasis.push(Ue=this.parseTemplateElement({isTagged:ge}));return this.next(),this.finishNode(Fe,"TemplateLiteral")},Yt.isAsyncProp=function(z){return!z.computed&&z.key.type==="Identifier"&&z.key.name==="async"&&(this.type===V.name||this.type===V.num||this.type===V.string||this.type===V.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===V.star)&&!ne.test(this.input.slice(this.lastTokEnd,this.start))},Yt.parseObj=function(z,ge){var Fe=this.startNode(),Ue=!0,Qe={};for(Fe.properties=[],this.next();!this.eat(V.braceR);){if(Ue)Ue=!1;else if(this.expect(V.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(V.braceR))break;var ut=this.parseProperty(z,ge);z||this.checkPropClash(ut,Qe,ge),Fe.properties.push(ut)}return this.finishNode(Fe,z?"ObjectPattern":"ObjectExpression")},Yt.parseProperty=function(z,ge){var Fe=this.startNode(),Ue,Qe,ut,pt;if(this.options.ecmaVersion>=9&&this.eat(V.ellipsis))return z?(Fe.argument=this.parseIdent(!1),this.type===V.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(Fe,"RestElement")):(Fe.argument=this.parseMaybeAssign(!1,ge),this.type===V.comma&&ge&&ge.trailingComma<0&&(ge.trailingComma=this.start),this.finishNode(Fe,"SpreadElement"));this.options.ecmaVersion>=6&&(Fe.method=!1,Fe.shorthand=!1,(z||ge)&&(ut=this.start,pt=this.startLoc),z||(Ue=this.eat(V.star)));var Vt=this.containsEsc;return this.parsePropertyName(Fe),!z&&!Vt&&this.options.ecmaVersion>=8&&!Ue&&this.isAsyncProp(Fe)?(Qe=!0,Ue=this.options.ecmaVersion>=9&&this.eat(V.star),this.parsePropertyName(Fe)):Qe=!1,this.parsePropertyValue(Fe,z,Ue,Qe,ut,pt,ge,Vt),this.finishNode(Fe,"Property")},Yt.parseGetterSetter=function(z){z.kind=z.key.name,this.parsePropertyName(z),z.value=this.parseMethod(!1);var ge=z.kind==="get"?0:1;if(z.value.params.length!==ge){var Fe=z.value.start;z.kind==="get"?this.raiseRecoverable(Fe,"getter should have no params"):this.raiseRecoverable(Fe,"setter should have exactly one param")}else z.kind==="set"&&z.value.params[0].type==="RestElement"&&this.raiseRecoverable(z.value.params[0].start,"Setter cannot use rest params")},Yt.parsePropertyValue=function(z,ge,Fe,Ue,Qe,ut,pt,Vt){(Fe||Ue)&&this.type===V.colon&&this.unexpected(),this.eat(V.colon)?(z.value=ge?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(!1,pt),z.kind="init"):this.options.ecmaVersion>=6&&this.type===V.parenL?(ge&&this.unexpected(),z.kind="init",z.method=!0,z.value=this.parseMethod(Fe,Ue)):!ge&&!Vt&&this.options.ecmaVersion>=5&&!z.computed&&z.key.type==="Identifier"&&(z.key.name==="get"||z.key.name==="set")&&this.type!==V.comma&&this.type!==V.braceR&&this.type!==V.eq?((Fe||Ue)&&this.unexpected(),this.parseGetterSetter(z)):this.options.ecmaVersion>=6&&!z.computed&&z.key.type==="Identifier"?((Fe||Ue)&&this.unexpected(),this.checkUnreserved(z.key),z.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=Qe),z.kind="init",ge?z.value=this.parseMaybeDefault(Qe,ut,this.copyNode(z.key)):this.type===V.eq&&pt?(pt.shorthandAssign<0&&(pt.shorthandAssign=this.start),z.value=this.parseMaybeDefault(Qe,ut,this.copyNode(z.key))):z.value=this.copyNode(z.key),z.shorthand=!0):this.unexpected()},Yt.parsePropertyName=function(z){if(this.options.ecmaVersion>=6){if(this.eat(V.bracketL))return z.computed=!0,z.key=this.parseMaybeAssign(),this.expect(V.bracketR),z.key;z.computed=!1}return z.key=this.type===V.num||this.type===V.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")},Yt.initFunction=function(z){z.id=null,this.options.ecmaVersion>=6&&(z.generator=z.expression=!1),this.options.ecmaVersion>=8&&(z.async=!1)},Yt.parseMethod=function(z,ge,Fe){var Ue=this.startNode(),Qe=this.yieldPos,ut=this.awaitPos,pt=this.awaitIdentPos;return this.initFunction(Ue),this.options.ecmaVersion>=6&&(Ue.generator=z),this.options.ecmaVersion>=8&&(Ue.async=!!ge),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(Ct(ge,Ue.generator)|Rt|(Fe?dt:0)),this.expect(V.parenL),Ue.params=this.parseBindingList(V.parenR,!1,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(Ue,!1,!0,!1),this.yieldPos=Qe,this.awaitPos=ut,this.awaitIdentPos=pt,this.finishNode(Ue,"FunctionExpression")},Yt.parseArrowExpression=function(z,ge,Fe,Ue){var Qe=this.yieldPos,ut=this.awaitPos,pt=this.awaitIdentPos;return this.enterScope(Ct(Fe,!1)|$t),this.initFunction(z),this.options.ecmaVersion>=8&&(z.async=!!Fe),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,z.params=this.toAssignableList(ge,!0),this.parseFunctionBody(z,!0,!1,Ue),this.yieldPos=Qe,this.awaitPos=ut,this.awaitIdentPos=pt,this.finishNode(z,"ArrowFunctionExpression")},Yt.parseFunctionBody=function(z,ge,Fe,Ue){var Qe=ge&&this.type!==V.braceL,ut=this.strict,pt=!1;if(Qe)z.body=this.parseMaybeAssign(Ue),z.expression=!0,this.checkParams(z,!1);else{var Vt=this.options.ecmaVersion>=7&&!this.isSimpleParamList(z.params);(!ut||Vt)&&(pt=this.strictDirective(this.end),pt&&Vt&&this.raiseRecoverable(z.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var Ft=this.labels;this.labels=[],pt&&(this.strict=!0),this.checkParams(z,!ut&&!pt&&!ge&&!Fe&&this.isSimpleParamList(z.params)),this.strict&&z.id&&this.checkLValSimple(z.id,ft),z.body=this.parseBlock(!1,void 0,pt&&!ut),z.expression=!1,this.adaptDirectivePrologue(z.body.body),this.labels=Ft}this.exitScope()},Yt.isSimpleParamList=function(z){for(var ge=0,Fe=z;ge<Fe.length;ge+=1){var Ue=Fe[ge];if(Ue.type!=="Identifier")return!1}return!0},Yt.checkParams=function(z,ge){for(var Fe=Object.create(null),Ue=0,Qe=z.params;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];this.checkLValInnerPattern(ut,Ye,ge?null:Fe)}},Yt.parseExprList=function(z,ge,Fe,Ue){for(var Qe=[],ut=!0;!this.eat(z);){if(ut)ut=!1;else if(this.expect(V.comma),ge&&this.afterTrailingComma(z))break;var pt=void 0;Fe&&this.type===V.comma?pt=null:this.type===V.ellipsis?(pt=this.parseSpread(Ue),Ue&&this.type===V.comma&&Ue.trailingComma<0&&(Ue.trailingComma=this.start)):pt=this.parseMaybeAssign(!1,Ue),Qe.push(pt)}return Qe},Yt.checkUnreserved=function(z){var ge=z.start,Fe=z.end,Ue=z.name;if(this.inGenerator&&Ue==="yield"&&this.raiseRecoverable(ge,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&Ue==="await"&&this.raiseRecoverable(ge,"Cannot use 'await' as identifier inside an async function"),this.currentThisScope().inClassFieldInit&&Ue==="arguments"&&this.raiseRecoverable(ge,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(Ue==="arguments"||Ue==="await")&&this.raise(ge,"Cannot use "+Ue+" in class static initialization block"),this.keywords.test(Ue)&&this.raise(ge,"Unexpected keyword '"+Ue+"'"),!(this.options.ecmaVersion<6&&this.input.slice(ge,Fe).indexOf("\\")!==-1)){var Qe=this.strict?this.reservedWordsStrict:this.reservedWords;Qe.test(Ue)&&(!this.inAsync&&Ue==="await"&&this.raiseRecoverable(ge,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(ge,"The keyword '"+Ue+"' is reserved"))}},Yt.parseIdent=function(z){var ge=this.parseIdentNode();return this.next(!!z),this.finishNode(ge,"Identifier"),z||(this.checkUnreserved(ge),ge.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=ge.start)),ge},Yt.parseIdentNode=function(){var z=this.startNode();return this.type===V.name?z.name=this.value:this.type.keyword?(z.name=this.type.keyword,(z.name==="class"||z.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=V.name):this.unexpected(),z},Yt.parsePrivateIdent=function(){var z=this.startNode();return this.type===V.privateId?z.name=this.value:this.unexpected(),this.next(),this.finishNode(z,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(z.start,"Private field '#"+z.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(z)),z},Yt.parseYield=function(z){this.yieldPos||(this.yieldPos=this.start);var ge=this.startNode();return this.next(),this.type===V.semi||this.canInsertSemicolon()||this.type!==V.star&&!this.type.startsExpr?(ge.delegate=!1,ge.argument=null):(ge.delegate=this.eat(V.star),ge.argument=this.parseMaybeAssign(z)),this.finishNode(ge,"YieldExpression")},Yt.parseAwait=function(z){this.awaitPos||(this.awaitPos=this.start);var ge=this.startNode();return this.next(),ge.argument=this.parseMaybeUnary(null,!0,!1,z),this.finishNode(ge,"AwaitExpression")};var Fn=yt.prototype;Fn.raise=function(z,ge){var Fe=nt(this.input,z);ge+=" ("+Fe.line+":"+Fe.column+")";var Ue=new SyntaxError(ge);throw Ue.pos=z,Ue.loc=Fe,Ue.raisedAt=this.pos,Ue},Fn.raiseRecoverable=Fn.raise,Fn.curPosition=function(){if(this.options.locations)return new ze(this.curLine,this.pos-this.lineStart)};var Cn=yt.prototype,Bn=function(ge){this.flags=ge,this.var=[],this.lexical=[],this.functions=[],this.inClassFieldInit=!1};Cn.enterScope=function(z){this.scopeStack.push(new Bn(z))},Cn.exitScope=function(){this.scopeStack.pop()},Cn.treatFunctionsAsVarInScope=function(z){return z.flags&ot||!this.inModule&&z.flags&tt},Cn.declareName=function(z,ge,Fe){var Ue=!1;if(ge===Ze){var Qe=this.currentScope();Ue=Qe.lexical.indexOf(z)>-1||Qe.functions.indexOf(z)>-1||Qe.var.indexOf(z)>-1,Qe.lexical.push(z),this.inModule&&Qe.flags&tt&&delete this.undefinedExports[z]}else if(ge===mt){var ut=this.currentScope();ut.lexical.push(z)}else if(ge===ct){var pt=this.currentScope();this.treatFunctionsAsVar?Ue=pt.lexical.indexOf(z)>-1:Ue=pt.lexical.indexOf(z)>-1||pt.var.indexOf(z)>-1,pt.functions.push(z)}else for(var Vt=this.scopeStack.length-1;Vt>=0;--Vt){var Ft=this.scopeStack[Vt];if(Ft.lexical.indexOf(z)>-1&&!(Ft.flags&rt&&Ft.lexical[0]===z)||!this.treatFunctionsAsVarInScope(Ft)&&Ft.functions.indexOf(z)>-1){Ue=!0;break}if(Ft.var.push(z),this.inModule&&Ft.flags&tt&&delete this.undefinedExports[z],Ft.flags&Mt)break}Ue&&this.raiseRecoverable(Fe,"Identifier '"+z+"' has already been declared")},Cn.checkLocalExport=function(z){this.scopeStack[0].lexical.indexOf(z.name)===-1&&this.scopeStack[0].var.indexOf(z.name)===-1&&(this.undefinedExports[z.name]=z)},Cn.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]},Cn.currentVarScope=function(){for(var z=this.scopeStack.length-1;;z--){var ge=this.scopeStack[z];if(ge.flags&Mt)return ge}},Cn.currentThisScope=function(){for(var z=this.scopeStack.length-1;;z--){var ge=this.scopeStack[z];if(ge.flags&Mt&&!(ge.flags&$t))return ge}};var qn=function(ge,Fe,Ue){this.type="",this.start=Fe,this.end=0,ge.options.locations&&(this.loc=new Xe(ge,Ue)),ge.options.directSourceFile&&(this.sourceFile=ge.options.directSourceFile),ge.options.ranges&&(this.range=[Fe,0])},Un=yt.prototype;Un.startNode=function(){return new qn(this,this.start,this.startLoc)},Un.startNodeAt=function(z,ge){return new qn(this,z,ge)};function sr(z,ge,Fe,Ue){return z.type=ge,z.end=Fe,this.options.locations&&(z.loc.end=Ue),this.options.ranges&&(z.range[1]=Fe),z}Un.finishNode=function(z,ge){return sr.call(this,z,ge,this.lastTokEnd,this.lastTokEndLoc)},Un.finishNodeAt=function(z,ge,Fe,Ue){return sr.call(this,z,ge,Fe,Ue)},Un.copyNode=function(z){var ge=new qn(this,z.start,this.startLoc);for(var Fe in z)ge[Fe]=z[Fe];return ge};var wn="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Dn=wn+" Extended_Pictographic",Zn=Dn,er=Zn+" EBase EComp EMod EPres ExtPict",Kn=er,or=Kn,kn={9:wn,10:Dn,11:Zn,12:er,13:Kn,14:or},lr="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",cr={9:"",10:"",11:"",12:"",13:"",14:lr},tr="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",nr="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",ur=nr+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Xt=ur+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",it=Xt+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Dt=it+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Wt=Dt+" Hrkt Katakana_Or_Hiragana Kawi Nag_Mundari Nagm Unknown Zzzz",pn={9:nr,10:ur,11:Xt,12:it,13:Dt,14:Wt},bn={};function gn(z){var ge=bn[z]={binary:Le(kn[z]+" "+tr),binaryOfStrings:Le(cr[z]),nonBinary:{General_Category:Le(tr),Script:Le(pn[z])}};ge.nonBinary.Script_Extensions=ge.nonBinary.Script,ge.nonBinary.gc=ge.nonBinary.General_Category,ge.nonBinary.sc=ge.nonBinary.Script,ge.nonBinary.scx=ge.nonBinary.Script_Extensions}for(var Sn=0,In=[9,10,11,12,13,14];Sn<In.length;Sn+=1){var Hn=In[Sn];gn(Hn)}var zt=yt.prototype,yn=function(ge,Fe){this.parent=ge,this.base=Fe||this};yn.prototype.separatedFrom=function(ge){for(var Fe=this;Fe;Fe=Fe.parent)for(var Ue=ge;Ue;Ue=Ue.parent)if(Fe.base===Ue.base&&Fe!==Ue)return!0;return!1},yn.prototype.sibling=function(){return new yn(this.parent,this.base)};var En=function(ge){this.parser=ge,this.validFlags="gim"+(ge.options.ecmaVersion>=6?"uy":"")+(ge.options.ecmaVersion>=9?"s":"")+(ge.options.ecmaVersion>=13?"d":"")+(ge.options.ecmaVersion>=15?"v":""),this.unicodeProperties=bn[ge.options.ecmaVersion>=14?14:ge.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=!1,this.switchV=!1,this.switchN=!1,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=!1,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null};En.prototype.reset=function(ge,Fe,Ue){var Qe=Ue.indexOf("v")!==-1,ut=Ue.indexOf("u")!==-1;this.start=ge|0,this.source=Fe+"",this.flags=Ue,Qe&&this.parser.options.ecmaVersion>=15?(this.switchU=!0,this.switchV=!0,this.switchN=!0):(this.switchU=ut&&this.parser.options.ecmaVersion>=6,this.switchV=!1,this.switchN=ut&&this.parser.options.ecmaVersion>=9)},En.prototype.raise=function(ge){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+ge)},En.prototype.at=function(ge,Fe){Fe===void 0&&(Fe=!1);var Ue=this.source,Qe=Ue.length;if(ge>=Qe)return-1;var ut=Ue.charCodeAt(ge);if(!(Fe||this.switchU)||ut<=55295||ut>=57344||ge+1>=Qe)return ut;var pt=Ue.charCodeAt(ge+1);return pt>=56320&&pt<=57343?(ut<<10)+pt-56613888:ut},En.prototype.nextIndex=function(ge,Fe){Fe===void 0&&(Fe=!1);var Ue=this.source,Qe=Ue.length;if(ge>=Qe)return Qe;var ut=Ue.charCodeAt(ge),pt;return!(Fe||this.switchU)||ut<=55295||ut>=57344||ge+1>=Qe||(pt=Ue.charCodeAt(ge+1))<56320||pt>57343?ge+1:ge+2},En.prototype.current=function(ge){return ge===void 0&&(ge=!1),this.at(this.pos,ge)},En.prototype.lookahead=function(ge){return ge===void 0&&(ge=!1),this.at(this.nextIndex(this.pos,ge),ge)},En.prototype.advance=function(ge){ge===void 0&&(ge=!1),this.pos=this.nextIndex(this.pos,ge)},En.prototype.eat=function(ge,Fe){return Fe===void 0&&(Fe=!1),this.current(Fe)===ge?(this.advance(Fe),!0):!1},En.prototype.eatChars=function(ge,Fe){Fe===void 0&&(Fe=!1);for(var Ue=this.pos,Qe=0,ut=ge;Qe<ut.length;Qe+=1){var pt=ut[Qe],Vt=this.at(Ue,Fe);if(Vt===-1||Vt!==pt)return!1;Ue=this.nextIndex(Ue,Fe)}return this.pos=Ue,!0},zt.validateRegExpFlags=function(z){for(var ge=z.validFlags,Fe=z.flags,Ue=!1,Qe=!1,ut=0;ut<Fe.length;ut++){var pt=Fe.charAt(ut);ge.indexOf(pt)===-1&&this.raise(z.start,"Invalid regular expression flag"),Fe.indexOf(pt,ut+1)>-1&&this.raise(z.start,"Duplicate regular expression flag"),pt==="u"&&(Ue=!0),pt==="v"&&(Qe=!0)}this.options.ecmaVersion>=15&&Ue&&Qe&&this.raise(z.start,"Invalid regular expression flag")};function dr(z){for(var ge in z)return!0;return!1}zt.validateRegExpPattern=function(z){this.regexp_pattern(z),!z.switchN&&this.options.ecmaVersion>=9&&dr(z.groupNames)&&(z.switchN=!0,this.regexp_pattern(z))},zt.regexp_pattern=function(z){z.pos=0,z.lastIntValue=0,z.lastStringValue="",z.lastAssertionIsQuantifiable=!1,z.numCapturingParens=0,z.maxBackReference=0,z.groupNames=Object.create(null),z.backReferenceNames.length=0,z.branchID=null,this.regexp_disjunction(z),z.pos!==z.source.length&&(z.eat(41)&&z.raise("Unmatched ')'"),(z.eat(93)||z.eat(125))&&z.raise("Lone quantifier brackets")),z.maxBackReference>z.numCapturingParens&&z.raise("Invalid escape");for(var ge=0,Fe=z.backReferenceNames;ge<Fe.length;ge+=1){var Ue=Fe[ge];z.groupNames[Ue]||z.raise("Invalid named capture referenced")}},zt.regexp_disjunction=function(z){var ge=this.options.ecmaVersion>=16;for(ge&&(z.branchID=new yn(z.branchID,null)),this.regexp_alternative(z);z.eat(124);)ge&&(z.branchID=z.branchID.sibling()),this.regexp_alternative(z);ge&&(z.branchID=z.branchID.parent),this.regexp_eatQuantifier(z,!0)&&z.raise("Nothing to repeat"),z.eat(123)&&z.raise("Lone quantifier brackets")},zt.regexp_alternative=function(z){for(;z.pos<z.source.length&&this.regexp_eatTerm(z););},zt.regexp_eatTerm=function(z){return this.regexp_eatAssertion(z)?(z.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(z)&&z.switchU&&z.raise("Invalid quantifier"),!0):(z.switchU?this.regexp_eatAtom(z):this.regexp_eatExtendedAtom(z))?(this.regexp_eatQuantifier(z),!0):!1},zt.regexp_eatAssertion=function(z){var ge=z.pos;if(z.lastAssertionIsQuantifiable=!1,z.eat(94)||z.eat(36))return!0;if(z.eat(92)){if(z.eat(66)||z.eat(98))return!0;z.pos=ge}if(z.eat(40)&&z.eat(63)){var Fe=!1;if(this.options.ecmaVersion>=9&&(Fe=z.eat(60)),z.eat(61)||z.eat(33))return this.regexp_disjunction(z),z.eat(41)||z.raise("Unterminated group"),z.lastAssertionIsQuantifiable=!Fe,!0}return z.pos=ge,!1},zt.regexp_eatQuantifier=function(z,ge){return ge===void 0&&(ge=!1),this.regexp_eatQuantifierPrefix(z,ge)?(z.eat(63),!0):!1},zt.regexp_eatQuantifierPrefix=function(z,ge){return z.eat(42)||z.eat(43)||z.eat(63)||this.regexp_eatBracedQuantifier(z,ge)},zt.regexp_eatBracedQuantifier=function(z,ge){var Fe=z.pos;if(z.eat(123)){var Ue=0,Qe=-1;if(this.regexp_eatDecimalDigits(z)&&(Ue=z.lastIntValue,z.eat(44)&&this.regexp_eatDecimalDigits(z)&&(Qe=z.lastIntValue),z.eat(125)))return Qe!==-1&&Qe<Ue&&!ge&&z.raise("numbers out of order in {} quantifier"),!0;z.switchU&&!ge&&z.raise("Incomplete quantifier"),z.pos=Fe}return!1},zt.regexp_eatAtom=function(z){return this.regexp_eatPatternCharacters(z)||z.eat(46)||this.regexp_eatReverseSolidusAtomEscape(z)||this.regexp_eatCharacterClass(z)||this.regexp_eatUncapturingGroup(z)||this.regexp_eatCapturingGroup(z)},zt.regexp_eatReverseSolidusAtomEscape=function(z){var ge=z.pos;if(z.eat(92)){if(this.regexp_eatAtomEscape(z))return!0;z.pos=ge}return!1},zt.regexp_eatUncapturingGroup=function(z){var ge=z.pos;if(z.eat(40)){if(z.eat(63)&&z.eat(58)){if(this.regexp_disjunction(z),z.eat(41))return!0;z.raise("Unterminated group")}z.pos=ge}return!1},zt.regexp_eatCapturingGroup=function(z){if(z.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(z):z.current()===63&&z.raise("Invalid group"),this.regexp_disjunction(z),z.eat(41))return z.numCapturingParens+=1,!0;z.raise("Unterminated group")}return!1},zt.regexp_eatExtendedAtom=function(z){return z.eat(46)||this.regexp_eatReverseSolidusAtomEscape(z)||this.regexp_eatCharacterClass(z)||this.regexp_eatUncapturingGroup(z)||this.regexp_eatCapturingGroup(z)||this.regexp_eatInvalidBracedQuantifier(z)||this.regexp_eatExtendedPatternCharacter(z)},zt.regexp_eatInvalidBracedQuantifier=function(z){return this.regexp_eatBracedQuantifier(z,!0)&&z.raise("Nothing to repeat"),!1},zt.regexp_eatSyntaxCharacter=function(z){var ge=z.current();return Rr(ge)?(z.lastIntValue=ge,z.advance(),!0):!1};function Rr(z){return z===36||z>=40&&z<=43||z===46||z===63||z>=91&&z<=94||z>=123&&z<=125}zt.regexp_eatPatternCharacters=function(z){for(var ge=z.pos,Fe=0;(Fe=z.current())!==-1&&!Rr(Fe);)z.advance();return z.pos!==ge},zt.regexp_eatExtendedPatternCharacter=function(z){var ge=z.current();return ge!==-1&&ge!==36&&!(ge>=40&&ge<=43)&&ge!==46&&ge!==63&&ge!==91&&ge!==94&&ge!==124?(z.advance(),!0):!1},zt.regexp_groupSpecifier=function(z){if(z.eat(63)){this.regexp_eatGroupName(z)||z.raise("Invalid group");var ge=this.options.ecmaVersion>=16,Fe=z.groupNames[z.lastStringValue];if(Fe)if(ge)for(var Ue=0,Qe=Fe;Ue<Qe.length;Ue+=1){var ut=Qe[Ue];ut.separatedFrom(z.branchID)||z.raise("Duplicate capture group name")}else z.raise("Duplicate capture group name");ge?(Fe||(z.groupNames[z.lastStringValue]=[])).push(z.branchID):z.groupNames[z.lastStringValue]=!0}},zt.regexp_eatGroupName=function(z){if(z.lastStringValue="",z.eat(60)){if(this.regexp_eatRegExpIdentifierName(z)&&z.eat(62))return!0;z.raise("Invalid capture group name")}return!1},zt.regexp_eatRegExpIdentifierName=function(z){if(z.lastStringValue="",this.regexp_eatRegExpIdentifierStart(z)){for(z.lastStringValue+=He(z.lastIntValue);this.regexp_eatRegExpIdentifierPart(z);)z.lastStringValue+=He(z.lastIntValue);return!0}return!1},zt.regexp_eatRegExpIdentifierStart=function(z){var ge=z.pos,Fe=this.options.ecmaVersion>=11,Ue=z.current(Fe);return z.advance(Fe),Ue===92&&this.regexp_eatRegExpUnicodeEscapeSequence(z,Fe)&&(Ue=z.lastIntValue),Dr(Ue)?(z.lastIntValue=Ue,!0):(z.pos=ge,!1)};function Dr(z){return A(z,!0)||z===36||z===95}zt.regexp_eatRegExpIdentifierPart=function(z){var ge=z.pos,Fe=this.options.ecmaVersion>=11,Ue=z.current(Fe);return z.advance(Fe),Ue===92&&this.regexp_eatRegExpUnicodeEscapeSequence(z,Fe)&&(Ue=z.lastIntValue),Vr(Ue)?(z.lastIntValue=Ue,!0):(z.pos=ge,!1)};function Vr(z){return M(z,!0)||z===36||z===95||z===8204||z===8205}zt.regexp_eatAtomEscape=function(z){return this.regexp_eatBackReference(z)||this.regexp_eatCharacterClassEscape(z)||this.regexp_eatCharacterEscape(z)||z.switchN&&this.regexp_eatKGroupName(z)?!0:(z.switchU&&(z.current()===99&&z.raise("Invalid unicode escape"),z.raise("Invalid escape")),!1)},zt.regexp_eatBackReference=function(z){var ge=z.pos;if(this.regexp_eatDecimalEscape(z)){var Fe=z.lastIntValue;if(z.switchU)return Fe>z.maxBackReference&&(z.maxBackReference=Fe),!0;if(Fe<=z.numCapturingParens)return!0;z.pos=ge}return!1},zt.regexp_eatKGroupName=function(z){if(z.eat(107)){if(this.regexp_eatGroupName(z))return z.backReferenceNames.push(z.lastStringValue),!0;z.raise("Invalid named reference")}return!1},zt.regexp_eatCharacterEscape=function(z){return this.regexp_eatControlEscape(z)||this.regexp_eatCControlLetter(z)||this.regexp_eatZero(z)||this.regexp_eatHexEscapeSequence(z)||this.regexp_eatRegExpUnicodeEscapeSequence(z,!1)||!z.switchU&&this.regexp_eatLegacyOctalEscapeSequence(z)||this.regexp_eatIdentityEscape(z)},zt.regexp_eatCControlLetter=function(z){var ge=z.pos;if(z.eat(99)){if(this.regexp_eatControlLetter(z))return!0;z.pos=ge}return!1},zt.regexp_eatZero=function(z){return z.current()===48&&!pr(z.lookahead())?(z.lastIntValue=0,z.advance(),!0):!1},zt.regexp_eatControlEscape=function(z){var ge=z.current();return ge===116?(z.lastIntValue=9,z.advance(),!0):ge===110?(z.lastIntValue=10,z.advance(),!0):ge===118?(z.lastIntValue=11,z.advance(),!0):ge===102?(z.lastIntValue=12,z.advance(),!0):ge===114?(z.lastIntValue=13,z.advance(),!0):!1},zt.regexp_eatControlLetter=function(z){var ge=z.current();return Pr(ge)?(z.lastIntValue=ge%32,z.advance(),!0):!1};function Pr(z){return z>=65&&z<=90||z>=97&&z<=122}zt.regexp_eatRegExpUnicodeEscapeSequence=function(z,ge){ge===void 0&&(ge=!1);var Fe=z.pos,Ue=ge||z.switchU;if(z.eat(117)){if(this.regexp_eatFixedHexDigits(z,4)){var Qe=z.lastIntValue;if(Ue&&Qe>=55296&&Qe<=56319){var ut=z.pos;if(z.eat(92)&&z.eat(117)&&this.regexp_eatFixedHexDigits(z,4)){var pt=z.lastIntValue;if(pt>=56320&&pt<=57343)return z.lastIntValue=(Qe-55296)*1024+(pt-56320)+65536,!0}z.pos=ut,z.lastIntValue=Qe}return!0}if(Ue&&z.eat(123)&&this.regexp_eatHexDigits(z)&&z.eat(125)&&Br(z.lastIntValue))return!0;Ue&&z.raise("Invalid unicode escape"),z.pos=Fe}return!1};function Br(z){return z>=0&&z<=1114111}zt.regexp_eatIdentityEscape=function(z){if(z.switchU)return this.regexp_eatSyntaxCharacter(z)?!0:z.eat(47)?(z.lastIntValue=47,!0):!1;var ge=z.current();return ge!==99&&(!z.switchN||ge!==107)?(z.lastIntValue=ge,z.advance(),!0):!1},zt.regexp_eatDecimalEscape=function(z){z.lastIntValue=0;var ge=z.current();if(ge>=49&&ge<=57){do z.lastIntValue=10*z.lastIntValue+(ge-48),z.advance();while((ge=z.current())>=48&&ge<=57);return!0}return!1};var Cr=0,Ln=1,Nn=2;zt.regexp_eatCharacterClassEscape=function(z){var ge=z.current();if(Lr(ge))return z.lastIntValue=-1,z.advance(),Ln;var Fe=!1;if(z.switchU&&this.options.ecmaVersion>=9&&((Fe=ge===80)||ge===112)){z.lastIntValue=-1,z.advance();var Ue;if(z.eat(123)&&(Ue=this.regexp_eatUnicodePropertyValueExpression(z))&&z.eat(125))return Fe&&Ue===Nn&&z.raise("Invalid property name"),Ue;z.raise("Invalid property name")}return Cr};function Lr(z){return z===100||z===68||z===115||z===83||z===119||z===87}zt.regexp_eatUnicodePropertyValueExpression=function(z){var ge=z.pos;if(this.regexp_eatUnicodePropertyName(z)&&z.eat(61)){var Fe=z.lastStringValue;if(this.regexp_eatUnicodePropertyValue(z)){var Ue=z.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(z,Fe,Ue),Ln}}if(z.pos=ge,this.regexp_eatLoneUnicodePropertyNameOrValue(z)){var Qe=z.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(z,Qe)}return Cr},zt.regexp_validateUnicodePropertyNameAndValue=function(z,ge,Fe){Be(z.unicodeProperties.nonBinary,ge)||z.raise("Invalid property name"),z.unicodeProperties.nonBinary[ge].test(Fe)||z.raise("Invalid property value")},zt.regexp_validateUnicodePropertyNameOrValue=function(z,ge){if(z.unicodeProperties.binary.test(ge))return Ln;if(z.switchV&&z.unicodeProperties.binaryOfStrings.test(ge))return Nn;z.raise("Invalid property name")},zt.regexp_eatUnicodePropertyName=function(z){var ge=0;for(z.lastStringValue="";wr(ge=z.current());)z.lastStringValue+=He(ge),z.advance();return z.lastStringValue!==""};function wr(z){return Pr(z)||z===95}zt.regexp_eatUnicodePropertyValue=function(z){var ge=0;for(z.lastStringValue="";Fr(ge=z.current());)z.lastStringValue+=He(ge),z.advance();return z.lastStringValue!==""};function Fr(z){return wr(z)||pr(z)}zt.regexp_eatLoneUnicodePropertyNameOrValue=function(z){return this.regexp_eatUnicodePropertyValue(z)},zt.regexp_eatCharacterClass=function(z){if(z.eat(91)){var ge=z.eat(94),Fe=this.regexp_classContents(z);return z.eat(93)||z.raise("Unterminated character class"),ge&&Fe===Nn&&z.raise("Negated character class may contain strings"),!0}return!1},zt.regexp_classContents=function(z){return z.current()===93?Ln:z.switchV?this.regexp_classSetExpression(z):(this.regexp_nonEmptyClassRanges(z),Ln)},zt.regexp_nonEmptyClassRanges=function(z){for(;this.regexp_eatClassAtom(z);){var ge=z.lastIntValue;if(z.eat(45)&&this.regexp_eatClassAtom(z)){var Fe=z.lastIntValue;z.switchU&&(ge===-1||Fe===-1)&&z.raise("Invalid character class"),ge!==-1&&Fe!==-1&&ge>Fe&&z.raise("Range out of order in character class")}}},zt.regexp_eatClassAtom=function(z){var ge=z.pos;if(z.eat(92)){if(this.regexp_eatClassEscape(z))return!0;if(z.switchU){var Fe=z.current();(Fe===99||Ar(Fe))&&z.raise("Invalid class escape"),z.raise("Invalid escape")}z.pos=ge}var Ue=z.current();return Ue!==93?(z.lastIntValue=Ue,z.advance(),!0):!1},zt.regexp_eatClassEscape=function(z){var ge=z.pos;if(z.eat(98))return z.lastIntValue=8,!0;if(z.switchU&&z.eat(45))return z.lastIntValue=45,!0;if(!z.switchU&&z.eat(99)){if(this.regexp_eatClassControlLetter(z))return!0;z.pos=ge}return this.regexp_eatCharacterClassEscape(z)||this.regexp_eatCharacterEscape(z)},zt.regexp_classSetExpression=function(z){var ge=Ln,Fe;if(!this.regexp_eatClassSetRange(z))if(Fe=this.regexp_eatClassSetOperand(z)){Fe===Nn&&(ge=Nn);for(var Ue=z.pos;z.eatChars([38,38]);){if(z.current()!==38&&(Fe=this.regexp_eatClassSetOperand(z))){Fe!==Nn&&(ge=Ln);continue}z.raise("Invalid character in character class")}if(Ue!==z.pos)return ge;for(;z.eatChars([45,45]);)this.regexp_eatClassSetOperand(z)||z.raise("Invalid character in character class");if(Ue!==z.pos)return ge}else z.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(z)){if(Fe=this.regexp_eatClassSetOperand(z),!Fe)return ge;Fe===Nn&&(ge=Nn)}},zt.regexp_eatClassSetRange=function(z){var ge=z.pos;if(this.regexp_eatClassSetCharacter(z)){var Fe=z.lastIntValue;if(z.eat(45)&&this.regexp_eatClassSetCharacter(z)){var Ue=z.lastIntValue;return Fe!==-1&&Ue!==-1&&Fe>Ue&&z.raise("Range out of order in character class"),!0}z.pos=ge}return!1},zt.regexp_eatClassSetOperand=function(z){return this.regexp_eatClassSetCharacter(z)?Ln:this.regexp_eatClassStringDisjunction(z)||this.regexp_eatNestedClass(z)},zt.regexp_eatNestedClass=function(z){var ge=z.pos;if(z.eat(91)){var Fe=z.eat(94),Ue=this.regexp_classContents(z);if(z.eat(93))return Fe&&Ue===Nn&&z.raise("Negated character class may contain strings"),Ue;z.pos=ge}if(z.eat(92)){var Qe=this.regexp_eatCharacterClassEscape(z);if(Qe)return Qe;z.pos=ge}return null},zt.regexp_eatClassStringDisjunction=function(z){var ge=z.pos;if(z.eatChars([92,113])){if(z.eat(123)){var Fe=this.regexp_classStringDisjunctionContents(z);if(z.eat(125))return Fe}else z.raise("Invalid escape");z.pos=ge}return null},zt.regexp_classStringDisjunctionContents=function(z){for(var ge=this.regexp_classString(z);z.eat(124);)this.regexp_classString(z)===Nn&&(ge=Nn);return ge},zt.regexp_classString=function(z){for(var ge=0;this.regexp_eatClassSetCharacter(z);)ge++;return ge===1?Ln:Nn},zt.regexp_eatClassSetCharacter=function(z){var ge=z.pos;if(z.eat(92))return this.regexp_eatCharacterEscape(z)||this.regexp_eatClassSetReservedPunctuator(z)?!0:z.eat(98)?(z.lastIntValue=8,!0):(z.pos=ge,!1);var Fe=z.current();return Fe<0||Fe===z.lookahead()&&qr(Fe)||Ur(Fe)?!1:(z.advance(),z.lastIntValue=Fe,!0)};function qr(z){return z===33||z>=35&&z<=38||z>=42&&z<=44||z===46||z>=58&&z<=64||z===94||z===96||z===126}function Ur(z){return z===40||z===41||z===45||z===47||z>=91&&z<=93||z>=123&&z<=125}zt.regexp_eatClassSetReservedPunctuator=function(z){var ge=z.current();return Hr(ge)?(z.lastIntValue=ge,z.advance(),!0):!1};function Hr(z){return z===33||z===35||z===37||z===38||z===44||z===45||z>=58&&z<=62||z===64||z===96||z===126}zt.regexp_eatClassControlLetter=function(z){var ge=z.current();return pr(ge)||ge===95?(z.lastIntValue=ge%32,z.advance(),!0):!1},zt.regexp_eatHexEscapeSequence=function(z){var ge=z.pos;if(z.eat(120)){if(this.regexp_eatFixedHexDigits(z,2))return!0;z.switchU&&z.raise("Invalid escape"),z.pos=ge}return!1},zt.regexp_eatDecimalDigits=function(z){var ge=z.pos,Fe=0;for(z.lastIntValue=0;pr(Fe=z.current());)z.lastIntValue=10*z.lastIntValue+(Fe-48),z.advance();return z.pos!==ge};function pr(z){return z>=48&&z<=57}zt.regexp_eatHexDigits=function(z){var ge=z.pos,Fe=0;for(z.lastIntValue=0;Er(Fe=z.current());)z.lastIntValue=16*z.lastIntValue+Tr(Fe),z.advance();return z.pos!==ge};function Er(z){return z>=48&&z<=57||z>=65&&z<=70||z>=97&&z<=102}function Tr(z){return z>=65&&z<=70?10+(z-65):z>=97&&z<=102?10+(z-97):z-48}zt.regexp_eatLegacyOctalEscapeSequence=function(z){if(this.regexp_eatOctalDigit(z)){var ge=z.lastIntValue;if(this.regexp_eatOctalDigit(z)){var Fe=z.lastIntValue;ge<=3&&this.regexp_eatOctalDigit(z)?z.lastIntValue=ge*64+Fe*8+z.lastIntValue:z.lastIntValue=ge*8+Fe}else z.lastIntValue=ge;return!0}return!1},zt.regexp_eatOctalDigit=function(z){var ge=z.current();return Ar(ge)?(z.lastIntValue=ge-48,z.advance(),!0):(z.lastIntValue=0,!1)};function Ar(z){return z>=48&&z<=55}zt.regexp_eatFixedHexDigits=function(z,ge){var Fe=z.pos;z.lastIntValue=0;for(var Ue=0;Ue<ge;++Ue){var Qe=z.current();if(!Er(Qe))return z.pos=Fe,!1;z.lastIntValue=16*z.lastIntValue+Tr(Qe),z.advance()}return!0};var mr=function(ge){this.type=ge.type,this.value=ge.value,this.start=ge.start,this.end=ge.end,ge.options.locations&&(this.loc=new Xe(ge,ge.startLoc,ge.endLoc)),ge.options.ranges&&(this.range=[ge.start,ge.end])},sn=yt.prototype;sn.next=function(z){!z&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new mr(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken()},sn.getToken=function(){return this.next(),new mr(this)},typeof Symbol<"u"&&(sn[Symbol.iterator]=function(){var z=this;return{next:function(){var ge=z.getToken();return{done:ge.type===V.eof,value:ge}}}}),sn.nextToken=function(){var z=this.curContext();if((!z||!z.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(V.eof);if(z.override)return z.override(this);this.readToken(this.fullCharCodeAtPos())},sn.readToken=function(z){return A(z,this.options.ecmaVersion>=6)||z===92?this.readWord():this.getTokenFromCode(z)},sn.fullCharCodeAtPos=function(){var z=this.input.charCodeAt(this.pos);if(z<=55295||z>=56320)return z;var ge=this.input.charCodeAt(this.pos+1);return ge<=56319||ge>=57344?z:(z<<10)+ge-56613888},sn.skipBlockComment=function(){var z=this.options.onComment&&this.curPosition(),ge=this.pos,Fe=this.input.indexOf("*/",this.pos+=2);if(Fe===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=Fe+2,this.options.locations)for(var Ue=void 0,Qe=ge;(Ue=Oe(this.input,Qe,this.pos))>-1;)++this.curLine,Qe=this.lineStart=Ue;this.options.onComment&&this.options.onComment(!0,this.input.slice(ge+2,Fe),ge,this.pos,z,this.curPosition())},sn.skipLineComment=function(z){for(var ge=this.pos,Fe=this.options.onComment&&this.curPosition(),Ue=this.input.charCodeAt(this.pos+=z);this.pos<this.input.length&&!se(Ue);)Ue=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(!1,this.input.slice(ge+z,this.pos),ge,this.pos,Fe,this.curPosition())},sn.skipSpace=function(){e:for(;this.pos<this.input.length;){var z=this.input.charCodeAt(this.pos);switch(z){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(z>8&&z<14||z>=5760&&Ne.test(String.fromCharCode(z)))++this.pos;else break e}}},sn.finishToken=function(z,ge){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var Fe=this.type;this.type=z,this.value=ge,this.updateContext(Fe)},sn.readToken_dot=function(){var z=this.input.charCodeAt(this.pos+1);if(z>=48&&z<=57)return this.readNumber(!0);var ge=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&z===46&&ge===46?(this.pos+=3,this.finishToken(V.ellipsis)):(++this.pos,this.finishToken(V.dot))},sn.readToken_slash=function(){var z=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):z===61?this.finishOp(V.assign,2):this.finishOp(V.slash,1)},sn.readToken_mult_modulo_exp=function(z){var ge=this.input.charCodeAt(this.pos+1),Fe=1,Ue=z===42?V.star:V.modulo;return this.options.ecmaVersion>=7&&z===42&&ge===42&&(++Fe,Ue=V.starstar,ge=this.input.charCodeAt(this.pos+2)),ge===61?this.finishOp(V.assign,Fe+1):this.finishOp(Ue,Fe)},sn.readToken_pipe_amp=function(z){var ge=this.input.charCodeAt(this.pos+1);if(ge===z){if(this.options.ecmaVersion>=12){var Fe=this.input.charCodeAt(this.pos+2);if(Fe===61)return this.finishOp(V.assign,3)}return this.finishOp(z===124?V.logicalOR:V.logicalAND,2)}return ge===61?this.finishOp(V.assign,2):this.finishOp(z===124?V.bitwiseOR:V.bitwiseAND,1)},sn.readToken_caret=function(){var z=this.input.charCodeAt(this.pos+1);return z===61?this.finishOp(V.assign,2):this.finishOp(V.bitwiseXOR,1)},sn.readToken_plus_min=function(z){var ge=this.input.charCodeAt(this.pos+1);return ge===z?ge===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||ne.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(V.incDec,2):ge===61?this.finishOp(V.assign,2):this.finishOp(V.plusMin,1)},sn.readToken_lt_gt=function(z){var ge=this.input.charCodeAt(this.pos+1),Fe=1;return ge===z?(Fe=z===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+Fe)===61?this.finishOp(V.assign,Fe+1):this.finishOp(V.bitShift,Fe)):ge===33&&z===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(ge===61&&(Fe=2),this.finishOp(V.relational,Fe))},sn.readToken_eq_excl=function(z){var ge=this.input.charCodeAt(this.pos+1);return ge===61?this.finishOp(V.equality,this.input.charCodeAt(this.pos+2)===61?3:2):z===61&&ge===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(V.arrow)):this.finishOp(z===61?V.eq:V.prefix,1)},sn.readToken_question=function(){var z=this.options.ecmaVersion;if(z>=11){var ge=this.input.charCodeAt(this.pos+1);if(ge===46){var Fe=this.input.charCodeAt(this.pos+2);if(Fe<48||Fe>57)return this.finishOp(V.questionDot,2)}if(ge===63){if(z>=12){var Ue=this.input.charCodeAt(this.pos+2);if(Ue===61)return this.finishOp(V.assign,3)}return this.finishOp(V.coalesce,2)}}return this.finishOp(V.question,1)},sn.readToken_numberSign=function(){var z=this.options.ecmaVersion,ge=35;if(z>=13&&(++this.pos,ge=this.fullCharCodeAtPos(),A(ge,!0)||ge===92))return this.finishToken(V.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+He(ge)+"'")},sn.getTokenFromCode=function(z){switch(z){case 46:return this.readToken_dot();case 40:return++this.pos,this.finishToken(V.parenL);case 41:return++this.pos,this.finishToken(V.parenR);case 59:return++this.pos,this.finishToken(V.semi);case 44:return++this.pos,this.finishToken(V.comma);case 91:return++this.pos,this.finishToken(V.bracketL);case 93:return++this.pos,this.finishToken(V.bracketR);case 123:return++this.pos,this.finishToken(V.braceL);case 125:return++this.pos,this.finishToken(V.braceR);case 58:return++this.pos,this.finishToken(V.colon);case 96:if(this.options.ecmaVersion<6)break;return++this.pos,this.finishToken(V.backQuote);case 48:var ge=this.input.charCodeAt(this.pos+1);if(ge===120||ge===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(ge===111||ge===79)return this.readRadixNumber(8);if(ge===98||ge===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(!1);case 34:case 39:return this.readString(z);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(z);case 124:case 38:return this.readToken_pipe_amp(z);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(z);case 60:case 62:return this.readToken_lt_gt(z);case 61:case 33:return this.readToken_eq_excl(z);case 63:return this.readToken_question();case 126:return this.finishOp(V.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+He(z)+"'")},sn.finishOp=function(z,ge){var Fe=this.input.slice(this.pos,this.pos+ge);return this.pos+=ge,this.finishToken(z,Fe)},sn.readRegexp=function(){for(var z,ge,Fe=this.pos;;){this.pos>=this.input.length&&this.raise(Fe,"Unterminated regular expression");var Ue=this.input.charAt(this.pos);if(ne.test(Ue)&&this.raise(Fe,"Unterminated regular expression"),z)z=!1;else{if(Ue==="[")ge=!0;else if(Ue==="]"&&ge)ge=!1;else if(Ue==="/"&&!ge)break;z=Ue==="\\"}++this.pos}var Qe=this.input.slice(Fe,this.pos);++this.pos;var ut=this.pos,pt=this.readWord1();this.containsEsc&&this.unexpected(ut);var Vt=this.regexpState||(this.regexpState=new En(this));Vt.reset(Fe,Qe,pt),this.validateRegExpFlags(Vt),this.validateRegExpPattern(Vt);var Ft=null;try{Ft=new RegExp(Qe,pt)}catch{}return this.finishToken(V.regexp,{pattern:Qe,flags:pt,value:Ft})},sn.readInt=function(z,ge,Fe){for(var Ue=this.options.ecmaVersion>=12&&ge===void 0,Qe=Fe&&this.input.charCodeAt(this.pos)===48,ut=this.pos,pt=0,Vt=0,Ft=0,nn=ge??1/0;Ft<nn;++Ft,++this.pos){var Zt=this.input.charCodeAt(this.pos),_n=void 0;if(Ue&&Zt===95){Qe&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),Vt===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),Ft===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),Vt=Zt;continue}if(Zt>=97?_n=Zt-97+10:Zt>=65?_n=Zt-65+10:Zt>=48&&Zt<=57?_n=Zt-48:_n=1/0,_n>=z)break;Vt=Zt,pt=pt*z+_n}return Ue&&Vt===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===ut||ge!=null&&this.pos-ut!==ge?null:pt};function Gr(z,ge){return ge?parseInt(z,8):parseFloat(z.replace(/_/g,""))}function Ir(z){return typeof BigInt!="function"?null:BigInt(z.replace(/_/g,""))}sn.readRadixNumber=function(z){var ge=this.pos;this.pos+=2;var Fe=this.readInt(z);return Fe==null&&this.raise(this.start+2,"Expected number in radix "+z),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(Fe=Ir(this.input.slice(ge,this.pos)),++this.pos):A(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(V.num,Fe)},sn.readNumber=function(z){var ge=this.pos;!z&&this.readInt(10,void 0,!0)===null&&this.raise(ge,"Invalid number");var Fe=this.pos-ge>=2&&this.input.charCodeAt(ge)===48;Fe&&this.strict&&this.raise(ge,"Invalid number");var Ue=this.input.charCodeAt(this.pos);if(!Fe&&!z&&this.options.ecmaVersion>=11&&Ue===110){var Qe=Ir(this.input.slice(ge,this.pos));return++this.pos,A(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(V.num,Qe)}Fe&&/[89]/.test(this.input.slice(ge,this.pos))&&(Fe=!1),Ue===46&&!Fe&&(++this.pos,this.readInt(10),Ue=this.input.charCodeAt(this.pos)),(Ue===69||Ue===101)&&!Fe&&(Ue=this.input.charCodeAt(++this.pos),(Ue===43||Ue===45)&&++this.pos,this.readInt(10)===null&&this.raise(ge,"Invalid number")),A(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var ut=Gr(this.input.slice(ge,this.pos),Fe);return this.finishToken(V.num,ut)},sn.readCodePoint=function(){var z=this.input.charCodeAt(this.pos),ge;if(z===123){this.options.ecmaVersion<6&&this.unexpected();var Fe=++this.pos;ge=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,ge>1114111&&this.invalidStringToken(Fe,"Code point out of bounds")}else ge=this.readHexChar(4);return ge},sn.readString=function(z){for(var ge="",Fe=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var Ue=this.input.charCodeAt(this.pos);if(Ue===z)break;Ue===92?(ge+=this.input.slice(Fe,this.pos),ge+=this.readEscapedChar(!1),Fe=this.pos):Ue===8232||Ue===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(se(Ue)&&this.raise(this.start,"Unterminated string constant"),++this.pos)}return ge+=this.input.slice(Fe,this.pos++),this.finishToken(V.string,ge)};var Nr={};sn.tryReadTemplateToken=function(){this.inTemplateElement=!0;try{this.readTmplToken()}catch(z){if(z===Nr)this.readInvalidTemplateToken();else throw z}this.inTemplateElement=!1},sn.invalidStringToken=function(z,ge){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Nr;this.raise(z,ge)},sn.readTmplToken=function(){for(var z="",ge=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var Fe=this.input.charCodeAt(this.pos);if(Fe===96||Fe===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===V.template||this.type===V.invalidTemplate)?Fe===36?(this.pos+=2,this.finishToken(V.dollarBraceL)):(++this.pos,this.finishToken(V.backQuote)):(z+=this.input.slice(ge,this.pos),this.finishToken(V.template,z));if(Fe===92)z+=this.input.slice(ge,this.pos),z+=this.readEscapedChar(!0),ge=this.pos;else if(se(Fe)){switch(z+=this.input.slice(ge,this.pos),++this.pos,Fe){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:z+=`
|
|
1227
1227
|
`;break;default:z+=String.fromCharCode(Fe);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),ge=this.pos}else++this.pos}},sn.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(V.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
|
|
1228
1228
|
`&&++this.pos;case`
|
|
1229
1229
|
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},sn.readEscapedChar=function(z){var ge=this.input.charCodeAt(++this.pos);switch(++this.pos,ge){case 110:return`
|
|
1230
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return He(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),z){var Fe=this.pos-1;this.invalidStringToken(Fe,"Invalid escape sequence in template string")}default:if(ge>=48&&ge<=55){var Ue=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Qe=parseInt(Ue,8);return Qe>255&&(Ue=Ue.slice(0,-1),Qe=parseInt(Ue,8)),this.pos+=Ue.length-1,ge=this.input.charCodeAt(this.pos),(Ue!=="0"||ge===56||ge===57)&&(this.strict||z)&&this.invalidStringToken(this.pos-1-Ue.length,z?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(Qe)}return se(ge)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(ge)}},sn.readHexChar=function(z){var ge=this.pos,Fe=this.readInt(16,z);return Fe===null&&this.invalidStringToken(ge,"Bad character escape sequence"),Fe},sn.readWord1=function(){this.containsEsc=!1;for(var z="",ge=!0,Fe=this.pos,Ue=this.options.ecmaVersion>=6;this.pos<this.input.length;){var Qe=this.fullCharCodeAtPos();if(M(Qe,Ue))this.pos+=Qe<=65535?1:2;else if(Qe===92){this.containsEsc=!0,z+=this.input.slice(Fe,this.pos);var ut=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var pt=this.readCodePoint();(ge?A:M)(pt,Ue)||this.invalidStringToken(ut,"Invalid Unicode escape"),z+=He(pt),Fe=this.pos}else break;ge=!1}return z+this.input.slice(Fe,this.pos)},sn.readWord=function(){var z=this.readWord1(),ge=V.name;return this.keywords.test(z)&&(ge=te[z]),this.finishToken(ge,z)};var Mr="8.12.1";yt.acorn={Parser:yt,version:Mr,defaultOptions:Je,Position:ze,SourceLocation:Xe,getLineInfo:nt,Node:qn,TokenType:I,tokTypes:V,keywordTypes:te,TokContext:
|
|
1230
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return He(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),z){var Fe=this.pos-1;this.invalidStringToken(Fe,"Invalid escape sequence in template string")}default:if(ge>=48&&ge<=55){var Ue=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],Qe=parseInt(Ue,8);return Qe>255&&(Ue=Ue.slice(0,-1),Qe=parseInt(Ue,8)),this.pos+=Ue.length-1,ge=this.input.charCodeAt(this.pos),(Ue!=="0"||ge===56||ge===57)&&(this.strict||z)&&this.invalidStringToken(this.pos-1-Ue.length,z?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(Qe)}return se(ge)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(ge)}},sn.readHexChar=function(z){var ge=this.pos,Fe=this.readInt(16,z);return Fe===null&&this.invalidStringToken(ge,"Bad character escape sequence"),Fe},sn.readWord1=function(){this.containsEsc=!1;for(var z="",ge=!0,Fe=this.pos,Ue=this.options.ecmaVersion>=6;this.pos<this.input.length;){var Qe=this.fullCharCodeAtPos();if(M(Qe,Ue))this.pos+=Qe<=65535?1:2;else if(Qe===92){this.containsEsc=!0,z+=this.input.slice(Fe,this.pos);var ut=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var pt=this.readCodePoint();(ge?A:M)(pt,Ue)||this.invalidStringToken(ut,"Invalid Unicode escape"),z+=He(pt),Fe=this.pos}else break;ge=!1}return z+this.input.slice(Fe,this.pos)},sn.readWord=function(){var z=this.readWord1(),ge=V.name;return this.keywords.test(z)&&(ge=te[z]),this.finishToken(ge,z)};var Mr="8.12.1";yt.acorn={Parser:yt,version:Mr,defaultOptions:Je,Position:ze,SourceLocation:Xe,getLineInfo:nt,Node:qn,TokenType:I,tokTypes:V,keywordTypes:te,TokContext:Qt,tokContexts:Ut,isIdentifierChar:M,isIdentifierStart:A,Token:mr,isNewLine:se,lineBreak:ne,lineBreakG:ae,nonASCIIwhitespace:Ne};function zr(z,ge){return yt.parse(z,ge)}function Wr(z,ge,Fe){return yt.parseExpressionAt(z,ge,Fe)}function Kr(z,ge){return yt.tokenizer(z,ge)}n.Node=qn,n.Parser=yt,n.Position=ze,n.SourceLocation=Xe,n.TokContext=Qt,n.Token=mr,n.TokenType=I,n.defaultOptions=Je,n.getLineInfo=nt,n.isIdentifierChar=M,n.isIdentifierStart=A,n.isNewLine=se,n.keywordTypes=te,n.lineBreak=ne,n.lineBreakG=ae,n.nonASCIIwhitespace=Ne,n.parse=zr,n.parseExpressionAt=Wr,n.tokContexts=Ut,n.tokTypes=V,n.tokenizer=Kr,n.version=Mr})}),require_acorn_jsx=__commonJS((e,t)=>{var n=require_xhtml(),o=/^[\da-fA-F]+$/,l=/^\d+$/,d=new WeakMap;function f(_){_=_.Parser.acorn||_;let S=d.get(_);if(!S){const R=_.tokTypes,C=_.TokContext,E=_.TokenType,A=new C("<tag",!1),M=new C("</tag",!1),I=new C("<tag>...</tag>",!0,!0),j={tc_oTag:A,tc_cTag:M,tc_expr:I},q={jsxName:new E("jsxName"),jsxText:new E("jsxText",{beforeExpr:!0}),jsxTagStart:new E("jsxTagStart",{startsExpr:!0}),jsxTagEnd:new E("jsxTagEnd")};q.jsxTagStart.updateContext=function(){this.context.push(I),this.context.push(A),this.exprAllowed=!1},q.jsxTagEnd.updateContext=function(Q){let te=this.context.pop();te===A&&Q===R.slash||te===M?(this.context.pop(),this.exprAllowed=this.curContext()===I):this.exprAllowed=!0},S={tokContexts:j,tokTypes:q},d.set(_,S)}return S}function g(_){if(!_)return _;if(_.type==="JSXIdentifier")return _.name;if(_.type==="JSXNamespacedName")return _.namespace.name+":"+_.name.name;if(_.type==="JSXMemberExpression")return g(_.object)+"."+g(_.property)}t.exports=function(_){return _=_||{},function(S){return b({allowNamespaces:_.allowNamespaces!==!1,allowNamespacedObjects:!!_.allowNamespacedObjects,autoCloseVoidElements:!!_.autoCloseVoidElements},S)}},Object.defineProperty(t.exports,"tokTypes",{get:function(){return f(require_acorn()).tokTypes},configurable:!0,enumerable:!0});function b(_,S){const R=S.acorn||require_acorn(),C=f(R),E=R.tokTypes,A=C.tokTypes,M=R.tokContexts,I=C.tokContexts.tc_oTag,j=C.tokContexts.tc_cTag,q=C.tokContexts.tc_expr,Q=R.isNewLine,te=R.isIdentifierStart,F=R.isIdentifierChar;return class extends S{static get acornJsx(){return C}jsx_readToken(){let V="",ne=this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated JSX contents");let ae=this.input.charCodeAt(this.pos);switch(ae){case 60:case 123:return this.pos===this.start?ae===60&&this.exprAllowed?(++this.pos,this.finishToken(A.jsxTagStart)):this.getTokenFromCode(ae):(V+=this.input.slice(ne,this.pos),this.finishToken(A.jsxText,V));case 38:V+=this.input.slice(ne,this.pos),V+=this.jsx_readEntity(),ne=this.pos;break;case 62:case 125:this.raise(this.pos,"Unexpected token `"+this.input[this.pos]+"`. Did you mean `"+(ae===62?">":"}")+'` or `{"'+this.input[this.pos]+'"}`?');default:Q(ae)?(V+=this.input.slice(ne,this.pos),V+=this.jsx_readNewLine(!0),ne=this.pos):++this.pos}}}jsx_readNewLine(V){let ne=this.input.charCodeAt(this.pos),ae;return++this.pos,ne===13&&this.input.charCodeAt(this.pos)===10?(++this.pos,ae=V?`
|
|
1231
1231
|
`:`\r
|
|
1232
1232
|
`):ae=String.fromCharCode(ne),this.options.locations&&(++this.curLine,this.lineStart=this.pos),ae}jsx_readString(V){let ne="",ae=++this.pos;for(;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");let se=this.input.charCodeAt(this.pos);if(se===V)break;se===38?(ne+=this.input.slice(ae,this.pos),ne+=this.jsx_readEntity(),ae=this.pos):Q(se)?(ne+=this.input.slice(ae,this.pos),ne+=this.jsx_readNewLine(!1),ae=this.pos):++this.pos}return ne+=this.input.slice(ae,this.pos++),this.finishToken(E.string,ne)}jsx_readEntity(){let V="",ne=0,ae,se=this.input[this.pos];se!=="&"&&this.raise(this.pos,"Entity must start with an ampersand");let Oe=++this.pos;for(;this.pos<this.input.length&&ne++<10;){if(se=this.input[this.pos++],se===";"){V[0]==="#"?V[1]==="x"?(V=V.substr(2),o.test(V)&&(ae=String.fromCharCode(parseInt(V,16)))):(V=V.substr(1),l.test(V)&&(ae=String.fromCharCode(parseInt(V,10)))):ae=n[V];break}V+=se}return ae||(this.pos=Oe,"&")}jsx_readWord(){let V,ne=this.pos;do V=this.input.charCodeAt(++this.pos);while(F(V)||V===45);return this.finishToken(A.jsxName,this.input.slice(ne,this.pos))}jsx_parseIdentifier(){let V=this.startNode();return this.type===A.jsxName?V.name=this.value:this.type.keyword?V.name=this.type.keyword:this.unexpected(),this.next(),this.finishNode(V,"JSXIdentifier")}jsx_parseNamespacedName(){let V=this.start,ne=this.startLoc,ae=this.jsx_parseIdentifier();if(!_.allowNamespaces||!this.eat(E.colon))return ae;var se=this.startNodeAt(V,ne);return se.namespace=ae,se.name=this.jsx_parseIdentifier(),this.finishNode(se,"JSXNamespacedName")}jsx_parseElementName(){if(this.type===A.jsxTagEnd)return"";let V=this.start,ne=this.startLoc,ae=this.jsx_parseNamespacedName();for(this.type===E.dot&&ae.type==="JSXNamespacedName"&&!_.allowNamespacedObjects&&this.unexpected();this.eat(E.dot);){let se=this.startNodeAt(V,ne);se.object=ae,se.property=this.jsx_parseIdentifier(),ae=this.finishNode(se,"JSXMemberExpression")}return ae}jsx_parseAttributeValue(){switch(this.type){case E.braceL:let V=this.jsx_parseExpressionContainer();return V.expression.type==="JSXEmptyExpression"&&this.raise(V.start,"JSX attributes must only be assigned a non-empty expression"),V;case A.jsxTagStart:case E.string:return this.parseExprAtom();default:this.raise(this.start,"JSX value should be either an expression or a quoted JSX text")}}jsx_parseEmptyExpression(){let V=this.startNodeAt(this.lastTokEnd,this.lastTokEndLoc);return this.finishNodeAt(V,"JSXEmptyExpression",this.start,this.startLoc)}jsx_parseExpressionContainer(){let V=this.startNode();return this.next(),V.expression=this.type===E.braceR?this.jsx_parseEmptyExpression():this.parseExpression(),this.expect(E.braceR),this.finishNode(V,"JSXExpressionContainer")}jsx_parseAttribute(){let V=this.startNode();return this.eat(E.braceL)?(this.expect(E.ellipsis),V.argument=this.parseMaybeAssign(),this.expect(E.braceR),this.finishNode(V,"JSXSpreadAttribute")):(V.name=this.jsx_parseNamespacedName(),V.value=this.eat(E.eq)?this.jsx_parseAttributeValue():null,this.finishNode(V,"JSXAttribute"))}jsx_parseOpeningElementAt(V,ne){let ae=this.startNodeAt(V,ne);ae.attributes=[];let se=this.jsx_parseElementName();for(se&&(ae.name=se);this.type!==E.slash&&this.type!==A.jsxTagEnd;)ae.attributes.push(this.jsx_parseAttribute());ae.selfClosing=this.eat(E.slash),this.expect(A.jsxTagEnd);const Oe=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"];return _.autoCloseVoidElements&&se&&Oe.includes(se.name)&&(ae.selfClosing=!0),this.finishNode(ae,se?"JSXOpeningElement":"JSXOpeningFragment")}jsx_parseClosingElementAt(V,ne){let ae=this.startNodeAt(V,ne),se=this.jsx_parseElementName();return se&&(ae.name=se),this.expect(A.jsxTagEnd),this.finishNode(ae,se?"JSXClosingElement":"JSXClosingFragment")}jsx_parseElementAt(V,ne){let ae=this.startNodeAt(V,ne),se=[],Oe=this.jsx_parseOpeningElementAt(V,ne),Ne=null;if(!Oe.selfClosing){e:for(;;)switch(this.type){case A.jsxTagStart:if(V=this.start,ne=this.startLoc,this.next(),this.eat(E.slash)){Ne=this.jsx_parseClosingElementAt(V,ne);break e}se.push(this.jsx_parseElementAt(V,ne));break;case A.jsxText:se.push(this.parseExprAtom());break;case E.braceL:se.push(this.jsx_parseExpressionContainer());break;default:this.unexpected()}g(Ne.name)!==g(Oe.name)&&this.raise(Ne.start,"Expected corresponding JSX closing tag for <"+g(Oe.name)+">")}let oe=Oe.name?"Element":"Fragment";return ae["opening"+oe]=Oe,ae["closing"+oe]=Ne,ae.children=se,this.type===E.relational&&this.value==="<"&&this.raise(this.start,"Adjacent JSX elements must be wrapped in an enclosing tag"),this.finishNode(ae,"JSX"+oe)}jsx_parseText(){let V=this.parseLiteral(this.value);return V.type="JSXText",V}jsx_parseElement(){let V=this.start,ne=this.startLoc;return this.next(),this.jsx_parseElementAt(V,ne)}parseExprAtom(V){return this.type===A.jsxText?this.jsx_parseText():this.type===A.jsxTagStart?this.jsx_parseElement():super.parseExprAtom(V)}readToken(V){let ne=this.curContext();if(ne===q)return this.jsx_readToken();if(ne===I||ne===j){if(te(V))return this.jsx_readWord();if(V==62)return++this.pos,this.finishToken(A.jsxTagEnd);if((V===34||V===39)&&ne==I)return this.jsx_readString(V)}return V===60&&this.exprAllowed&&this.input.charCodeAt(this.pos+1)!==33?(++this.pos,this.finishToken(A.jsxTagStart)):super.readToken(V)}updateContext(V){if(this.type==E.braceL){var ne=this.curContext();ne==I?this.context.push(M.b_expr):ne==q?this.context.push(M.b_tmpl):super.updateContext(V),this.exprAllowed=!0}else if(this.type===E.slash&&V===A.jsxTagStart)this.context.length-=2,this.context.push(j),this.exprAllowed=!1;else return super.updateContext(V)}}}}),astralIdentifierCodes=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,370,1,81,2,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,193,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,84,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,406,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,330,3,10,1,2,0,49,6,4,4,14,9,5351,0,7,14,13835,9,87,9,39,4,60,6,26,9,1014,0,2,54,8,3,82,0,12,1,19628,1,4706,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,983,6,110,6,6,9,4759,9,787719,239],astralIdentifierStartCodes=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,68,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,71,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,349,41,7,1,79,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,159,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,264,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,328,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,4026,582,8634,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,689,63,129,74,6,0,67,12,65,1,2,0,29,6135,9,1237,43,8,8936,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,757,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4153,7,221,3,5761,15,7472,16,621,2467,541,1507,4938,6,4191],nonASCIIidentifierChars="·̀-ͯ·҃-֑҇-ׇֽֿׁׂׅׄؐ-ًؚ-٩ٰۖ-ۜ۟-۪ۤۧۨ-ۭ۰-۹ܑܰ-݊ަ-ް߀-߉߫-߽߳ࠖ-࠙ࠛ-ࠣࠥ-ࠧࠩ-࡙࠭-࡛࢘-࢟࣊-ࣣ࣡-ःऺ-़ा-ॏ॑-ॗॢॣ०-९ঁ-ঃ়া-ৄেৈো-্ৗৢৣ০-৯৾ਁ-ਃ਼ਾ-ੂੇੈੋ-੍ੑ੦-ੱੵઁ-ઃ઼ા-ૅે-ૉો-્ૢૣ૦-૯ૺ-૿ଁ-ଃ଼ା-ୄେୈୋ-୍୕-ୗୢୣ୦-୯ஂா-ூெ-ைொ-்ௗ௦-௯ఀ-ఄ఼ా-ౄె-ైొ-్ౕౖౢౣ౦-౯ಁ-ಃ಼ಾ-ೄೆ-ೈೊ-್ೕೖೢೣ೦-೯ೳഀ-ഃ഻഼ാ-ൄെ-ൈൊ-്ൗൢൣ൦-൯ඁ-ඃ්ා-ුූෘ-ෟ෦-෯ෲෳัิ-ฺ็-๎๐-๙ັິ-ຼ່-໎໐-໙༘༙༠-༩༹༵༷༾༿ཱ-྄྆྇ྍ-ྗྙ-ྼ࿆ါ-ှ၀-၉ၖ-ၙၞ-ၠၢ-ၤၧ-ၭၱ-ၴႂ-ႍႏ-ႝ፝-፟፩-፱ᜒ-᜕ᜲ-᜴ᝒᝓᝲᝳ឴-៓៝០-៩᠋-᠍᠏-᠙ᢩᤠ-ᤫᤰ-᤻᥆-᥏᧐-᧚ᨗ-ᨛᩕ-ᩞ᩠-᩿᩼-᪉᪐-᪙᪰-᪽ᪿ-ᫎᬀ-ᬄ᬴-᭄᭐-᭙᭫-᭳ᮀ-ᮂᮡ-ᮭ᮰-᮹᯦-᯳ᰤ-᰷᱀-᱉᱐-᱙᳐-᳔᳒-᳨᳭᳴᳷-᳹᷀-᷿‿⁀⁔⃐-⃥⃜⃡-⃰⳯-⵿⳱ⷠ-〪ⷿ-゙゚〯・꘠-꘩꙯ꙴ-꙽ꚞꚟ꛰꛱ꠂ꠆ꠋꠣ-ꠧ꠬ꢀꢁꢴ-ꣅ꣐-꣙꣠-꣱ꣿ-꤉ꤦ-꤭ꥇ-꥓ꦀ-ꦃ꦳-꧀꧐-꧙ꧥ꧰-꧹ꨩ-ꨶꩃꩌꩍ꩐-꩙ꩻ-ꩽꪰꪲ-ꪴꪷꪸꪾ꪿꫁ꫫ-ꫯꫵ꫶ꯣ-ꯪ꯬꯭꯰-꯹ﬞ︀-️︠-︯︳︴﹍-﹏0-9_・",nonASCIIidentifierStartChars="ªµºÀ-ÖØ-öø-ˁˆ-ˑˠ-ˤˬˮͰ-ʹͶͷͺ-ͽͿΆΈ-ΊΌΎ-ΡΣ-ϵϷ-ҁҊ-ԯԱ-Ֆՙՠ-ֈא-תׯ-ײؠ-يٮٯٱ-ۓەۥۦۮۯۺ-ۼۿܐܒ-ܯݍ-ޥޱߊ-ߪߴߵߺࠀ-ࠕࠚࠤࠨࡀ-ࡘࡠ-ࡪࡰ-ࢇࢉ-ࢎࢠ-ࣉऄ-हऽॐक़-ॡॱ-ঀঅ-ঌএঐও-নপ-রলশ-হঽৎড়ঢ়য়-ৡৰৱৼਅ-ਊਏਐਓ-ਨਪ-ਰਲਲ਼ਵਸ਼ਸਹਖ਼-ੜਫ਼ੲ-ੴઅ-ઍએ-ઑઓ-નપ-રલળવ-હઽૐૠૡૹଅ-ଌଏଐଓ-ନପ-ରଲଳଵ-ହଽଡ଼ଢ଼ୟ-ୡୱஃஅ-ஊஎ-ஐஒ-கஙசஜஞடணதந-பம-ஹௐఅ-ఌఎ-ఐఒ-నప-హఽౘ-ౚౝౠౡಀಅ-ಌಎ-ಐಒ-ನಪ-ಳವ-ಹಽೝೞೠೡೱೲഄ-ഌഎ-ഐഒ-ഺഽൎൔ-ൖൟ-ൡൺ-ൿඅ-ඖක-නඳ-රලව-ෆก-ะาำเ-ๆກຂຄຆ-ຊຌ-ຣລວ-ະາຳຽເ-ໄໆໜ-ໟༀཀ-ཇཉ-ཬྈ-ྌက-ဪဿၐ-ၕၚ-ၝၡၥၦၮ-ၰၵ-ႁႎႠ-ჅჇჍა-ჺჼ-ቈቊ-ቍቐ-ቖቘቚ-ቝበ-ኈኊ-ኍነ-ኰኲ-ኵኸ-ኾዀዂ-ዅወ-ዖዘ-ጐጒ-ጕጘ-ፚᎀ-ᎏᎠ-Ᏽᏸ-ᏽᐁ-ᙬᙯ-ᙿᚁ-ᚚᚠ-ᛪᛮ-ᛸᜀ-ᜑᜟ-ᜱᝀ-ᝑᝠ-ᝬᝮ-ᝰក-ឳៗៜᠠ-ᡸᢀ-ᢨᢪᢰ-ᣵᤀ-ᤞᥐ-ᥭᥰ-ᥴᦀ-ᦫᦰ-ᧉᨀ-ᨖᨠ-ᩔᪧᬅ-ᬳᭅ-ᭌᮃ-ᮠᮮᮯᮺ-ᯥᰀ-ᰣᱍ-ᱏᱚ-ᱽᲀ-ᲈᲐ-ᲺᲽ-Ჿᳩ-ᳬᳮ-ᳳᳵᳶᳺᴀ-ᶿḀ-ἕἘ-Ἕἠ-ὅὈ-Ὅὐ-ὗὙὛὝὟ-ώᾀ-ᾴᾶ-ᾼιῂ-ῄῆ-ῌῐ-ΐῖ-Ίῠ-Ῥῲ-ῴῶ-ῼⁱⁿₐ-ₜℂℇℊ-ℓℕ℘-ℝℤΩℨK-ℹℼ-ℿⅅ-ⅉⅎⅠ-ↈⰀ-ⳤⳫ-ⳮⳲⳳⴀ-ⴥⴧⴭⴰ-ⵧⵯⶀ-ⶖⶠ-ⶦⶨ-ⶮⶰ-ⶶⶸ-ⶾⷀ-ⷆⷈ-ⷎⷐ-ⷖⷘ-ⷞ々-〇〡-〩〱-〵〸-〼ぁ-ゖ゛-ゟァ-ヺー-ヿㄅ-ㄯㄱ-ㆎㆠ-ㆿㇰ-ㇿ㐀-䶿一-ꒌꓐ-ꓽꔀ-ꘌꘐ-ꘟꘪꘫꙀ-ꙮꙿ-ꚝꚠ-ꛯꜗ-ꜟꜢ-ꞈꞋ-ꟊꟐꟑꟓꟕ-ꟙꟲ-ꠁꠃ-ꠅꠇ-ꠊꠌ-ꠢꡀ-ꡳꢂ-ꢳꣲ-ꣷꣻꣽꣾꤊ-ꤥꤰ-ꥆꥠ-ꥼꦄ-ꦲꧏꧠ-ꧤꧦ-ꧯꧺ-ꧾꨀ-ꨨꩀ-ꩂꩄ-ꩋꩠ-ꩶꩺꩾ-ꪯꪱꪵꪶꪹ-ꪽꫀꫂꫛ-ꫝꫠ-ꫪꫲ-ꫴꬁ-ꬆꬉ-ꬎꬑ-ꬖꬠ-ꬦꬨ-ꬮꬰ-ꭚꭜ-ꭩꭰ-ꯢ가-힣ힰ-ퟆퟋ-ퟻ豈-舘並-龎ff-stﬓ-ﬗיִײַ-ﬨשׁ-זּטּ-לּמּנּסּףּפּצּ-ﮱﯓ-ﴽﵐ-ﶏﶒ-ﷇﷰ-ﷻﹰ-ﹴﹶ-ﻼA-Za-zヲ-하-ᅦᅧ-ᅬᅭ-ᅲᅳ-ᅵ",reservedWords={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ecma5AndLessKeywords="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",keywords$1={5:ecma5AndLessKeywords,"5module":ecma5AndLessKeywords+" export import",6:ecma5AndLessKeywords+" const class extends export import super"},keywordRelationalOperator=/^in(stanceof)?$/,nonASCIIidentifierStart=new RegExp("["+nonASCIIidentifierStartChars+"]"),nonASCIIidentifier=new RegExp("["+nonASCIIidentifierStartChars+nonASCIIidentifierChars+"]");function isInAstralSet(e,t){for(var n=65536,o=0;o<t.length;o+=2){if(n+=t[o],n>e)return!1;if(n+=t[o+1],n>=e)return!0}return!1}function isIdentifierStart(e,t){return e<65?e===36:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&nonASCIIidentifierStart.test(String.fromCharCode(e)):t===!1?!1:isInAstralSet(e,astralIdentifierStartCodes)}function isIdentifierChar(e,t){return e<48?e===36:e<58?!0:e<65?!1:e<91?!0:e<97?e===95:e<123?!0:e<=65535?e>=170&&nonASCIIidentifier.test(String.fromCharCode(e)):t===!1?!1:isInAstralSet(e,astralIdentifierStartCodes)||isInAstralSet(e,astralIdentifierCodes)}var TokenType=function e(t,n){n===void 0&&(n={}),this.label=t,this.keyword=n.keyword,this.beforeExpr=!!n.beforeExpr,this.startsExpr=!!n.startsExpr,this.isLoop=!!n.isLoop,this.isAssign=!!n.isAssign,this.prefix=!!n.prefix,this.postfix=!!n.postfix,this.binop=n.binop||null,this.updateContext=null};function binop(e,t){return new TokenType(e,{beforeExpr:!0,binop:t})}var beforeExpr={beforeExpr:!0},startsExpr={startsExpr:!0},keywords={};function kw(e,t){return t===void 0&&(t={}),t.keyword=e,keywords[e]=new TokenType(e,t)}var types$1={num:new TokenType("num",startsExpr),regexp:new TokenType("regexp",startsExpr),string:new TokenType("string",startsExpr),name:new TokenType("name",startsExpr),privateId:new TokenType("privateId",startsExpr),eof:new TokenType("eof"),bracketL:new TokenType("[",{beforeExpr:!0,startsExpr:!0}),bracketR:new TokenType("]"),braceL:new TokenType("{",{beforeExpr:!0,startsExpr:!0}),braceR:new TokenType("}"),parenL:new TokenType("(",{beforeExpr:!0,startsExpr:!0}),parenR:new TokenType(")"),comma:new TokenType(",",beforeExpr),semi:new TokenType(";",beforeExpr),colon:new TokenType(":",beforeExpr),dot:new TokenType("."),question:new TokenType("?",beforeExpr),questionDot:new TokenType("?."),arrow:new TokenType("=>",beforeExpr),template:new TokenType("template"),invalidTemplate:new TokenType("invalidTemplate"),ellipsis:new TokenType("...",beforeExpr),backQuote:new TokenType("`",startsExpr),dollarBraceL:new TokenType("${",{beforeExpr:!0,startsExpr:!0}),eq:new TokenType("=",{beforeExpr:!0,isAssign:!0}),assign:new TokenType("_=",{beforeExpr:!0,isAssign:!0}),incDec:new TokenType("++/--",{prefix:!0,postfix:!0,startsExpr:!0}),prefix:new TokenType("!/~",{beforeExpr:!0,prefix:!0,startsExpr:!0}),logicalOR:binop("||",1),logicalAND:binop("&&",2),bitwiseOR:binop("|",3),bitwiseXOR:binop("^",4),bitwiseAND:binop("&",5),equality:binop("==/!=/===/!==",6),relational:binop("</>/<=/>=",7),bitShift:binop("<</>>/>>>",8),plusMin:new TokenType("+/-",{beforeExpr:!0,binop:9,prefix:!0,startsExpr:!0}),modulo:binop("%",10),star:binop("*",10),slash:binop("/",10),starstar:new TokenType("**",{beforeExpr:!0}),coalesce:binop("??",1),_break:kw("break"),_case:kw("case",beforeExpr),_catch:kw("catch"),_continue:kw("continue"),_debugger:kw("debugger"),_default:kw("default",beforeExpr),_do:kw("do",{isLoop:!0,beforeExpr:!0}),_else:kw("else",beforeExpr),_finally:kw("finally"),_for:kw("for",{isLoop:!0}),_function:kw("function",startsExpr),_if:kw("if"),_return:kw("return",beforeExpr),_switch:kw("switch"),_throw:kw("throw",beforeExpr),_try:kw("try"),_var:kw("var"),_const:kw("const"),_while:kw("while",{isLoop:!0}),_with:kw("with"),_new:kw("new",{beforeExpr:!0,startsExpr:!0}),_this:kw("this",startsExpr),_super:kw("super",startsExpr),_class:kw("class",startsExpr),_extends:kw("extends",beforeExpr),_export:kw("export"),_import:kw("import",startsExpr),_null:kw("null",startsExpr),_true:kw("true",startsExpr),_false:kw("false",startsExpr),_in:kw("in",{beforeExpr:!0,binop:7}),_instanceof:kw("instanceof",{beforeExpr:!0,binop:7}),_typeof:kw("typeof",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_void:kw("void",{beforeExpr:!0,prefix:!0,startsExpr:!0}),_delete:kw("delete",{beforeExpr:!0,prefix:!0,startsExpr:!0})},lineBreak=/\r\n?|\n|\u2028|\u2029/,lineBreakG=new RegExp(lineBreak.source,"g");function isNewLine(e){return e===10||e===13||e===8232||e===8233}function nextLineBreak(e,t,n){n===void 0&&(n=e.length);for(var o=t;o<n;o++){var l=e.charCodeAt(o);if(isNewLine(l))return o<n-1&&l===13&&e.charCodeAt(o+1)===10?o+2:o+1}return-1}var nonASCIIwhitespace=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,skipWhiteSpace=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,ref=Object.prototype,hasOwnProperty=ref.hasOwnProperty,toString=ref.toString,hasOwn=Object.hasOwn||function(e,t){return hasOwnProperty.call(e,t)},isArray=Array.isArray||function(e){return toString.call(e)==="[object Array]"},regexpCache=Object.create(null);function wordsRegexp(e){return regexpCache[e]||(regexpCache[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function codePointToString(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var loneSurrogate=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Position=function e(t,n){this.line=t,this.column=n};Position.prototype.offset=function e(t){return new Position(this.line,this.column+t)};var SourceLocation=function e(t,n,o){this.start=n,this.end=o,t.sourceFile!==null&&(this.source=t.sourceFile)};function getLineInfo(e,t){for(var n=1,o=0;;){var l=nextLineBreak(e,o,t);if(l<0)return new Position(n,t-o);++n,o=l}}var defaultOptions={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:!1,allowImportExportEverywhere:!1,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:!1,checkPrivateFields:!0,locations:!1,onToken:null,onComment:null,ranges:!1,program:null,sourceFile:null,directSourceFile:null,preserveParens:!1},warnedAboutEcmaVersion=!1;function getOptions(e){var t={};for(var n in defaultOptions)t[n]=e&&hasOwn(e,n)?e[n]:defaultOptions[n];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!warnedAboutEcmaVersion&&typeof console=="object"&&console.warn&&(warnedAboutEcmaVersion=!0,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
|
|
1233
1233
|
Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),isArray(t.onToken)){var o=t.onToken;t.onToken=function(l){return o.push(l)}}return isArray(t.onComment)&&(t.onComment=pushComment(t,t.onComment)),t}function pushComment(e,t){return function(n,o,l,d,f,g){var b={type:n?"Block":"Line",value:o,start:l,end:d};e.locations&&(b.loc=new SourceLocation(this,f,g)),e.ranges&&(b.range=[l,d]),t.push(b)}}var SCOPE_TOP=1,SCOPE_FUNCTION=2,SCOPE_ASYNC=4,SCOPE_GENERATOR=8,SCOPE_ARROW=16,SCOPE_SIMPLE_CATCH=32,SCOPE_SUPER=64,SCOPE_DIRECT_SUPER=128,SCOPE_CLASS_STATIC_BLOCK=256,SCOPE_VAR=SCOPE_TOP|SCOPE_FUNCTION|SCOPE_CLASS_STATIC_BLOCK;function functionFlags(e,t){return SCOPE_FUNCTION|(e?SCOPE_ASYNC:0)|(t?SCOPE_GENERATOR:0)}var BIND_NONE=0,BIND_VAR=1,BIND_LEXICAL=2,BIND_FUNCTION=3,BIND_SIMPLE_CATCH=4,BIND_OUTSIDE=5,Parser=function e(t,n,o){this.options=t=getOptions(t),this.sourceFile=t.sourceFile,this.keywords=wordsRegexp(keywords$1[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var l="";t.allowReserved!==!0&&(l=reservedWords[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(l+=" await")),this.reservedWords=wordsRegexp(l);var d=(l?l+" ":"")+reservedWords.strict;this.reservedWordsStrict=wordsRegexp(d),this.reservedWordsStrictBind=wordsRegexp(d+" "+reservedWords.strictBind),this.input=String(n),this.containsEsc=!1,o?(this.pos=o,this.lineStart=this.input.lastIndexOf(`
|
|
@@ -1237,7 +1237,7 @@ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=1
|
|
|
1237
1237
|
`;break;default:e+=String.fromCharCode(n);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos}else++this.pos}},pp.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case"\\":++this.pos;break;case"$":if(this.input[this.pos+1]!=="{")break;case"`":return this.finishToken(types$1.invalidTemplate,this.input.slice(this.start,this.pos));case"\r":this.input[this.pos+1]===`
|
|
1238
1238
|
`&&++this.pos;case`
|
|
1239
1239
|
`:case"\u2028":case"\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template")},pp.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return`
|
|
1240
|
-
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var o=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(o,8);return l>255&&(o=o.slice(0,-1),l=parseInt(o,8)),this.pos+=o.length-1,t=this.input.charCodeAt(this.pos),(o!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-o.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return isNewLine(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},pp.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n},pp.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,o=this.options.ecmaVersion>=6;this.pos<this.input.length;){var l=this.fullCharCodeAtPos();if(isIdentifierChar(l,o))this.pos+=l<=65535?1:2;else if(l===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var d=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var f=this.readCodePoint();(t?isIdentifierStart:isIdentifierChar)(f,o)||this.invalidStringToken(d,"Invalid Unicode escape"),e+=codePointToString(f),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},pp.readWord=function(){var e=this.readWord1(),t=types$1.name;return this.keywords.test(e)&&(t=keywords[e]),this.finishToken(t,e)};var version="8.12.1";Parser.acorn={Parser,version,defaultOptions,Position,SourceLocation,getLineInfo,Node:Node$3,TokenType,tokTypes:types$1,keywordTypes:keywords,TokContext,tokContexts:types,isIdentifierChar,isIdentifierStart,Token,isNewLine,lineBreak,lineBreakG,nonASCIIwhitespace};var AcornJSX=__toESM(require_acorn_jsx()),attributeNames_default={acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",colspan:"colSpan",contenteditable:"contentEditable",crossorigin:"crossOrigin",datetime:"dateTime",enctype:"encType",for:"htmlFor",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",httpequiv:"httpEquiv",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"},VOID_ELEMENTS=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],NO_WHITESPACE=["table","tbody","tfoot","thead","tr"];function canHaveChildren(e){return VOID_ELEMENTS.indexOf(e.toLowerCase())===-1}function canHaveWhitespace(e){return NO_WHITESPACE.indexOf(e.toLowerCase())!==-1}class NullishShortCircuit extends Error{constructor(t="Nullish value encountered"){super(t),this.name="NullishShortCircuit"}}var hash=(e="",t=16)=>{const n=String(e);let o=0;return n.split("").forEach(l=>{o=(o<<5)-o+l.charCodeAt(0),o&=o}),Math.abs(o).toString(t)},randomHash=()=>hash(Math.random().toString()),camelCase=e=>e.replace(/([A-Z])([A-Z])/g,"$1 $2").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-zA-Z\u00C0-\u00ff]/g," ").toLowerCase().split(" ").filter(t=>t).map((t,n)=>n>0?t[0].toUpperCase()+t.slice(1):t).join(""),parseStyle=e=>{switch(typeof e){case"string":return e.split(";").filter(t=>t).reduce((t,n)=>{const o=n.slice(0,n.indexOf(":")).trim(),l=n.slice(n.indexOf(":")+1).trim();return{...t,[camelCase(o)]:l}},{});case"object":return e;default:return}},pathToArrayPath=e=>e==null||e===""?[]:e.split("."),resolveArrayPath=(e,t)=>{const[n,...o]=t;if(!(e==null||n==null))return o.length===0?e[n]:resolveArrayPath(e[n],o)},resolvePath=(e,t)=>resolveArrayPath(e,pathToArrayPath(t));function handleNaN(e){return Number.isNaN(e)?"NaN":e}class JsxParser extends React.Component{constructor(){super(...arguments);en(this,"ParsedChildren",null);zn(this,fn,n=>{const o=Parser.extend(AcornJSX.default({autoCloseVoidElements:this.props.autoCloseVoidElements})),l=`<root>${n}</root>`;let d=[];try{return d=o.parse(l,{ecmaVersion:"latest"}),d=d.body[0].expression.children||[],d.map(f=>on(this,rn).call(this,f)).filter(Boolean)}catch(f){return this.props.showWarnings&&console.warn(f),this.props.onError&&this.props.onError(f),this.props.renderError?this.props.renderError({error:String(f)}):null}});zn(this,rn,(n,o)=>{var l,d;switch(n.type){case"JSXAttribute":return n.value===null?!0:on(this,rn).call(this,n.value,o);case"JSXElement":case"JSXFragment":return on(this,Qn).call(this,n,o);case"JSXExpressionContainer":return on(this,rn).call(this,n.expression,o);case"JSXText":const f=this.props.disableKeyGeneration?void 0:randomHash();return this.props.disableFragments?n.value:React.createElement(React.Fragment,{key:f},n.value);case"ArrayExpression":return n.elements.map(A=>on(this,rn).call(this,A,o));case"BinaryExpression":const g=on(this,rn).call(this,n.left,o),b=on(this,rn).call(this,n.right,o);let _;switch(n.operator){case"-":_=g-b;break;case"!=":_=g!=b;break;case"!==":_=g!==b;break;case"*":_=g*b;break;case"**":_=g**b;break;case"/":_=g/b;break;case"%":_=g%b;break;case"+":_=g+b;break;case"<":_=g<b;break;case"<=":_=g<=b;break;case"==":_=g==b;break;case"===":_=g===b;break;case">":_=g>b;break;case">=":_=g>=b;break;default:this.props.onError(new Error(`Unsupported binary operator: ${n.operator}`));return}return handleNaN(_);case"CallExpression":const S=on(this,rn).call(this,n.callee,o);if(S===void 0){if(n.optional)throw new NullishShortCircuit;this.props.onError(new Error(`The expression '${n.callee}' could not be resolved, resulting in an undefined return value.`));return}return S(...n.arguments.map(A=>on(this,rn).call(this,A,o)));case"ConditionalExpression":return on(this,rn).call(this,n.test,o)?on(this,rn).call(this,n.consequent,o):on(this,rn).call(this,n.alternate,o);case"ExpressionStatement":return on(this,rn).call(this,n.expression,o);case"Identifier":return n.name==="Infinity"?1/0:n.name==="-Infinity"?-1/0:n.name==="NaN"?NaN:o&&n.name in o?handleNaN(o[n.name]):handleNaN((this.props.bindings||{})[n.name]);case"Literal":return n.value;case"LogicalExpression":const R=on(this,rn).call(this,n.left,o);return n.operator==="||"&&R?R:n.operator==="&&"&&R||n.operator==="||"&&!R?on(this,rn).call(this,n.right,o):!1;case"MemberExpression":return on(this,ar).call(this,n,o);case"ChainExpression":return on(this,ir).call(this,n,o);case"ObjectExpression":const C={};return n.properties.forEach(A=>{C[A.key.name||A.key.value]=on(this,rn).call(this,A.value,o)}),C;case"TemplateElement":return n.value.cooked;case"TemplateLiteral":return[...n.expressions,...n.quasis].sort((A,M)=>A.start<M.start?-1:1).map(A=>on(this,rn).call(this,A,o)).join("");case"UnaryExpression":const E=on(this,rn).call(this,n.argument,o);switch(n.operator){case"+":return+E;case"-":return-E;case"!":return!E;case"~":return~E;case"typeof":return typeof E}return;case"ArrowFunctionExpression":return(n.async||n.generator)&&((d=(l=this.props).onError)==null||d.call(l,new Error("Async and generator arrow functions are not supported."))),(...A)=>{const M={...o};return n.params.forEach((I,j)=>{M[I.name]=A[j]}),on(this,rn).call(this,n.body,M)};default:this.props.onError(new Error(`The expression type '${n.type}' is not supported.`));return}});zn(this,ir,(n,o)=>{try{return on(this,rn).call(this,n.expression,o)}catch(l){if(l instanceof NullishShortCircuit)return;throw l}});zn(this,ar,(n,o)=>{const l=on(this,rn).call(this,n.object,o);let d;if(n.computed)d=on(this,rn).call(this,n.property,o);else if(n.property.type==="Identifier")d=n.property.name;else{this.props.onError(new Error("Only simple MemberExpressions are supported."));return}if(l==null&&n.optional)throw new NullishShortCircuit;let f;try{f=l[d]}catch{this.props.onError(new Error(`The property '${d}' could not be resolved on the object '${l}'.`));return}return typeof f=="function"?f.bind(l):f});zn(this,Wn,n=>n.type==="JSXIdentifier"?n.name:`${on(this,Wn).call(this,n.object)}.${on(this,Wn).call(this,n.property)}`);zn(this,Qn,(n,o)=>{const{allowUnknownElements:l,components:d,componentsOnly:f,onError:g}=this.props,{children:b=[]}=n,_=n.type==="JSXElement"?n.openingElement:n.openingFragment,{attributes:S=[]}=_,R=n.type==="JSXElement"?on(this,Wn).call(this,_.name):"",C=(this.props.blacklistedAttrs||[]).map(Q=>Q instanceof RegExp?Q:new RegExp(Q,"i")),E=(this.props.blacklistedTags||[]).map(Q=>Q.trim().toLowerCase()).filter(Boolean);if(/^(html|head|body)$/i.test(R))return b.map(Q=>on(this,Qn).call(this,Q,o));const A=R.trim().toLowerCase();if(E.indexOf(A)!==-1)return g(new Error(`The tag <${R}> is blacklisted, and will not be rendered.`)),null;if(R!==""&&!resolvePath(d,R)){if(f)return g(new Error(`The component <${R}> is unrecognized, and will not be rendered.`)),this.props.renderUnrecognized(R);if(!l&&document.createElement(R)instanceof HTMLUnknownElement)return g(new Error(`The tag <${R}> is unrecognized in this browser, and will not be rendered.`)),this.props.renderUnrecognized(R)}let M,I=n.type==="JSXElement"?resolvePath(d,R):React.Fragment;if(I||canHaveChildren(R)){if(M=b.map(te=>on(this,rn).call(this,te,o)),R.includes(".")){const F=R.split(".").reduce((V,ne)=>V?V[ne]:d==null?void 0:d[ne],null);F&&(I=F)}!I&&!canHaveWhitespace(R)&&(M=M.filter(te=>typeof te!="string"||!/^\s*$/.test(te)));const Q=M.find(te=>typeof te=="function");M.length===0?M=void 0:Q?M=Q:M.length===1?[M]=M:M.length>1&&!this.props.disableKeyGeneration&&(M=M.map((te,F)=>te!=null&&te.type&&!(te!=null&&te.key)?{...te,key:te.key||F}:te))}const j={key:this.props.disableKeyGeneration?void 0:randomHash()};S.forEach(Q=>{if(Q.type==="JSXAttribute"){const te=Q.name.name,F=attributeNames_default[te]||te,V=on(this,rn).call(this,Q,o);C.filter(ae=>ae.test(F)).length===0&&(j[F]=V)}else if(Q.type==="JSXSpreadAttribute"&&Q.argument.type==="Identifier"||Q.argument.type==="MemberExpression"){const te=on(this,rn).call(this,Q.argument,o);typeof te=="object"&&Object.keys(te).forEach(F=>{const V=attributeNames_default[F]||F;C.filter(ae=>ae.test(V)).length===0&&(j[V]=te[F])})}}),typeof j.style=="string"&&(j.style=parseStyle(j.style));const q=R.toLowerCase();return q==="option"&&(M=M.props.children),React.createElement(I||q,j,M)})}render(){const n=(this.props.jsx||"").trim().replace(/<!DOCTYPE([^>]*)>/g,"");this.ParsedChildren=on(this,fn).call(this,n);const o=[...new Set(["jsx-parser",...String(this.props.className).split(" ")])].filter(Boolean).join(" ");return this.props.renderInWrapper?React.createElement("div",{className:o},this.ParsedChildren):this.ParsedChildren}}fn=new WeakMap,rn=new WeakMap,ir=new WeakMap,ar=new WeakMap,Wn=new WeakMap,Qn=new WeakMap,en(JsxParser,"displayName","JsxParser"),en(JsxParser,"defaultProps",{allowUnknownElements:!0,autoCloseVoidElements:!1,bindings:{},blacklistedAttrs:[/^on.+/i],blacklistedTags:["script"],className:"",components:{},componentsOnly:!1,disableFragments:!1,disableKeyGeneration:!1,jsx:"",onError:()=>{},showWarnings:!1,renderError:void 0,renderInWrapper:!0,renderUnrecognized:()=>null});var source_default=JsxParser;const CountryFlag=({countryCode:e,className:t=""})=>{const[n,o]=React.useState(null),[l,d]=React.useState(!1);return React.useEffect(()=>{if(!e)return;const g=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(g,{method:"HEAD"}).then(b=>{b.ok?(o(g),d(!1)):d(!0)}).catch(()=>{d(!0)})},[e]),l||!n?jsxRuntime.jsx("span",{className:t,children:e}):jsxRuntime.jsx("img",{src:n,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function ProductCard({applicationId:e,product:t,viewProductLink:n,defaultOpportunityNumber:o="",onAddToCart:l,addingToCart:d=!1,shopifyHostname:f,customAction:g=jsxRuntime.jsx(jsxRuntime.Fragment,{})}){var $t,rt,Rt,dt,It,Mt,Ct,Ke,Ye;const b=reactRouterDom.useNavigate(),{toast:_}=useToast(),[S,R]=React.useState(1),[C,E]=React.useState(null),[A,M]=React.useState(0),[I,j]=React.useState(!1),[q]=usePostV4ResellerByRouteResellerIdProductAndRandmarSkuShopifyMutation(),[Q,te]=React.useState(!1),[F,V]=React.useState(null),[ne,ae]=React.useState("idle"),[se,Oe]=React.useState(null),[Ne]=useLazyGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery(),oe=(($t=t==null?void 0:t.Distribution)==null?void 0:$t.Cost)||0,$e=((rt=t==null?void 0:t.Distribution)==null?void 0:rt.RegularPrice)||0,Ae=((Rt=t==null?void 0:t.Distribution)==null?void 0:Rt.Price)||0,je=!!(e&&(t!=null&&t.RandmarSKU));React.useEffect(()=>{R(1),E(null),M(0)},[t==null?void 0:t.RandmarSKU]),React.useEffect(()=>{var Ze;if(t&&o){const ct=(Ze=t.Opportunities)==null?void 0:Ze.find(mt=>mt.BidNumber==o);ct&&Be(ct)&&E(ct)}},[t,o]),React.useEffect(()=>{if(!t)return;const Ze=C!=null&&C.Price?C.Price:Ae;M($e>0?Math.round(($e-Ze)/$e*100):0)},[t,C,Ae,$e]),React.useEffect(()=>{d||R(1)},[d]),React.useEffect(()=>{if(!Q){V(null),ae("idle"),Oe(null);return}if(!e||!(t!=null&&t.RandmarSKU)){ae("error"),Oe("Missing identifiers to load performance data.");return}let Ze=!1;const ct=t.RandmarSKU;return(async()=>{ae("summary"),Oe(null);try{const ft=await Ne({routeApplicationId:e,randmarSku:ct,withSpecification:!1});if(Ze)return;if("error"in ft&&ft.error)throw ft.error;V(ft.data??null),ae("detailed");const yt=await Ne({routeApplicationId:e,randmarSku:ct,withSpecification:!0});if(Ze)return;if("error"in yt&&yt.error)throw yt.error;V(yt.data??ft.data??null),ae("complete")}catch(ft){if(Ze)return;console.error("Failed to load performance data for product modal",ft),ae("error"),Oe("We couldn't load the performance details. Please try again.")}})(),()=>{Ze=!0}},[e,Ne,Q,t==null?void 0:t.RandmarSKU]);const Be=Ze=>{if(Ze.Active!==!0)return!1;const ct=new Date().toISOString().split("T")[0];return!(Ze.EndDate&&Ze.EndDate.split("T")[0]<ct||Ze.StartDate&&Ze.StartDate.split("T")[0]>ct)},qe=Ze=>Ze>=90?{label:"Top 10% Bestseller",color:"text-purple-950",bgColor:"bg-purple-200"}:Ze>=75?{label:"Bestseller",color:"text-blue-700",bgColor:"bg-blue-50"}:Ze>=33?{label:"Popular",color:"text-green-700",bgColor:"bg-green-50"}:{label:"Rising",color:"text-gray-700",bgColor:"bg-white"},Ve=ne!=="complete"&&ne!=="error",Le=ne==="summary"?40:ne==="detailed"?80:10,He=(F==null?void 0:F.SalesStatistics)??[],We=Ve?[]:He,ze=(F==null?void 0:F.RandmarTitle)??(t==null?void 0:t.RandmarTitle)??(t==null?void 0:t.RandmarSKU)??"this product",Xe=(F==null?void 0:F.RandmarSKU)??(t==null?void 0:t.RandmarSKU);if(!t)return jsxRuntime.jsx(Card,{children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-28 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex gap-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx("div",{className:"w-60 h-40",children:jsxRuntime.jsx(Skeleton,{className:"w-full h-full rounded-lg"})})})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-24 mb-3"}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-full rounded-md"})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-32 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24 mt-4"})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-10 flex-1 rounded-md"})]})]})]})});const nt=(t==null?void 0:t.Opportunities)||[],Je=nt.length>0,st=()=>{if(S==null){R(1);return}S>1&&R(S-1)},et=()=>{if(S==null){R(1);return}R(S+1)},at=Ze=>{const ct=Number.parseInt(Ze.target.value,10);if(!isNaN(ct)&&ct>0){R(ct);return}R(void 0)},tt=()=>{(S==null||S<1)&&R(1)},ot=Ze=>{try{return new Date(Ze).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(ct){return console.error(ct),Ze.split("T")[0]||"N/A"}},lt=()=>{typeof l<"u"&&l({quantity:S??1,bidNumber:(C==null?void 0:C.BidNumber)??null})},Ge=()=>{I||!f||(j(!0),q({routeResellerId:e??"",randmarSku:t.RandmarSKU??"",shopifyHostName:f}).then(Ze=>{if(Ze.error){console.error("Error syncing to Shopify:",Ze.error),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"});return}_({title:"Product synced",description:"Product synced to Shopify successfully",variant:"success"})}).catch(Ze=>{console.error("Error syncing to Shopify:",Ze),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"})}).finally(()=>{j(!1)}))};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Card,{className:"w-full hover:shadow-lg transition-shadow @container",children:jsxRuntime.jsxs(CardContent,{className:"p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-xl",children:t.Title||t.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex items-center justify-end ml-4 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:t.ManufacturerId,name:t.ManufacturerName,width:96,height:40},`partner_logo_${t.ManufacturerId}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6",children:[jsxRuntime.jsxs("div",{className:"flex-1 @[36rem]:order-1 order-2 flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-center @[36rem]:items-start @[36rem]:justify-start",children:[t.State&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Check,{size:"12",className:"mr-1.5"})," ",t.State]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[jsxRuntime.jsx(QrCode,{size:"12",className:"mr-1.5"})," ",t.SerialNumber?"Serialized":"Unserialized"]}),t.TransparencyCode&&jsxRuntime.jsxs(Badge,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[jsxRuntime.jsx(CircleDashed,{size:"12",className:"mr-1.5"})," Transparency Code"]}),t.AvailableToBuy!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(ShoppingCart,{size:"12",className:"mr-1.5"})," ",t.AvailableToBuy?"Available":"Unavailable"]}),t.ManufacturerCategory!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${(dt=t.ManufacturerCategory)!=null&&dt.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[jsxRuntime.jsx(ShieldCheck,{size:"12",className:"mr-1.5"})," ",(It=t.ManufacturerCategory)!=null&&It.QualificationRequired?"Qualified Only":"Available to all"]}),t.ManufacturerId&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(RefreshCw,{size:"12",className:"mr-1.5"})," ",t.AutoUpdate?`Automatic Reorder (${t.MasterCarton})`:"Manually Reorders"]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.BodyHTML&&t.Title&&t.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Store,{size:"12",className:"mr-1.5"})," ",t.BodyHTML&&t.Title&&t.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.MPN||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.UPC||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.UnitWeight?`${formatNumber(t.UnitWeight)} lbs`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["MAP",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),"MSRP"]}),jsxRuntime.jsxs("div",{className:"font-medium",children:[t.MAP?formatMoney(t.MAP):"N/A",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),t.MSRP?formatMoney(t.MSRP):"N/A"]})]}),!!t.OverallPercentileRank&&!!t.ManufacturerPercentileRank&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Bestseller Status"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{children:"Global: "}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${qe(t.OverallPercentileRank).bgColor} ${qe(t.OverallPercentileRank).color} hover:${qe(t.OverallPercentileRank).bgColor}`,children:qe(t.OverallPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",t.OverallPercentileRank]})})]})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("span",{children:[t.ManufacturerName,": "]}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${qe(t.ManufacturerPercentileRank).bgColor} ${qe(t.ManufacturerPercentileRank).color} hover:${qe(t.ManufacturerPercentileRank).bgColor}`,children:qe(t.ManufacturerPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",t.ManufacturerPercentileRank]})})]})})]})]})]}),t.CountryCodeOfOrigin&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),jsxRuntime.jsxs("div",{className:"font-medium flex items-center",children:[jsxRuntime.jsx(CountryFlag,{countryCode:t.CountryCodeOfOrigin,className:"mr-2"}),t.CountryCodeOfOrigin]})]})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:order-2 order-1 items-center",children:jsxRuntime.jsx(ProductImage,{randmarSKU:t.RandmarSKU||"",alt:t.RandmarTitle||""},`product_image_${t.RandmarSKU}`)})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:flex-row gap-6 mt-4",children:jsxRuntime.jsx("div",{className:"flex flex-1 @[36rem]:order-1 order-2",children:Je&&t.Distribution&&jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx("div",{className:"flex items-center",children:"You have "+nt.length+(nt.length>1?" opportunities":" opportunity")+" for this product:"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:nt.map((Ze,ct)=>Be(Ze)?jsxRuntime.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 border border-muted cursor-pointer ${Ze.BidNumber==(C==null?void 0:C.BidNumber)?"bg-purple-100 border-2 border-purple-900":"bg-white border-1 border-purple-600 hover:bg-purple-200"}`,onClick:()=>{E(Ze.BidNumber!==(C==null?void 0:C.BidNumber)?Ze:null)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsx("span",{className:"text-xs text-neutral-900",children:Ze.BidNumber})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",ot(Ze.EndDate)]})]})]},ct):jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted cursor-pointer !bg-neutral-50 hover:bg-neutral-100",onClick:()=>{Ze.BidNumber&&b(`/${e}/Opportunity/${Ze.ManufacturerId}/${Ze.BidNumber}`)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsxs("span",{className:"text-xs text-neutral-900",children:[Ze.BidNumber," ",jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",ot(Ze.EndDate)]})]})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"View Opportunity"})})]},ct))})})]})})}),jsxRuntime.jsxs("div",{className:"mt-4 flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end gap-4",children:[jsxRuntime.jsx("div",{className:"flex flex-col gap-3 flex-1",children:t.Distribution&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:oe>0?jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:["Cost: ",formatMoney(oe)]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap",children:[$e>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("span",{className:"text-2xl font-bold whitespace-nowrap",children:formatMoney((C?(Ct=(Mt=t.Opportunities)==null?void 0:Mt.find(Ze=>Ze.BidNumber==C.BidNumber))==null?void 0:Ct.Price:Ae)??0)})}),A>0&&jsxRuntime.jsx("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:formatMoney($e)})]}),A>0&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Badge,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[jsxRuntime.jsxs("span",{children:[A,"% OFF"]}),((Ke=t.InstantRebate)==null?void 0:Ke.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",t.InstantRebate.EndDate.split("T")[0]]}),(C==null?void 0:C.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",C.EndDate.split("T")[0]]})]})})]})})}),jsxRuntime.jsxs("div",{className:"flex flex-col justify-center @[36rem]:justify-end items-end gap-2 w-full @[36rem]:w-auto",children:[f&&jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:Ge,disabled:I,children:I?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Sync to Shopify"]})}),g,typeof l<"u"&&jsxRuntime.jsxs("div",{className:"flex gap-2 whitespace-nowrap",children:[jsxRuntime.jsxs("div",{className:"flex items-center border rounded-md",children:[jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:st,disabled:typeof S<"u"&&(S<=1||!t.AvailableToBuy||d),children:"-"}),jsxRuntime.jsx("input",{value:S,onChange:at,onBlur:tt,onClick:Ze=>Ze.currentTarget.select(),className:`w-6 @[36rem]:w-12 text-center border-0 focus:ring-0 focus:outline-none ${!t.AvailableToBuy||d?"text-gray-400":""}`,disabled:!t.AvailableToBuy||d}),jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:et,disabled:!t.AvailableToBuy||d,children:"+"})]}),jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap",onClick:lt,disabled:!t.AvailableToBuy||d,children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Add to Cart"]})})]})]})]}),jsxRuntime.jsxs("div",{className:"flex w-full flex-col gap-2 @[36rem]:flex-row",children:[jsxRuntime.jsx("div",{className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsxs(Button$1,{variant:"outline",type:"button",className:"h-11 px-4 text-sm font-medium justify-start w-full",onClick:()=>te(!0),disabled:!je,children:[jsxRuntime.jsx(ChartLine,{className:"mr-2"}),"View statistics"]})}),jsxRuntime.jsx("div",{className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsx(ProductInventoryButton,{applicationId:e??"",randmarSku:t.RandmarSKU??"",inventory:(Ye=t.Distribution)==null?void 0:Ye.Inventory,buttonSize:"lg",buttonClassName:"w-full h-11 justify-start"})}),n&&jsxRuntime.jsx(reactRouterDom.Link,{to:n,className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsxs(Button$1,{variant:"outline",className:"h-11 px-4 text-sm font-medium justify-start w-full",children:[jsxRuntime.jsx(Eye,{className:"mr-2"}),"View Product"]})})]})]})]})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:te,children:jsxRuntime.jsxs(DialogContent,{className:"w-[min(95vw,1100px)] max-w-5xl space-y-6",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Monthly Sales Performance"}),jsxRuntime.jsxs(DialogDescription,{children:["Expanded product insights for ",ze,Xe?` (SKU ${Xe})`:""]})]}),jsxRuntime.jsx("div",{className:"space-y-6",children:se?jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(AlertTitle,{children:"Unable to load details"}),jsxRuntime.jsx(AlertDescription,{children:se})]}):jsxRuntime.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[jsxRuntime.jsxs("div",{className:"mb-4 space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Rolling 12-month sales dollars and units sold pulled from the detailed endpoint."}),Ve&&jsxRuntime.jsx("div",{"aria-live":"polite","aria-busy":"true",children:jsxRuntime.jsx(Progress,{value:Le,className:"h-2 w-full animate-pulse","aria-label":"Loading performance data"})})]}),jsxRuntime.jsx(SalesChart,{statistics:We,mode:"month",chartHeight:320}),Ve&&jsxRuntime.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Gathering product summary and sales statistics..."})]})})]})})]})}const complexComponents=[`----
|
|
1240
|
+
`;case 114:return"\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return codePointToString(this.readCodePoint());case 116:return" ";case 98:return"\b";case 118:return"\v";case 102:return"\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var n=this.pos-1;this.invalidStringToken(n,"Invalid escape sequence in template string")}default:if(t>=48&&t<=55){var o=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],l=parseInt(o,8);return l>255&&(o=o.slice(0,-1),l=parseInt(o,8)),this.pos+=o.length-1,t=this.input.charCodeAt(this.pos),(o!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-o.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(l)}return isNewLine(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}},pp.readHexChar=function(e){var t=this.pos,n=this.readInt(16,e);return n===null&&this.invalidStringToken(t,"Bad character escape sequence"),n},pp.readWord1=function(){this.containsEsc=!1;for(var e="",t=!0,n=this.pos,o=this.options.ecmaVersion>=6;this.pos<this.input.length;){var l=this.fullCharCodeAtPos();if(isIdentifierChar(l,o))this.pos+=l<=65535?1:2;else if(l===92){this.containsEsc=!0,e+=this.input.slice(n,this.pos);var d=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var f=this.readCodePoint();(t?isIdentifierStart:isIdentifierChar)(f,o)||this.invalidStringToken(d,"Invalid Unicode escape"),e+=codePointToString(f),n=this.pos}else break;t=!1}return e+this.input.slice(n,this.pos)},pp.readWord=function(){var e=this.readWord1(),t=types$1.name;return this.keywords.test(e)&&(t=keywords[e]),this.finishToken(t,e)};var version="8.12.1";Parser.acorn={Parser,version,defaultOptions,Position,SourceLocation,getLineInfo,Node:Node$3,TokenType,tokTypes:types$1,keywordTypes:keywords,TokContext,tokContexts:types,isIdentifierChar,isIdentifierStart,Token,isNewLine,lineBreak,lineBreakG,nonASCIIwhitespace};var AcornJSX=__toESM(require_acorn_jsx()),attributeNames_default={acceptcharset:"acceptCharset",accesskey:"accessKey",allowfullscreen:"allowFullScreen",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autofocus:"autoFocus",autoplay:"autoPlay",cellpadding:"cellPadding",cellspacing:"cellSpacing",charset:"charSet",class:"className",colspan:"colSpan",contenteditable:"contentEditable",crossorigin:"crossOrigin",datetime:"dateTime",enctype:"encType",for:"htmlFor",formaction:"formAction",formenctype:"formEncType",formmethod:"formMethod",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",hreflang:"hrefLang",httpequiv:"httpEquiv",inputmode:"inputMode",keyparams:"keyParams",keytype:"keyType",marginheight:"marginHeight",marginwidth:"marginWidth",maxlength:"maxLength",mediagroup:"mediaGroup",minlength:"minLength",novalidate:"noValidate",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rowspan:"rowSpan",spellcheck:"spellCheck",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",tabindex:"tabIndex",usemap:"useMap"},VOID_ELEMENTS=["area","base","br","col","embed","hr","img","input","keygen","link","menuitem","meta","param","source","track","wbr"],NO_WHITESPACE=["table","tbody","tfoot","thead","tr"];function canHaveChildren(e){return VOID_ELEMENTS.indexOf(e.toLowerCase())===-1}function canHaveWhitespace(e){return NO_WHITESPACE.indexOf(e.toLowerCase())!==-1}class NullishShortCircuit extends Error{constructor(t="Nullish value encountered"){super(t),this.name="NullishShortCircuit"}}var hash=(e="",t=16)=>{const n=String(e);let o=0;return n.split("").forEach(l=>{o=(o<<5)-o+l.charCodeAt(0),o&=o}),Math.abs(o).toString(t)},randomHash=()=>hash(Math.random().toString()),camelCase=e=>e.replace(/([A-Z])([A-Z])/g,"$1 $2").replace(/([a-z])([A-Z])/g,"$1 $2").replace(/[^a-zA-Z\u00C0-\u00ff]/g," ").toLowerCase().split(" ").filter(t=>t).map((t,n)=>n>0?t[0].toUpperCase()+t.slice(1):t).join(""),parseStyle=e=>{switch(typeof e){case"string":return e.split(";").filter(t=>t).reduce((t,n)=>{const o=n.slice(0,n.indexOf(":")).trim(),l=n.slice(n.indexOf(":")+1).trim();return{...t,[camelCase(o)]:l}},{});case"object":return e;default:return}},pathToArrayPath=e=>e==null||e===""?[]:e.split("."),resolveArrayPath=(e,t)=>{const[n,...o]=t;if(!(e==null||n==null))return o.length===0?e[n]:resolveArrayPath(e[n],o)},resolvePath=(e,t)=>resolveArrayPath(e,pathToArrayPath(t));function handleNaN(e){return Number.isNaN(e)?"NaN":e}class JsxParser extends React.Component{constructor(){super(...arguments);en(this,"ParsedChildren",null);zn(this,fn,n=>{const o=Parser.extend(AcornJSX.default({autoCloseVoidElements:this.props.autoCloseVoidElements})),l=`<root>${n}</root>`;let d=[];try{return d=o.parse(l,{ecmaVersion:"latest"}),d=d.body[0].expression.children||[],d.map(f=>on(this,rn).call(this,f)).filter(Boolean)}catch(f){return this.props.showWarnings&&console.warn(f),this.props.onError&&this.props.onError(f),this.props.renderError?this.props.renderError({error:String(f)}):null}});zn(this,rn,(n,o)=>{var l,d;switch(n.type){case"JSXAttribute":return n.value===null?!0:on(this,rn).call(this,n.value,o);case"JSXElement":case"JSXFragment":return on(this,Qn).call(this,n,o);case"JSXExpressionContainer":return on(this,rn).call(this,n.expression,o);case"JSXText":const f=this.props.disableKeyGeneration?void 0:randomHash();return this.props.disableFragments?n.value:React.createElement(React.Fragment,{key:f},n.value);case"ArrayExpression":return n.elements.map(A=>on(this,rn).call(this,A,o));case"BinaryExpression":const g=on(this,rn).call(this,n.left,o),b=on(this,rn).call(this,n.right,o);let _;switch(n.operator){case"-":_=g-b;break;case"!=":_=g!=b;break;case"!==":_=g!==b;break;case"*":_=g*b;break;case"**":_=g**b;break;case"/":_=g/b;break;case"%":_=g%b;break;case"+":_=g+b;break;case"<":_=g<b;break;case"<=":_=g<=b;break;case"==":_=g==b;break;case"===":_=g===b;break;case">":_=g>b;break;case">=":_=g>=b;break;default:this.props.onError(new Error(`Unsupported binary operator: ${n.operator}`));return}return handleNaN(_);case"CallExpression":const S=on(this,rn).call(this,n.callee,o);if(S===void 0){if(n.optional)throw new NullishShortCircuit;this.props.onError(new Error(`The expression '${n.callee}' could not be resolved, resulting in an undefined return value.`));return}return S(...n.arguments.map(A=>on(this,rn).call(this,A,o)));case"ConditionalExpression":return on(this,rn).call(this,n.test,o)?on(this,rn).call(this,n.consequent,o):on(this,rn).call(this,n.alternate,o);case"ExpressionStatement":return on(this,rn).call(this,n.expression,o);case"Identifier":return n.name==="Infinity"?1/0:n.name==="-Infinity"?-1/0:n.name==="NaN"?NaN:o&&n.name in o?handleNaN(o[n.name]):handleNaN((this.props.bindings||{})[n.name]);case"Literal":return n.value;case"LogicalExpression":const R=on(this,rn).call(this,n.left,o);return n.operator==="||"&&R?R:n.operator==="&&"&&R||n.operator==="||"&&!R?on(this,rn).call(this,n.right,o):!1;case"MemberExpression":return on(this,ar).call(this,n,o);case"ChainExpression":return on(this,ir).call(this,n,o);case"ObjectExpression":const C={};return n.properties.forEach(A=>{C[A.key.name||A.key.value]=on(this,rn).call(this,A.value,o)}),C;case"TemplateElement":return n.value.cooked;case"TemplateLiteral":return[...n.expressions,...n.quasis].sort((A,M)=>A.start<M.start?-1:1).map(A=>on(this,rn).call(this,A,o)).join("");case"UnaryExpression":const E=on(this,rn).call(this,n.argument,o);switch(n.operator){case"+":return+E;case"-":return-E;case"!":return!E;case"~":return~E;case"typeof":return typeof E}return;case"ArrowFunctionExpression":return(n.async||n.generator)&&((d=(l=this.props).onError)==null||d.call(l,new Error("Async and generator arrow functions are not supported."))),(...A)=>{const M={...o};return n.params.forEach((I,j)=>{M[I.name]=A[j]}),on(this,rn).call(this,n.body,M)};default:this.props.onError(new Error(`The expression type '${n.type}' is not supported.`));return}});zn(this,ir,(n,o)=>{try{return on(this,rn).call(this,n.expression,o)}catch(l){if(l instanceof NullishShortCircuit)return;throw l}});zn(this,ar,(n,o)=>{const l=on(this,rn).call(this,n.object,o);let d;if(n.computed)d=on(this,rn).call(this,n.property,o);else if(n.property.type==="Identifier")d=n.property.name;else{this.props.onError(new Error("Only simple MemberExpressions are supported."));return}if(l==null&&n.optional)throw new NullishShortCircuit;let f;try{f=l[d]}catch{this.props.onError(new Error(`The property '${d}' could not be resolved on the object '${l}'.`));return}return typeof f=="function"?f.bind(l):f});zn(this,Wn,n=>n.type==="JSXIdentifier"?n.name:`${on(this,Wn).call(this,n.object)}.${on(this,Wn).call(this,n.property)}`);zn(this,Qn,(n,o)=>{const{allowUnknownElements:l,components:d,componentsOnly:f,onError:g}=this.props,{children:b=[]}=n,_=n.type==="JSXElement"?n.openingElement:n.openingFragment,{attributes:S=[]}=_,R=n.type==="JSXElement"?on(this,Wn).call(this,_.name):"",C=(this.props.blacklistedAttrs||[]).map(Q=>Q instanceof RegExp?Q:new RegExp(Q,"i")),E=(this.props.blacklistedTags||[]).map(Q=>Q.trim().toLowerCase()).filter(Boolean);if(/^(html|head|body)$/i.test(R))return b.map(Q=>on(this,Qn).call(this,Q,o));const A=R.trim().toLowerCase();if(E.indexOf(A)!==-1)return g(new Error(`The tag <${R}> is blacklisted, and will not be rendered.`)),null;if(R!==""&&!resolvePath(d,R)){if(f)return g(new Error(`The component <${R}> is unrecognized, and will not be rendered.`)),this.props.renderUnrecognized(R);if(!l&&document.createElement(R)instanceof HTMLUnknownElement)return g(new Error(`The tag <${R}> is unrecognized in this browser, and will not be rendered.`)),this.props.renderUnrecognized(R)}let M,I=n.type==="JSXElement"?resolvePath(d,R):React.Fragment;if(I||canHaveChildren(R)){if(M=b.map(te=>on(this,rn).call(this,te,o)),R.includes(".")){const F=R.split(".").reduce((V,ne)=>V?V[ne]:d==null?void 0:d[ne],null);F&&(I=F)}!I&&!canHaveWhitespace(R)&&(M=M.filter(te=>typeof te!="string"||!/^\s*$/.test(te)));const Q=M.find(te=>typeof te=="function");M.length===0?M=void 0:Q?M=Q:M.length===1?[M]=M:M.length>1&&!this.props.disableKeyGeneration&&(M=M.map((te,F)=>te!=null&&te.type&&!(te!=null&&te.key)?{...te,key:te.key||F}:te))}const j={key:this.props.disableKeyGeneration?void 0:randomHash()};S.forEach(Q=>{if(Q.type==="JSXAttribute"){const te=Q.name.name,F=attributeNames_default[te]||te,V=on(this,rn).call(this,Q,o);C.filter(ae=>ae.test(F)).length===0&&(j[F]=V)}else if(Q.type==="JSXSpreadAttribute"&&Q.argument.type==="Identifier"||Q.argument.type==="MemberExpression"){const te=on(this,rn).call(this,Q.argument,o);typeof te=="object"&&Object.keys(te).forEach(F=>{const V=attributeNames_default[F]||F;C.filter(ae=>ae.test(V)).length===0&&(j[V]=te[F])})}}),typeof j.style=="string"&&(j.style=parseStyle(j.style));const q=R.toLowerCase();return q==="option"&&(M=M.props.children),React.createElement(I||q,j,M)})}render(){const n=(this.props.jsx||"").trim().replace(/<!DOCTYPE([^>]*)>/g,"");this.ParsedChildren=on(this,fn).call(this,n);const o=[...new Set(["jsx-parser",...String(this.props.className).split(" ")])].filter(Boolean).join(" ");return this.props.renderInWrapper?React.createElement("div",{className:o},this.ParsedChildren):this.ParsedChildren}}fn=new WeakMap,rn=new WeakMap,ir=new WeakMap,ar=new WeakMap,Wn=new WeakMap,Qn=new WeakMap,en(JsxParser,"displayName","JsxParser"),en(JsxParser,"defaultProps",{allowUnknownElements:!0,autoCloseVoidElements:!1,bindings:{},blacklistedAttrs:[/^on.+/i],blacklistedTags:["script"],className:"",components:{},componentsOnly:!1,disableFragments:!1,disableKeyGeneration:!1,jsx:"",onError:()=>{},showWarnings:!1,renderError:void 0,renderInWrapper:!0,renderUnrecognized:()=>null});var source_default=JsxParser;const CountryFlag=({countryCode:e,className:t=""})=>{const[n,o]=React.useState(null),[l,d]=React.useState(!1);return React.useEffect(()=>{if(!e)return;const g=`https://purecatamphetamine.github.io/country-flag-icons/3x2/${e.toUpperCase()}.svg`;fetch(g,{method:"HEAD"}).then(b=>{b.ok?(o(g),d(!1)):d(!0)}).catch(()=>{d(!0)})},[e]),l||!n?jsxRuntime.jsx("span",{className:t,children:e}):jsxRuntime.jsx("img",{src:n,alt:`${e} flag`,className:`inline-block ${t}`,style:{width:"24px",height:"auto"}})};function ProductCard({applicationId:e,product:t,viewProductLink:n,defaultOpportunityNumber:o="",onAddToCart:l,addingToCart:d=!1,shopifyHostname:f,customAction:g=jsxRuntime.jsx(jsxRuntime.Fragment,{})}){var $t,rt,Rt,dt,It,Mt,Ct,Ke,Ye;const b=reactRouterDom.useNavigate(),{toast:_}=useToast(),[S,R]=React.useState(1),[C,E]=React.useState(null),[A,M]=React.useState(0),[I,j]=React.useState(!1),[q]=usePostV4ResellerByRouteResellerIdProductAndRandmarSkuShopifyMutation(),[Q,te]=React.useState(!1),[F,V]=React.useState(null),[ne,ae]=React.useState("idle"),[se,Oe]=React.useState(null),[Ne]=useLazyGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery(),oe=(($t=t==null?void 0:t.Distribution)==null?void 0:$t.Cost)||0,$e=((rt=t==null?void 0:t.Distribution)==null?void 0:rt.RegularPrice)||0,Ae=((Rt=t==null?void 0:t.Distribution)==null?void 0:Rt.Price)||0,je=!!(e&&(t!=null&&t.RandmarSKU));React.useEffect(()=>{R(1),E(null),M(0)},[t==null?void 0:t.RandmarSKU]),React.useEffect(()=>{var Ze;if(t&&o){const ct=(Ze=t.Opportunities)==null?void 0:Ze.find(mt=>mt.BidNumber==o);ct&&Be(ct)&&E(ct)}},[t,o]),React.useEffect(()=>{if(!t)return;const Ze=C!=null&&C.Price?C.Price:Ae;M($e>0?Math.round(($e-Ze)/$e*100):0)},[t,C,Ae,$e]),React.useEffect(()=>{d||R(1)},[d]),React.useEffect(()=>{if(!Q){V(null),ae("idle"),Oe(null);return}if(!e||!(t!=null&&t.RandmarSKU)){ae("error"),Oe("Missing identifiers to load performance data.");return}let Ze=!1;const ct=t.RandmarSKU;return(async()=>{ae("summary"),Oe(null);try{const ft=await Ne({routeApplicationId:e,randmarSku:ct,withSpecification:!1});if(Ze)return;if("error"in ft&&ft.error)throw ft.error;V(ft.data??null),ae("detailed");const yt=await Ne({routeApplicationId:e,randmarSku:ct,withSpecification:!0});if(Ze)return;if("error"in yt&&yt.error)throw yt.error;V(yt.data??ft.data??null),ae("complete")}catch(ft){if(Ze)return;console.error("Failed to load performance data for product modal",ft),ae("error"),Oe("We couldn't load the performance details. Please try again.")}})(),()=>{Ze=!0}},[e,Ne,Q,t==null?void 0:t.RandmarSKU]);const Be=Ze=>{if(Ze.Active!==!0)return!1;const ct=new Date().toISOString().split("T")[0];return!(Ze.EndDate&&Ze.EndDate.split("T")[0]<ct||Ze.StartDate&&Ze.StartDate.split("T")[0]>ct)},qe=Ze=>Ze>=90?{label:"Top 10% Bestseller",color:"text-purple-950",bgColor:"bg-purple-200"}:Ze>=75?{label:"Bestseller",color:"text-blue-700",bgColor:"bg-blue-50"}:Ze>=33?{label:"Popular",color:"text-green-700",bgColor:"bg-green-50"}:{label:"Rising",color:"text-gray-700",bgColor:"bg-white"},Ve=ne!=="complete"&&ne!=="error",Le=ne==="summary"?40:ne==="detailed"?80:10,He=(F==null?void 0:F.SalesStatistics)??[],We=Ve?[]:He,ze=(F==null?void 0:F.RandmarTitle)??(t==null?void 0:t.RandmarTitle)??(t==null?void 0:t.RandmarSKU)??"this product",Xe=(F==null?void 0:F.RandmarSKU)??(t==null?void 0:t.RandmarSKU);if(!t)return jsxRuntime.jsx(Card,{className:"flex h-full w-full flex-col",children:jsxRuntime.jsxs(CardContent,{className:"flex h-full flex-col p-6",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx(Skeleton,{className:"h-7 w-3/4"}),jsxRuntime.jsx("div",{className:"h-10 w-24 flex items-center justify-end ml-4",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-20 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-28 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"flex gap-6",children:[jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-6 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-20 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-16"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-12 mb-1"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-20"})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col",children:jsxRuntime.jsx("div",{className:"w-60 h-40",children:jsxRuntime.jsx(Skeleton,{className:"w-full h-full rounded-lg"})})})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsx("div",{className:"flex flex-1",children:jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-24 mb-3"}),jsxRuntime.jsx(Skeleton,{className:"h-16 w-full rounded-md"})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-center",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-32 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24 mt-4"})]})]}),jsxRuntime.jsxs("div",{className:"flex gap-6 mt-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-col items-start gap-1 mb-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-8 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex flex-1 items-center gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-10 flex-1 rounded-md"})]})]})]})});const nt=(t==null?void 0:t.Opportunities)||[],Je=nt.length>0,st=()=>{if(S==null){R(1);return}S>1&&R(S-1)},et=()=>{if(S==null){R(1);return}R(S+1)},at=Ze=>{const ct=Number.parseInt(Ze.target.value,10);if(!isNaN(ct)&&ct>0){R(ct);return}R(void 0)},tt=()=>{(S==null||S<1)&&R(1)},ot=Ze=>{try{return new Date(Ze).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"})}catch(ct){return console.error(ct),Ze.split("T")[0]||"N/A"}},lt=()=>{typeof l<"u"&&l({quantity:S??1,bidNumber:(C==null?void 0:C.BidNumber)??null})},Ge=()=>{I||!f||(j(!0),q({routeResellerId:e??"",randmarSku:t.RandmarSKU??"",shopifyHostName:f}).then(Ze=>{if(Ze.error){console.error("Error syncing to Shopify:",Ze.error),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"});return}_({title:"Product synced",description:"Product synced to Shopify successfully",variant:"success"})}).catch(Ze=>{console.error("Error syncing to Shopify:",Ze),_({title:"Product synced failed.",description:"Error syncing to Shopify:",variant:"destructive"})}).finally(()=>{j(!1)}))};return jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Card,{className:"flex h-full w-full flex-col hover:shadow-lg transition-shadow @container",children:jsxRuntime.jsxs(CardContent,{className:"flex h-full flex-col p-6",children:[jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-3",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-xl",children:t.Title||t.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex items-center justify-end ml-4 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:t.ManufacturerId,name:t.ManufacturerName,width:96,height:40},`partner_logo_${t.ManufacturerId}`)})]}),jsxRuntime.jsxs("div",{className:"flex flex-col @[36rem]:flex-row gap-6",children:[jsxRuntime.jsxs("div",{className:"flex-1 @[36rem]:order-1 order-2 flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 items-center justify-center @[36rem]:items-start @[36rem]:justify-start",children:[t.State&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.State==="Active"?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Check,{size:"12",className:"mr-1.5"})," ",t.State]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.SerialNumber?"bg-green-50 text-green-700 hover:bg-green-50":"bg-yellow-50 text-yellow-700 hover:bg-yellow-50"}`,children:[jsxRuntime.jsx(QrCode,{size:"12",className:"mr-1.5"})," ",t.SerialNumber?"Serialized":"Unserialized"]}),t.TransparencyCode&&jsxRuntime.jsxs(Badge,{variant:"outline",className:"rounded-full px-3 bg-green-50 text-green-700 hover:bg-green-50",children:[jsxRuntime.jsx(CircleDashed,{size:"12",className:"mr-1.5"})," Transparency Code"]}),t.AvailableToBuy!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.AvailableToBuy?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(ShoppingCart,{size:"12",className:"mr-1.5"})," ",t.AvailableToBuy?"Available":"Unavailable"]}),t.ManufacturerCategory!==void 0&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${(dt=t.ManufacturerCategory)!=null&&dt.QualificationRequired?"bg-blue-50 text-blue-700 hover:bg-blue-50":"bg-neutral-50 text-neutral-700 hover:bg-neutral-50"}`,children:[jsxRuntime.jsx(ShieldCheck,{size:"12",className:"mr-1.5"})," ",(It=t.ManufacturerCategory)!=null&&It.QualificationRequired?"Qualified Only":"Available to all"]}),t.ManufacturerId&&jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.AutoUpdate?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(RefreshCw,{size:"12",className:"mr-1.5"})," ",t.AutoUpdate?`Automatic Reorder (${t.MasterCarton})`:"Manually Reorders"]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:`rounded-full px-3 ${t.BodyHTML&&t.Title&&t.MAP?"bg-green-50 text-green-700 hover:bg-green-50":"bg-red-50 text-red-700 hover:bg-red-50"}`,children:[jsxRuntime.jsx(Store,{size:"12",className:"mr-1.5"})," ",t.BodyHTML&&t.Title&&t.MAP?"Shopify Ready":"Not Shopify Ready"]})]}),jsxRuntime.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-4 flex-1",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"MPN"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.MPN||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"UPC"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.UPC||"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Unit Weight"}),jsxRuntime.jsx("div",{className:"font-medium",children:t.UnitWeight?`${formatNumber(t.UnitWeight)} lbs`:"N/A"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"text-sm text-muted-foreground",children:["MAP",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),"MSRP"]}),jsxRuntime.jsxs("div",{className:"font-medium",children:[t.MAP?formatMoney(t.MAP):"N/A",jsxRuntime.jsx("span",{className:"text-primary",children:" / "}),t.MSRP?formatMoney(t.MSRP):"N/A"]})]}),!!t.OverallPercentileRank&&!!t.ManufacturerPercentileRank&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground mb-2",children:"Bestseller Status"}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-2",children:[jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("span",{children:"Global: "}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${qe(t.OverallPercentileRank).bgColor} ${qe(t.OverallPercentileRank).color} hover:${qe(t.OverallPercentileRank).bgColor}`,children:qe(t.OverallPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",t.OverallPercentileRank]})})]})})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("span",{children:[t.ManufacturerName,": "]}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Badge,{variant:"outline",className:`rounded-full px-3 w-fit ${qe(t.ManufacturerPercentileRank).bgColor} ${qe(t.ManufacturerPercentileRank).color} hover:${qe(t.ManufacturerPercentileRank).bgColor}`,children:qe(t.ManufacturerPercentileRank).label})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["Percentile Rank: ",t.ManufacturerPercentileRank]})})]})})]})]})]}),t.CountryCodeOfOrigin&&jsxRuntime.jsxs("div",{children:[jsxRuntime.jsx("div",{className:"text-sm text-muted-foreground",children:"Origin"}),jsxRuntime.jsxs("div",{className:"font-medium flex items-center",children:[jsxRuntime.jsx(CountryFlag,{countryCode:t.CountryCodeOfOrigin,className:"mr-2"}),t.CountryCodeOfOrigin]})]})]})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:order-2 order-1 items-center",children:jsxRuntime.jsx(ProductImage,{randmarSKU:t.RandmarSKU||"",alt:t.RandmarTitle||""},`product_image_${t.RandmarSKU}`)})]}),jsxRuntime.jsx("div",{className:"flex flex-col @[36rem]:flex-row gap-6 mt-4",children:jsxRuntime.jsx("div",{className:"flex flex-1 @[36rem]:order-1 order-2",children:Je&&t.Distribution&&jsxRuntime.jsxs("div",{className:"w-full",children:[jsxRuntime.jsx("div",{className:"flex items-center",children:"You have "+nt.length+(nt.length>1?" opportunities":" opportunity")+" for this product:"}),jsxRuntime.jsx(TooltipProvider,{children:jsxRuntime.jsx("div",{className:"space-y-2 max-h-[200px] overflow-y-auto p-2 mt-1",children:nt.map((Ze,ct)=>Be(Ze)?jsxRuntime.jsxs("div",{className:`flex justify-between items-center rounded-lg transition-colors py-2 px-4 border border-muted cursor-pointer ${Ze.BidNumber==(C==null?void 0:C.BidNumber)?"bg-purple-100 border-2 border-purple-900":"bg-white border-1 border-purple-600 hover:bg-purple-200"}`,onClick:()=>{E(Ze.BidNumber!==(C==null?void 0:C.BidNumber)?Ze:null)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsx("span",{className:"text-xs text-neutral-900",children:Ze.BidNumber})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",ot(Ze.EndDate)]})]})]},ct):jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsxs("div",{className:"flex justify-between items-center rounded-lg transition-colors py-2 px-4 bg-purple-100 border border-muted cursor-pointer !bg-neutral-50 hover:bg-neutral-100",onClick:()=>{Ze.BidNumber&&b(`/${e}/Opportunity/${Ze.ManufacturerId}/${Ze.BidNumber}`)},children:[jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("div",{className:"flex flex-col",children:[jsxRuntime.jsx("span",{className:"font-medium text-sm",children:Ze.Opportunity}),jsxRuntime.jsxs("span",{className:"text-xs text-neutral-900",children:[Ze.BidNumber," ",jsxRuntime.jsx(Badge,{variant:"outline",className:"text-xs mx-1 h-5 bg-gray-100",children:"Currently unavailable"})]})]})}),jsxRuntime.jsxs("div",{className:"flex flex-col items-end",children:[jsxRuntime.jsx("span",{className:"font-semibold",children:formatMoney(Ze.Price??0)}),Ze.Rebate&&Ze.Rebate>0&&jsxRuntime.jsxs("span",{className:"text-xs text-green-600",children:["Rebate: ",formatMoney(Ze.Rebate)]}),Ze.EndDate&&jsxRuntime.jsxs("span",{className:"text-xs text-neutral-600",children:["Ends: ",ot(Ze.EndDate)]})]})]})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsx("p",{children:"View Opportunity"})})]},ct))})})]})})})]}),jsxRuntime.jsxs("div",{className:"mt-4 flex flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex flex-row flex-wrap justify-between items-end gap-4",children:[jsxRuntime.jsx("div",{className:"flex flex-col gap-3 flex-1",children:t.Distribution&&jsxRuntime.jsx("div",{className:"flex flex-col gap-1",children:oe>0?jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs("span",{className:"text-2xl font-bold whitespace-nowrap",children:["Cost: ",formatMoney(oe)]})}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex items-center flex-wrap",children:[$e>0&&jsxRuntime.jsx(jsxRuntime.Fragment,{children:jsxRuntime.jsx("span",{className:"text-2xl font-bold whitespace-nowrap",children:formatMoney((C?(Ct=(Mt=t.Opportunities)==null?void 0:Mt.find(Ze=>Ze.BidNumber==C.BidNumber))==null?void 0:Ct.Price:Ae)??0)})}),A>0&&jsxRuntime.jsx("span",{className:"text-muted-foreground line-through ml-2 whitespace-nowrap",children:formatMoney($e)})]}),A>0&&jsxRuntime.jsx("div",{className:"flex items-center",children:jsxRuntime.jsxs(Badge,{variant:"outline",className:"bg-red-50 text-red-700 rounded-full px-3 whitespace-nowrap",children:[jsxRuntime.jsxs("span",{children:[A,"% OFF"]}),((Ke=t.InstantRebate)==null?void 0:Ke.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",t.InstantRebate.EndDate.split("T")[0]]}),(C==null?void 0:C.EndDate)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("span",{className:"mx-1.5",children:"●"})," Ends ",C.EndDate.split("T")[0]]})]})})]})})}),jsxRuntime.jsxs("div",{className:"flex flex-col justify-center @[36rem]:justify-end items-end gap-2 w-full @[36rem]:w-auto",children:[f&&jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap bg-green-600 hover:bg-green-700",onClick:Ge,disabled:I,children:I?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Syncing..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Sync to Shopify"]})}),g,typeof l<"u"&&jsxRuntime.jsxs("div",{className:"flex gap-2 whitespace-nowrap",children:[jsxRuntime.jsxs("div",{className:"flex items-center border rounded-md",children:[jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-r-none",onClick:st,disabled:typeof S<"u"&&(S<=1||!t.AvailableToBuy||d),children:"-"}),jsxRuntime.jsx("input",{value:S,onChange:at,onBlur:tt,onClick:Ze=>Ze.currentTarget.select(),className:`w-6 @[36rem]:w-12 text-center border-0 focus:ring-0 focus:outline-none ${!t.AvailableToBuy||d?"text-gray-400":""}`,disabled:!t.AvailableToBuy||d}),jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"rounded-l-none",onClick:et,disabled:!t.AvailableToBuy||d,children:"+"})]}),jsxRuntime.jsx(Button$1,{className:"gap-2 whitespace-nowrap",onClick:lt,disabled:!t.AvailableToBuy||d,children:d?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"h-4 w-4 animate-spin"}),"Adding..."]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(ShoppingCart,{className:"mr-2"}),"Add to Cart"]})})]})]})]}),jsxRuntime.jsxs("div",{className:"flex w-full flex-col gap-2 @[36rem]:flex-row",children:[jsxRuntime.jsx("div",{className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsxs(Button$1,{variant:"outline",type:"button",className:"h-11 px-4 text-sm font-medium justify-start w-full",onClick:()=>te(!0),disabled:!je,children:[jsxRuntime.jsx(ChartLine,{className:"mr-2"}),"View statistics"]})}),jsxRuntime.jsx("div",{className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsx(ProductInventoryButton,{applicationId:e??"",randmarSku:t.RandmarSKU??"",inventory:(Ye=t.Distribution)==null?void 0:Ye.Inventory,buttonSize:"lg",buttonClassName:"w-full h-11 justify-start"})}),n&&jsxRuntime.jsx(reactRouterDom.Link,{to:n,className:"flex-1 min-w-[10rem]",children:jsxRuntime.jsxs(Button$1,{variant:"outline",className:"h-11 px-4 text-sm font-medium justify-start w-full",children:[jsxRuntime.jsx(Eye,{className:"mr-2"}),"View Product"]})})]})]})]})}),jsxRuntime.jsx(Dialog,{open:Q,onOpenChange:te,children:jsxRuntime.jsxs(DialogContent,{className:"w-[min(95vw,1100px)] max-w-5xl space-y-6",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Monthly Sales Performance"}),jsxRuntime.jsxs(DialogDescription,{children:["Expanded product insights for ",ze,Xe?` (SKU ${Xe})`:""]})]}),jsxRuntime.jsx("div",{className:"space-y-6",children:se?jsxRuntime.jsxs(Alert,{variant:"destructive",children:[jsxRuntime.jsx(AlertTitle,{children:"Unable to load details"}),jsxRuntime.jsx(AlertDescription,{children:se})]}):jsxRuntime.jsxs("div",{className:"rounded-xl border bg-background p-4",children:[jsxRuntime.jsxs("div",{className:"mb-4 space-y-2",children:[jsxRuntime.jsx("p",{className:"text-sm text-muted-foreground",children:"Rolling 12-month sales dollars and units sold pulled from the detailed endpoint."}),Ve&&jsxRuntime.jsx("div",{"aria-live":"polite","aria-busy":"true",children:jsxRuntime.jsx(Progress,{value:Le,className:"h-2 w-full animate-pulse","aria-label":"Loading performance data"})})]}),jsxRuntime.jsx(SalesChart,{statistics:We,mode:"month",chartHeight:320}),Ve&&jsxRuntime.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Gathering product summary and sales statistics..."})]})})]})})]})}const complexComponents=[`----
|
|
1241
1241
|
PartnerCard: For data that fits this shape:
|
|
1242
1242
|
{ "ApplicationId": "19022", "PublicName": "BiOSS", "VoiceName": null, "VoiceStyle": null, "About": "example", "SceneName": "Kitchen Counter", "IsReseller": true, "IsManufacturer": true, "IsSalesAgency": false, "Socials": [ { "ApplicationId": "19022", "SocialNetwork": "Facebook", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "Instagram", "Tag": "@bioss.ca" }, { "ApplicationId": "19022", "SocialNetwork": "LinkedIn", "Tag": "@biossinc" }, { "ApplicationId": "19022", "SocialNetwork": "Youtube", "Tag": "@biosssolutionssanitairessa4095" } ], "Manufacturer": null, "Reseller": null }
|
|
1243
1243
|
Use <PartnerCard account={data} action={<></>}>`,`----
|
|
@@ -1452,6 +1452,6 @@ img.ProseMirror-separator {
|
|
|
1452
1452
|
.ProseMirror p {
|
|
1453
1453
|
margin-bottom: 0.5em;
|
|
1454
1454
|
}
|
|
1455
|
-
`;function RichTextEditor({id:e,name:t,value:n,onChange:o,placeholder:l,className:d,...f}){const[g,b]=React.useState(!1),_=React.useRef(null),S=React.useRef(null),R=useEditor({extensions:[StarterKit,Underline],content:n,editorProps:{attributes:{class:"prose prose-sm sm:prose dark:prose-invert focus:outline-none",id:e??"",name:t??""}},onUpdate:({editor:j})=>{const q=j.getHTML();o({target:{id:e,name:t,value:q}})}});React.useEffect(()=>{R&&n!==R.getHTML()&&R.commands.setContent(n)},[n,R]);const C=React.useCallback(j=>{if(R)if(R.chain().focus(),j==="paragraph")R.chain().setParagraph().run();else{const q=Number.parseInt(j.slice(1));R.chain().setHeading({level:q}).run()}},[R]),E=React.useCallback(j=>{if(R)switch(R.chain().focus(),j){case"bold":R.chain().toggleBold().run();break;case"italic":R.chain().toggleItalic().run();break;case"underline":R.chain().toggleUnderline().run();break;case"strike":R.chain().toggleStrike().run();break;case"bulletList":R.chain().toggleBulletList().run();break;case"orderedList":R.chain().toggleOrderedList().run();break}},[R]),A=React.useCallback(()=>{b(j=>!j)},[]),M=React.useCallback(j=>{const q=j.target.value;R&&R.commands.setContent(q),o({target:{id:e,name:t,value:q}})},[o,R,e,t]),I=React.useCallback(()=>{!g&&R&&R.commands.focus()},[g,R]);return R?jsxRuntime.jsxs("div",{ref:S,className:cn("border border-input rounded-md overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring",d),onClick:I,...f,children:[jsxRuntime.jsx("style",{children:editorStyles}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center p-2 border-b border-input gap-2 bg-background",children:[jsxRuntime.jsxs(Select$1,{onValueChange:C,disabled:g,children:[jsxRuntime.jsx(SelectTrigger,{className:"w-[160px]",children:jsxRuntime.jsx(SelectValue,{placeholder:"Format"})}),jsxRuntime.jsx(SelectContent,{children:formatOptions.map(j=>jsxRuntime.jsx(SelectItem,{value:j.value,children:j.label},j.value))})]}),["bold","italic","underline","strike","bulletList","orderedList"].map(j=>jsxRuntime.jsxs(Button$1,{type:"button",variant:"ghost",size:"sm",onClick:()=>E(j),className:R.isActive(j)?"bg-muted":"",disabled:g,children:[j==="bold"&&jsxRuntime.jsx(Bold$1,{className:"h-4 w-4"}),j==="italic"&&jsxRuntime.jsx(Italic$1,{className:"h-4 w-4"}),j==="underline"&&jsxRuntime.jsx(Underline$1,{className:"h-4 w-4"}),j==="strike"&&jsxRuntime.jsx(Strikethrough,{className:"h-4 w-4"}),j==="bulletList"&&jsxRuntime.jsx(List$1,{className:"h-4 w-4"}),j==="orderedList"&&jsxRuntime.jsx(ListOrdered,{className:"h-4 w-4"})]},j)),jsxRuntime.jsx(Button$1,{type:"button",variant:"ghost",size:"sm",onClick:A,className:g?"bg-muted":"",children:jsxRuntime.jsx(Code$1,{className:"h-4 w-4"})})]}),jsxRuntime.jsx("div",{className:"p-3",children:g?jsxRuntime.jsx(Textarea,{ref:_,id:e,name:t,value:R.getHTML(),onChange:M,className:cn("min-h-[150px] font-mono text-sm resize-none border-0 focus-visible:ring-0 focus-visible:ring-offset-0",d),placeholder:l}):jsxRuntime.jsx(EditorContent,{editor:R})})]}):null}function ReceiptsTable({applicationId:e,receipts:t=null,loading:n=!1}){const o=React.useMemo(()=>[{accessorKey:"Location",header:"Location",cell:({row:f})=>f.original.Location??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"ReceiptDate",header:"Date",cell:({row:f})=>formatYYYYMMDDIntToDateString(f.original.ReceiptDate),enableSorting:!0,enableFiltering:!0},{accessorKey:"ReceiptNumber",header:"Number",cell:({row:f})=>f.original.ReceiptNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Document/${f.original.ReceiptNumber}`,className:"font-medium text-primary hover:underline",children:f.original.ReceiptNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for Receipt ",f.original.ReceiptNumber]})})]})}):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"Quantity",header:"Quantity",cell:({row:f})=>f.original.Quantity??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"UnitPrice",header:"Unit Price",cell:({row:f})=>f.original.UnitPrice?formatMoney(f.original.UnitPrice):"—",enableSorting:!0,enableFiltering:!0}],[]),l=React.useMemo(()=>{const f={};if(t){const g=Array.from(new Set(t.map(_=>_.Location).filter(_=>_!=null)));f.Location=g;const b=Array.from(new Set(t.map(_=>formatYYYYMMDDIntToDateString(_.ReceiptDate)).filter(_=>_!=="—"&&_!=="Invalid Date"))).sort((_,S)=>new Date(S).getTime()-new Date(_).getTime());f.ReceiptDate=b}return f},[t]),d=t||[];return jsxRuntime.jsx(DataTable,{columns:o,data:d,uniqueValues:l,loading:n,tableClass:"bg-card text-card-foreground",initialSort:[{id:"ReceiptDate",desc:!0}]})}const formatDate$1=e=>{if(!e)return"N/A";try{const t=new Date(e);return isNaN(t.getTime())?"Invalid Date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return"Invalid Date"}},getStatusVariant=e=>{const t=(e==null?void 0:e.toLowerCase())||"";return t.includes("accepted")?"success":t.includes("error")||t.includes("rejected")?"destructive":"neutral"};function ReturnsTable({applicationId:e,returns:t=null,loading:n=!1}){const o=React.useMemo(()=>[{accessorKey:"ReturnNumber1",header:"RMA Number",cell:({row:f})=>{const g=f.original.ReturnNumber1||f.original.ReturnNumber;return g?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Return/${g}`,className:"font-medium text-primary hover:underline",children:g})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for return ",g]})})]})}):"N/A"},enableSorting:!0,enableFiltering:!0},{accessorKey:"RequestDate",header:"Request Date",cell:({row:f})=>formatDate$1(f.original.RequestDate),enableSorting:!0},{accessorKey:"InvoiceNumber",header:"Invoice Number",cell:({row:f})=>{const g=f.original.InvoiceNumber;return g?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Document/${g}`,className:"text-blue-600 hover:underline dark:text-blue-400",children:g})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for invoice ",g]})})]})}):"N/A"},enableSorting:!0,enableFiltering:!0},{accessorKey:"Quantity",header:"Quantity",cell:({row:f})=>f.original.Quantity??"0",enableSorting:!0},{accessorKey:"ReasonForReturn",header:"Return Reason",cell:({row:f})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:f.original.ReasonForReturn??"—"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"Status",header:"Status",cell:({row:f})=>{const g=f.original.Status,b=getStatusVariant(g);let _="border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";return b==="success"?_="border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400":b==="destructive"&&(_="border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400"),g?jsxRuntime.jsx(Badge,{variant:"outline",className:`${_} font-medium`,children:g}):"—"},enableSorting:!0,enableFiltering:!0},{accessorKey:"WarehouseLocation",header:"Warehouse",cell:({row:f})=>f.original.WarehouseLocation??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"LastUpdatedDate",header:"Last Update",cell:({row:f})=>formatDate$1(f.original.LastUpdatedDate)!=="N/A"?formatDate$1(f.original.LastUpdatedDate):"—",enableSorting:!0}],[e]),l=React.useMemo(()=>{const f={};if(t){const g=Array.from(new Set(t.map(S=>S.Status).filter(Boolean)));f.Status=g;const b=Array.from(new Set(t.map(S=>S.ReasonForReturn).filter(Boolean)));f.ReasonForReturn=b;const _=Array.from(new Set(t.map(S=>S.WarehouseLocation).filter(Boolean)));f.WarehouseLocation=_}return f},[t]),d=React.useMemo(()=>t?[...t].sort((g,b)=>(b.ReturnNumber1||b.ReturnNumber||"").localeCompare(g.ReturnNumber1||g.ReturnNumber||"")):[],[t]);return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-48 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Returns"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:o,data:d,uniqueValues:l})})]})}function PurchaseOrdersTable({applicationId:e,purchaseOrders:t=null,loading:n=!1}){const[o,l]=React.useState([]),[d]=usePostV4ManufacturerByRouteManufacturerIdPurchaseOrderAndPurchaseOrderNumberEditItemRandmarSkuMutation(),{toast:f}=useToast();React.useEffect(()=>{l(t||[])},[t]);const g=React.useMemo(()=>[{accessorKey:"PurchaseOrderNumber",header:"Number",cell:({row:_})=>_.original.PurchaseOrderNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Document/${_.original.PurchaseOrderNumber}`,className:"font-medium text-primary hover:underline",children:_.original.PurchaseOrderNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for Purchase Order ",_.original.PurchaseOrderNumber]})})]})}):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"PurchaseOrderDate",header:"Date",cell:({row:_})=>formatYYYYMMDDIntToDateString(_.original.PurchaseOrderDate),enableSorting:!0,enableFiltering:!0},{accessorKey:"Location",header:"Location",cell:({row:_})=>_.original.Location??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"PartNumber",header:"Part Number",cell:({row:_})=>_.original.MPN?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Product/${_.original.RandmarSKU}`,className:"font-medium text-primary hover:underline",children:_.original.MPN})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for Product ",_.original.RandmarSKU]})})]})}):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"QuantityOrdered",header:"Quantity Ordered",cell:({row:_})=>_.original.QuantityOrdered??0,enableSorting:!0,enableFiltering:!0},{accessorKey:"UnitPrice",header:"Unit Price",cell:({row:_})=>_.original.UnitPrice?formatMoney(_.original.UnitPrice):"—",enableSorting:!0,enableFiltering:!0},{id:"actions",header:()=>jsxRuntime.jsx("div",{className:"text-right",children:"Action"}),cell:function({row:S}){const[R,C]=React.useState(!1),E=S.original,A=()=>{C(!0),d({routeManufacturerId:e,purchaseOrderNumber:E.PurchaseOrderNumber??"",randmarSku:E.RandmarSKU??"",quantity:0}).then(()=>{l(M=>M.filter(I=>!(I.PurchaseOrderNumber===I.PurchaseOrderNumber&&I.MPN===I.MPN))),f({variant:"success",title:"Success",description:`Part ${E.MPN} has been successfully deleted from Purchase Order ${E.PurchaseOrderNumber}.`})}).catch(M=>{console.error(M),C(!0),f({variant:"destructive",title:"Error",description:"Something went wrong!"})})};return jsxRuntime.jsx("div",{className:"text-right",children:jsxRuntime.jsxs(AlertDialog,{children:[jsxRuntime.jsx(AlertDialogTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"red",size:"sm",disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Trash2,{className:"mr-2 h-4 w-4"}),"Delete"]})})}),jsxRuntime.jsxs(AlertDialogContent,{children:[jsxRuntime.jsxs(AlertDialogHeader,{children:[jsxRuntime.jsx(AlertDialogTitle,{children:"Confirmation"}),jsxRuntime.jsxs(AlertDialogDescription,{children:["Are you sure you want to delete part ",jsxRuntime.jsx("strong",{children:E.MPN})," from Purchase Order ",jsxRuntime.jsx("strong",{children:E.PurchaseOrderNumber}),"?."]})]}),jsxRuntime.jsxs(AlertDialogFooter,{children:[jsxRuntime.jsx(AlertDialogCancel,{disabled:R,children:"Cancel"}),jsxRuntime.jsxs(AlertDialogAction,{onClick:A,disabled:R,children:[R&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Confirm"]})]})]})]})})}}],[e]),b=React.useMemo(()=>{const _={};return o&&(_.PurchaseOrderNumber=Array.from(new Set(o.map(S=>S.PurchaseOrderNumber).filter(S=>S!=null))),_.PurchaseOrderDate=Array.from(new Set(o.map(S=>S.PurchaseOrderDate).filter(S=>S!=null).map(String))),_.Location=Array.from(new Set(o.map(S=>S.Location).filter(S=>S!=null))),_.PartNumber=Array.from(new Set(o.map(S=>S.MPN).filter(S=>S!=null))),_.QuantityOrdered=Array.from(new Set(o.map(S=>S.QuantityOrdered).filter(S=>S!=null).map(String))),_.UnitPrice=Array.from(new Set(o.map(S=>S.UnitPrice).filter(S=>S!=null).map(String)))),_},[o]);return jsxRuntime.jsx(DataTable,{columns:g,data:o,uniqueValues:b,loading:n,tableClass:"bg-card text-card-foreground"})}function RequisitionsTable({applicationId:e,requisitions:t=null,loading:n=!1}){const[o,l]=React.useState([]),[d]=useDeleteV4ManufacturerByRouteManufacturerIdRequisitionAndRequisitionNumberMutation(),{toast:f}=useToast();React.useEffect(()=>{l(t||[])},[t]);const g=React.useMemo(()=>[{accessorKey:"RequisitionNumber",header:"Number",cell:({row:_})=>_.original.RequisitionNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Document/${_.original.RequisitionNumber}`,className:"font-medium text-primary hover:underline",children:_.original.RequisitionNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for Draft Purchase ",_.original.RequisitionNumber]})})]})}):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"RequisitionDate",header:"Date",cell:({row:_})=>formatYYYYMMDDIntToDateString(_.original.RequisitionDate),enableSorting:!0,enableFiltering:!0},{accessorKey:"Location",header:"Location",cell:({row:_})=>_.original.Location??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"QuantityOrdered",header:"Quantity Ordered",cell:({row:_})=>_.original.QuantityOrdered??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"QuantityOutstanding",header:"Quantity Outstanding",cell:({row:_})=>_.original.QuantityOutstanding??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"QuantityReceived",header:"Quantity Received",cell:({row:_})=>_.original.QuantityReceived??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"SubTotal",header:"Sub Total",cell:({row:_})=>_.original.SubTotal?formatMoney(_.original.SubTotal):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"RequestedBy",header:"Requestor",cell:({row:_})=>_.original.RequestedBy??"—",enableSorting:!0,enableFiltering:!0},{id:"actions",header:()=>jsxRuntime.jsx("div",{className:"text-right",children:"Action"}),cell:function({row:S}){const[R,C]=React.useState(!1),E=S.original,A=()=>{C(!0),d({routeManufacturerId:e,requisitionNumber:E.RequisitionNumber??""}).then(()=>{l(M=>M.filter(I=>I.RequisitionNumber!==I.RequisitionNumber)),f({variant:"success",title:"Success",description:`Draft Purchase ${E.RequisitionNumber} has been successfully cancelled.`})}).catch(M=>{console.error(M),C(!0),f({variant:"destructive",title:"Error",description:"Something went wrong!"})})};return jsxRuntime.jsx("div",{className:"text-right",children:jsxRuntime.jsxs(AlertDialog,{children:[jsxRuntime.jsx(AlertDialogTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"red",size:"sm",disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancelling"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Trash2,{className:"mr-2 h-4 w-4"}),"Cancel"]})})}),jsxRuntime.jsxs(AlertDialogContent,{children:[jsxRuntime.jsxs(AlertDialogHeader,{children:[jsxRuntime.jsx(AlertDialogTitle,{children:"Confirmation"}),jsxRuntime.jsxs(AlertDialogDescription,{children:["Are you sure you want to cancel Draft Purchase ",jsxRuntime.jsx("strong",{children:E.RequisitionNumber}),"?."]})]}),jsxRuntime.jsxs(AlertDialogFooter,{children:[jsxRuntime.jsx(AlertDialogCancel,{disabled:R,children:"Cancel"}),jsxRuntime.jsxs(AlertDialogAction,{onClick:A,disabled:R,children:[R&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Confirm"]})]})]})]})})}}],[e]),b=React.useMemo(()=>{const _={};return o&&(_.RequisitionNumber=Array.from(new Set(o.map(S=>S.RequisitionNumber).filter(S=>S!=null))),_.RequisitionDate=Array.from(new Set(o.map(S=>S.RequisitionDate).filter(S=>S!=null).map(String))),_.QuantityOrdered=Array.from(new Set(o.map(S=>S.QuantityOrdered).filter(S=>S!=null).map(String))),_.QuantityOutstanding=Array.from(new Set(o.map(S=>S.QuantityOutstanding).filter(S=>S!=null).map(String))),_.QuantityReceived=Array.from(new Set(o.map(S=>S.QuantityReceived).filter(S=>S!=null).map(String))),_.Location=Array.from(new Set(o.map(S=>S.Location).filter(S=>S!=null))),_.RequestedBy=Array.from(new Set(o.map(S=>S.RequestedBy).filter(S=>S!=null))),_.SubTotal=Array.from(new Set(o.map(S=>S.SubTotal).filter(S=>S!=null).map(String)))),_},[o]);return jsxRuntime.jsx(DataTable,{columns:g,data:o,uniqueValues:b,loading:n,tableClass:"bg-card text-card-foreground"})}function ProductOverviewPage({applicationId:e,sku:t,product:n,productDefaultOpportunityNumber:o="",productOnAddToCart:l,productAddingToCart:d=!1,productShopifyHostname:f,productCustomAction:g=jsxRuntime.jsx(jsxRuntime.Fragment,{})}){var Q,te,F,V,ne,ae,se,Oe,Ne,oe,$e,Ae,je,Be,qe,Ve;const{data:b,isLoading:_}=useGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery({routeApplicationId:e,randmarSku:t??"",withSpecification:!1},{skip:!!n||!e||!t}),{data:S,isLoading:R}=useGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery({routeApplicationId:e,randmarSku:t??"",withSpecification:!0},{skip:!!n||!e||!t}),C=n??S??b,{data:E}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:e}),[A,M]=React.useState("stats-tab"),[I,j]=React.useState(!1);React.useEffect(()=>{var We,ze,Xe,nt,Je,st,et,at;if(!n&&R){j(!1);return}const Le={stats:(((We=C==null?void 0:C.SalesStatistics)==null?void 0:We.length)??0)<=0,inventory:(((Xe=(ze=C==null?void 0:C.Distribution)==null?void 0:ze.Inventory)==null?void 0:Xe.length)??0)<=0,opportunities:(((nt=C==null?void 0:C.Opportunities)==null?void 0:nt.length)??0)<=0,orders:(((Je=C==null?void 0:C.ActiveOrderDetails)==null?void 0:Je.length)??0)<=0&&(((st=C==null?void 0:C.Returns)==null?void 0:st.length)??0)<=0,invoices:(((et=C==null?void 0:C.CompletedOrderDetails)==null?void 0:et.length)??0)<=0,warehouse:(((at=C==null?void 0:C.Receipts)==null?void 0:at.length)??0)<=0},He=Object.values(Le).some(tt=>!tt);if(j(He),He&&Le[A]){const tt=Object.keys(Le).find(ot=>!Le[ot]);tt&&M(tt)}},[R,C,n,A]);const q=(C==null?void 0:C.ManufacturerId)!==e;return console.log("readonly",q),jsxRuntime.jsxs("div",{className:"@container",children:[jsxRuntime.jsxs("div",{className:"grid gap-4 grid-cols-1 @sm:grid-cols-2 @md:grid-cols-3",children:[jsxRuntime.jsx("div",{className:"@md:col-span-2",children:jsxRuntime.jsx(ProductCard,{applicationId:e,product:C??C,defaultOpportunityNumber:o,onAddToCart:l,addingToCart:d,shopifyHostname:f,customAction:g})}),jsxRuntime.jsxs(Card,{className:"flex flex-col",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsxs(CardTitle,{children:[jsxRuntime.jsx(Info,{className:"h-5 w-5 inline mr-2"})," Additionnal information"]})}),jsxRuntime.jsx(CardContent,{className:"basis-0 mb-6 grow overflow-y-auto",children:_?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-1 w-full my-6"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full mt-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full mt-1"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Category Name"}),jsxRuntime.jsx("span",{className:"font-medium",children:(C==null?void 0:C.ProductType)||"N/A"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Master Carton"}),jsxRuntime.jsx("span",{className:"font-medium",children:(C==null?void 0:C.MasterCarton)||"N/A"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Skid Quantity"}),jsxRuntime.jsx("span",{className:"font-medium",children:(C==null?void 0:C.SkidQuantity)||"N/A"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Automatic Reorder"}),jsxRuntime.jsx("span",{className:"font-medium",children:C!=null&&C.AutoUpdate?"Yes":"No"})]}),((C==null?void 0:C.VoiceoverCaption)||(C==null?void 0:C.BodyHTML))&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("hr",{className:"my-6"}),jsxRuntime.jsx("div",{className:"text-muted-foreground mb-2",children:"Description"}),(C==null?void 0:C.VoiceoverCaption)&&jsxRuntime.jsx("div",{children:C==null?void 0:C.VoiceoverCaption}),(C==null?void 0:C.BodyHTML)&&jsxRuntime.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:(C==null?void 0:C.BodyHTML)??""}})]})]})})]})]}),jsxRuntime.jsx("div",{className:"my-4",children:_||R?jsxRuntime.jsx("div",{className:"mx-auto flex justify-center items-center h-32",children:jsxRuntime.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin text-primary"})}):I&&jsxRuntime.jsxs(Tabs,{value:A,onValueChange:M,children:[jsxRuntime.jsxs(TabsList,{className:"inline-flex h-auto items-center justify-center rounded-none border-b bg-transparent p-0",children:[jsxRuntime.jsx(TabsTrigger,{value:"stats-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((Q=C==null?void 0:C.SalesStatistics)==null?void 0:Q.length)??0)<=0,children:"Statistics"}),jsxRuntime.jsx(TabsTrigger,{value:"inventory-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((F=(te=C==null?void 0:C.Distribution)==null?void 0:te.Inventory)==null?void 0:F.length)??0)<=0,children:"Inventory"}),jsxRuntime.jsx(TabsTrigger,{value:"opportunities-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((V=C==null?void 0:C.Opportunities)==null?void 0:V.length)??0)<=0,children:"Opportunities"}),jsxRuntime.jsx(TabsTrigger,{value:"active-orders-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((ne=C==null?void 0:C.ActiveOrderDetails)==null?void 0:ne.length)??0)<=0,children:"Active Orders"}),jsxRuntime.jsx(TabsTrigger,{value:"completed-orders-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((ae=C==null?void 0:C.CompletedOrderDetails)==null?void 0:ae.length)??0)<=0,children:"Completed Orders"}),jsxRuntime.jsx(TabsTrigger,{value:"returns-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((se=C==null?void 0:C.Returns)==null?void 0:se.length)??0)<=0,children:"Returns"}),jsxRuntime.jsx(TabsTrigger,{value:"purchase-orders-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:!(E!=null&&E.IsManufacturer)||(((Oe=C==null?void 0:C.PurchaseOrders)==null?void 0:Oe.length)??0)<=0&&(((Ne=C==null?void 0:C.Requisitions)==null?void 0:Ne.length)??0)<=0,children:"Purchase Orders"}),jsxRuntime.jsx(TabsTrigger,{value:"warehouse-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((oe=C==null?void 0:C.Receipts)==null?void 0:oe.length)??0)<=0,children:"Latest Warehouse Receiving"})]}),jsxRuntime.jsx(TabsContent,{value:"stats-tab",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(SalesChartCard,{statistics:(C==null?void 0:C.SalesStatistics)??[],loading:R})})}),jsxRuntime.jsx(TabsContent,{value:"inventory-tab",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ProductInventoryGrid,{inventory:(($e=C==null?void 0:C.Distribution)==null?void 0:$e.Inventory)??[],className:"bg-card text-card-foreground"})})}),jsxRuntime.jsx(TabsContent,{value:"opportunities-tab",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(OpportunitiesTable,{applicationId:e,opportunities:C==null?void 0:C.Opportunities,loading:R})})}),jsxRuntime.jsx(TabsContent,{value:"active-orders-tab",children:(((Ae=C==null?void 0:C.ActiveOrderDetails)==null?void 0:Ae.length)??0)>0&&jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(OrdersCard,{applicationId:e,title:"Active Orders",orders:C==null?void 0:C.ActiveOrderDetails,loading:R})})}),jsxRuntime.jsx(TabsContent,{value:"completed-orders-tab",children:(((je=C==null?void 0:C.CompletedOrderDetails)==null?void 0:je.length)??0)>0&&jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(OrdersCard,{applicationId:e,title:"Completed Orders",orders:C==null?void 0:C.CompletedOrderDetails,loading:R})})}),jsxRuntime.jsx(TabsContent,{value:"returns-tab",children:(((Be=C==null?void 0:C.Returns)==null?void 0:Be.length)??0)>0&&jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ReturnsTable,{applicationId:e,returns:C==null?void 0:C.Returns,loading:R})})}),jsxRuntime.jsxs(TabsContent,{value:"purchase-orders-tab",children:[(((qe=C==null?void 0:C.PurchaseOrders)==null?void 0:qe.length)??0)>0&&jsxRuntime.jsxs(Card,{className:"mt-4 w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Purchase Orders"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(PurchaseOrdersTable,{applicationId:e,purchaseOrders:C==null?void 0:C.PurchaseOrders,loading:R})})]}),(((Ve=C==null?void 0:C.Requisitions)==null?void 0:Ve.length)??0)>0&&jsxRuntime.jsxs(Card,{className:"mt-4 w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Draft Purchases"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(RequisitionsTable,{applicationId:e,requisitions:C==null?void 0:C.Requisitions,loading:R})})]})]}),jsxRuntime.jsx(TabsContent,{value:"warehouse-tab",children:jsxRuntime.jsxs(Card,{className:"mt-4 w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Receipts"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(ReceiptsTable,{applicationId:e,receipts:C==null?void 0:C.Receipts,loading:R})})]})})]})})]})}const colClasses={base:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",5:"xl:grid-cols-5",6:"xl:grid-cols-6"}},buildGridClassName=e=>{const t={base:1,md:2,...e};return["grid","gap-4",t.base?colClasses.base[t.base]:"",t.sm?colClasses.sm[t.sm]:"",t.md?colClasses.md[t.md]:"",t.lg?colClasses.lg[t.lg]:"",t.xl?colClasses.xl[t.xl]:""].filter(Boolean).join(" ")},SearchPageGrid=({results:e,groupBy:t,renderItem:n})=>{const o=t(e);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.entries(o).map(([l,d])=>{const{items:f,gridCols:g}=d;if(f.length===0)return null;const b=buildGridClassName(g);return jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("h2",{className:"text-xl font-semibold tracking-tight mb-4",children:l}),jsxRuntime.jsx("div",{className:b,children:f.map((_,S)=>n(_,S))})]},l)})})},SearchPage=({query:e,results:t,isLoading:n,children:o})=>n?jsxRuntime.jsx("div",{className:"flex w-full justify-center items-center py-24",children:jsxRuntime.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):e&&t.length===0?jsxRuntime.jsx("div",{className:"flex w-full justify-center items-start pt-16",children:jsxRuntime.jsx(Card,{className:"w-full max-w-lg",children:jsxRuntime.jsxs(CardHeader,{className:"text-center items-center",children:[jsxRuntime.jsx("div",{className:"rounded-full border bg-muted p-3 mb-4",children:jsxRuntime.jsx(SearchX,{className:"h-8 w-8 text-muted-foreground"})}),jsxRuntime.jsx(CardTitle,{children:"No Results Found"}),jsxRuntime.jsxs(CardDescription,{children:['Your search for "',e,'" did not return any results. Please try a different search term.']})]})})}):t.length>0?jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-8",children:jsxRuntime.jsx("div",{className:"col-span-3",children:o})}):null;var COLLAPSIBLE_NAME="Collapsible",[createCollapsibleContext,createCollapsibleScope]=createContextScope$2(COLLAPSIBLE_NAME),[CollapsibleProvider,useCollapsibleContext]=createCollapsibleContext(COLLAPSIBLE_NAME),Collapsible=React__namespace.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:l,disabled:d,onOpenChange:f,...g}=e,[b,_]=useControllableState({prop:o,defaultProp:l??!1,onChange:f,caller:COLLAPSIBLE_NAME});return jsxRuntime.jsx(CollapsibleProvider,{scope:n,disabled:d,contentId:useId(),open:b,onOpenToggle:React__namespace.useCallback(()=>_(S=>!S),[_]),children:jsxRuntime.jsx(Primitive$4.div,{"data-state":getState$1(b),"data-disabled":d?"":void 0,...g,ref:t})})});Collapsible.displayName=COLLAPSIBLE_NAME;var TRIGGER_NAME$1="CollapsibleTrigger",CollapsibleTrigger=React__namespace.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,l=useCollapsibleContext(TRIGGER_NAME$1,n);return jsxRuntime.jsx(Primitive$4.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":getState$1(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...o,ref:t,onClick:composeEventHandlers(e.onClick,l.onOpenToggle)})});CollapsibleTrigger.displayName=TRIGGER_NAME$1;var CONTENT_NAME$1="CollapsibleContent",CollapsibleContent=React__namespace.forwardRef((e,t)=>{const{forceMount:n,...o}=e,l=useCollapsibleContext(CONTENT_NAME$1,e.__scopeCollapsible);return jsxRuntime.jsx(Presence,{present:n||l.open,children:({present:d})=>jsxRuntime.jsx(CollapsibleContentImpl,{...o,ref:t,present:d})})});CollapsibleContent.displayName=CONTENT_NAME$1;var CollapsibleContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:l,...d}=e,f=useCollapsibleContext(CONTENT_NAME$1,n),[g,b]=React__namespace.useState(o),_=React__namespace.useRef(null),S=useComposedRefs(t,_),R=React__namespace.useRef(0),C=R.current,E=React__namespace.useRef(0),A=E.current,M=f.open||g,I=React__namespace.useRef(M),j=React__namespace.useRef(void 0);return React__namespace.useEffect(()=>{const q=requestAnimationFrame(()=>I.current=!1);return()=>cancelAnimationFrame(q)},[]),useLayoutEffect2(()=>{const q=_.current;if(q){j.current=j.current||{transitionDuration:q.style.transitionDuration,animationName:q.style.animationName},q.style.transitionDuration="0s",q.style.animationName="none";const Q=q.getBoundingClientRect();R.current=Q.height,E.current=Q.width,I.current||(q.style.transitionDuration=j.current.transitionDuration,q.style.animationName=j.current.animationName),b(o)}},[f.open,o]),jsxRuntime.jsx(Primitive$4.div,{"data-state":getState$1(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!M,...d,ref:S,style:{"--radix-collapsible-content-height":C?`${C}px`:void 0,"--radix-collapsible-content-width":A?`${A}px`:void 0,...e.style},children:M&&l})});function getState$1(e){return e?"open":"closed"}var Root$1=Collapsible,Trigger=CollapsibleTrigger,Content=CollapsibleContent,ACCORDION_NAME="Accordion",ACCORDION_KEYS=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Collection,useCollection,createCollectionScope]=createCollection(ACCORDION_NAME),[createAccordionContext]=createContextScope$2(ACCORDION_NAME,[createCollectionScope,createCollapsibleScope]),useCollapsibleScope=createCollapsibleScope(),Accordion$1=React.forwardRef((e,t)=>{const{type:n,...o}=e,l=o,d=o;return jsxRuntime.jsx(Collection.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?jsxRuntime.jsx(AccordionImplMultiple,{...d,ref:t}):jsxRuntime.jsx(AccordionImplSingle,{...l,ref:t})})});Accordion$1.displayName=ACCORDION_NAME;var[AccordionValueProvider,useAccordionValueContext]=createAccordionContext(ACCORDION_NAME),[AccordionCollapsibleProvider,useAccordionCollapsibleContext]=createAccordionContext(ACCORDION_NAME,{collapsible:!1}),AccordionImplSingle=React.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:l=()=>{},collapsible:d=!1,...f}=e,[g,b]=useControllableState({prop:n,defaultProp:o??"",onChange:l,caller:ACCORDION_NAME});return jsxRuntime.jsx(AccordionValueProvider,{scope:e.__scopeAccordion,value:React.useMemo(()=>g?[g]:[],[g]),onItemOpen:b,onItemClose:React.useCallback(()=>d&&b(""),[d,b]),children:jsxRuntime.jsx(AccordionCollapsibleProvider,{scope:e.__scopeAccordion,collapsible:d,children:jsxRuntime.jsx(AccordionImpl,{...f,ref:t})})})}),AccordionImplMultiple=React.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:l=()=>{},...d}=e,[f,g]=useControllableState({prop:n,defaultProp:o??[],onChange:l,caller:ACCORDION_NAME}),b=React.useCallback(S=>g((R=[])=>[...R,S]),[g]),_=React.useCallback(S=>g((R=[])=>R.filter(C=>C!==S)),[g]);return jsxRuntime.jsx(AccordionValueProvider,{scope:e.__scopeAccordion,value:f,onItemOpen:b,onItemClose:_,children:jsxRuntime.jsx(AccordionCollapsibleProvider,{scope:e.__scopeAccordion,collapsible:!0,children:jsxRuntime.jsx(AccordionImpl,{...d,ref:t})})})}),[AccordionImplProvider,useAccordionContext]=createAccordionContext(ACCORDION_NAME),AccordionImpl=React.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:o,dir:l,orientation:d="vertical",...f}=e,g=React.useRef(null),b=useComposedRefs(g,t),_=useCollection(n),R=useDirection(l)==="ltr",C=composeEventHandlers(e.onKeyDown,E=>{var ae;if(!ACCORDION_KEYS.includes(E.key))return;const A=E.target,M=_().filter(se=>{var Oe;return!((Oe=se.ref.current)!=null&&Oe.disabled)}),I=M.findIndex(se=>se.ref.current===A),j=M.length;if(I===-1)return;E.preventDefault();let q=I;const Q=0,te=j-1,F=()=>{q=I+1,q>te&&(q=Q)},V=()=>{q=I-1,q<Q&&(q=te)};switch(E.key){case"Home":q=Q;break;case"End":q=te;break;case"ArrowRight":d==="horizontal"&&(R?F():V());break;case"ArrowDown":d==="vertical"&&F();break;case"ArrowLeft":d==="horizontal"&&(R?V():F());break;case"ArrowUp":d==="vertical"&&V();break}const ne=q%j;(ae=M[ne].ref.current)==null||ae.focus()});return jsxRuntime.jsx(AccordionImplProvider,{scope:n,disabled:o,direction:l,orientation:d,children:jsxRuntime.jsx(Collection.Slot,{scope:n,children:jsxRuntime.jsx(Primitive$4.div,{...f,"data-orientation":d,ref:b,onKeyDown:o?void 0:C})})})}),ITEM_NAME="AccordionItem",[AccordionItemProvider,useAccordionItemContext]=createAccordionContext(ITEM_NAME),AccordionItem$1=React.forwardRef((e,t)=>{const{__scopeAccordion:n,value:o,...l}=e,d=useAccordionContext(ITEM_NAME,n),f=useAccordionValueContext(ITEM_NAME,n),g=useCollapsibleScope(n),b=useId(),_=o&&f.value.includes(o)||!1,S=d.disabled||e.disabled;return jsxRuntime.jsx(AccordionItemProvider,{scope:n,open:_,disabled:S,triggerId:b,children:jsxRuntime.jsx(Root$1,{"data-orientation":d.orientation,"data-state":getState(_),...g,...l,ref:t,disabled:S,open:_,onOpenChange:R=>{R?f.onItemOpen(o):f.onItemClose(o)}})})});AccordionItem$1.displayName=ITEM_NAME;var HEADER_NAME="AccordionHeader",AccordionHeader=React.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,l=useAccordionContext(ACCORDION_NAME,n),d=useAccordionItemContext(HEADER_NAME,n);return jsxRuntime.jsx(Primitive$4.h3,{"data-orientation":l.orientation,"data-state":getState(d.open),"data-disabled":d.disabled?"":void 0,...o,ref:t})});AccordionHeader.displayName=HEADER_NAME;var TRIGGER_NAME="AccordionTrigger",AccordionTrigger$1=React.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,l=useAccordionContext(ACCORDION_NAME,n),d=useAccordionItemContext(TRIGGER_NAME,n),f=useAccordionCollapsibleContext(TRIGGER_NAME,n),g=useCollapsibleScope(n);return jsxRuntime.jsx(Collection.ItemSlot,{scope:n,children:jsxRuntime.jsx(Trigger,{"aria-disabled":d.open&&!f.collapsible||void 0,"data-orientation":l.orientation,id:d.triggerId,...g,...o,ref:t})})});AccordionTrigger$1.displayName=TRIGGER_NAME;var CONTENT_NAME="AccordionContent",AccordionContent$1=React.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,l=useAccordionContext(ACCORDION_NAME,n),d=useAccordionItemContext(CONTENT_NAME,n),f=useCollapsibleScope(n);return jsxRuntime.jsx(Content,{role:"region","aria-labelledby":d.triggerId,"data-orientation":l.orientation,...f,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});AccordionContent$1.displayName=CONTENT_NAME;function getState(e){return e?"open":"closed"}var Root2=Accordion$1,Item=AccordionItem$1,Header=AccordionHeader,Trigger2=AccordionTrigger$1,Content2=AccordionContent$1;const Accordion=Root2,AccordionItem=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Item,{ref:n,className:cn("border-b",e),...t}));AccordionItem.displayName="AccordionItem";const AccordionTrigger=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsx(Header,{className:"flex",children:jsxRuntime.jsxs(Trigger2,{ref:o,className:cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));AccordionTrigger.displayName=Trigger2.displayName;const AccordionContent=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsx(Content2,{ref:o,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:jsxRuntime.jsx("div",{className:cn("pb-4 pt-0",e),children:t})}));AccordionContent.displayName=Content2.displayName;function AssistantInsight({prompt:e,smartAndSlow:t=!1,thinkingPlaceholderText:n="Thinking...",withCard:o=!0}){const{response:l,isLoading:d,error:f,sendPrompt:g}=useGemini({useProModel:t,outputFormat:"html"});React.useEffect(()=>{e&&g(e)},[e,g]);const b=`flex items-start gap-4 ${o?"p-4 border rounded-lg bg-background":""}`;return jsxRuntime.jsxs("div",{className:b,children:[jsxRuntime.jsx(Bot,{className:`mt-1 h-6 w-6 flex-shrink-0 ${d?"animate-pulse text-primary":"text-primary"}`}),jsxRuntime.jsxs("div",{className:"w-full min-h-[4rem]",children:[d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("p",{className:"font-medium text-muted-foreground",children:n}),jsxRuntime.jsxs("div",{className:"space-y-2 mt-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-5/6"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-3/4"})]})]}),f&&jsxRuntime.jsx("p",{className:"text-sm text-red-600",children:f}),!d&&!f&&l&&jsxRuntime.jsx("div",{className:"chat-bubble-in-animation text-sm text-foreground space-y-4",dangerouslySetInnerHTML:{__html:l}})]})]})}function tzName(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const offsetFormatCache={},offsetCache={};function tzOffset(e,t){try{const o=(offsetFormatCache[e]||(offsetFormatCache[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return o in offsetCache?offsetCache[o]:calcOffset(o,o.split(":"))}catch{if(e in offsetCache)return offsetCache[e];const n=e==null?void 0:e.match(offsetRe);return n?calcOffset(e,n.slice(1)):NaN}}const offsetRe=/([+-]\d\d):?(\d\d)?/;function calcOffset(e,t){const n=+(t[0]||0),o=+(t[1]||0),l=+(t[2]||0)/60;return offsetCache[e]=n*60+o>0?n*60+o+l:n*60-o-l}class TZDateMini extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(tzOffset(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),adjustToSystemTZ(this),syncToInternal(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new TZDateMini(...n,t):new TZDateMini(Date.now(),t)}withTimeZone(t){return new TZDateMini(+this,t)}getTimezoneOffset(){const t=-tzOffset(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),syncToInternal(this),+this}[Symbol.for("constructDateFrom")](t){return new TZDateMini(+new Date(t),this.timeZone)}}const re=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!re.test(e))return;const t=e.replace(re,"$1UTC");TZDateMini.prototype[t]&&(e.startsWith("get")?TZDateMini.prototype[e]=function(){return this.internal[t]()}:(TZDateMini.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),syncFromInternal(this),+this},TZDateMini.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),syncToInternal(this),+this}))});function syncToInternal(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-tzOffset(e.timeZone,e)*60))}function syncFromInternal(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),adjustToSystemTZ(e)}function adjustToSystemTZ(e){const t=tzOffset(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),o=new Date(+e);o.setUTCHours(o.getUTCHours()-1);const l=-new Date(+e).getTimezoneOffset(),d=-new Date(+o).getTimezoneOffset(),f=l-d,g=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();f&&g&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+f);const b=l-n;b&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+b);const _=new Date(+e);_.setUTCSeconds(0);const S=l>0?_.getSeconds():(_.getSeconds()-60)%60,R=Math.round(-(tzOffset(e.timeZone,e)*60))%60;(R||S)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+R),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+R+S));const C=tzOffset(e.timeZone,e),E=C>0?Math.floor(C):Math.ceil(C),M=-new Date(+e).getTimezoneOffset()-E,I=E!==n,j=M-b;if(I&&j){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j);const q=tzOffset(e.timeZone,e),Q=q>0?Math.floor(q):Math.ceil(q),te=E-Q;te&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+te),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+te))}}class TZDate extends TZDateMini{static tz(t,...n){return n.length?new TZDate(...n,t):new TZDate(Date.now(),t)}toISOString(){const[t,n,o]=this.tzComponents(),l=`${t}${n}:${o}`;return this.internal.toISOString().slice(0,-1)+l}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,o,l]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${o} ${n} ${l}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,o,l]=this.tzComponents();return`${t} GMT${n}${o}${l} (${tzName(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",o=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),l=String(Math.abs(t)%60).padStart(2,"0");return[n,o,l]}withTimeZone(t){return new TZDate(+this,t)}[Symbol.for("constructDateFrom")](t){return new TZDate(+new Date(t),this.timeZone)}}const FIVE_WEEKS=5,FOUR_WEEKS=4;function getBroadcastWeeksInMonth(e,t){const n=t.startOfMonth(e),o=n.getDay()>0?n.getDay():7,l=t.addDays(e,-o+1),d=t.addDays(l,FIVE_WEEKS*7-1);return t.getMonth(e)===t.getMonth(d)?FIVE_WEEKS:FOUR_WEEKS}function startOfBroadcastWeek(e,t){const n=t.startOfMonth(e),o=n.getDay();return o===1?n:o===0?t.addDays(n,-6):t.addDays(n,-1*(o-1))}function endOfBroadcastWeek(e,t){const n=startOfBroadcastWeek(e,t),o=getBroadcastWeeksInMonth(e,t);return t.addDays(n,o*7-1)}class DateLib{constructor(t,n){this.Date=Date,this.today=()=>{var o;return(o=this.overrides)!=null&&o.today?this.overrides.today():this.options.timeZone?TZDate.tz(this.options.timeZone):new this.Date},this.newDate=(o,l,d)=>{var f;return(f=this.overrides)!=null&&f.newDate?this.overrides.newDate(o,l,d):this.options.timeZone?new TZDate(o,l,d,this.options.timeZone):new Date(o,l,d)},this.addDays=(o,l)=>{var d;return(d=this.overrides)!=null&&d.addDays?this.overrides.addDays(o,l):addDays(o,l)},this.addMonths=(o,l)=>{var d;return(d=this.overrides)!=null&&d.addMonths?this.overrides.addMonths(o,l):addMonths(o,l)},this.addWeeks=(o,l)=>{var d;return(d=this.overrides)!=null&&d.addWeeks?this.overrides.addWeeks(o,l):addWeeks(o,l)},this.addYears=(o,l)=>{var d;return(d=this.overrides)!=null&&d.addYears?this.overrides.addYears(o,l):addYears(o,l)},this.differenceInCalendarDays=(o,l)=>{var d;return(d=this.overrides)!=null&&d.differenceInCalendarDays?this.overrides.differenceInCalendarDays(o,l):differenceInCalendarDays(o,l)},this.differenceInCalendarMonths=(o,l)=>{var d;return(d=this.overrides)!=null&&d.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(o,l):differenceInCalendarMonths(o,l)},this.eachMonthOfInterval=o=>{var l;return(l=this.overrides)!=null&&l.eachMonthOfInterval?this.overrides.eachMonthOfInterval(o):eachMonthOfInterval(o)},this.eachYearOfInterval=o=>{var g;const l=(g=this.overrides)!=null&&g.eachYearOfInterval?this.overrides.eachYearOfInterval(o):eachYearOfInterval(o),d=new Set(l.map(b=>this.getYear(b)));if(d.size===l.length)return l;const f=[];return d.forEach(b=>{f.push(new Date(b,0,1))}),f},this.endOfBroadcastWeek=o=>{var l;return(l=this.overrides)!=null&&l.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(o):endOfBroadcastWeek(o,this)},this.endOfISOWeek=o=>{var l;return(l=this.overrides)!=null&&l.endOfISOWeek?this.overrides.endOfISOWeek(o):endOfISOWeek(o)},this.endOfMonth=o=>{var l;return(l=this.overrides)!=null&&l.endOfMonth?this.overrides.endOfMonth(o):endOfMonth(o)},this.endOfWeek=(o,l)=>{var d;return(d=this.overrides)!=null&&d.endOfWeek?this.overrides.endOfWeek(o,l):endOfWeek(o,this.options)},this.endOfYear=o=>{var l;return(l=this.overrides)!=null&&l.endOfYear?this.overrides.endOfYear(o):endOfYear(o)},this.format=(o,l,d)=>{var g;const f=(g=this.overrides)!=null&&g.format?this.overrides.format(o,l,this.options):format(o,l,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(f):f},this.getISOWeek=o=>{var l;return(l=this.overrides)!=null&&l.getISOWeek?this.overrides.getISOWeek(o):getISOWeek(o)},this.getMonth=(o,l)=>{var d;return(d=this.overrides)!=null&&d.getMonth?this.overrides.getMonth(o,this.options):getMonth(o,this.options)},this.getYear=(o,l)=>{var d;return(d=this.overrides)!=null&&d.getYear?this.overrides.getYear(o,this.options):getYear(o,this.options)},this.getWeek=(o,l)=>{var d;return(d=this.overrides)!=null&&d.getWeek?this.overrides.getWeek(o,this.options):getWeek(o,this.options)},this.isAfter=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isAfter?this.overrides.isAfter(o,l):isAfter(o,l)},this.isBefore=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isBefore?this.overrides.isBefore(o,l):isBefore(o,l)},this.isDate=o=>{var l;return(l=this.overrides)!=null&&l.isDate?this.overrides.isDate(o):isDate(o)},this.isSameDay=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isSameDay?this.overrides.isSameDay(o,l):isSameDay(o,l)},this.isSameMonth=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isSameMonth?this.overrides.isSameMonth(o,l):isSameMonth(o,l)},this.isSameYear=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isSameYear?this.overrides.isSameYear(o,l):isSameYear(o,l)},this.max=o=>{var l;return(l=this.overrides)!=null&&l.max?this.overrides.max(o):max$1(o)},this.min=o=>{var l;return(l=this.overrides)!=null&&l.min?this.overrides.min(o):min$1(o)},this.setMonth=(o,l)=>{var d;return(d=this.overrides)!=null&&d.setMonth?this.overrides.setMonth(o,l):setMonth(o,l)},this.setYear=(o,l)=>{var d;return(d=this.overrides)!=null&&d.setYear?this.overrides.setYear(o,l):setYear(o,l)},this.startOfBroadcastWeek=(o,l)=>{var d;return(d=this.overrides)!=null&&d.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(o,this):startOfBroadcastWeek(o,this)},this.startOfDay=o=>{var l;return(l=this.overrides)!=null&&l.startOfDay?this.overrides.startOfDay(o):startOfDay(o)},this.startOfISOWeek=o=>{var l;return(l=this.overrides)!=null&&l.startOfISOWeek?this.overrides.startOfISOWeek(o):startOfISOWeek(o)},this.startOfMonth=o=>{var l;return(l=this.overrides)!=null&&l.startOfMonth?this.overrides.startOfMonth(o):startOfMonth(o)},this.startOfWeek=(o,l)=>{var d;return(d=this.overrides)!=null&&d.startOfWeek?this.overrides.startOfWeek(o,this.options):startOfWeek(o,this.options)},this.startOfYear=o=>{var l;return(l=this.overrides)!=null&&l.startOfYear?this.overrides.startOfYear(o):startOfYear(o)},this.options={locale:enUS,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),o={};for(let l=0;l<10;l++)o[l.toString()]=n.format(l);return o}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,o=>n[o]||o)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&DateLib.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:o,numerals:l}=this.options,d=n==null?void 0:n.code;if(d&&DateLib.yearFirstLocales.has(d))try{return new Intl.DateTimeFormat(d,{month:"long",year:"numeric",timeZone:o,numberingSystem:l}).format(t)}catch{}const f=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,f)}}DateLib.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const defaultDateLib=new DateLib;class CalendarDay{constructor(t,n,o=defaultDateLib){this.date=t,this.displayMonth=n,this.outside=!!(n&&!o.isSameMonth(t,n)),this.dateLib=o,this.isoDate=o.format(t,"yyyy-MM-dd"),this.displayMonthId=o.format(n,"yyyy-MM"),this.dateMonthId=o.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class CalendarMonth{constructor(t,n){this.date=t,this.weeks=n}}class CalendarWeek{constructor(t,n){this.days=n,this.weekNumber=t}}function Button(e){return React.createElement("button",{...e})}function CaptionLabel(e){return React.createElement("span",{...e})}function Chevron(e){const{size:t=24,orientation:n="left",className:o}=e;return React.createElement("svg",{className:o,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&React.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&React.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&React.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&React.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Day(e){const{day:t,modifiers:n,...o}=e;return React.createElement("td",{...o})}function DayButton(e){const{day:t,modifiers:n,...o}=e,l=React.useRef(null);return React.useEffect(()=>{var d;n.focused&&((d=l.current)==null||d.focus())},[n.focused]),React.createElement("button",{ref:l,...o})}var UI;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(UI||(UI={}));var DayFlag;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(DayFlag||(DayFlag={}));var SelectionState;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(SelectionState||(SelectionState={}));var Animation;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Animation||(Animation={}));function Dropdown(e){const{options:t,className:n,components:o,classNames:l,...d}=e,f=[l[UI.Dropdown],n].join(" "),g=t==null?void 0:t.find(({value:b})=>b===d.value);return React.createElement("span",{"data-disabled":d.disabled,className:l[UI.DropdownRoot]},React.createElement(o.Select,{className:f,...d},t==null?void 0:t.map(({value:b,label:_,disabled:S})=>React.createElement(o.Option,{key:b,value:b,disabled:S},_))),React.createElement("span",{className:l[UI.CaptionLabel],"aria-hidden":!0},g==null?void 0:g.label,React.createElement(o.Chevron,{orientation:"down",size:18,className:l[UI.Chevron]})))}function DropdownNav(e){return React.createElement("div",{...e})}function Footer(e){return React.createElement("div",{...e})}function Month(e){const{calendarMonth:t,displayIndex:n,...o}=e;return React.createElement("div",{...o},e.children)}function MonthCaption(e){const{calendarMonth:t,displayIndex:n,...o}=e;return React.createElement("div",{...o})}function MonthGrid(e){return React.createElement("table",{...e})}function Months(e){return React.createElement("div",{...e})}const dayPickerContext=React.createContext(void 0);function useDayPicker(){const e=React.useContext(dayPickerContext);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function MonthsDropdown(e){const{components:t}=useDayPicker();return React.createElement(t.Dropdown,{...e})}function Nav(e){const{onPreviousClick:t,onNextClick:n,previousMonth:o,nextMonth:l,...d}=e,{components:f,classNames:g,labels:{labelPrevious:b,labelNext:_}}=useDayPicker(),S=React.useCallback(C=>{l&&(n==null||n(C))},[l,n]),R=React.useCallback(C=>{o&&(t==null||t(C))},[o,t]);return React.createElement("nav",{...d},React.createElement(f.PreviousMonthButton,{type:"button",className:g[UI.PreviousMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":b(o),onClick:R},React.createElement(f.Chevron,{disabled:o?void 0:!0,className:g[UI.Chevron],orientation:"left"})),React.createElement(f.NextMonthButton,{type:"button",className:g[UI.NextMonthButton],tabIndex:l?void 0:-1,"aria-disabled":l?void 0:!0,"aria-label":_(l),onClick:S},React.createElement(f.Chevron,{disabled:l?void 0:!0,orientation:"right",className:g[UI.Chevron]})))}function NextMonthButton(e){const{components:t}=useDayPicker();return React.createElement(t.Button,{...e})}function Option(e){return React.createElement("option",{...e})}function PreviousMonthButton(e){const{components:t}=useDayPicker();return React.createElement(t.Button,{...e})}function Root(e){const{rootRef:t,...n}=e;return React.createElement("div",{...n,ref:t})}function Select(e){return React.createElement("select",{...e})}function Week(e){const{week:t,...n}=e;return React.createElement("tr",{...n})}function Weekday(e){return React.createElement("th",{...e})}function Weekdays(e){return React.createElement("thead",{"aria-hidden":!0},React.createElement("tr",{...e}))}function WeekNumber(e){const{week:t,...n}=e;return React.createElement("th",{...n})}function WeekNumberHeader(e){return React.createElement("th",{...e})}function Weeks(e){return React.createElement("tbody",{...e})}function YearsDropdown(e){const{components:t}=useDayPicker();return React.createElement(t.Dropdown,{...e})}const components=Object.freeze(Object.defineProperty({__proto__:null,Button,CaptionLabel,Chevron,Day,DayButton,Dropdown,DropdownNav,Footer,Month,MonthCaption,MonthGrid,Months,MonthsDropdown,Nav,NextMonthButton,Option,PreviousMonthButton,Root,Select,Week,WeekNumber,WeekNumberHeader,Weekday,Weekdays,Weeks,YearsDropdown},Symbol.toStringTag,{value:"Module"}));function rangeIncludesDate(e,t,n=!1,o=defaultDateLib){let{from:l,to:d}=e;const{differenceInCalendarDays:f,isSameDay:g}=o;return l&&d?(f(d,l)<0&&([l,d]=[d,l]),f(t,l)>=(n?1:0)&&f(d,t)>=(n?1:0)):!n&&d?g(d,t):!n&&l?g(l,t):!1}function isDateInterval(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function isDateRange(e){return!!(e&&typeof e=="object"&&"from"in e)}function isDateAfterType(e){return!!(e&&typeof e=="object"&&"after"in e)}function isDateBeforeType(e){return!!(e&&typeof e=="object"&&"before"in e)}function isDayOfWeekType(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function isDatesArray(e,t){return Array.isArray(e)&&e.every(t.isDate)}function dateMatchModifiers(e,t,n=defaultDateLib){const o=Array.isArray(t)?t:[t],{isSameDay:l,differenceInCalendarDays:d,isAfter:f}=n;return o.some(g=>{if(typeof g=="boolean")return g;if(n.isDate(g))return l(e,g);if(isDatesArray(g,n))return g.includes(e);if(isDateRange(g))return rangeIncludesDate(g,e,!1,n);if(isDayOfWeekType(g))return Array.isArray(g.dayOfWeek)?g.dayOfWeek.includes(e.getDay()):g.dayOfWeek===e.getDay();if(isDateInterval(g)){const b=d(g.before,e),_=d(g.after,e),S=b>0,R=_<0;return f(g.before,g.after)?R&&S:S||R}return isDateAfterType(g)?d(e,g.after)>0:isDateBeforeType(g)?d(g.before,e)>0:typeof g=="function"?g(e):!1})}function createGetModifiers(e,t,n,o,l){const{disabled:d,hidden:f,modifiers:g,showOutsideDays:b,broadcastCalendar:_,today:S=l.today()}=t,{isSameDay:R,isSameMonth:C,startOfMonth:E,isBefore:A,endOfMonth:M,isAfter:I}=l,j=n&&E(n),q=o&&M(o),Q={[DayFlag.focused]:[],[DayFlag.outside]:[],[DayFlag.disabled]:[],[DayFlag.hidden]:[],[DayFlag.today]:[]},te={};for(const F of e){const{date:V,displayMonth:ne}=F,ae=!!(ne&&!C(V,ne)),se=!!(j&&A(V,j)),Oe=!!(q&&I(V,q)),Ne=!!(d&&dateMatchModifiers(V,d,l)),oe=!!(f&&dateMatchModifiers(V,f,l))||se||Oe||!_&&!b&&ae||_&&b===!1&&ae,$e=R(V,S);ae&&Q.outside.push(F),Ne&&Q.disabled.push(F),oe&&Q.hidden.push(F),$e&&Q.today.push(F),g&&Object.keys(g).forEach(Ae=>{const je=g==null?void 0:g[Ae];je&&dateMatchModifiers(V,je,l)&&(te[Ae]?te[Ae].push(F):te[Ae]=[F])})}return F=>{const V={[DayFlag.focused]:!1,[DayFlag.disabled]:!1,[DayFlag.hidden]:!1,[DayFlag.outside]:!1,[DayFlag.today]:!1},ne={};for(const ae in Q){const se=Q[ae];V[ae]=se.some(Oe=>Oe===F)}for(const ae in te)ne[ae]=te[ae].some(se=>se===F);return{...V,...ne}}}function getClassNamesForModifiers(e,t,n={}){return Object.entries(e).filter(([,l])=>l===!0).reduce((l,[d])=>(n[d]?l.push(n[d]):t[DayFlag[d]]?l.push(t[DayFlag[d]]):t[SelectionState[d]]&&l.push(t[SelectionState[d]]),l),[t[UI.Day]])}function getComponents(e){return{...components,...e}}function getDataAttributes(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,o])=>{n.startsWith("data-")&&(t[n]=o)}),t}function getDefaultClassNames(){const e={};for(const t in UI)e[UI[t]]=`rdp-${UI[t]}`;for(const t in DayFlag)e[DayFlag[t]]=`rdp-${DayFlag[t]}`;for(const t in SelectionState)e[SelectionState[t]]=`rdp-${SelectionState[t]}`;for(const t in Animation)e[Animation[t]]=`rdp-${Animation[t]}`;return e}function formatCaption(e,t,n){return(n??new DateLib(t)).formatMonthYear(e)}const formatMonthCaption=formatCaption;function formatDay(e,t,n){return(n??new DateLib(t)).format(e,"d")}function formatMonthDropdown(e,t=defaultDateLib){return t.format(e,"LLLL")}function formatWeekdayName(e,t,n){return(n??new DateLib(t)).format(e,"cccccc")}function formatWeekNumber(e,t=defaultDateLib){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function formatWeekNumberHeader(){return""}function formatYearDropdown(e,t=defaultDateLib){return t.format(e,"yyyy")}const formatYearCaption=formatYearDropdown,defaultFormatters=Object.freeze(Object.defineProperty({__proto__:null,formatCaption,formatDay,formatMonthCaption,formatMonthDropdown,formatWeekNumber,formatWeekNumberHeader,formatWeekdayName,formatYearCaption,formatYearDropdown},Symbol.toStringTag,{value:"Module"}));function getFormatters(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...defaultFormatters,...e}}function getMonthOptions(e,t,n,o,l){const{startOfMonth:d,startOfYear:f,endOfYear:g,eachMonthOfInterval:b,getMonth:_}=l;return b({start:f(e),end:g(e)}).map(C=>{const E=o.formatMonthDropdown(C,l),A=_(C),M=t&&C<d(t)||n&&C>d(n)||!1;return{value:A,label:E,disabled:M}})}function getStyleForModifiers(e,t={},n={}){let o={...t==null?void 0:t[UI.Day]};return Object.entries(e).filter(([,l])=>l===!0).forEach(([l])=>{o={...o,...n==null?void 0:n[l]}}),o}function getWeekdays(e,t,n,o){const l=o??e.today(),d=n?e.startOfBroadcastWeek(l,e):t?e.startOfISOWeek(l):e.startOfWeek(l),f=[];for(let g=0;g<7;g++){const b=e.addDays(d,g);f.push(b)}return f}function getYearOptions(e,t,n,o,l=!1){if(!e||!t)return;const{startOfYear:d,endOfYear:f,eachYearOfInterval:g,getYear:b}=o,_=d(e),S=f(t),R=g({start:_,end:S});return l&&R.reverse(),R.map(C=>{const E=n.formatYearDropdown(C,o);return{value:b(C),label:E,disabled:!1}})}function labelDayButton(e,t,n,o){let l=(o??new DateLib(n)).format(e,"PPPP");return t.today&&(l=`Today, ${l}`),t.selected&&(l=`${l}, selected`),l}const labelDay=labelDayButton;function labelGrid(e,t,n){return(n??new DateLib(t)).formatMonthYear(e)}const labelCaption=labelGrid;function labelGridcell(e,t,n,o){let l=(o??new DateLib(n)).format(e,"PPPP");return t!=null&&t.today&&(l=`Today, ${l}`),l}function labelMonthDropdown(e){return"Choose the Month"}function labelNav(){return""}function labelNext(e){return"Go to the Next Month"}function labelPrevious(e){return"Go to the Previous Month"}function labelWeekday(e,t,n){return(n??new DateLib(t)).format(e,"cccc")}function labelWeekNumber(e,t){return`Week ${e}`}function labelWeekNumberHeader(e){return"Week Number"}function labelYearDropdown(e){return"Choose the Year"}const defaultLabels=Object.freeze(Object.defineProperty({__proto__:null,labelCaption,labelDay,labelDayButton,labelGrid,labelGridcell,labelMonthDropdown,labelNav,labelNext,labelPrevious,labelWeekNumber,labelWeekNumberHeader,labelWeekday,labelYearDropdown},Symbol.toStringTag,{value:"Module"})),asHtmlElement=e=>e instanceof HTMLElement?e:null,queryMonthEls=e=>[...e.querySelectorAll("[data-animated-month]")??[]],queryMonthEl=e=>asHtmlElement(e.querySelector("[data-animated-month]")),queryCaptionEl=e=>asHtmlElement(e.querySelector("[data-animated-caption]")),queryWeeksEl=e=>asHtmlElement(e.querySelector("[data-animated-weeks]")),queryNavEl=e=>asHtmlElement(e.querySelector("[data-animated-nav]")),queryWeekdaysEl=e=>asHtmlElement(e.querySelector("[data-animated-weekdays]"));function useAnimation(e,t,{classNames:n,months:o,focused:l,dateLib:d}){const f=React.useRef(null),g=React.useRef(o),b=React.useRef(!1);React.useLayoutEffect(()=>{const _=g.current;if(g.current=o,!t||!e.current||!(e.current instanceof HTMLElement)||o.length===0||_.length===0||o.length!==_.length)return;const S=d.isSameMonth(o[0].date,_[0].date),R=d.isAfter(o[0].date,_[0].date),C=R?n[Animation.caption_after_enter]:n[Animation.caption_before_enter],E=R?n[Animation.weeks_after_enter]:n[Animation.weeks_before_enter],A=f.current,M=e.current.cloneNode(!0);if(M instanceof HTMLElement?(queryMonthEls(M).forEach(Q=>{if(!(Q instanceof HTMLElement))return;const te=queryMonthEl(Q);te&&Q.contains(te)&&Q.removeChild(te);const F=queryCaptionEl(Q);F&&F.classList.remove(C);const V=queryWeeksEl(Q);V&&V.classList.remove(E)}),f.current=M):f.current=null,b.current||S||l)return;const I=A instanceof HTMLElement?queryMonthEls(A):[],j=queryMonthEls(e.current);if(j!=null&&j.every(q=>q instanceof HTMLElement)&&I&&I.every(q=>q instanceof HTMLElement)){b.current=!0,e.current.style.isolation="isolate";const q=queryNavEl(e.current);q&&(q.style.zIndex="1"),j.forEach((Q,te)=>{const F=I[te];if(!F)return;Q.style.position="relative",Q.style.overflow="hidden";const V=queryCaptionEl(Q);V&&V.classList.add(C);const ne=queryWeeksEl(Q);ne&&ne.classList.add(E);const ae=()=>{b.current=!1,e.current&&(e.current.style.isolation=""),q&&(q.style.zIndex=""),V&&V.classList.remove(C),ne&&ne.classList.remove(E),Q.style.position="",Q.style.overflow="",Q.contains(F)&&Q.removeChild(F)};F.style.pointerEvents="none",F.style.position="absolute",F.style.overflow="hidden",F.setAttribute("aria-hidden","true");const se=queryWeekdaysEl(F);se&&(se.style.opacity="0");const Oe=queryCaptionEl(F);Oe&&(Oe.classList.add(R?n[Animation.caption_before_exit]:n[Animation.caption_after_exit]),Oe.addEventListener("animationend",ae));const Ne=queryWeeksEl(F);Ne&&Ne.classList.add(R?n[Animation.weeks_before_exit]:n[Animation.weeks_after_exit]),Q.insertBefore(F,Q.firstChild)})}})}function getDates(e,t,n,o){const l=e[0],d=e[e.length-1],{ISOWeek:f,fixedWeeks:g,broadcastCalendar:b}=n??{},{addDays:_,differenceInCalendarDays:S,differenceInCalendarMonths:R,endOfBroadcastWeek:C,endOfISOWeek:E,endOfMonth:A,endOfWeek:M,isAfter:I,startOfBroadcastWeek:j,startOfISOWeek:q,startOfWeek:Q}=o,te=b?j(l,o):f?q(l):Q(l),F=b?C(d):f?E(A(d)):M(A(d)),V=S(F,te),ne=R(d,l)+1,ae=[];for(let Ne=0;Ne<=V;Ne++){const oe=_(te,Ne);if(t&&I(oe,t))break;ae.push(oe)}const Oe=(b?35:42)*ne;if(g&&ae.length<Oe){const Ne=Oe-ae.length;for(let oe=0;oe<Ne;oe++){const $e=_(ae[ae.length-1],1);ae.push($e)}}return ae}function getDays(e){const t=[];return e.reduce((n,o)=>{const l=o.weeks.reduce((d,f)=>d.concat(f.days.slice()),t.slice());return n.concat(l.slice())},t.slice())}function getDisplayMonths(e,t,n,o){const{numberOfMonths:l=1}=n,d=[];for(let f=0;f<l;f++){const g=o.addMonths(e,f);if(t&&g>t)break;d.push(g)}return d}function getInitialMonth(e,t,n,o){const{month:l,defaultMonth:d,today:f=o.today(),numberOfMonths:g=1}=e;let b=l||d||f;const{differenceInCalendarMonths:_,addMonths:S,startOfMonth:R}=o;if(n&&_(n,b)<g-1){const C=-1*(g-1);b=S(n,C)}return t&&_(b,t)<0&&(b=t),R(b)}function getMonths(e,t,n,o){const{addDays:l,endOfBroadcastWeek:d,endOfISOWeek:f,endOfMonth:g,endOfWeek:b,getISOWeek:_,getWeek:S,startOfBroadcastWeek:R,startOfISOWeek:C,startOfWeek:E}=o,A=e.reduce((M,I)=>{const j=n.broadcastCalendar?R(I,o):n.ISOWeek?C(I):E(I),q=n.broadcastCalendar?d(I):n.ISOWeek?f(g(I)):b(g(I)),Q=t.filter(ne=>ne>=j&&ne<=q),te=n.broadcastCalendar?35:42;if(n.fixedWeeks&&Q.length<te){const ne=t.filter(ae=>{const se=te-Q.length;return ae>q&&ae<=l(q,se)});Q.push(...ne)}const F=Q.reduce((ne,ae)=>{const se=n.ISOWeek?_(ae):S(ae),Oe=ne.find(oe=>oe.weekNumber===se),Ne=new CalendarDay(ae,I,o);return Oe?Oe.days.push(Ne):ne.push(new CalendarWeek(se,[Ne])),ne},[]),V=new CalendarMonth(I,F);return M.push(V),M},[]);return n.reverseMonths?A.reverse():A}function getNavMonths(e,t){let{startMonth:n,endMonth:o}=e;const{startOfYear:l,startOfDay:d,startOfMonth:f,endOfMonth:g,addYears:b,endOfYear:_,newDate:S,today:R}=t,{fromYear:C,toYear:E,fromMonth:A,toMonth:M}=e;!n&&A&&(n=A),!n&&C&&(n=t.newDate(C,0,1)),!o&&M&&(o=M),!o&&E&&(o=S(E,11,31));const I=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=f(n):C?n=S(C,0,1):!n&&I&&(n=l(b(e.today??R(),-100))),o?o=g(o):E?o=S(E,11,31):!o&&I&&(o=_(e.today??R())),[n&&d(n),o&&d(o)]}function getNextMonth(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:d=1}=n,{startOfMonth:f,addMonths:g,differenceInCalendarMonths:b}=o,_=l?d:1,S=f(e);if(!t)return g(S,_);if(!(b(t,e)<d))return g(S,_)}function getPreviousMonth(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:d}=n,{startOfMonth:f,addMonths:g,differenceInCalendarMonths:b}=o,_=l?d??1:1,S=f(e);if(!t)return g(S,-_);if(!(b(S,t)<=0))return g(S,-_)}function getWeeks(e){const t=[];return e.reduce((n,o)=>n.concat(o.weeks.slice()),t.slice())}function useControlledValue(e,t){const[n,o]=React.useState(e);return[t===void 0?n:t,o]}function useCalendar(e,t){var te;const[n,o]=getNavMonths(e,t),{startOfMonth:l,endOfMonth:d}=t,f=getInitialMonth(e,n,o,t),[g,b]=useControlledValue(f,e.month?f:void 0);React.useEffect(()=>{const F=getInitialMonth(e,n,o,t);b(F)},[e.timeZone]);const{months:_,weeks:S,days:R,previousMonth:C,nextMonth:E}=React.useMemo(()=>{const F=getDisplayMonths(g,o,{numberOfMonths:e.numberOfMonths},t),V=getDates(F,e.endMonth?d(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),ne=getMonths(F,V,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),ae=getWeeks(ne),se=getDays(ne),Oe=getPreviousMonth(g,n,e,t),Ne=getNextMonth(g,o,e,t);return{months:ne,weeks:ae,days:se,previousMonth:Oe,nextMonth:Ne}},[t,g.getTime(),o==null?void 0:o.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(te=e.endMonth)==null?void 0:te.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:A,onMonthChange:M}=e,I=F=>S.some(V=>V.days.some(ne=>ne.isEqualTo(F))),j=F=>{if(A)return;let V=l(F);n&&V<l(n)&&(V=l(n)),o&&V>l(o)&&(V=l(o)),b(V),M==null||M(V)};return{months:_,weeks:S,days:R,navStart:n,navEnd:o,previousMonth:C,nextMonth:E,goToMonth:j,goToDay:F=>{I(F)||j(F.date)}}}var FocusTargetPriority;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(FocusTargetPriority||(FocusTargetPriority={}));function isFocusableDay(e){return!e[DayFlag.disabled]&&!e[DayFlag.hidden]&&!e[DayFlag.outside]}function calculateFocusTarget(e,t,n,o){let l,d=-1;for(const f of e){const g=t(f);isFocusableDay(g)&&(g[DayFlag.focused]&&d<FocusTargetPriority.FocusedModifier?(l=f,d=FocusTargetPriority.FocusedModifier):o!=null&&o.isEqualTo(f)&&d<FocusTargetPriority.LastFocused?(l=f,d=FocusTargetPriority.LastFocused):n(f.date)&&d<FocusTargetPriority.Selected?(l=f,d=FocusTargetPriority.Selected):g[DayFlag.today]&&d<FocusTargetPriority.Today&&(l=f,d=FocusTargetPriority.Today))}return l||(l=e.find(f=>isFocusableDay(t(f)))),l}function getFocusableDate(e,t,n,o,l,d,f){const{ISOWeek:g,broadcastCalendar:b}=d,{addDays:_,addMonths:S,addWeeks:R,addYears:C,endOfBroadcastWeek:E,endOfISOWeek:A,endOfWeek:M,max:I,min:j,startOfBroadcastWeek:q,startOfISOWeek:Q,startOfWeek:te}=f;let V={day:_,week:R,month:S,year:C,startOfWeek:ne=>b?q(ne,f):g?Q(ne):te(ne),endOfWeek:ne=>b?E(ne):g?A(ne):M(ne)}[e](n,t==="after"?1:-1);return t==="before"&&o?V=I([o,V]):t==="after"&&l&&(V=j([l,V])),V}function getNextFocus(e,t,n,o,l,d,f,g=0){if(g>365)return;const b=getFocusableDate(e,t,n.date,o,l,d,f),_=!!(d.disabled&&dateMatchModifiers(b,d.disabled,f)),S=!!(d.hidden&&dateMatchModifiers(b,d.hidden,f)),R=b,C=new CalendarDay(b,R,f);return!_&&!S?C:getNextFocus(e,t,C,o,l,d,f,g+1)}function useFocus(e,t,n,o,l){const{autoFocus:d}=e,[f,g]=React.useState(),b=calculateFocusTarget(t.days,n,o||(()=>!1),f),[_,S]=React.useState(d?b:void 0);return{isFocusTarget:M=>!!(b!=null&&b.isEqualTo(M)),setFocused:S,focused:_,blur:()=>{g(_),S(void 0)},moveFocus:(M,I)=>{if(!_)return;const j=getNextFocus(M,I,_,t.navStart,t.navEnd,e,l);j&&(e.disableNavigation&&!t.days.some(Q=>Q.isEqualTo(j))||(t.goToDay(j),S(j)))}}}function useMulti(e,t){const{selected:n,required:o,onSelect:l}=e,[d,f]=useControlledValue(n,l?n:void 0),g=l?n:d,{isSameDay:b}=t,_=E=>(g==null?void 0:g.some(A=>b(A,E)))??!1,{min:S,max:R}=e;return{selected:g,select:(E,A,M)=>{let I=[...g??[]];if(_(E)){if((g==null?void 0:g.length)===S||o&&(g==null?void 0:g.length)===1)return;I=g==null?void 0:g.filter(j=>!b(j,E))}else(g==null?void 0:g.length)===R?I=[E]:I=[...I,E];return l||f(I),l==null||l(I,E,A,M),I},isSelected:_}}function addToRange(e,t,n=0,o=0,l=!1,d=defaultDateLib){const{from:f,to:g}=t||{},{isSameDay:b,isAfter:_,isBefore:S}=d;let R;if(!f&&!g)R={from:e,to:n>0?void 0:e};else if(f&&!g)b(f,e)?n===0?R={from:f,to:e}:l?R={from:f,to:void 0}:R=void 0:S(e,f)?R={from:e,to:f}:R={from:f,to:e};else if(f&&g)if(b(f,e)&&b(g,e))l?R={from:f,to:g}:R=void 0;else if(b(f,e))R={from:f,to:n>0?void 0:e};else if(b(g,e))R={from:e,to:n>0?void 0:e};else if(S(e,f))R={from:e,to:g};else if(_(e,f))R={from:f,to:e};else if(_(e,g))R={from:f,to:e};else throw new Error("Invalid range");if(R!=null&&R.from&&(R!=null&&R.to)){const C=d.differenceInCalendarDays(R.to,R.from);o>0&&C>o?R={from:e,to:void 0}:n>1&&C<n&&(R={from:e,to:void 0})}return R}function rangeContainsDayOfWeek(e,t,n=defaultDateLib){const o=Array.isArray(t)?t:[t];let l=e.from;const d=n.differenceInCalendarDays(e.to,e.from),f=Math.min(d,6);for(let g=0;g<=f;g++){if(o.includes(l.getDay()))return!0;l=n.addDays(l,1)}return!1}function rangeOverlaps(e,t,n=defaultDateLib){return rangeIncludesDate(e,t.from,!1,n)||rangeIncludesDate(e,t.to,!1,n)||rangeIncludesDate(t,e.from,!1,n)||rangeIncludesDate(t,e.to,!1,n)}function rangeContainsModifiers(e,t,n=defaultDateLib){const o=Array.isArray(t)?t:[t];if(o.filter(g=>typeof g!="function").some(g=>typeof g=="boolean"?g:n.isDate(g)?rangeIncludesDate(e,g,!1,n):isDatesArray(g,n)?g.some(b=>rangeIncludesDate(e,b,!1,n)):isDateRange(g)?g.from&&g.to?rangeOverlaps(e,{from:g.from,to:g.to},n):!1:isDayOfWeekType(g)?rangeContainsDayOfWeek(e,g.dayOfWeek,n):isDateInterval(g)?n.isAfter(g.before,g.after)?rangeOverlaps(e,{from:n.addDays(g.after,1),to:n.addDays(g.before,-1)},n):dateMatchModifiers(e.from,g,n)||dateMatchModifiers(e.to,g,n):isDateAfterType(g)||isDateBeforeType(g)?dateMatchModifiers(e.from,g,n)||dateMatchModifiers(e.to,g,n):!1))return!0;const f=o.filter(g=>typeof g=="function");if(f.length){let g=e.from;const b=n.differenceInCalendarDays(e.to,e.from);for(let _=0;_<=b;_++){if(f.some(S=>S(g)))return!0;g=n.addDays(g,1)}}return!1}function useRange(e,t){const{disabled:n,excludeDisabled:o,selected:l,required:d,onSelect:f}=e,[g,b]=useControlledValue(l,f?l:void 0),_=f?l:g;return{selected:_,select:(C,E,A)=>{const{min:M,max:I}=e,j=C?addToRange(C,_,M,I,d,t):void 0;return o&&n&&(j!=null&&j.from)&&j.to&&rangeContainsModifiers({from:j.from,to:j.to},n,t)&&(j.from=C,j.to=void 0),f||b(j),f==null||f(j,C,E,A),j},isSelected:C=>_&&rangeIncludesDate(_,C,!1,t)}}function useSingle(e,t){const{selected:n,required:o,onSelect:l}=e,[d,f]=useControlledValue(n,l?n:void 0),g=l?n:d,{isSameDay:b}=t;return{selected:g,select:(R,C,E)=>{let A=R;return!o&&g&&g&&b(R,g)&&(A=void 0),l||f(A),l==null||l(A,R,C,E),A},isSelected:R=>g?b(g,R):!1}}function useSelection(e,t){const n=useSingle(e,t),o=useMulti(e,t),l=useRange(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return l;default:return}}function toTimeZone(e,t){return e instanceof TZDate&&e.timeZone===t?e:new TZDate(e,t)}function convertMatcher(e,t){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?toTimeZone(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?toTimeZone(n,t):n):isDateRange(e)?{...e,from:e.from?toTimeZone(e.from,t):e.from,to:e.to?toTimeZone(e.to,t):e.to}:isDateInterval(e)?{before:toTimeZone(e.before,t),after:toTimeZone(e.after,t)}:isDateAfterType(e)?{after:toTimeZone(e.after,t)}:isDateBeforeType(e)?{before:toTimeZone(e.before,t)}:e}function convertMatchersToTimeZone(e,t){return e&&(Array.isArray(e)?e.map(n=>convertMatcher(n,t)):convertMatcher(e,t))}function DayPicker(e){var Vn;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=toTimeZone(t.today,n)),t.month&&(t.month=toTimeZone(t.month,n)),t.defaultMonth&&(t.defaultMonth=toTimeZone(t.defaultMonth,n)),t.startMonth&&(t.startMonth=toTimeZone(t.startMonth,n)),t.endMonth&&(t.endMonth=toTimeZone(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=toTimeZone(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(Vn=t.selected)==null?void 0:Vn.map(Jt=>toTimeZone(Jt,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?toTimeZone(t.selected.from,n):t.selected.from,to:t.selected.to?toTimeZone(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=convertMatchersToTimeZone(t.disabled,n)),t.hidden!==void 0&&(t.hidden=convertMatchersToTimeZone(t.hidden,n)),t.modifiers)){const Jt={};Object.keys(t.modifiers).forEach(Zt=>{var Ut;Jt[Zt]=convertMatchersToTimeZone((Ut=t.modifiers)==null?void 0:Ut[Zt],n)}),t.modifiers=Jt}const{components:o,formatters:l,labels:d,dateLib:f,locale:g,classNames:b}=React.useMemo(()=>{const Jt={...enUS,...t.locale};return{dateLib:new DateLib({locale:Jt,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:getComponents(t.components),formatters:getFormatters(t.formatters),labels:{...defaultLabels,...t.labels},locale:Jt,classNames:{...getDefaultClassNames(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:f.today()});const{captionLayout:_,mode:S,navLayout:R,numberOfMonths:C=1,onDayBlur:E,onDayClick:A,onDayFocus:M,onDayKeyDown:I,onDayMouseEnter:j,onDayMouseLeave:q,onNextClick:Q,onPrevClick:te,showWeekNumber:F,styles:V}=t,{formatCaption:ne,formatDay:ae,formatMonthDropdown:se,formatWeekNumber:Oe,formatWeekNumberHeader:Ne,formatWeekdayName:oe,formatYearDropdown:$e}=l,Ae=useCalendar(t,f),{days:je,months:Be,navStart:qe,navEnd:Ve,previousMonth:Le,nextMonth:He,goToMonth:We}=Ae,ze=createGetModifiers(je,t,qe,Ve,f),{isSelected:Xe,select:nt,selected:Je}=useSelection(t,f)??{},{blur:st,focused:et,isFocusTarget:at,moveFocus:tt,setFocused:ot}=useFocus(t,Ae,ze,Xe??(()=>!1),f),{labelDayButton:lt,labelGridcell:Ge,labelGrid:$t,labelMonthDropdown:rt,labelNav:Rt,labelPrevious:dt,labelNext:It,labelWeekday:Mt,labelWeekNumber:Ct,labelWeekNumberHeader:Ke,labelYearDropdown:Ye}=d,Ze=React.useMemo(()=>getWeekdays(f,t.ISOWeek,t.broadcastCalendar,t.today),[f,t.ISOWeek,t.broadcastCalendar,t.today]),ct=S!==void 0||A!==void 0,mt=React.useCallback(()=>{Le&&(We(Le),te==null||te(Le))},[Le,We,te]),ft=React.useCallback(()=>{He&&(We(He),Q==null||Q(He))},[We,He,Q]),yt=React.useCallback((Jt,Zt)=>Ut=>{Ut.preventDefault(),Ut.stopPropagation(),ot(Jt),nt==null||nt(Jt.date,Zt,Ut),A==null||A(Jt.date,Zt,Ut)},[nt,A,ot]),Ht=React.useCallback((Jt,Zt)=>Ut=>{ot(Jt),M==null||M(Jt.date,Zt,Ut)},[M,ot]),Kt=React.useCallback((Jt,Zt)=>Ut=>{st(),E==null||E(Jt.date,Zt,Ut)},[st,E]),un=React.useCallback((Jt,Zt)=>Ut=>{const tn={ArrowLeft:[Ut.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Ut.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Ut.shiftKey?"year":"week","after"],ArrowUp:[Ut.shiftKey?"year":"week","before"],PageUp:[Ut.shiftKey?"year":"month","before"],PageDown:[Ut.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(tn[Ut.key]){Ut.preventDefault(),Ut.stopPropagation();const[Yt,an]=tn[Ut.key];tt(Yt,an)}I==null||I(Jt.date,Zt,Ut)},[tt,I,t.dir]),hn=React.useCallback((Jt,Zt)=>Ut=>{j==null||j(Jt.date,Zt,Ut)},[j]),qt=React.useCallback((Jt,Zt)=>Ut=>{q==null||q(Jt.date,Zt,Ut)},[q]),An=React.useCallback(Jt=>Zt=>{const Ut=Number(Zt.target.value),tn=f.setMonth(f.startOfMonth(Jt),Ut);We(tn)},[f,We]),xn=React.useCallback(Jt=>Zt=>{const Ut=Number(Zt.target.value),tn=f.setYear(f.startOfMonth(Jt),Ut);We(tn)},[f,We]),{className:Rn,style:vn}=React.useMemo(()=>({className:[b[UI.Root],t.className].filter(Boolean).join(" "),style:{...V==null?void 0:V[UI.Root],...t.style}}),[b,t.className,t.style,V]),Pn=getDataAttributes(t),Mn=React.useRef(null);useAnimation(Mn,!!t.animate,{classNames:b,months:Be,focused:et,dateLib:f});const $n={dayPickerProps:t,selected:Je,select:nt,isSelected:Xe,months:Be,nextMonth:He,previousMonth:Le,goToMonth:We,getModifiers:ze,components:o,classNames:b,styles:V,labels:d,formatters:l};return React.createElement(dayPickerContext.Provider,{value:$n},React.createElement(o.Root,{rootRef:t.animate?Mn:void 0,className:Rn,style:vn,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Pn},React.createElement(o.Months,{className:b[UI.Months],style:V==null?void 0:V[UI.Months]},!t.hideNavigation&&!R&&React.createElement(o.Nav,{"data-animated-nav":t.animate?"true":void 0,className:b[UI.Nav],style:V==null?void 0:V[UI.Nav],"aria-label":Rt(),onPreviousClick:mt,onNextClick:ft,previousMonth:Le,nextMonth:He}),Be.map((Jt,Zt)=>React.createElement(o.Month,{"data-animated-month":t.animate?"true":void 0,className:b[UI.Month],style:V==null?void 0:V[UI.Month],key:Zt,displayIndex:Zt,calendarMonth:Jt},R==="around"&&!t.hideNavigation&&Zt===0&&React.createElement(o.PreviousMonthButton,{type:"button",className:b[UI.PreviousMonthButton],tabIndex:Le?void 0:-1,"aria-disabled":Le?void 0:!0,"aria-label":dt(Le),onClick:mt,"data-animated-button":t.animate?"true":void 0},React.createElement(o.Chevron,{disabled:Le?void 0:!0,className:b[UI.Chevron],orientation:t.dir==="rtl"?"right":"left"})),React.createElement(o.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:b[UI.MonthCaption],style:V==null?void 0:V[UI.MonthCaption],calendarMonth:Jt,displayIndex:Zt},_!=null&&_.startsWith("dropdown")?React.createElement(o.DropdownNav,{className:b[UI.Dropdowns],style:V==null?void 0:V[UI.Dropdowns]},(()=>{const Ut=_==="dropdown"||_==="dropdown-months"?React.createElement(o.MonthsDropdown,{key:"month",className:b[UI.MonthsDropdown],"aria-label":rt(),classNames:b,components:o,disabled:!!t.disableNavigation,onChange:An(Jt.date),options:getMonthOptions(Jt.date,qe,Ve,l,f),style:V==null?void 0:V[UI.Dropdown],value:f.getMonth(Jt.date)}):React.createElement("span",{key:"month"},se(Jt.date,f)),tn=_==="dropdown"||_==="dropdown-years"?React.createElement(o.YearsDropdown,{key:"year",className:b[UI.YearsDropdown],"aria-label":Ye(f.options),classNames:b,components:o,disabled:!!t.disableNavigation,onChange:xn(Jt.date),options:getYearOptions(qe,Ve,l,f,!!t.reverseYears),style:V==null?void 0:V[UI.Dropdown],value:f.getYear(Jt.date)}):React.createElement("span",{key:"year"},$e(Jt.date,f));return f.getMonthYearOrder()==="year-first"?[tn,Ut]:[Ut,tn]})(),React.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},ne(Jt.date,f.options,f))):React.createElement(o.CaptionLabel,{className:b[UI.CaptionLabel],role:"status","aria-live":"polite"},ne(Jt.date,f.options,f))),R==="around"&&!t.hideNavigation&&Zt===C-1&&React.createElement(o.NextMonthButton,{type:"button",className:b[UI.NextMonthButton],tabIndex:He?void 0:-1,"aria-disabled":He?void 0:!0,"aria-label":It(He),onClick:ft,"data-animated-button":t.animate?"true":void 0},React.createElement(o.Chevron,{disabled:He?void 0:!0,className:b[UI.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Zt===C-1&&R==="after"&&!t.hideNavigation&&React.createElement(o.Nav,{"data-animated-nav":t.animate?"true":void 0,className:b[UI.Nav],style:V==null?void 0:V[UI.Nav],"aria-label":Rt(),onPreviousClick:mt,onNextClick:ft,previousMonth:Le,nextMonth:He}),React.createElement(o.MonthGrid,{role:"grid","aria-multiselectable":S==="multiple"||S==="range","aria-label":$t(Jt.date,f.options,f)||void 0,className:b[UI.MonthGrid],style:V==null?void 0:V[UI.MonthGrid]},!t.hideWeekdays&&React.createElement(o.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:b[UI.Weekdays],style:V==null?void 0:V[UI.Weekdays]},F&&React.createElement(o.WeekNumberHeader,{"aria-label":Ke(f.options),className:b[UI.WeekNumberHeader],style:V==null?void 0:V[UI.WeekNumberHeader],scope:"col"},Ne()),Ze.map(Ut=>React.createElement(o.Weekday,{"aria-label":Mt(Ut,f.options,f),className:b[UI.Weekday],key:String(Ut),style:V==null?void 0:V[UI.Weekday],scope:"col"},oe(Ut,f.options,f)))),React.createElement(o.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:b[UI.Weeks],style:V==null?void 0:V[UI.Weeks]},Jt.weeks.map(Ut=>React.createElement(o.Week,{className:b[UI.Week],key:Ut.weekNumber,style:V==null?void 0:V[UI.Week],week:Ut},F&&React.createElement(o.WeekNumber,{week:Ut,style:V==null?void 0:V[UI.WeekNumber],"aria-label":Ct(Ut.weekNumber,{locale:g}),className:b[UI.WeekNumber],scope:"row",role:"rowheader"},Oe(Ut.weekNumber,f)),Ut.days.map(tn=>{const{date:Yt}=tn,an=ze(tn);if(an[DayFlag.focused]=!an.hidden&&!!(et!=null&&et.isEqualTo(tn)),an[SelectionState.selected]=(Xe==null?void 0:Xe(Yt))||an.selected,isDateRange(Je)){const{from:Cn,to:Bn}=Je;an[SelectionState.range_start]=!!(Cn&&Bn&&f.isSameDay(Yt,Cn)),an[SelectionState.range_end]=!!(Cn&&Bn&&f.isSameDay(Yt,Bn)),an[SelectionState.range_middle]=rangeIncludesDate(Je,Yt,!0,f)}const mn=getStyleForModifiers(an,V,t.modifiersStyles),On=getClassNamesForModifiers(an,b,t.modifiersClassNames),Fn=!ct&&!an.hidden?Ge(Yt,an,f.options,f):void 0;return React.createElement(o.Day,{key:`${tn.isoDate}_${tn.displayMonthId}`,day:tn,modifiers:an,className:On.join(" "),style:mn,role:"gridcell","aria-selected":an.selected||void 0,"aria-label":Fn,"data-day":tn.isoDate,"data-month":tn.outside?tn.dateMonthId:void 0,"data-selected":an.selected||void 0,"data-disabled":an.disabled||void 0,"data-hidden":an.hidden||void 0,"data-outside":tn.outside||void 0,"data-focused":an.focused||void 0,"data-today":an.today||void 0},!an.hidden&&ct?React.createElement(o.DayButton,{className:b[UI.DayButton],style:V==null?void 0:V[UI.DayButton],type:"button",day:tn,modifiers:an,disabled:!an.focused&&an.disabled||void 0,"aria-disabled":an.focused&&an.disabled||void 0,tabIndex:at(tn)?0:-1,"aria-label":lt(Yt,an,f.options,f),onClick:yt(tn,an),onBlur:Kt(tn,an),onFocus:Ht(tn,an),onKeyDown:un(tn,an),onMouseEnter:hn(tn,an),onMouseLeave:qt(tn,an)},ae(Yt,f.options,f)):!an.hidden&&ae(tn.date,f.options,f))})))))))),t.footer&&React.createElement(o.Footer,{className:b[UI.Footer],style:V==null?void 0:V[UI.Footer],role:"status","aria-live":"polite"},t.footer)))}function Calendar({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:o="label",buttonVariant:l="ghost",formatters:d,components:f,...g}){const b=getDefaultClassNames();return jsxRuntime.jsx(DayPicker,{showOutsideDays:n,className:cn("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:o,formatters:{formatMonthDropdown:_=>_.toLocaleString("default",{month:"short"}),...d},classNames:{root:cn("w-fit",b.root),months:cn("relative flex flex-col gap-4 md:flex-row",b.months),month:cn("flex w-full flex-col gap-4",b.month),nav:cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",b.nav),button_previous:cn(buttonVariants({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",b.button_previous),button_next:cn(buttonVariants({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",b.button_next),month_caption:cn("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",b.month_caption),dropdowns:cn("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",b.dropdowns),dropdown_root:cn("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",b.dropdown_root),dropdown:cn("bg-popover absolute inset-0 opacity-0",b.dropdown),caption_label:cn("select-none font-medium",o==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",b.caption_label),table:"w-full border-collapse",weekdays:cn("flex",b.weekdays),weekday:cn("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",b.weekday),week:cn("mt-2 flex w-full",b.week),week_number_header:cn("w-[--cell-size] select-none",b.week_number_header),week_number:cn("text-muted-foreground select-none text-[0.8rem]",b.week_number),day:cn("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",b.day),range_start:cn("bg-accent rounded-l-md",b.range_start),range_middle:cn("rounded-none",b.range_middle),range_end:cn("bg-accent rounded-r-md",b.range_end),today:cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",b.today),outside:cn("text-muted-foreground aria-selected:text-muted-foreground",b.outside),disabled:cn("text-muted-foreground opacity-50",b.disabled),hidden:cn("invisible",b.hidden),...t},components:{Root:({className:_,rootRef:S,...R})=>jsxRuntime.jsx("div",{"data-slot":"calendar",ref:S,className:cn(_),...R}),Chevron:({className:_,orientation:S,...R})=>S==="left"?jsxRuntime.jsx(ChevronLeft,{className:cn("size-4",_),...R}):S==="right"?jsxRuntime.jsx(ChevronRight,{className:cn("size-4",_),...R}):jsxRuntime.jsx(ChevronDown,{className:cn("size-4",_),...R}),DayButton:CalendarDayButton,WeekNumber:({children:_,...S})=>jsxRuntime.jsx("td",{...S,children:jsxRuntime.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:_})}),...f},...g})}function CalendarDayButton({className:e,day:t,modifiers:n,...o}){const l=getDefaultClassNames(),d=React__namespace.useRef(null);return React__namespace.useEffect(()=>{var f;n.focused&&((f=d.current)==null||f.focus())},[n.focused]),jsxRuntime.jsx(Button$1,{ref:d,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",l.day,e),...o})}function AssistantChat(e){return jsxRuntime.jsx(Card,{className:"max-w-6xl",children:jsxRuntime.jsx(AIChatLayout,{className:"h-[40em]",userId:e.userId,userName:e.userName,initialPrompt:e.initialPrompt})})}function formatDateToISO(e){if(!e||!isValidDate(e))return"";const t=e.getTimezoneOffset()*6e4;return new Date(e.getTime()-t).toISOString().split("T")[0]}function isValidDate(e){return e instanceof Date&&!isNaN(e.getTime())}function DatePicker({date:e,onDateChange:t,label:n,id:o,className:l}){const[d,f]=React__namespace.useState(!1),[g,b]=React__namespace.useState(e),[_,S]=React__namespace.useState(formatDateToISO(e));React__namespace.useEffect(()=>{S(formatDateToISO(e)),isValidDate(e)&&b(e)},[e]);const R=E=>{const M=E.target.value.replace(/\D/g,"").slice(0,8);let I=M;if(M.length>4&&(I=`${M.slice(0,4)}-${M.slice(4)}`),M.length>6&&(I=`${M.slice(0,4)}-${M.slice(4,6)}-${M.slice(6)}`),S(I),M.length===8){const j=new Date(I),q=new Date(j.getUTCFullYear(),j.getUTCMonth(),j.getUTCDate());isValidDate(q)?(t(q),b(q)):t(void 0)}else t(void 0)},C=E=>{E&&(t(E),S(formatDateToISO(E))),f(!1)};return jsxRuntime.jsxs("div",{className:cn("flex flex-col gap-2",l),children:[n&&jsxRuntime.jsx(Label$2,{htmlFor:o,children:n}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Input,{id:o,value:_,placeholder:"YYYY-MM-DD",className:"bg-background pr-10",onChange:R,onKeyDown:E=>{E.key==="ArrowDown"&&(E.preventDefault(),f(!0))}}),jsxRuntime.jsxs(Popover,{open:d,onOpenChange:f,children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2","aria-label":"Select date",children:jsxRuntime.jsx(Calendar$1,{className:"h-4 w-4"})})}),jsxRuntime.jsx(PopoverContent,{className:"w-auto min-w-[280px] p-0",align:"end",sideOffset:8,children:jsxRuntime.jsx(Calendar,{mode:"single",selected:e,onSelect:C,month:g,onMonthChange:b,initialFocus:!0,className:"w-full"})})]})]})]})}function ExternalProductCard({product:e,viewProductLink:t}){return e?jsxRuntime.jsx(Card,{className:"@container border-dashed border-2 hover:shadow-md transition-shadow h-full",children:jsxRuntime.jsxs(CardContent,{className:"p-6 flex flex-col h-full",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4 @[36rem]:hidden",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg pr-4 text-center w-full",children:e.Title||e.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:e.ManufacturerId,name:e.ManufacturerName,width:96,height:40})})]}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-x-6 gap-y-4 flex-grow @[36rem]:flex-row",children:[jsxRuntime.jsx("div",{className:"mx-auto flex-shrink-0 @[36rem]:mx-0 @[36rem]:w-48",children:jsxRuntime.jsx(ProductImage,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col text-center @[36rem]:text-left",children:[jsxRuntime.jsxs("div",{className:"hidden @[36rem]:flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg pr-4",children:e.Title||e.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:e.ManufacturerId,name:e.ManufacturerName,width:96,height:40})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 justify-center @[36rem]:hidden",children:[jsxRuntime.jsxs(Badge,{variant:"outline",className:"border-orange-300 bg-orange-50 text-orange-800",children:[jsxRuntime.jsx(Telescope,{className:"mr-2 h-3 w-3"}),jsxRuntime.jsx("span",{children:"External Product"})]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:"border-randmar-red bg-red-50 text-randmar-red",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2 h-3 w-3"}),jsxRuntime.jsxs("span",{children:["Held by ",jsxRuntime.jsx("b",{children:"Randmar"})]})]})]}),jsxRuntime.jsxs("div",{className:"hidden @[36rem]:grid grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center rounded-md bg-orange-50 px-4 py-2 text-orange-800 border-1 border-orange-800 text-sm",children:[jsxRuntime.jsx(Telescope,{className:"mr-2 h-5 w-5 flex-shrink-0"}),jsxRuntime.jsx("span",{children:"External Product"})]}),jsxRuntime.jsxs("div",{className:"flex items-center rounded-md bg-red-50 px-4 py-2 text-randmar-red border-1 border-randmar-red text-sm",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2 h-5 w-5 flex-shrink-0"}),jsxRuntime.jsxs("span",{children:["Held by ",jsxRuntime.jsx("b",{children:"Randmar"})]})]})]}),t&&jsxRuntime.jsx("div",{className:"mt-auto pt-4 flex justify-center @[36rem]:justify-end",children:jsxRuntime.jsx(reactRouterDom.Link,{to:t,children:jsxRuntime.jsxs(Button$1,{variant:"secondary",className:"w-full @[36rem]:w-auto",children:[jsxRuntime.jsx(Eye,{className:"mr-2 h-4 w-4"}),"View Product"]})})})]})]})]})}):jsxRuntime.jsx(Card,{className:"@container border-dashed border-2 h-full",children:jsxRuntime.jsx(CardContent,{className:"p-6 flex flex-col h-full",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-6 flex-grow @[36rem]:flex-row",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 @[36rem]:w-48",children:jsxRuntime.jsx(Skeleton,{className:"aspect-square w-full h-auto"})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-1/2"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 justify-center @[36rem]:hidden",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-36 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-36 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"hidden @[36rem]:grid grid-cols-2 gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md"})]})]}),jsxRuntime.jsx("div",{className:"mt-auto pt-4 flex justify-center @[36rem]:justify-end",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-full @[36rem]:w-40"})})]})]})})})}function getEndDateStatus(e){if(!e)return{text:"No End Date",variant:"neutral",daysRemaining:null};const t=new Date(e);if(isNaN(t.getTime()))return{text:"Invalid Date",variant:"neutral",daysRemaining:null};const n=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate()),l=new Date(n.getFullYear(),n.getMonth(),n.getDate()),d=o.getTime()-l.getTime(),f=Math.ceil(d/(1e3*60*60*24));return f<0?{text:`Ended ${Math.abs(f)}d ago`,variant:"destructive",daysRemaining:f}:f===0?{text:"Ends today",variant:"destructive",daysRemaining:f}:f<=7?{text:`Ends in ${f}d`,variant:"destructive",daysRemaining:f}:f<=30?{text:`Ends in ${f}d`,variant:"warning",daysRemaining:f}:{text:`Ends in ${f}d`,variant:"neutral",daysRemaining:f}}const formatDate=e=>{if(!e)return"N/A";try{const t=new Date(e);return isNaN(t.getTime())?"Invalid Date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return"Invalid Date"}};function OpportunitiesTable({applicationId:e,opportunities:t=null,loading:n=!1}){var ne;const{toast:o}=useToast(),[l,d]=React.useState({}),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,R]=React.useState(null),{data:C}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:e},{skip:!e}),E=React.useCallback((ae,se,Oe)=>{d(Ne=>({...Ne,[ae]:{...Ne[ae],[se]:Oe}}))},[]),[A]=usePutV4ResellerByRouteResellerIdOpportunityAndManufacturerIdDefaultMutation(),M=React.useCallback(async ae=>{if(!(C!=null&&C.IsReseller))return;if(!ae.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot set default.",variant:"destructive"});return}const se=ae.BidNumber;E(se,"isSettingDefault",!0),A({routeResellerId:e,manufacturerId:ae.ManufacturerId??"",opportunityNumber:se}).unwrap().then(()=>{o({title:"Success",description:`Opportunity "${ae.OpportunityName||ae.Opportunity||se}" was successfully set as default.`,variant:"success"})}).catch(Oe=>{var Ne;console.error("Set as default error:",Oe),o({title:"Error",description:((Ne=Oe.data)==null?void 0:Ne.message)||Oe.message||"An error occurred while setting this opportunity as default.",variant:"destructive"})}).finally(()=>{E(se,"isSettingDefault",!1)})},[e,A,o,E,C==null?void 0:C.IsReseller]),[I]=usePostV4ResellerByRouteResellerIdOpportunityAndManufacturerIdBidNumberEmailMutation(),j=React.useCallback(ae=>{if(C!=null&&C.IsReseller){if(!ae.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot prepare report.",variant:"destructive"});return}R(ae),_(""),g(!0)}},[o,C==null?void 0:C.IsReseller]),q=React.useCallback(async()=>{if(!(C!=null&&C.IsReseller))return;if(!S||!S.BidNumber){o({title:"Error",description:"No opportunity selected or Bid Number is missing.",variant:"destructive"});return}if(!b.trim()||!/\S+@\S+\.\S+/.test(b)){o({title:"Validation Error",description:"Please enter a valid email address.",variant:"destructive"});return}const ae=S.BidNumber;E(ae,"isSendingReport",!0),I({routeResellerId:e,manufacturerId:S.ManufacturerId??"",bidNumber:ae,emailAddress:b}).unwrap().then(()=>{o({title:"Success",description:`A report for "${S.OpportunityName||S.Opportunity||ae}" was successfully sent to ${b}.`,variant:"success"}),g(!1)}).catch(se=>{var Oe;console.error("Send report by email error:",se),o({title:"Error",description:((Oe=se.data)==null?void 0:Oe.message)||se.message||"An error occurred while sending the report by email.",variant:"destructive"})}).finally(()=>{E(ae,"isSendingReport",!1),f||(R(null),_(""))})},[S,b,e,I,o,E,g]),Q=React.useMemo(()=>[{accessorKey:"ManufacturerId",header:"Manuf.",cell:({row:ae})=>jsxRuntime.jsx("div",{className:"w-20 h-8",children:jsxRuntime.jsx(PartnerLogo,{id:ae.original.ManufacturerId,width:80,height:32})}),enableSorting:!0,enableFiltering:!0},{id:"opportunityDisplay",accessorFn:ae=>ae.OpportunityName||ae.Opportunity,header:"Opportunity",cell:({getValue:ae})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:ae()??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"BidNumber",header:"Bid Number",cell:({row:ae})=>ae.original.BidNumber??"N/A",enableSorting:!0,enableFiltering:!0},{id:"statusInfo",header:"Status",cell:({row:ae})=>{const se=ae.original,Oe=se.Active===!0,Ne=getEndDateStatus(se.EndDate);let oe="border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";return Ne.variant==="destructive"?oe="border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400":Ne.variant==="warning"&&(oe="border-yellow-500 bg-yellow-100 text-yellow-700 dark:border-yellow-600 dark:bg-yellow-900/50 dark:text-yellow-400"),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 min-w-[200px]",children:[jsxRuntime.jsx(Badge,{variant:"outline",className:Oe?"border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium":"border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium",children:Oe?"Active":"Inactive"}),se.EndDate&&jsxRuntime.jsx(Badge,{variant:"outline",className:`${oe} font-medium`,children:Ne.text}),jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0 data-[state=delayed-open]:bg-accent data-[state=instant-open]:bg-accent",children:jsxRuntime.jsx(Info,{className:"h-4 w-4 text-muted-foreground"})})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",className:"bg-popover text-popover-foreground p-2 rounded shadow-lg",children:jsxRuntime.jsxs("div",{className:"text-sm space-y-1",children:[jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Start:"})," ",formatDate(se.StartDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"End:"})," ",formatDate(se.EndDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Updated:"})," ",formatDate(se.LastUpdate)]})]})})]})})]})},enableFiltering:!1},{id:"actions",header:"Actions",cell:({row:ae})=>{var Be,qe;const se=ae.original;if(!se.BidNumber)return jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Actions unavailable"});const Oe=se.BidNumber,Ne=(Be=l[Oe])==null?void 0:Be.isSettingDefault,oe=(S==null?void 0:S.BidNumber)===Oe&&((qe=l[Oe])==null?void 0:qe.isSendingReport),$e=Ne||oe,Ae=se.CanBeSetAsDefault===!0,je=C!=null&&C.IsManufacturer?`/${e}/Opportunity/${se.BidNumber}`:`/${e}/Opportunity/${se.ManufacturerId}/${se.BidNumber}`;return jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx(reactRouterDom.Link,{to:je,children:jsxRuntime.jsxs(Button$1,{variant:"outline",size:"sm",className:"flex items-center",children:[jsxRuntime.jsx(Star,{className:"mr-2 h-4 w-4"})," View"]})}),(C==null?void 0:C.IsReseller)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Button$1,{variant:"outline",size:"sm",onClick:()=>M(se),disabled:$e||!Ae,title:Ae?"Set as default":"This opportunity cannot be set as default",className:"flex items-center",children:[Ne?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Star,{className:"mr-2 h-4 w-4"})," Set Default"]}),jsxRuntime.jsxs(Button$1,{variant:"outline",size:"sm",onClick:()=>j(se),disabled:$e,title:"Send report by email",className:"flex items-center",children:[oe?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Send,{className:"mr-2 h-4 w-4"})," Send Report"]})]})]})}}],[l,M,j,S,C==null?void 0:C.IsReseller,e]),te=React.useMemo(()=>{const ae={};if(t){const se=Array.from(new Set(t.map(Ne=>Ne.ManufacturerId).filter(Ne=>Ne!=null)));ae.ManufacturerId=se;const Oe=Array.from(new Set(t.map(Ne=>Ne.OpportunityName||Ne.Opportunity).filter(Ne=>Ne!=null)));ae.opportunityDisplay=Oe}return ae},[t]),F=t||[],V=S!=null&&S.BidNumber?(ne=l[S.BidNumber])==null?void 0:ne.isSendingReport:!1;return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-48 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Opportunities"})," "]}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:Q,data:F,uniqueValues:te})})]}),jsxRuntime.jsx(Dialog,{open:f,onOpenChange:ae=>{g(ae),ae||(R(null),_(""))},children:jsxRuntime.jsxs(DialogContent,{className:"@sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Send Opportunity Report"}),jsxRuntime.jsxs(DialogDescription,{children:["Enter the email address to send the report for opportunity: ",jsxRuntime.jsx("br",{}),jsxRuntime.jsx("span",{className:"font-semibold",children:(S==null?void 0:S.OpportunityName)||(S==null?void 0:S.Opportunity)||"N/A"}),(S==null?void 0:S.BidNumber)&&jsxRuntime.jsxs("span",{className:"block text-sm text-muted-foreground",children:["Bid Number: ",S.BidNumber]})]})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",className:"text-right",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",type:"email",value:b,onChange:ae=>_(ae.target.value),placeholder:"recipient@example.com",className:"col-span-3",disabled:V})]})}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>g(!1),disabled:V,children:"Cancel"}),jsxRuntime.jsxs(Button$1,{type:"submit",onClick:q,disabled:V,children:[V&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"})," Send Report"]})]})]})})]})}function useLoadScript(e){const[t,n]=React.useState(!0),[o,l]=React.useState(null),[d,f]=React.useState(!1),g=()=>{n(!1),f(!0)};return React.useEffect(()=>{if(!document){const R=new Error(`[ScriptLoadingError] document not defined when attempting to load ${e}`);l(R);return}const b=document.querySelector(`script[src="${e}"]`);if(b!=null&&b.dataset.loaded){g();return}const _=b||document.createElement("script");b||(_.src=e);const S=()=>{_.dataset.loaded="1",g()};_.addEventListener("load",S),_.addEventListener("error",R=>{console.error("Failed to load script:",e,R);const C=new Error(`[ScriptLoadingError] Failed to load script: ${e}`);l(C)}),b||document.head.append(_)},[]),{isLoading:t,error:o,isSuccess:d}}const isGoogleReady=e=>e&&e.charts,isGoogleChartsReady=(e,t)=>{const{controls:n,toolbarItems:o,getChartEditor:l}=e;return t&&t.charts&&t.visualization&&t.visualization.ChartWrapper&&t.visualization.Dashboard&&(!n||t.visualization.ChartWrapper)&&(!l||t.visualization.ChartEditor)&&(!o||t.visualization.drawToolbar)},getGoogleInstanceFromWindow=e=>window.google;function useLoadGoogleCharts(e){const{chartVersion:t="current",chartPackages:n=["corechart","controls"],chartLanguage:o="en",mapsApiKey:l}=e,[d,f]=React.useState(null),[g,b]=React.useState(null),[_,S]=React.useState(null),{isLoading:R,error:C,isSuccess:E}=useLoadScript(e.chartLoaderScriptUrl||"https://www.gstatic.com/charts/loader.js");return React.useEffect(()=>{if(!E)return;const A=getGoogleInstanceFromWindow();if(!isGoogleReady(A)){const M=new Error("[ScriptInitializationError] Script loaded but Google not attached to window.");b(M);return}if(isGoogleChartsReady(e,A)){f(A);return}A.charts.load(t,{packages:n,language:o,mapsApiKey:l}),A.charts.setOnLoadCallback(()=>{if(!isGoogleChartsReady(e,A)){const M=new Error("[GoogleChartsInitializationError] Google Charts not ready after load callback.");console.error(M),S(M);return}f(A)})},[E]),{error:C||g||_,isLoading:R,google:d}}const chartDefaultProps={legend_toggle:!1,options:{},legendToggle:!1,getChartWrapper:()=>{},spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{},chartLoaderScriptUrl:"https://www.gstatic.com/charts/loader.js"},GoogleChartControls=e=>{const{isReady:t,chartControls:n,filter:o}=e;return!t||!n||!(n!=null&&n.length)?null:React.createElement(React.Fragment,null,n.filter(l=>{let{controlProp:d,control:f}=l;return o?o({control:f,controlProp:d}):!0}).map(l=>{let{control:d}=l;return React.createElement("div",{key:d.getContainerId(),id:d.getContainerId()})}))};let uniqueID=0;const generateUniqueID=()=>(uniqueID+=1,`reactgooglegraph-${uniqueID}`),jn=class jn{};en(jn,"initializeControls",t=>{for(let n=0;n<t.length;n+=1){const{controlType:o,options:l,controlWrapperParams:d}=t[n].controlProp;d&&"state"in d&&t[n].control.setState(d.state),t[n].control.setOptions(l),t[n].control.setControlType(o)}}),en(jn,"listenToControlEvents",(t,n)=>{const{google:o}=n;return t.flatMap(l=>{const{control:d,controlProp:f}=l,{controlEvents:g=[]}=f;return g.map(b=>{const{callback:_,eventName:S}=b;return o.visualization.events.addListener(d,S,function(){for(var R=arguments.length,C=new Array(R),E=0;E<R;E++)C[E]=arguments[E];_({chartWrapper:null,controlWrapper:d,props:n,google:o,eventArgs:C})})})})}),en(jn,"createControlId",t=>{let n;return typeof t>"u"?n=`googlechart-control-${generateUniqueID()}`:n=t,n}),en(jn,"createChartControls",t=>{const{controls:n,google:o}=t;return n?n.map((l,d)=>{const{controlID:f,controlType:g,options:b,controlWrapperParams:_}=l,S=jn.createControlId(f);return{controlProp:l,control:new o.visualization.ControlWrapper({containerId:S,controlType:g,options:b,..._})}}):null}),en(jn,"addControls",t=>{const{chartWrapper:n,chartDashboard:o}=t,l=jn.createChartControls(t);return!l||!o||!n?null:(o.bind(l.map(d=>{let{control:f}=d;return f}),n),jn.initializeControls(l),l)});let GoogleChartControlsInternal=jn;const useCreateChartControls=e=>{const[t,n]=React__namespace.useState(null);return[React__namespace.useMemo(()=>!t||!e?null:e.map((l,d)=>{const f=t[d];return f?{controlProp:l,control:f}:void 0}).flatMap(l=>l?[l]:[]),[t,e]),n]},useListenToControlEvents=(e,t)=>{React__namespace.useEffect(()=>{const n=GoogleChartControlsInternal.listenToControlEvents(e??[],t);return()=>{n.forEach(o=>{t.google.visualization.events.removeListener(o)})}},[e,t])},useChartControls=e=>{const[t,n]=useCreateChartControls(e.controls);return useListenToControlEvents(t??[],e),{addControls:l=>{const d=GoogleChartControlsInternal.addControls(l);n((d==null?void 0:d.map(f=>f.control))??null)},renderControl:l=>{const{chartWrapper:d,chartDashboard:f}=e;return React__namespace.createElement(GoogleChartControls,{...e,isReady:!!(d&&f),chartControls:t,filter:l})}}},useChartId=e=>{const t=React__namespace.useRef(null);return{chartId:(()=>{const{graphID:l,graph_id:d}=e,f=l||d;let g;return f?g=f:g=t.current||generateUniqueID(),t.current=g,t.current})()}},DEFAULT_CHART_COLORS=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],loadDataTableFromSpreadSheet=async function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new Promise((o,l)=>{const d=`${n.headers?`headers=${n.headers}`:"headers=0"}`,f=`${n.query?`&tq=${encodeURIComponent(n.query)}`:""}`,g=`${n.gid?`&gid=${n.gid}`:""}`,b=`${n.sheet?`&sheet=${n.sheet}`:""}`,_=`${n.access_token?`&access_token=${n.access_token}`:""}`,S=`${d}${g}${b}${f}${_}`,R=`${t}/gviz/tq?${S}`;new e.visualization.Query(R).send(E=>{E.isError()?l(`Error in query: ${E.getMessage()} ${E.getDetailedMessage()}`):o(E.getDataTable())})})},GRAY_COLOR="#CCCCCC",Tn=class Tn{};en(Tn,"grayOutHiddenColumnsLabel",(t,n)=>{const{googleChartWrapper:o,options:l}=t;if(!o){console.error("googleChartWrapper is not defined");return}const d=o.getDataTable();if(!d)return;const f=d.getNumberOfColumns();if(n.length>0===!1)return;const b=Array.from({length:f-1}).map((_,S)=>{const R=Tn.getColumnId(d,S+1);return n.includes(R)?GRAY_COLOR:l&&l.colors?l.colors[S]:DEFAULT_CHART_COLORS[S]});o.setOptions({...l,colors:b}),o.draw()}),en(Tn,"listenToLegendToggle",(t,n)=>{const[o,l]=n,{google:d,googleChartWrapper:f}=t;if(!f){console.error("googleChartWrapper is not defined");return}return d.visualization.events.addListener(f,"select",()=>{const b=f.getChart().getSelection(),_=f.getDataTable();if(b.length===0||b[0].row!==null||!_)return;const S=b[0].column,R=Tn.getColumnId(_,S);o!=null&&o.includes(R)?l(C=>[...C.filter(E=>E!==R)]):l(C=>[...C,R])})}),en(Tn,"draw",async t=>{const{data:n,diffdata:o,rows:l,columns:d,options:f,chartType:g,formatters:b,spreadSheetUrl:_,spreadSheetQueryParameters:S,googleChartDashboard:R,googleChartWrapper:C,google:E,hiddenColumns:A,legendToggle:M,legend_toggle:I}=t;if(!C){console.error("draw was called with googleChartWrapper = null");return}let j,q=null;if(o){const ne=E.visualization.arrayToDataTable(o.old),ae=E.visualization.arrayToDataTable(o.new);q=E.visualization[g].prototype.computeDiff(ne,ae)}n?n instanceof E.visualization.DataTable?j=n:Array.isArray(n)?j=E.visualization.arrayToDataTable(n):j=new E.visualization.DataTable(n):l&&d?j=E.visualization.arrayToDataTable([d,...l]):_?j=await loadDataTableFromSpreadSheet(E,_,S):j=E.visualization.arrayToDataTable([]);const Q=j.getNumberOfColumns(),te=Array(Q).fill(0).map((ne,ae)=>{const se=Tn.getColumnId(j,ae);return A.includes(se)?{label:j.getColumnLabel(ae),type:j.getColumnType(ae),calc:()=>null}:ae}),F=C.getChart();C.getChartType()==="Timeline"&&F&&F.clearChart(),C.setChartType(g),C.setOptions(f||{});const V=new E.visualization.DataView(j);V.setColumns(te),C.setDataTable(V),C.draw(),R&&R.draw(j),q&&(C.setDataTable(q),C.draw()),b&&(Tn.applyFormatters({dataTable:j,formatters:b,google:E}),C.setDataTable(j),C.draw()),(M===!0||I===!0)&&Tn.grayOutHiddenColumnsLabel(t,A)}),en(Tn,"getColumnId",(t,n)=>t.getColumnId(n)||t.getColumnLabel(n)),en(Tn,"applyFormatters",t=>{let{dataTable:n,formatters:o,google:l}=t;for(let d of o)switch(d.type){case"ArrowFormat":{new l.visualization.ArrowFormat(d.options).format(n,d.column);return}case"BarFormat":{new l.visualization.BarFormat(d.options).format(n,d.column);return}case"ColorFormat":{const f=new l.visualization.ColorFormat(d.options),{ranges:g}=d;if(g)for(let b of g)f.addRange(...b);f.format(n,d.column);return}case"DateFormat":{new l.visualization.DateFormat(d.options).format(n,d.column);return}case"NumberFormat":{new l.visualization.NumberFormat(d.options).format(n,d.column);return}case"PatternFormat":{new l.visualization.PatternFormat(d.options).format(n,d.column);return}default:{console.warn(`Unknown formatter type: ${d.type}`);return}}});let GoogleChartInternal=Tn;const useGoogleChartDataTable=e=>{const{google:t,googleChartWrapper:n,googleChartDashboard:o}=e,[l,d]=React__namespace.useState([]);React__namespace.useEffect(()=>{n&&GoogleChartInternal.draw({...e,hiddenColumns:l,googleChartWrapper:n,googleChartDashboard:o,google:t})},[l,e.data,e.rows,e.columns,e.options,e.chartLoaderScriptUrl,e.chartType,e.formatters,e.spreadSheetUrl,e.spreadSheetQueryParameters,e.legendToggle,e.legend_toggle]);const f=()=>{const{googleChartWrapper:_}=e;_&&_.draw()},g=_=>{const S=[],{legendToggle:R,legend_toggle:C}=e;if(GoogleChartInternal.draw({...e,hiddenColumns:l,googleChartWrapper:_,googleChartDashboard:o,google:t}),window.addEventListener("resize",f),C||R){const E=GoogleChartInternal.listenToLegendToggle(e,[l,d]);E&&S.push(E)}return S},b=(_,S)=>{window.removeEventListener("resize",f),S.forEach(R=>{t.visualization.events.removeListener(R)}),_.getChartType()==="Timeline"&&_.getChart()&&_.getChart().clearChart()};React__namespace.useEffect(()=>{if(!n)return;const _=g(n);return()=>{b(n,_)}},[n,g,b])},listenToEvents=e=>{const{chartEvents:t,google:n,googleChartWrapper:o}=e;if(t){if(!o){console.warn("listenToEvents was called before chart wrapper ready.");return}return t.map(l=>{let{eventName:d,callback:f}=l;return n.visualization.events.addListener(o,d,function(){for(var g=arguments.length,b=new Array(g),_=0;_<g;_++)b[_]=arguments[_];f({chartWrapper:o,props:e,google:n,eventArgs:b})})})}},useGoogleChartEvents=e=>{React.useEffect(()=>{if(!e.googleChartWrapper)return;const t=listenToEvents(e);return()=>{t==null||t.forEach(n=>{e.google.visualization.events.removeListener(n)})}},[e])},GoogleChart=e=>{const[t,n]=React__namespace.useState(null),[o,l]=React__namespace.useState(null),{addControls:d,renderControl:f}=useChartControls({...e,chartDashboard:o,chartWrapper:t});useGoogleChartEvents({...e,googleChartWrapper:t});const{chartId:g}=useChartId(e),b=React__namespace.useRef(null),_=React__namespace.useRef(null);React__namespace.useEffect(()=>{const{options:j,google:q,chartType:Q,chartWrapperParams:te,toolbarItems:F,getChartEditor:V,getChartWrapper:ne,onLoad:ae}=e,se={chartType:Q,options:j,containerId:g,...te},Oe=new q.visualization.ChartWrapper(se);Oe.setOptions(j||{}),ne==null||ne(Oe,q);const Ne=new q.visualization.Dashboard(b.current);F&&q.visualization.drawToolbar(_.current,F);let oe=null;V&&(oe=new q.visualization.ChartEditor,V({chartEditor:oe,chartWrapper:Oe,google:q})),d({...e,chartDashboard:Ne,chartWrapper:Oe}),n(Oe),l(Ne),ae==null||ae(q,{google:q,chartWrapper:Oe,chartEditor:oe,chartDashboard:Ne})},[]),useGoogleChartDataTable({...e,googleChartWrapper:t,googleChartDashboard:o});const S=()=>{const{width:j,height:q,options:Q,style:te,className:F,rootProps:V,google:ne}=e,ae={height:q||Q&&Q.height,width:j||Q&&Q.width,...te};return React__namespace.createElement("div",{id:g,style:ae,className:F,...V})},R=()=>e.toolbarItems?React__namespace.createElement("div",{ref:_}):null,{width:C,height:E,options:A,style:M}=e,I={height:E||A&&A.height,width:C||A&&A.width,...M};return e.render?React__namespace.createElement("div",{ref:b,style:I},React__namespace.createElement("div",{ref:_,id:"toolbar"}),e.render({renderChart:S,renderControl:f,renderToolbar:R})):React__namespace.createElement("div",{ref:b,style:I},f(j=>{let{controlProp:q}=j;return q.controlPosition!=="bottom"}),S(),f(j=>{let{controlProp:q}=j;return q.controlPosition==="bottom"}),R())},ChartContext=React__namespace.createContext(chartDefaultProps),ContextProvider=e=>{let{children:t,value:n}=e;return React__namespace.createElement(ChartContext.Provider,{value:n},t)},ChartView=e=>{const{google:t,isLoading:n,error:o}=useLoadGoogleCharts(e);return n?e.loader??null:o?e.errorElement??null:t?React.createElement(GoogleChart,{google:t,...e}):null},Chart=e=>{const t={...chartDefaultProps,...e};return React.createElement(ContextProvider,{value:t},React.createElement(ChartView,t))};var GoogleDataTableColumnRoleType;(function(e){e.annotation="annotation",e.annotationText="annotationText",e.certainty="certainty",e.emphasis="emphasis",e.interval="interval",e.scope="scope",e.style="style",e.tooltip="tooltip",e.domain="domain"})(GoogleDataTableColumnRoleType||(GoogleDataTableColumnRoleType={}));function parseHsl(e){const t=e.match(/(\d+\.?\d*)\s*(\d+\.?\d*)%\s*(\d+\.?\d*)%/);return t?{h:parseFloat(t[1]),s:parseFloat(t[2]),l:parseFloat(t[3])}:null}function hslToHex(e,t,n){n/=100;const o=t*Math.min(n,1-n)/100,l=d=>{const f=(d+e/30)%12,g=n-o*Math.max(Math.min(f-3,9-f,1),-1);return Math.round(255*g).toString(16).padStart(2,"0")};return`#${l(0)}${l(8)}${l(4)}`}const Treemap=React__namespace.forwardRef(({data:e,options:t,height:n="500px",className:o,loading:l,disableClick:d=!0,...f},g)=>{const b=React__namespace.useRef(null),[_,S]=React__namespace.useState(null);React__namespace.useEffect(()=>{if(!b.current)return;const E=b.current,A=()=>{const q=getComputedStyle(E).getPropertyValue("--primary").trim();if(q){const Q=parseHsl(q);if(Q){const{h:te,s:F,l:V}=Q;S({minColor:hslToHex(te,F,Math.min(100,V+50)),midColor:hslToHex(te,F,Math.min(100,V+35)),maxColor:hslToHex(te,F,Math.min(100,V+20))})}return!0}return!1};if(A())return;let M=0;const I=20,j=setInterval(()=>{(A()||M>=I)&&clearInterval(j),M++},100);return()=>{j&&clearInterval(j)}},[]);const R=React__namespace.useMemo(()=>{const E={headerHeight:0,fontSize:14,showScale:!1,isHtml:!0,backgroundColor:"hsl(var(--background))",generateTooltip:(A,M)=>{var q;const I=(q=e[A+1])==null?void 0:q[0];if(!I)return"";const j=formatMoney(M);return`<div class="p-2 bg-background text-foreground border rounded-md shadow-lg">
|
|
1455
|
+
`;function RichTextEditor({id:e,name:t,value:n,onChange:o,placeholder:l,className:d,...f}){const[g,b]=React.useState(!1),_=React.useRef(null),S=React.useRef(null),R=useEditor({extensions:[StarterKit,Underline],content:n,editorProps:{attributes:{class:"prose prose-sm sm:prose dark:prose-invert focus:outline-none",id:e??"",name:t??""}},onUpdate:({editor:j})=>{const q=j.getHTML();o({target:{id:e,name:t,value:q}})}});React.useEffect(()=>{R&&n!==R.getHTML()&&R.commands.setContent(n)},[n,R]);const C=React.useCallback(j=>{if(R)if(R.chain().focus(),j==="paragraph")R.chain().setParagraph().run();else{const q=Number.parseInt(j.slice(1));R.chain().setHeading({level:q}).run()}},[R]),E=React.useCallback(j=>{if(R)switch(R.chain().focus(),j){case"bold":R.chain().toggleBold().run();break;case"italic":R.chain().toggleItalic().run();break;case"underline":R.chain().toggleUnderline().run();break;case"strike":R.chain().toggleStrike().run();break;case"bulletList":R.chain().toggleBulletList().run();break;case"orderedList":R.chain().toggleOrderedList().run();break}},[R]),A=React.useCallback(()=>{b(j=>!j)},[]),M=React.useCallback(j=>{const q=j.target.value;R&&R.commands.setContent(q),o({target:{id:e,name:t,value:q}})},[o,R,e,t]),I=React.useCallback(()=>{!g&&R&&R.commands.focus()},[g,R]);return R?jsxRuntime.jsxs("div",{ref:S,className:cn("border border-input rounded-md overflow-hidden focus-within:outline-hidden focus-within:ring-1 focus-within:ring-ring",d),onClick:I,...f,children:[jsxRuntime.jsx("style",{children:editorStyles}),jsxRuntime.jsxs("div",{className:"flex flex-wrap items-center p-2 border-b border-input gap-2 bg-background",children:[jsxRuntime.jsxs(Select$1,{onValueChange:C,disabled:g,children:[jsxRuntime.jsx(SelectTrigger,{className:"w-[160px]",children:jsxRuntime.jsx(SelectValue,{placeholder:"Format"})}),jsxRuntime.jsx(SelectContent,{children:formatOptions.map(j=>jsxRuntime.jsx(SelectItem,{value:j.value,children:j.label},j.value))})]}),["bold","italic","underline","strike","bulletList","orderedList"].map(j=>jsxRuntime.jsxs(Button$1,{type:"button",variant:"ghost",size:"sm",onClick:()=>E(j),className:R.isActive(j)?"bg-muted":"",disabled:g,children:[j==="bold"&&jsxRuntime.jsx(Bold$1,{className:"h-4 w-4"}),j==="italic"&&jsxRuntime.jsx(Italic$1,{className:"h-4 w-4"}),j==="underline"&&jsxRuntime.jsx(Underline$1,{className:"h-4 w-4"}),j==="strike"&&jsxRuntime.jsx(Strikethrough,{className:"h-4 w-4"}),j==="bulletList"&&jsxRuntime.jsx(List$1,{className:"h-4 w-4"}),j==="orderedList"&&jsxRuntime.jsx(ListOrdered,{className:"h-4 w-4"})]},j)),jsxRuntime.jsx(Button$1,{type:"button",variant:"ghost",size:"sm",onClick:A,className:g?"bg-muted":"",children:jsxRuntime.jsx(Code$1,{className:"h-4 w-4"})})]}),jsxRuntime.jsx("div",{className:"p-3",children:g?jsxRuntime.jsx(Textarea,{ref:_,id:e,name:t,value:R.getHTML(),onChange:M,className:cn("min-h-[150px] font-mono text-sm resize-none border-0 focus-visible:ring-0 focus-visible:ring-offset-0",d),placeholder:l}):jsxRuntime.jsx(EditorContent,{editor:R})})]}):null}function ReceiptsTable({applicationId:e,receipts:t=null,loading:n=!1}){const o=React.useMemo(()=>[{accessorKey:"Location",header:"Location",cell:({row:f})=>f.original.Location??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"ReceiptDate",header:"Date",cell:({row:f})=>formatYYYYMMDDIntToDateString(f.original.ReceiptDate),enableSorting:!0,enableFiltering:!0},{accessorKey:"ReceiptNumber",header:"Number",cell:({row:f})=>f.original.ReceiptNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Document/${f.original.ReceiptNumber}`,className:"font-medium text-primary hover:underline",children:f.original.ReceiptNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for Receipt ",f.original.ReceiptNumber]})})]})}):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"Quantity",header:"Quantity",cell:({row:f})=>f.original.Quantity??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"UnitPrice",header:"Unit Price",cell:({row:f})=>f.original.UnitPrice?formatMoney(f.original.UnitPrice):"—",enableSorting:!0,enableFiltering:!0}],[]),l=React.useMemo(()=>{const f={};if(t){const g=Array.from(new Set(t.map(_=>_.Location).filter(_=>_!=null)));f.Location=g;const b=Array.from(new Set(t.map(_=>formatYYYYMMDDIntToDateString(_.ReceiptDate)).filter(_=>_!=="—"&&_!=="Invalid Date"))).sort((_,S)=>new Date(S).getTime()-new Date(_).getTime());f.ReceiptDate=b}return f},[t]),d=t||[];return jsxRuntime.jsx(DataTable,{columns:o,data:d,uniqueValues:l,loading:n,tableClass:"bg-card text-card-foreground",initialSort:[{id:"ReceiptDate",desc:!0}]})}const formatDate$1=e=>{if(!e)return"N/A";try{const t=new Date(e);return isNaN(t.getTime())?"Invalid Date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return"Invalid Date"}},getStatusVariant=e=>{const t=(e==null?void 0:e.toLowerCase())||"";return t.includes("accepted")?"success":t.includes("error")||t.includes("rejected")?"destructive":"neutral"};function ReturnsTable({applicationId:e,returns:t=null,loading:n=!1}){const o=React.useMemo(()=>[{accessorKey:"ReturnNumber1",header:"RMA Number",cell:({row:f})=>{const g=f.original.ReturnNumber1||f.original.ReturnNumber;return g?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Return/${g}`,className:"font-medium text-primary hover:underline",children:g})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for return ",g]})})]})}):"N/A"},enableSorting:!0,enableFiltering:!0},{accessorKey:"RequestDate",header:"Request Date",cell:({row:f})=>formatDate$1(f.original.RequestDate),enableSorting:!0},{accessorKey:"InvoiceNumber",header:"Invoice Number",cell:({row:f})=>{const g=f.original.InvoiceNumber;return g?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Document/${g}`,className:"text-blue-600 hover:underline dark:text-blue-400",children:g})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for invoice ",g]})})]})}):"N/A"},enableSorting:!0,enableFiltering:!0},{accessorKey:"Quantity",header:"Quantity",cell:({row:f})=>f.original.Quantity??"0",enableSorting:!0},{accessorKey:"ReasonForReturn",header:"Return Reason",cell:({row:f})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:f.original.ReasonForReturn??"—"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"Status",header:"Status",cell:({row:f})=>{const g=f.original.Status,b=getStatusVariant(g);let _="border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";return b==="success"?_="border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400":b==="destructive"&&(_="border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400"),g?jsxRuntime.jsx(Badge,{variant:"outline",className:`${_} font-medium`,children:g}):"—"},enableSorting:!0,enableFiltering:!0},{accessorKey:"WarehouseLocation",header:"Warehouse",cell:({row:f})=>f.original.WarehouseLocation??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"LastUpdatedDate",header:"Last Update",cell:({row:f})=>formatDate$1(f.original.LastUpdatedDate)!=="N/A"?formatDate$1(f.original.LastUpdatedDate):"—",enableSorting:!0}],[e]),l=React.useMemo(()=>{const f={};if(t){const g=Array.from(new Set(t.map(S=>S.Status).filter(Boolean)));f.Status=g;const b=Array.from(new Set(t.map(S=>S.ReasonForReturn).filter(Boolean)));f.ReasonForReturn=b;const _=Array.from(new Set(t.map(S=>S.WarehouseLocation).filter(Boolean)));f.WarehouseLocation=_}return f},[t]),d=React.useMemo(()=>t?[...t].sort((g,b)=>(b.ReturnNumber1||b.ReturnNumber||"").localeCompare(g.ReturnNumber1||g.ReturnNumber||"")):[],[t]);return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-48 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"}),jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Returns"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:o,data:d,uniqueValues:l})})]})}function PurchaseOrdersTable({applicationId:e,purchaseOrders:t=null,loading:n=!1}){const[o,l]=React.useState([]),[d]=usePostV4ManufacturerByRouteManufacturerIdPurchaseOrderAndPurchaseOrderNumberEditItemRandmarSkuMutation(),{toast:f}=useToast();React.useEffect(()=>{l(t||[])},[t]);const g=React.useMemo(()=>[{accessorKey:"PurchaseOrderNumber",header:"Number",cell:({row:_})=>_.original.PurchaseOrderNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Document/${_.original.PurchaseOrderNumber}`,className:"font-medium text-primary hover:underline",children:_.original.PurchaseOrderNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for Purchase Order ",_.original.PurchaseOrderNumber]})})]})}):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"PurchaseOrderDate",header:"Date",cell:({row:_})=>formatYYYYMMDDIntToDateString(_.original.PurchaseOrderDate),enableSorting:!0,enableFiltering:!0},{accessorKey:"Location",header:"Location",cell:({row:_})=>_.original.Location??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"PartNumber",header:"Part Number",cell:({row:_})=>_.original.MPN?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Product/${_.original.RandmarSKU}`,className:"font-medium text-primary hover:underline",children:_.original.MPN})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for Product ",_.original.RandmarSKU]})})]})}):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"QuantityOrdered",header:"Quantity Ordered",cell:({row:_})=>_.original.QuantityOrdered??0,enableSorting:!0,enableFiltering:!0},{accessorKey:"UnitPrice",header:"Unit Price",cell:({row:_})=>_.original.UnitPrice?formatMoney(_.original.UnitPrice):"—",enableSorting:!0,enableFiltering:!0},{id:"actions",header:()=>jsxRuntime.jsx("div",{className:"text-right",children:"Action"}),cell:function({row:S}){const[R,C]=React.useState(!1),E=S.original,A=()=>{C(!0),d({routeManufacturerId:e,purchaseOrderNumber:E.PurchaseOrderNumber??"",randmarSku:E.RandmarSKU??"",quantity:0}).then(()=>{l(M=>M.filter(I=>!(I.PurchaseOrderNumber===I.PurchaseOrderNumber&&I.MPN===I.MPN))),f({variant:"success",title:"Success",description:`Part ${E.MPN} has been successfully deleted from Purchase Order ${E.PurchaseOrderNumber}.`})}).catch(M=>{console.error(M),C(!0),f({variant:"destructive",title:"Error",description:"Something went wrong!"})})};return jsxRuntime.jsx("div",{className:"text-right",children:jsxRuntime.jsxs(AlertDialog,{children:[jsxRuntime.jsx(AlertDialogTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"red",size:"sm",disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Deleting"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Trash2,{className:"mr-2 h-4 w-4"}),"Delete"]})})}),jsxRuntime.jsxs(AlertDialogContent,{children:[jsxRuntime.jsxs(AlertDialogHeader,{children:[jsxRuntime.jsx(AlertDialogTitle,{children:"Confirmation"}),jsxRuntime.jsxs(AlertDialogDescription,{children:["Are you sure you want to delete part ",jsxRuntime.jsx("strong",{children:E.MPN})," from Purchase Order ",jsxRuntime.jsx("strong",{children:E.PurchaseOrderNumber}),"?."]})]}),jsxRuntime.jsxs(AlertDialogFooter,{children:[jsxRuntime.jsx(AlertDialogCancel,{disabled:R,children:"Cancel"}),jsxRuntime.jsxs(AlertDialogAction,{onClick:A,disabled:R,children:[R&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Confirm"]})]})]})]})})}}],[e]),b=React.useMemo(()=>{const _={};return o&&(_.PurchaseOrderNumber=Array.from(new Set(o.map(S=>S.PurchaseOrderNumber).filter(S=>S!=null))),_.PurchaseOrderDate=Array.from(new Set(o.map(S=>S.PurchaseOrderDate).filter(S=>S!=null).map(String))),_.Location=Array.from(new Set(o.map(S=>S.Location).filter(S=>S!=null))),_.PartNumber=Array.from(new Set(o.map(S=>S.MPN).filter(S=>S!=null))),_.QuantityOrdered=Array.from(new Set(o.map(S=>S.QuantityOrdered).filter(S=>S!=null).map(String))),_.UnitPrice=Array.from(new Set(o.map(S=>S.UnitPrice).filter(S=>S!=null).map(String)))),_},[o]);return jsxRuntime.jsx(DataTable,{columns:g,data:o,uniqueValues:b,loading:n,tableClass:"bg-card text-card-foreground"})}function RequisitionsTable({applicationId:e,requisitions:t=null,loading:n=!1}){const[o,l]=React.useState([]),[d]=useDeleteV4ManufacturerByRouteManufacturerIdRequisitionAndRequisitionNumberMutation(),{toast:f}=useToast();React.useEffect(()=>{l(t||[])},[t]);const g=React.useMemo(()=>[{accessorKey:"RequisitionNumber",header:"Number",cell:({row:_})=>_.original.RequisitionNumber?jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(reactRouterDom.Link,{to:`/${e}/Document/${_.original.RequisitionNumber}`,className:"font-medium text-primary hover:underline",children:_.original.RequisitionNumber})}),jsxRuntime.jsx(TooltipContent,{children:jsxRuntime.jsxs("p",{children:["View details for Draft Purchase ",_.original.RequisitionNumber]})})]})}):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"RequisitionDate",header:"Date",cell:({row:_})=>formatYYYYMMDDIntToDateString(_.original.RequisitionDate),enableSorting:!0,enableFiltering:!0},{accessorKey:"Location",header:"Location",cell:({row:_})=>_.original.Location??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"QuantityOrdered",header:"Quantity Ordered",cell:({row:_})=>_.original.QuantityOrdered??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"QuantityOutstanding",header:"Quantity Outstanding",cell:({row:_})=>_.original.QuantityOutstanding??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"QuantityReceived",header:"Quantity Received",cell:({row:_})=>_.original.QuantityReceived??"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"SubTotal",header:"Sub Total",cell:({row:_})=>_.original.SubTotal?formatMoney(_.original.SubTotal):"—",enableSorting:!0,enableFiltering:!0},{accessorKey:"RequestedBy",header:"Requestor",cell:({row:_})=>_.original.RequestedBy??"—",enableSorting:!0,enableFiltering:!0},{id:"actions",header:()=>jsxRuntime.jsx("div",{className:"text-right",children:"Action"}),cell:function({row:S}){const[R,C]=React.useState(!1),E=S.original,A=()=>{C(!0),d({routeManufacturerId:e,requisitionNumber:E.RequisitionNumber??""}).then(()=>{l(M=>M.filter(I=>I.RequisitionNumber!==I.RequisitionNumber)),f({variant:"success",title:"Success",description:`Draft Purchase ${E.RequisitionNumber} has been successfully cancelled.`})}).catch(M=>{console.error(M),C(!0),f({variant:"destructive",title:"Error",description:"Something went wrong!"})})};return jsxRuntime.jsx("div",{className:"text-right",children:jsxRuntime.jsxs(AlertDialog,{children:[jsxRuntime.jsx(AlertDialogTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"red",size:"sm",disabled:R,children:R?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Cancelling"]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx(Trash2,{className:"mr-2 h-4 w-4"}),"Cancel"]})})}),jsxRuntime.jsxs(AlertDialogContent,{children:[jsxRuntime.jsxs(AlertDialogHeader,{children:[jsxRuntime.jsx(AlertDialogTitle,{children:"Confirmation"}),jsxRuntime.jsxs(AlertDialogDescription,{children:["Are you sure you want to cancel Draft Purchase ",jsxRuntime.jsx("strong",{children:E.RequisitionNumber}),"?."]})]}),jsxRuntime.jsxs(AlertDialogFooter,{children:[jsxRuntime.jsx(AlertDialogCancel,{disabled:R,children:"Cancel"}),jsxRuntime.jsxs(AlertDialogAction,{onClick:A,disabled:R,children:[R&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}),"Confirm"]})]})]})]})})}}],[e]),b=React.useMemo(()=>{const _={};return o&&(_.RequisitionNumber=Array.from(new Set(o.map(S=>S.RequisitionNumber).filter(S=>S!=null))),_.RequisitionDate=Array.from(new Set(o.map(S=>S.RequisitionDate).filter(S=>S!=null).map(String))),_.QuantityOrdered=Array.from(new Set(o.map(S=>S.QuantityOrdered).filter(S=>S!=null).map(String))),_.QuantityOutstanding=Array.from(new Set(o.map(S=>S.QuantityOutstanding).filter(S=>S!=null).map(String))),_.QuantityReceived=Array.from(new Set(o.map(S=>S.QuantityReceived).filter(S=>S!=null).map(String))),_.Location=Array.from(new Set(o.map(S=>S.Location).filter(S=>S!=null))),_.RequestedBy=Array.from(new Set(o.map(S=>S.RequestedBy).filter(S=>S!=null))),_.SubTotal=Array.from(new Set(o.map(S=>S.SubTotal).filter(S=>S!=null).map(String)))),_},[o]);return jsxRuntime.jsx(DataTable,{columns:g,data:o,uniqueValues:b,loading:n,tableClass:"bg-card text-card-foreground"})}function ProductOverviewPage({applicationId:e,sku:t,product:n,productDefaultOpportunityNumber:o="",productOnAddToCart:l,productAddingToCart:d=!1,productShopifyHostname:f,productCustomAction:g=jsxRuntime.jsx(jsxRuntime.Fragment,{})}){var Q,te,F,V,ne,ae,se,Oe,Ne,oe,$e,Ae,je,Be,qe,Ve;const{data:b,isLoading:_}=useGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery({routeApplicationId:e,randmarSku:t??"",withSpecification:!1},{skip:!!n||!e||!t}),{data:S,isLoading:R}=useGetV4PartnerByRouteApplicationIdProductAndRandmarSkuQuery({routeApplicationId:e,randmarSku:t??"",withSpecification:!0},{skip:!!n||!e||!t}),C=n??S??b,{data:E}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:e}),[A,M]=React.useState("stats-tab"),[I,j]=React.useState(!1);React.useEffect(()=>{var We,ze,Xe,nt,Je,st,et,at;if(!n&&R){j(!1);return}const Le={stats:(((We=C==null?void 0:C.SalesStatistics)==null?void 0:We.length)??0)<=0,inventory:(((Xe=(ze=C==null?void 0:C.Distribution)==null?void 0:ze.Inventory)==null?void 0:Xe.length)??0)<=0,opportunities:(((nt=C==null?void 0:C.Opportunities)==null?void 0:nt.length)??0)<=0,orders:(((Je=C==null?void 0:C.ActiveOrderDetails)==null?void 0:Je.length)??0)<=0&&(((st=C==null?void 0:C.Returns)==null?void 0:st.length)??0)<=0,invoices:(((et=C==null?void 0:C.CompletedOrderDetails)==null?void 0:et.length)??0)<=0,warehouse:(((at=C==null?void 0:C.Receipts)==null?void 0:at.length)??0)<=0},He=Object.values(Le).some(tt=>!tt);if(j(He),He&&Le[A]){const tt=Object.keys(Le).find(ot=>!Le[ot]);tt&&M(tt)}},[R,C,n,A]);const q=(C==null?void 0:C.ManufacturerId)!==e;return console.log("readonly",q),jsxRuntime.jsxs("div",{className:"@container",children:[jsxRuntime.jsxs("div",{className:"grid gap-4 grid-cols-1 @sm:grid-cols-2 @md:grid-cols-3",children:[jsxRuntime.jsx("div",{className:"@md:col-span-2",children:jsxRuntime.jsx(ProductCard,{applicationId:e,product:C??C,defaultOpportunityNumber:o,onAddToCart:l,addingToCart:d,shopifyHostname:f,customAction:g})}),jsxRuntime.jsxs(Card,{className:"flex flex-col",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsxs(CardTitle,{children:[jsxRuntime.jsx(Info,{className:"h-5 w-5 inline mr-2"})," Additionnal information"]})}),jsxRuntime.jsx(CardContent,{className:"basis-0 mb-6 grow overflow-y-auto",children:_?jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-5 w-32"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"})]}),jsxRuntime.jsx(Skeleton,{className:"h-1 w-full my-6"}),jsxRuntime.jsx(Skeleton,{className:"h-5 w-24"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full mt-2"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-full mt-1"})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs("div",{className:"flex justify-between",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Category Name"}),jsxRuntime.jsx("span",{className:"font-medium",children:(C==null?void 0:C.ProductType)||"N/A"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Master Carton"}),jsxRuntime.jsx("span",{className:"font-medium",children:(C==null?void 0:C.MasterCarton)||"N/A"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Skid Quantity"}),jsxRuntime.jsx("span",{className:"font-medium",children:(C==null?void 0:C.SkidQuantity)||"N/A"})]}),jsxRuntime.jsxs("div",{className:"flex justify-between mt-2",children:[jsxRuntime.jsx("span",{className:"text-muted-foreground",children:"Automatic Reorder"}),jsxRuntime.jsx("span",{className:"font-medium",children:C!=null&&C.AutoUpdate?"Yes":"No"})]}),((C==null?void 0:C.VoiceoverCaption)||(C==null?void 0:C.BodyHTML))&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("hr",{className:"my-6"}),jsxRuntime.jsx("div",{className:"text-muted-foreground mb-2",children:"Description"}),(C==null?void 0:C.VoiceoverCaption)&&jsxRuntime.jsx("div",{children:C==null?void 0:C.VoiceoverCaption}),(C==null?void 0:C.BodyHTML)&&jsxRuntime.jsx("div",{className:"prose prose-sm max-w-none",dangerouslySetInnerHTML:{__html:(C==null?void 0:C.BodyHTML)??""}})]})]})})]})]}),jsxRuntime.jsx("div",{className:"my-4",children:_||R?jsxRuntime.jsx("div",{className:"mx-auto flex justify-center items-center h-32",children:jsxRuntime.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin text-primary"})}):I&&jsxRuntime.jsxs(Tabs,{value:A,onValueChange:M,children:[jsxRuntime.jsxs(TabsList,{className:"inline-flex h-auto items-center justify-center rounded-none border-b bg-transparent p-0",children:[jsxRuntime.jsx(TabsTrigger,{value:"stats-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((Q=C==null?void 0:C.SalesStatistics)==null?void 0:Q.length)??0)<=0,children:"Statistics"}),jsxRuntime.jsx(TabsTrigger,{value:"inventory-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((F=(te=C==null?void 0:C.Distribution)==null?void 0:te.Inventory)==null?void 0:F.length)??0)<=0,children:"Inventory"}),jsxRuntime.jsx(TabsTrigger,{value:"opportunities-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((V=C==null?void 0:C.Opportunities)==null?void 0:V.length)??0)<=0,children:"Opportunities"}),jsxRuntime.jsx(TabsTrigger,{value:"active-orders-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((ne=C==null?void 0:C.ActiveOrderDetails)==null?void 0:ne.length)??0)<=0,children:"Active Orders"}),jsxRuntime.jsx(TabsTrigger,{value:"completed-orders-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((ae=C==null?void 0:C.CompletedOrderDetails)==null?void 0:ae.length)??0)<=0,children:"Completed Orders"}),jsxRuntime.jsx(TabsTrigger,{value:"returns-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((se=C==null?void 0:C.Returns)==null?void 0:se.length)??0)<=0,children:"Returns"}),jsxRuntime.jsx(TabsTrigger,{value:"purchase-orders-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:!(E!=null&&E.IsManufacturer)||(((Oe=C==null?void 0:C.PurchaseOrders)==null?void 0:Oe.length)??0)<=0&&(((Ne=C==null?void 0:C.Requisitions)==null?void 0:Ne.length)??0)<=0,children:"Purchase Orders"}),jsxRuntime.jsx(TabsTrigger,{value:"warehouse-tab",className:"relative h-12 rounded-none border-b-2 border-b-transparent bg-transparent px-4 pb-3 pt-2 text-sm font-medium text-muted-foreground shadow-none transition-none hover:text-foreground data-[state=active]:border-b-primary data-[state=active]:text-foreground data-[state=active]:shadow-none cursor-pointer",disabled:(((oe=C==null?void 0:C.Receipts)==null?void 0:oe.length)??0)<=0,children:"Latest Warehouse Receiving"})]}),jsxRuntime.jsx(TabsContent,{value:"stats-tab",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(SalesChartCard,{statistics:(C==null?void 0:C.SalesStatistics)??[],loading:R})})}),jsxRuntime.jsx(TabsContent,{value:"inventory-tab",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ProductInventoryGrid,{inventory:(($e=C==null?void 0:C.Distribution)==null?void 0:$e.Inventory)??[],className:"bg-card text-card-foreground"})})}),jsxRuntime.jsx(TabsContent,{value:"opportunities-tab",children:jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(OpportunitiesTable,{applicationId:e,opportunities:C==null?void 0:C.Opportunities,loading:R})})}),jsxRuntime.jsx(TabsContent,{value:"active-orders-tab",children:(((Ae=C==null?void 0:C.ActiveOrderDetails)==null?void 0:Ae.length)??0)>0&&jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(OrdersCard,{applicationId:e,title:"Active Orders",orders:C==null?void 0:C.ActiveOrderDetails,loading:R})})}),jsxRuntime.jsx(TabsContent,{value:"completed-orders-tab",children:(((je=C==null?void 0:C.CompletedOrderDetails)==null?void 0:je.length)??0)>0&&jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(OrdersCard,{applicationId:e,title:"Completed Orders",orders:C==null?void 0:C.CompletedOrderDetails,loading:R})})}),jsxRuntime.jsx(TabsContent,{value:"returns-tab",children:(((Be=C==null?void 0:C.Returns)==null?void 0:Be.length)??0)>0&&jsxRuntime.jsx("div",{className:"mt-4",children:jsxRuntime.jsx(ReturnsTable,{applicationId:e,returns:C==null?void 0:C.Returns,loading:R})})}),jsxRuntime.jsxs(TabsContent,{value:"purchase-orders-tab",children:[(((qe=C==null?void 0:C.PurchaseOrders)==null?void 0:qe.length)??0)>0&&jsxRuntime.jsxs(Card,{className:"mt-4 w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Purchase Orders"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(PurchaseOrdersTable,{applicationId:e,purchaseOrders:C==null?void 0:C.PurchaseOrders,loading:R})})]}),(((Ve=C==null?void 0:C.Requisitions)==null?void 0:Ve.length)??0)>0&&jsxRuntime.jsxs(Card,{className:"mt-4 w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Draft Purchases"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(RequisitionsTable,{applicationId:e,requisitions:C==null?void 0:C.Requisitions,loading:R})})]})]}),jsxRuntime.jsx(TabsContent,{value:"warehouse-tab",children:jsxRuntime.jsxs(Card,{className:"mt-4 w-full",children:[jsxRuntime.jsx(CardHeader,{children:jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Receipts"})}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(ReceiptsTable,{applicationId:e,receipts:C==null?void 0:C.Receipts,loading:R})})]})})]})})]})}const colClasses={base:{1:"grid-cols-1",2:"grid-cols-2",3:"grid-cols-3",4:"grid-cols-4",5:"grid-cols-5",6:"grid-cols-6"},sm:{1:"sm:grid-cols-1",2:"sm:grid-cols-2",3:"sm:grid-cols-3",4:"sm:grid-cols-4",5:"sm:grid-cols-5",6:"sm:grid-cols-6"},md:{1:"md:grid-cols-1",2:"md:grid-cols-2",3:"md:grid-cols-3",4:"md:grid-cols-4",5:"md:grid-cols-5",6:"md:grid-cols-6"},lg:{1:"lg:grid-cols-1",2:"lg:grid-cols-2",3:"lg:grid-cols-3",4:"lg:grid-cols-4",5:"lg:grid-cols-5",6:"lg:grid-cols-6"},xl:{1:"xl:grid-cols-1",2:"xl:grid-cols-2",3:"xl:grid-cols-3",4:"xl:grid-cols-4",5:"xl:grid-cols-5",6:"xl:grid-cols-6"}},buildGridClassName=e=>{const t={base:1,md:2,...e};return["grid","gap-4",t.base?colClasses.base[t.base]:"",t.sm?colClasses.sm[t.sm]:"",t.md?colClasses.md[t.md]:"",t.lg?colClasses.lg[t.lg]:"",t.xl?colClasses.xl[t.xl]:""].filter(Boolean).join(" ")},SearchPageGrid=({results:e,groupBy:t,renderItem:n})=>{const o=t(e);return jsxRuntime.jsx(jsxRuntime.Fragment,{children:Object.entries(o).map(([l,d])=>{const{items:f,gridCols:g}=d;if(f.length===0)return null;const b=buildGridClassName(g);return jsxRuntime.jsxs("div",{className:"mb-4",children:[jsxRuntime.jsx("h2",{className:"text-xl font-semibold tracking-tight mb-4",children:l}),jsxRuntime.jsx("div",{className:b,children:f.map((_,S)=>n(_,S))})]},l)})})},SearchPage=({query:e,results:t,isLoading:n,children:o})=>n?jsxRuntime.jsx("div",{className:"flex w-full justify-center items-center py-24",children:jsxRuntime.jsx(LoaderCircle,{className:"h-8 w-8 animate-spin text-muted-foreground"})}):e&&t.length===0?jsxRuntime.jsx("div",{className:"flex w-full justify-center items-start pt-16",children:jsxRuntime.jsx(Card,{className:"w-full max-w-lg",children:jsxRuntime.jsxs(CardHeader,{className:"text-center items-center",children:[jsxRuntime.jsx("div",{className:"rounded-full border bg-muted p-3 mb-4",children:jsxRuntime.jsx(SearchX,{className:"h-8 w-8 text-muted-foreground"})}),jsxRuntime.jsx(CardTitle,{children:"No Results Found"}),jsxRuntime.jsxs(CardDescription,{children:['Your search for "',e,'" did not return any results. Please try a different search term.']})]})})}):t.length>0?jsxRuntime.jsx("div",{className:"grid grid-cols-3 gap-8",children:jsxRuntime.jsx("div",{className:"col-span-3",children:o})}):null;var COLLAPSIBLE_NAME="Collapsible",[createCollapsibleContext,createCollapsibleScope]=createContextScope$2(COLLAPSIBLE_NAME),[CollapsibleProvider,useCollapsibleContext]=createCollapsibleContext(COLLAPSIBLE_NAME),Collapsible=React__namespace.forwardRef((e,t)=>{const{__scopeCollapsible:n,open:o,defaultOpen:l,disabled:d,onOpenChange:f,...g}=e,[b,_]=useControllableState({prop:o,defaultProp:l??!1,onChange:f,caller:COLLAPSIBLE_NAME});return jsxRuntime.jsx(CollapsibleProvider,{scope:n,disabled:d,contentId:useId(),open:b,onOpenToggle:React__namespace.useCallback(()=>_(S=>!S),[_]),children:jsxRuntime.jsx(Primitive$4.div,{"data-state":getState$1(b),"data-disabled":d?"":void 0,...g,ref:t})})});Collapsible.displayName=COLLAPSIBLE_NAME;var TRIGGER_NAME$1="CollapsibleTrigger",CollapsibleTrigger=React__namespace.forwardRef((e,t)=>{const{__scopeCollapsible:n,...o}=e,l=useCollapsibleContext(TRIGGER_NAME$1,n);return jsxRuntime.jsx(Primitive$4.button,{type:"button","aria-controls":l.contentId,"aria-expanded":l.open||!1,"data-state":getState$1(l.open),"data-disabled":l.disabled?"":void 0,disabled:l.disabled,...o,ref:t,onClick:composeEventHandlers(e.onClick,l.onOpenToggle)})});CollapsibleTrigger.displayName=TRIGGER_NAME$1;var CONTENT_NAME$1="CollapsibleContent",CollapsibleContent=React__namespace.forwardRef((e,t)=>{const{forceMount:n,...o}=e,l=useCollapsibleContext(CONTENT_NAME$1,e.__scopeCollapsible);return jsxRuntime.jsx(Presence,{present:n||l.open,children:({present:d})=>jsxRuntime.jsx(CollapsibleContentImpl,{...o,ref:t,present:d})})});CollapsibleContent.displayName=CONTENT_NAME$1;var CollapsibleContentImpl=React__namespace.forwardRef((e,t)=>{const{__scopeCollapsible:n,present:o,children:l,...d}=e,f=useCollapsibleContext(CONTENT_NAME$1,n),[g,b]=React__namespace.useState(o),_=React__namespace.useRef(null),S=useComposedRefs(t,_),R=React__namespace.useRef(0),C=R.current,E=React__namespace.useRef(0),A=E.current,M=f.open||g,I=React__namespace.useRef(M),j=React__namespace.useRef(void 0);return React__namespace.useEffect(()=>{const q=requestAnimationFrame(()=>I.current=!1);return()=>cancelAnimationFrame(q)},[]),useLayoutEffect2(()=>{const q=_.current;if(q){j.current=j.current||{transitionDuration:q.style.transitionDuration,animationName:q.style.animationName},q.style.transitionDuration="0s",q.style.animationName="none";const Q=q.getBoundingClientRect();R.current=Q.height,E.current=Q.width,I.current||(q.style.transitionDuration=j.current.transitionDuration,q.style.animationName=j.current.animationName),b(o)}},[f.open,o]),jsxRuntime.jsx(Primitive$4.div,{"data-state":getState$1(f.open),"data-disabled":f.disabled?"":void 0,id:f.contentId,hidden:!M,...d,ref:S,style:{"--radix-collapsible-content-height":C?`${C}px`:void 0,"--radix-collapsible-content-width":A?`${A}px`:void 0,...e.style},children:M&&l})});function getState$1(e){return e?"open":"closed"}var Root$1=Collapsible,Trigger=CollapsibleTrigger,Content=CollapsibleContent,ACCORDION_NAME="Accordion",ACCORDION_KEYS=["Home","End","ArrowDown","ArrowUp","ArrowLeft","ArrowRight"],[Collection,useCollection,createCollectionScope]=createCollection(ACCORDION_NAME),[createAccordionContext]=createContextScope$2(ACCORDION_NAME,[createCollectionScope,createCollapsibleScope]),useCollapsibleScope=createCollapsibleScope(),Accordion$1=React.forwardRef((e,t)=>{const{type:n,...o}=e,l=o,d=o;return jsxRuntime.jsx(Collection.Provider,{scope:e.__scopeAccordion,children:n==="multiple"?jsxRuntime.jsx(AccordionImplMultiple,{...d,ref:t}):jsxRuntime.jsx(AccordionImplSingle,{...l,ref:t})})});Accordion$1.displayName=ACCORDION_NAME;var[AccordionValueProvider,useAccordionValueContext]=createAccordionContext(ACCORDION_NAME),[AccordionCollapsibleProvider,useAccordionCollapsibleContext]=createAccordionContext(ACCORDION_NAME,{collapsible:!1}),AccordionImplSingle=React.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:l=()=>{},collapsible:d=!1,...f}=e,[g,b]=useControllableState({prop:n,defaultProp:o??"",onChange:l,caller:ACCORDION_NAME});return jsxRuntime.jsx(AccordionValueProvider,{scope:e.__scopeAccordion,value:React.useMemo(()=>g?[g]:[],[g]),onItemOpen:b,onItemClose:React.useCallback(()=>d&&b(""),[d,b]),children:jsxRuntime.jsx(AccordionCollapsibleProvider,{scope:e.__scopeAccordion,collapsible:d,children:jsxRuntime.jsx(AccordionImpl,{...f,ref:t})})})}),AccordionImplMultiple=React.forwardRef((e,t)=>{const{value:n,defaultValue:o,onValueChange:l=()=>{},...d}=e,[f,g]=useControllableState({prop:n,defaultProp:o??[],onChange:l,caller:ACCORDION_NAME}),b=React.useCallback(S=>g((R=[])=>[...R,S]),[g]),_=React.useCallback(S=>g((R=[])=>R.filter(C=>C!==S)),[g]);return jsxRuntime.jsx(AccordionValueProvider,{scope:e.__scopeAccordion,value:f,onItemOpen:b,onItemClose:_,children:jsxRuntime.jsx(AccordionCollapsibleProvider,{scope:e.__scopeAccordion,collapsible:!0,children:jsxRuntime.jsx(AccordionImpl,{...d,ref:t})})})}),[AccordionImplProvider,useAccordionContext]=createAccordionContext(ACCORDION_NAME),AccordionImpl=React.forwardRef((e,t)=>{const{__scopeAccordion:n,disabled:o,dir:l,orientation:d="vertical",...f}=e,g=React.useRef(null),b=useComposedRefs(g,t),_=useCollection(n),R=useDirection(l)==="ltr",C=composeEventHandlers(e.onKeyDown,E=>{var ae;if(!ACCORDION_KEYS.includes(E.key))return;const A=E.target,M=_().filter(se=>{var Oe;return!((Oe=se.ref.current)!=null&&Oe.disabled)}),I=M.findIndex(se=>se.ref.current===A),j=M.length;if(I===-1)return;E.preventDefault();let q=I;const Q=0,te=j-1,F=()=>{q=I+1,q>te&&(q=Q)},V=()=>{q=I-1,q<Q&&(q=te)};switch(E.key){case"Home":q=Q;break;case"End":q=te;break;case"ArrowRight":d==="horizontal"&&(R?F():V());break;case"ArrowDown":d==="vertical"&&F();break;case"ArrowLeft":d==="horizontal"&&(R?V():F());break;case"ArrowUp":d==="vertical"&&V();break}const ne=q%j;(ae=M[ne].ref.current)==null||ae.focus()});return jsxRuntime.jsx(AccordionImplProvider,{scope:n,disabled:o,direction:l,orientation:d,children:jsxRuntime.jsx(Collection.Slot,{scope:n,children:jsxRuntime.jsx(Primitive$4.div,{...f,"data-orientation":d,ref:b,onKeyDown:o?void 0:C})})})}),ITEM_NAME="AccordionItem",[AccordionItemProvider,useAccordionItemContext]=createAccordionContext(ITEM_NAME),AccordionItem$1=React.forwardRef((e,t)=>{const{__scopeAccordion:n,value:o,...l}=e,d=useAccordionContext(ITEM_NAME,n),f=useAccordionValueContext(ITEM_NAME,n),g=useCollapsibleScope(n),b=useId(),_=o&&f.value.includes(o)||!1,S=d.disabled||e.disabled;return jsxRuntime.jsx(AccordionItemProvider,{scope:n,open:_,disabled:S,triggerId:b,children:jsxRuntime.jsx(Root$1,{"data-orientation":d.orientation,"data-state":getState(_),...g,...l,ref:t,disabled:S,open:_,onOpenChange:R=>{R?f.onItemOpen(o):f.onItemClose(o)}})})});AccordionItem$1.displayName=ITEM_NAME;var HEADER_NAME="AccordionHeader",AccordionHeader=React.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,l=useAccordionContext(ACCORDION_NAME,n),d=useAccordionItemContext(HEADER_NAME,n);return jsxRuntime.jsx(Primitive$4.h3,{"data-orientation":l.orientation,"data-state":getState(d.open),"data-disabled":d.disabled?"":void 0,...o,ref:t})});AccordionHeader.displayName=HEADER_NAME;var TRIGGER_NAME="AccordionTrigger",AccordionTrigger$1=React.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,l=useAccordionContext(ACCORDION_NAME,n),d=useAccordionItemContext(TRIGGER_NAME,n),f=useAccordionCollapsibleContext(TRIGGER_NAME,n),g=useCollapsibleScope(n);return jsxRuntime.jsx(Collection.ItemSlot,{scope:n,children:jsxRuntime.jsx(Trigger,{"aria-disabled":d.open&&!f.collapsible||void 0,"data-orientation":l.orientation,id:d.triggerId,...g,...o,ref:t})})});AccordionTrigger$1.displayName=TRIGGER_NAME;var CONTENT_NAME="AccordionContent",AccordionContent$1=React.forwardRef((e,t)=>{const{__scopeAccordion:n,...o}=e,l=useAccordionContext(ACCORDION_NAME,n),d=useAccordionItemContext(CONTENT_NAME,n),f=useCollapsibleScope(n);return jsxRuntime.jsx(Content,{role:"region","aria-labelledby":d.triggerId,"data-orientation":l.orientation,...f,...o,ref:t,style:{"--radix-accordion-content-height":"var(--radix-collapsible-content-height)","--radix-accordion-content-width":"var(--radix-collapsible-content-width)",...e.style}})});AccordionContent$1.displayName=CONTENT_NAME;function getState(e){return e?"open":"closed"}var Root2=Accordion$1,Item=AccordionItem$1,Header=AccordionHeader,Trigger2=AccordionTrigger$1,Content2=AccordionContent$1;const Accordion=Root2,AccordionItem=React__namespace.forwardRef(({className:e,...t},n)=>jsxRuntime.jsx(Item,{ref:n,className:cn("border-b",e),...t}));AccordionItem.displayName="AccordionItem";const AccordionTrigger=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsx(Header,{className:"flex",children:jsxRuntime.jsxs(Trigger2,{ref:o,className:cn("flex flex-1 items-center justify-between py-4 text-sm font-medium transition-all hover:underline text-left [&[data-state=open]>svg]:rotate-180",e),...n,children:[t,jsxRuntime.jsx(ChevronDown,{className:"h-4 w-4 shrink-0 text-muted-foreground transition-transform duration-200"})]})}));AccordionTrigger.displayName=Trigger2.displayName;const AccordionContent=React__namespace.forwardRef(({className:e,children:t,...n},o)=>jsxRuntime.jsx(Content2,{ref:o,className:"overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down",...n,children:jsxRuntime.jsx("div",{className:cn("pb-4 pt-0",e),children:t})}));AccordionContent.displayName=Content2.displayName;function AssistantInsight({prompt:e,smartAndSlow:t=!1,thinkingPlaceholderText:n="Thinking...",withCard:o=!0}){const{response:l,isLoading:d,error:f,sendPrompt:g}=useGemini({useProModel:t,outputFormat:"html"});React.useEffect(()=>{e&&g(e)},[e,g]);const b=`flex items-start gap-4 ${o?"p-4 border rounded-lg bg-background":""}`;return jsxRuntime.jsxs("div",{className:b,children:[jsxRuntime.jsx(Bot,{className:`mt-1 h-6 w-6 flex-shrink-0 ${d?"animate-pulse text-primary":"text-primary"}`}),jsxRuntime.jsxs("div",{className:"w-full min-h-[4rem]",children:[d&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsx("p",{className:"font-medium text-muted-foreground",children:n}),jsxRuntime.jsxs("div",{className:"space-y-2 mt-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-4 w-5/6"}),jsxRuntime.jsx(Skeleton,{className:"h-4 w-3/4"})]})]}),f&&jsxRuntime.jsx("p",{className:"text-sm text-red-600",children:f}),!d&&!f&&l&&jsxRuntime.jsx("div",{className:"chat-bubble-in-animation text-sm text-foreground space-y-4",dangerouslySetInnerHTML:{__html:l}})]})]})}function tzName(e,t,n="long"){return new Intl.DateTimeFormat("en-US",{hour:"numeric",timeZone:e,timeZoneName:n}).format(t).split(/\s/g).slice(2).join(" ")}const offsetFormatCache={},offsetCache={};function tzOffset(e,t){try{const o=(offsetFormatCache[e]||(offsetFormatCache[e]=new Intl.DateTimeFormat("en-US",{timeZone:e,timeZoneName:"longOffset"}).format))(t).split("GMT")[1];return o in offsetCache?offsetCache[o]:calcOffset(o,o.split(":"))}catch{if(e in offsetCache)return offsetCache[e];const n=e==null?void 0:e.match(offsetRe);return n?calcOffset(e,n.slice(1)):NaN}}const offsetRe=/([+-]\d\d):?(\d\d)?/;function calcOffset(e,t){const n=+(t[0]||0),o=+(t[1]||0),l=+(t[2]||0)/60;return offsetCache[e]=n*60+o>0?n*60+o+l:n*60-o-l}class TZDateMini extends Date{constructor(...t){super(),t.length>1&&typeof t[t.length-1]=="string"&&(this.timeZone=t.pop()),this.internal=new Date,isNaN(tzOffset(this.timeZone,this))?this.setTime(NaN):t.length?typeof t[0]=="number"&&(t.length===1||t.length===2&&typeof t[1]!="number")?this.setTime(t[0]):typeof t[0]=="string"?this.setTime(+new Date(t[0])):t[0]instanceof Date?this.setTime(+t[0]):(this.setTime(+new Date(...t)),adjustToSystemTZ(this),syncToInternal(this)):this.setTime(Date.now())}static tz(t,...n){return n.length?new TZDateMini(...n,t):new TZDateMini(Date.now(),t)}withTimeZone(t){return new TZDateMini(+this,t)}getTimezoneOffset(){const t=-tzOffset(this.timeZone,this);return t>0?Math.floor(t):Math.ceil(t)}setTime(t){return Date.prototype.setTime.apply(this,arguments),syncToInternal(this),+this}[Symbol.for("constructDateFrom")](t){return new TZDateMini(+new Date(t),this.timeZone)}}const re=/^(get|set)(?!UTC)/;Object.getOwnPropertyNames(Date.prototype).forEach(e=>{if(!re.test(e))return;const t=e.replace(re,"$1UTC");TZDateMini.prototype[t]&&(e.startsWith("get")?TZDateMini.prototype[e]=function(){return this.internal[t]()}:(TZDateMini.prototype[e]=function(){return Date.prototype[t].apply(this.internal,arguments),syncFromInternal(this),+this},TZDateMini.prototype[t]=function(){return Date.prototype[t].apply(this,arguments),syncToInternal(this),+this}))});function syncToInternal(e){e.internal.setTime(+e),e.internal.setUTCSeconds(e.internal.getUTCSeconds()-Math.round(-tzOffset(e.timeZone,e)*60))}function syncFromInternal(e){Date.prototype.setFullYear.call(e,e.internal.getUTCFullYear(),e.internal.getUTCMonth(),e.internal.getUTCDate()),Date.prototype.setHours.call(e,e.internal.getUTCHours(),e.internal.getUTCMinutes(),e.internal.getUTCSeconds(),e.internal.getUTCMilliseconds()),adjustToSystemTZ(e)}function adjustToSystemTZ(e){const t=tzOffset(e.timeZone,e),n=t>0?Math.floor(t):Math.ceil(t),o=new Date(+e);o.setUTCHours(o.getUTCHours()-1);const l=-new Date(+e).getTimezoneOffset(),d=-new Date(+o).getTimezoneOffset(),f=l-d,g=Date.prototype.getHours.apply(e)!==e.internal.getUTCHours();f&&g&&e.internal.setUTCMinutes(e.internal.getUTCMinutes()+f);const b=l-n;b&&Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+b);const _=new Date(+e);_.setUTCSeconds(0);const S=l>0?_.getSeconds():(_.getSeconds()-60)%60,R=Math.round(-(tzOffset(e.timeZone,e)*60))%60;(R||S)&&(e.internal.setUTCSeconds(e.internal.getUTCSeconds()+R),Date.prototype.setUTCSeconds.call(e,Date.prototype.getUTCSeconds.call(e)+R+S));const C=tzOffset(e.timeZone,e),E=C>0?Math.floor(C):Math.ceil(C),M=-new Date(+e).getTimezoneOffset()-E,I=E!==n,j=M-b;if(I&&j){Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+j);const q=tzOffset(e.timeZone,e),Q=q>0?Math.floor(q):Math.ceil(q),te=E-Q;te&&(e.internal.setUTCMinutes(e.internal.getUTCMinutes()+te),Date.prototype.setUTCMinutes.call(e,Date.prototype.getUTCMinutes.call(e)+te))}}class TZDate extends TZDateMini{static tz(t,...n){return n.length?new TZDate(...n,t):new TZDate(Date.now(),t)}toISOString(){const[t,n,o]=this.tzComponents(),l=`${t}${n}:${o}`;return this.internal.toISOString().slice(0,-1)+l}toString(){return`${this.toDateString()} ${this.toTimeString()}`}toDateString(){const[t,n,o,l]=this.internal.toUTCString().split(" ");return`${t==null?void 0:t.slice(0,-1)} ${o} ${n} ${l}`}toTimeString(){const t=this.internal.toUTCString().split(" ")[4],[n,o,l]=this.tzComponents();return`${t} GMT${n}${o}${l} (${tzName(this.timeZone,this)})`}toLocaleString(t,n){return Date.prototype.toLocaleString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleDateString(t,n){return Date.prototype.toLocaleDateString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}toLocaleTimeString(t,n){return Date.prototype.toLocaleTimeString.call(this,t,{...n,timeZone:(n==null?void 0:n.timeZone)||this.timeZone})}tzComponents(){const t=this.getTimezoneOffset(),n=t>0?"-":"+",o=String(Math.floor(Math.abs(t)/60)).padStart(2,"0"),l=String(Math.abs(t)%60).padStart(2,"0");return[n,o,l]}withTimeZone(t){return new TZDate(+this,t)}[Symbol.for("constructDateFrom")](t){return new TZDate(+new Date(t),this.timeZone)}}const FIVE_WEEKS=5,FOUR_WEEKS=4;function getBroadcastWeeksInMonth(e,t){const n=t.startOfMonth(e),o=n.getDay()>0?n.getDay():7,l=t.addDays(e,-o+1),d=t.addDays(l,FIVE_WEEKS*7-1);return t.getMonth(e)===t.getMonth(d)?FIVE_WEEKS:FOUR_WEEKS}function startOfBroadcastWeek(e,t){const n=t.startOfMonth(e),o=n.getDay();return o===1?n:o===0?t.addDays(n,-6):t.addDays(n,-1*(o-1))}function endOfBroadcastWeek(e,t){const n=startOfBroadcastWeek(e,t),o=getBroadcastWeeksInMonth(e,t);return t.addDays(n,o*7-1)}class DateLib{constructor(t,n){this.Date=Date,this.today=()=>{var o;return(o=this.overrides)!=null&&o.today?this.overrides.today():this.options.timeZone?TZDate.tz(this.options.timeZone):new this.Date},this.newDate=(o,l,d)=>{var f;return(f=this.overrides)!=null&&f.newDate?this.overrides.newDate(o,l,d):this.options.timeZone?new TZDate(o,l,d,this.options.timeZone):new Date(o,l,d)},this.addDays=(o,l)=>{var d;return(d=this.overrides)!=null&&d.addDays?this.overrides.addDays(o,l):addDays(o,l)},this.addMonths=(o,l)=>{var d;return(d=this.overrides)!=null&&d.addMonths?this.overrides.addMonths(o,l):addMonths(o,l)},this.addWeeks=(o,l)=>{var d;return(d=this.overrides)!=null&&d.addWeeks?this.overrides.addWeeks(o,l):addWeeks(o,l)},this.addYears=(o,l)=>{var d;return(d=this.overrides)!=null&&d.addYears?this.overrides.addYears(o,l):addYears(o,l)},this.differenceInCalendarDays=(o,l)=>{var d;return(d=this.overrides)!=null&&d.differenceInCalendarDays?this.overrides.differenceInCalendarDays(o,l):differenceInCalendarDays(o,l)},this.differenceInCalendarMonths=(o,l)=>{var d;return(d=this.overrides)!=null&&d.differenceInCalendarMonths?this.overrides.differenceInCalendarMonths(o,l):differenceInCalendarMonths(o,l)},this.eachMonthOfInterval=o=>{var l;return(l=this.overrides)!=null&&l.eachMonthOfInterval?this.overrides.eachMonthOfInterval(o):eachMonthOfInterval(o)},this.eachYearOfInterval=o=>{var g;const l=(g=this.overrides)!=null&&g.eachYearOfInterval?this.overrides.eachYearOfInterval(o):eachYearOfInterval(o),d=new Set(l.map(b=>this.getYear(b)));if(d.size===l.length)return l;const f=[];return d.forEach(b=>{f.push(new Date(b,0,1))}),f},this.endOfBroadcastWeek=o=>{var l;return(l=this.overrides)!=null&&l.endOfBroadcastWeek?this.overrides.endOfBroadcastWeek(o):endOfBroadcastWeek(o,this)},this.endOfISOWeek=o=>{var l;return(l=this.overrides)!=null&&l.endOfISOWeek?this.overrides.endOfISOWeek(o):endOfISOWeek(o)},this.endOfMonth=o=>{var l;return(l=this.overrides)!=null&&l.endOfMonth?this.overrides.endOfMonth(o):endOfMonth(o)},this.endOfWeek=(o,l)=>{var d;return(d=this.overrides)!=null&&d.endOfWeek?this.overrides.endOfWeek(o,l):endOfWeek(o,this.options)},this.endOfYear=o=>{var l;return(l=this.overrides)!=null&&l.endOfYear?this.overrides.endOfYear(o):endOfYear(o)},this.format=(o,l,d)=>{var g;const f=(g=this.overrides)!=null&&g.format?this.overrides.format(o,l,this.options):format(o,l,this.options);return this.options.numerals&&this.options.numerals!=="latn"?this.replaceDigits(f):f},this.getISOWeek=o=>{var l;return(l=this.overrides)!=null&&l.getISOWeek?this.overrides.getISOWeek(o):getISOWeek(o)},this.getMonth=(o,l)=>{var d;return(d=this.overrides)!=null&&d.getMonth?this.overrides.getMonth(o,this.options):getMonth(o,this.options)},this.getYear=(o,l)=>{var d;return(d=this.overrides)!=null&&d.getYear?this.overrides.getYear(o,this.options):getYear(o,this.options)},this.getWeek=(o,l)=>{var d;return(d=this.overrides)!=null&&d.getWeek?this.overrides.getWeek(o,this.options):getWeek(o,this.options)},this.isAfter=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isAfter?this.overrides.isAfter(o,l):isAfter(o,l)},this.isBefore=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isBefore?this.overrides.isBefore(o,l):isBefore(o,l)},this.isDate=o=>{var l;return(l=this.overrides)!=null&&l.isDate?this.overrides.isDate(o):isDate(o)},this.isSameDay=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isSameDay?this.overrides.isSameDay(o,l):isSameDay(o,l)},this.isSameMonth=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isSameMonth?this.overrides.isSameMonth(o,l):isSameMonth(o,l)},this.isSameYear=(o,l)=>{var d;return(d=this.overrides)!=null&&d.isSameYear?this.overrides.isSameYear(o,l):isSameYear(o,l)},this.max=o=>{var l;return(l=this.overrides)!=null&&l.max?this.overrides.max(o):max$1(o)},this.min=o=>{var l;return(l=this.overrides)!=null&&l.min?this.overrides.min(o):min$1(o)},this.setMonth=(o,l)=>{var d;return(d=this.overrides)!=null&&d.setMonth?this.overrides.setMonth(o,l):setMonth(o,l)},this.setYear=(o,l)=>{var d;return(d=this.overrides)!=null&&d.setYear?this.overrides.setYear(o,l):setYear(o,l)},this.startOfBroadcastWeek=(o,l)=>{var d;return(d=this.overrides)!=null&&d.startOfBroadcastWeek?this.overrides.startOfBroadcastWeek(o,this):startOfBroadcastWeek(o,this)},this.startOfDay=o=>{var l;return(l=this.overrides)!=null&&l.startOfDay?this.overrides.startOfDay(o):startOfDay(o)},this.startOfISOWeek=o=>{var l;return(l=this.overrides)!=null&&l.startOfISOWeek?this.overrides.startOfISOWeek(o):startOfISOWeek(o)},this.startOfMonth=o=>{var l;return(l=this.overrides)!=null&&l.startOfMonth?this.overrides.startOfMonth(o):startOfMonth(o)},this.startOfWeek=(o,l)=>{var d;return(d=this.overrides)!=null&&d.startOfWeek?this.overrides.startOfWeek(o,this.options):startOfWeek(o,this.options)},this.startOfYear=o=>{var l;return(l=this.overrides)!=null&&l.startOfYear?this.overrides.startOfYear(o):startOfYear(o)},this.options={locale:enUS,...t},this.overrides=n}getDigitMap(){const{numerals:t="latn"}=this.options,n=new Intl.NumberFormat("en-US",{numberingSystem:t}),o={};for(let l=0;l<10;l++)o[l.toString()]=n.format(l);return o}replaceDigits(t){const n=this.getDigitMap();return t.replace(/\d/g,o=>n[o]||o)}formatNumber(t){return this.replaceDigits(t.toString())}getMonthYearOrder(){var n;const t=(n=this.options.locale)==null?void 0:n.code;return t&&DateLib.yearFirstLocales.has(t)?"year-first":"month-first"}formatMonthYear(t){const{locale:n,timeZone:o,numerals:l}=this.options,d=n==null?void 0:n.code;if(d&&DateLib.yearFirstLocales.has(d))try{return new Intl.DateTimeFormat(d,{month:"long",year:"numeric",timeZone:o,numberingSystem:l}).format(t)}catch{}const f=this.getMonthYearOrder()==="year-first"?"y LLLL":"LLLL y";return this.format(t,f)}}DateLib.yearFirstLocales=new Set(["eu","hu","ja","ja-Hira","ja-JP","ko","ko-KR","lt","lt-LT","lv","lv-LV","mn","mn-MN","zh","zh-CN","zh-HK","zh-TW"]);const defaultDateLib=new DateLib;class CalendarDay{constructor(t,n,o=defaultDateLib){this.date=t,this.displayMonth=n,this.outside=!!(n&&!o.isSameMonth(t,n)),this.dateLib=o,this.isoDate=o.format(t,"yyyy-MM-dd"),this.displayMonthId=o.format(n,"yyyy-MM"),this.dateMonthId=o.format(t,"yyyy-MM")}isEqualTo(t){return this.dateLib.isSameDay(t.date,this.date)&&this.dateLib.isSameMonth(t.displayMonth,this.displayMonth)}}class CalendarMonth{constructor(t,n){this.date=t,this.weeks=n}}class CalendarWeek{constructor(t,n){this.days=n,this.weekNumber=t}}function Button(e){return React.createElement("button",{...e})}function CaptionLabel(e){return React.createElement("span",{...e})}function Chevron(e){const{size:t=24,orientation:n="left",className:o}=e;return React.createElement("svg",{className:o,width:t,height:t,viewBox:"0 0 24 24"},n==="up"&&React.createElement("polygon",{points:"6.77 17 12.5 11.43 18.24 17 20 15.28 12.5 8 5 15.28"}),n==="down"&&React.createElement("polygon",{points:"6.77 8 12.5 13.57 18.24 8 20 9.72 12.5 17 5 9.72"}),n==="left"&&React.createElement("polygon",{points:"16 18.112 9.81111111 12 16 5.87733333 14.0888889 4 6 12 14.0888889 20"}),n==="right"&&React.createElement("polygon",{points:"8 18.112 14.18888889 12 8 5.87733333 9.91111111 4 18 12 9.91111111 20"}))}function Day(e){const{day:t,modifiers:n,...o}=e;return React.createElement("td",{...o})}function DayButton(e){const{day:t,modifiers:n,...o}=e,l=React.useRef(null);return React.useEffect(()=>{var d;n.focused&&((d=l.current)==null||d.focus())},[n.focused]),React.createElement("button",{ref:l,...o})}var UI;(function(e){e.Root="root",e.Chevron="chevron",e.Day="day",e.DayButton="day_button",e.CaptionLabel="caption_label",e.Dropdowns="dropdowns",e.Dropdown="dropdown",e.DropdownRoot="dropdown_root",e.Footer="footer",e.MonthGrid="month_grid",e.MonthCaption="month_caption",e.MonthsDropdown="months_dropdown",e.Month="month",e.Months="months",e.Nav="nav",e.NextMonthButton="button_next",e.PreviousMonthButton="button_previous",e.Week="week",e.Weeks="weeks",e.Weekday="weekday",e.Weekdays="weekdays",e.WeekNumber="week_number",e.WeekNumberHeader="week_number_header",e.YearsDropdown="years_dropdown"})(UI||(UI={}));var DayFlag;(function(e){e.disabled="disabled",e.hidden="hidden",e.outside="outside",e.focused="focused",e.today="today"})(DayFlag||(DayFlag={}));var SelectionState;(function(e){e.range_end="range_end",e.range_middle="range_middle",e.range_start="range_start",e.selected="selected"})(SelectionState||(SelectionState={}));var Animation;(function(e){e.weeks_before_enter="weeks_before_enter",e.weeks_before_exit="weeks_before_exit",e.weeks_after_enter="weeks_after_enter",e.weeks_after_exit="weeks_after_exit",e.caption_after_enter="caption_after_enter",e.caption_after_exit="caption_after_exit",e.caption_before_enter="caption_before_enter",e.caption_before_exit="caption_before_exit"})(Animation||(Animation={}));function Dropdown(e){const{options:t,className:n,components:o,classNames:l,...d}=e,f=[l[UI.Dropdown],n].join(" "),g=t==null?void 0:t.find(({value:b})=>b===d.value);return React.createElement("span",{"data-disabled":d.disabled,className:l[UI.DropdownRoot]},React.createElement(o.Select,{className:f,...d},t==null?void 0:t.map(({value:b,label:_,disabled:S})=>React.createElement(o.Option,{key:b,value:b,disabled:S},_))),React.createElement("span",{className:l[UI.CaptionLabel],"aria-hidden":!0},g==null?void 0:g.label,React.createElement(o.Chevron,{orientation:"down",size:18,className:l[UI.Chevron]})))}function DropdownNav(e){return React.createElement("div",{...e})}function Footer(e){return React.createElement("div",{...e})}function Month(e){const{calendarMonth:t,displayIndex:n,...o}=e;return React.createElement("div",{...o},e.children)}function MonthCaption(e){const{calendarMonth:t,displayIndex:n,...o}=e;return React.createElement("div",{...o})}function MonthGrid(e){return React.createElement("table",{...e})}function Months(e){return React.createElement("div",{...e})}const dayPickerContext=React.createContext(void 0);function useDayPicker(){const e=React.useContext(dayPickerContext);if(e===void 0)throw new Error("useDayPicker() must be used within a custom component.");return e}function MonthsDropdown(e){const{components:t}=useDayPicker();return React.createElement(t.Dropdown,{...e})}function Nav(e){const{onPreviousClick:t,onNextClick:n,previousMonth:o,nextMonth:l,...d}=e,{components:f,classNames:g,labels:{labelPrevious:b,labelNext:_}}=useDayPicker(),S=React.useCallback(C=>{l&&(n==null||n(C))},[l,n]),R=React.useCallback(C=>{o&&(t==null||t(C))},[o,t]);return React.createElement("nav",{...d},React.createElement(f.PreviousMonthButton,{type:"button",className:g[UI.PreviousMonthButton],tabIndex:o?void 0:-1,"aria-disabled":o?void 0:!0,"aria-label":b(o),onClick:R},React.createElement(f.Chevron,{disabled:o?void 0:!0,className:g[UI.Chevron],orientation:"left"})),React.createElement(f.NextMonthButton,{type:"button",className:g[UI.NextMonthButton],tabIndex:l?void 0:-1,"aria-disabled":l?void 0:!0,"aria-label":_(l),onClick:S},React.createElement(f.Chevron,{disabled:l?void 0:!0,orientation:"right",className:g[UI.Chevron]})))}function NextMonthButton(e){const{components:t}=useDayPicker();return React.createElement(t.Button,{...e})}function Option(e){return React.createElement("option",{...e})}function PreviousMonthButton(e){const{components:t}=useDayPicker();return React.createElement(t.Button,{...e})}function Root(e){const{rootRef:t,...n}=e;return React.createElement("div",{...n,ref:t})}function Select(e){return React.createElement("select",{...e})}function Week(e){const{week:t,...n}=e;return React.createElement("tr",{...n})}function Weekday(e){return React.createElement("th",{...e})}function Weekdays(e){return React.createElement("thead",{"aria-hidden":!0},React.createElement("tr",{...e}))}function WeekNumber(e){const{week:t,...n}=e;return React.createElement("th",{...n})}function WeekNumberHeader(e){return React.createElement("th",{...e})}function Weeks(e){return React.createElement("tbody",{...e})}function YearsDropdown(e){const{components:t}=useDayPicker();return React.createElement(t.Dropdown,{...e})}const components=Object.freeze(Object.defineProperty({__proto__:null,Button,CaptionLabel,Chevron,Day,DayButton,Dropdown,DropdownNav,Footer,Month,MonthCaption,MonthGrid,Months,MonthsDropdown,Nav,NextMonthButton,Option,PreviousMonthButton,Root,Select,Week,WeekNumber,WeekNumberHeader,Weekday,Weekdays,Weeks,YearsDropdown},Symbol.toStringTag,{value:"Module"}));function rangeIncludesDate(e,t,n=!1,o=defaultDateLib){let{from:l,to:d}=e;const{differenceInCalendarDays:f,isSameDay:g}=o;return l&&d?(f(d,l)<0&&([l,d]=[d,l]),f(t,l)>=(n?1:0)&&f(d,t)>=(n?1:0)):!n&&d?g(d,t):!n&&l?g(l,t):!1}function isDateInterval(e){return!!(e&&typeof e=="object"&&"before"in e&&"after"in e)}function isDateRange(e){return!!(e&&typeof e=="object"&&"from"in e)}function isDateAfterType(e){return!!(e&&typeof e=="object"&&"after"in e)}function isDateBeforeType(e){return!!(e&&typeof e=="object"&&"before"in e)}function isDayOfWeekType(e){return!!(e&&typeof e=="object"&&"dayOfWeek"in e)}function isDatesArray(e,t){return Array.isArray(e)&&e.every(t.isDate)}function dateMatchModifiers(e,t,n=defaultDateLib){const o=Array.isArray(t)?t:[t],{isSameDay:l,differenceInCalendarDays:d,isAfter:f}=n;return o.some(g=>{if(typeof g=="boolean")return g;if(n.isDate(g))return l(e,g);if(isDatesArray(g,n))return g.includes(e);if(isDateRange(g))return rangeIncludesDate(g,e,!1,n);if(isDayOfWeekType(g))return Array.isArray(g.dayOfWeek)?g.dayOfWeek.includes(e.getDay()):g.dayOfWeek===e.getDay();if(isDateInterval(g)){const b=d(g.before,e),_=d(g.after,e),S=b>0,R=_<0;return f(g.before,g.after)?R&&S:S||R}return isDateAfterType(g)?d(e,g.after)>0:isDateBeforeType(g)?d(g.before,e)>0:typeof g=="function"?g(e):!1})}function createGetModifiers(e,t,n,o,l){const{disabled:d,hidden:f,modifiers:g,showOutsideDays:b,broadcastCalendar:_,today:S=l.today()}=t,{isSameDay:R,isSameMonth:C,startOfMonth:E,isBefore:A,endOfMonth:M,isAfter:I}=l,j=n&&E(n),q=o&&M(o),Q={[DayFlag.focused]:[],[DayFlag.outside]:[],[DayFlag.disabled]:[],[DayFlag.hidden]:[],[DayFlag.today]:[]},te={};for(const F of e){const{date:V,displayMonth:ne}=F,ae=!!(ne&&!C(V,ne)),se=!!(j&&A(V,j)),Oe=!!(q&&I(V,q)),Ne=!!(d&&dateMatchModifiers(V,d,l)),oe=!!(f&&dateMatchModifiers(V,f,l))||se||Oe||!_&&!b&&ae||_&&b===!1&&ae,$e=R(V,S);ae&&Q.outside.push(F),Ne&&Q.disabled.push(F),oe&&Q.hidden.push(F),$e&&Q.today.push(F),g&&Object.keys(g).forEach(Ae=>{const je=g==null?void 0:g[Ae];je&&dateMatchModifiers(V,je,l)&&(te[Ae]?te[Ae].push(F):te[Ae]=[F])})}return F=>{const V={[DayFlag.focused]:!1,[DayFlag.disabled]:!1,[DayFlag.hidden]:!1,[DayFlag.outside]:!1,[DayFlag.today]:!1},ne={};for(const ae in Q){const se=Q[ae];V[ae]=se.some(Oe=>Oe===F)}for(const ae in te)ne[ae]=te[ae].some(se=>se===F);return{...V,...ne}}}function getClassNamesForModifiers(e,t,n={}){return Object.entries(e).filter(([,l])=>l===!0).reduce((l,[d])=>(n[d]?l.push(n[d]):t[DayFlag[d]]?l.push(t[DayFlag[d]]):t[SelectionState[d]]&&l.push(t[SelectionState[d]]),l),[t[UI.Day]])}function getComponents(e){return{...components,...e}}function getDataAttributes(e){const t={"data-mode":e.mode??void 0,"data-required":"required"in e?e.required:void 0,"data-multiple-months":e.numberOfMonths&&e.numberOfMonths>1||void 0,"data-week-numbers":e.showWeekNumber||void 0,"data-broadcast-calendar":e.broadcastCalendar||void 0,"data-nav-layout":e.navLayout||void 0};return Object.entries(e).forEach(([n,o])=>{n.startsWith("data-")&&(t[n]=o)}),t}function getDefaultClassNames(){const e={};for(const t in UI)e[UI[t]]=`rdp-${UI[t]}`;for(const t in DayFlag)e[DayFlag[t]]=`rdp-${DayFlag[t]}`;for(const t in SelectionState)e[SelectionState[t]]=`rdp-${SelectionState[t]}`;for(const t in Animation)e[Animation[t]]=`rdp-${Animation[t]}`;return e}function formatCaption(e,t,n){return(n??new DateLib(t)).formatMonthYear(e)}const formatMonthCaption=formatCaption;function formatDay(e,t,n){return(n??new DateLib(t)).format(e,"d")}function formatMonthDropdown(e,t=defaultDateLib){return t.format(e,"LLLL")}function formatWeekdayName(e,t,n){return(n??new DateLib(t)).format(e,"cccccc")}function formatWeekNumber(e,t=defaultDateLib){return e<10?t.formatNumber(`0${e.toLocaleString()}`):t.formatNumber(`${e.toLocaleString()}`)}function formatWeekNumberHeader(){return""}function formatYearDropdown(e,t=defaultDateLib){return t.format(e,"yyyy")}const formatYearCaption=formatYearDropdown,defaultFormatters=Object.freeze(Object.defineProperty({__proto__:null,formatCaption,formatDay,formatMonthCaption,formatMonthDropdown,formatWeekNumber,formatWeekNumberHeader,formatWeekdayName,formatYearCaption,formatYearDropdown},Symbol.toStringTag,{value:"Module"}));function getFormatters(e){return e!=null&&e.formatMonthCaption&&!e.formatCaption&&(e.formatCaption=e.formatMonthCaption),e!=null&&e.formatYearCaption&&!e.formatYearDropdown&&(e.formatYearDropdown=e.formatYearCaption),{...defaultFormatters,...e}}function getMonthOptions(e,t,n,o,l){const{startOfMonth:d,startOfYear:f,endOfYear:g,eachMonthOfInterval:b,getMonth:_}=l;return b({start:f(e),end:g(e)}).map(C=>{const E=o.formatMonthDropdown(C,l),A=_(C),M=t&&C<d(t)||n&&C>d(n)||!1;return{value:A,label:E,disabled:M}})}function getStyleForModifiers(e,t={},n={}){let o={...t==null?void 0:t[UI.Day]};return Object.entries(e).filter(([,l])=>l===!0).forEach(([l])=>{o={...o,...n==null?void 0:n[l]}}),o}function getWeekdays(e,t,n,o){const l=o??e.today(),d=n?e.startOfBroadcastWeek(l,e):t?e.startOfISOWeek(l):e.startOfWeek(l),f=[];for(let g=0;g<7;g++){const b=e.addDays(d,g);f.push(b)}return f}function getYearOptions(e,t,n,o,l=!1){if(!e||!t)return;const{startOfYear:d,endOfYear:f,eachYearOfInterval:g,getYear:b}=o,_=d(e),S=f(t),R=g({start:_,end:S});return l&&R.reverse(),R.map(C=>{const E=n.formatYearDropdown(C,o);return{value:b(C),label:E,disabled:!1}})}function labelDayButton(e,t,n,o){let l=(o??new DateLib(n)).format(e,"PPPP");return t.today&&(l=`Today, ${l}`),t.selected&&(l=`${l}, selected`),l}const labelDay=labelDayButton;function labelGrid(e,t,n){return(n??new DateLib(t)).formatMonthYear(e)}const labelCaption=labelGrid;function labelGridcell(e,t,n,o){let l=(o??new DateLib(n)).format(e,"PPPP");return t!=null&&t.today&&(l=`Today, ${l}`),l}function labelMonthDropdown(e){return"Choose the Month"}function labelNav(){return""}function labelNext(e){return"Go to the Next Month"}function labelPrevious(e){return"Go to the Previous Month"}function labelWeekday(e,t,n){return(n??new DateLib(t)).format(e,"cccc")}function labelWeekNumber(e,t){return`Week ${e}`}function labelWeekNumberHeader(e){return"Week Number"}function labelYearDropdown(e){return"Choose the Year"}const defaultLabels=Object.freeze(Object.defineProperty({__proto__:null,labelCaption,labelDay,labelDayButton,labelGrid,labelGridcell,labelMonthDropdown,labelNav,labelNext,labelPrevious,labelWeekNumber,labelWeekNumberHeader,labelWeekday,labelYearDropdown},Symbol.toStringTag,{value:"Module"})),asHtmlElement=e=>e instanceof HTMLElement?e:null,queryMonthEls=e=>[...e.querySelectorAll("[data-animated-month]")??[]],queryMonthEl=e=>asHtmlElement(e.querySelector("[data-animated-month]")),queryCaptionEl=e=>asHtmlElement(e.querySelector("[data-animated-caption]")),queryWeeksEl=e=>asHtmlElement(e.querySelector("[data-animated-weeks]")),queryNavEl=e=>asHtmlElement(e.querySelector("[data-animated-nav]")),queryWeekdaysEl=e=>asHtmlElement(e.querySelector("[data-animated-weekdays]"));function useAnimation(e,t,{classNames:n,months:o,focused:l,dateLib:d}){const f=React.useRef(null),g=React.useRef(o),b=React.useRef(!1);React.useLayoutEffect(()=>{const _=g.current;if(g.current=o,!t||!e.current||!(e.current instanceof HTMLElement)||o.length===0||_.length===0||o.length!==_.length)return;const S=d.isSameMonth(o[0].date,_[0].date),R=d.isAfter(o[0].date,_[0].date),C=R?n[Animation.caption_after_enter]:n[Animation.caption_before_enter],E=R?n[Animation.weeks_after_enter]:n[Animation.weeks_before_enter],A=f.current,M=e.current.cloneNode(!0);if(M instanceof HTMLElement?(queryMonthEls(M).forEach(Q=>{if(!(Q instanceof HTMLElement))return;const te=queryMonthEl(Q);te&&Q.contains(te)&&Q.removeChild(te);const F=queryCaptionEl(Q);F&&F.classList.remove(C);const V=queryWeeksEl(Q);V&&V.classList.remove(E)}),f.current=M):f.current=null,b.current||S||l)return;const I=A instanceof HTMLElement?queryMonthEls(A):[],j=queryMonthEls(e.current);if(j!=null&&j.every(q=>q instanceof HTMLElement)&&I&&I.every(q=>q instanceof HTMLElement)){b.current=!0,e.current.style.isolation="isolate";const q=queryNavEl(e.current);q&&(q.style.zIndex="1"),j.forEach((Q,te)=>{const F=I[te];if(!F)return;Q.style.position="relative",Q.style.overflow="hidden";const V=queryCaptionEl(Q);V&&V.classList.add(C);const ne=queryWeeksEl(Q);ne&&ne.classList.add(E);const ae=()=>{b.current=!1,e.current&&(e.current.style.isolation=""),q&&(q.style.zIndex=""),V&&V.classList.remove(C),ne&&ne.classList.remove(E),Q.style.position="",Q.style.overflow="",Q.contains(F)&&Q.removeChild(F)};F.style.pointerEvents="none",F.style.position="absolute",F.style.overflow="hidden",F.setAttribute("aria-hidden","true");const se=queryWeekdaysEl(F);se&&(se.style.opacity="0");const Oe=queryCaptionEl(F);Oe&&(Oe.classList.add(R?n[Animation.caption_before_exit]:n[Animation.caption_after_exit]),Oe.addEventListener("animationend",ae));const Ne=queryWeeksEl(F);Ne&&Ne.classList.add(R?n[Animation.weeks_before_exit]:n[Animation.weeks_after_exit]),Q.insertBefore(F,Q.firstChild)})}})}function getDates(e,t,n,o){const l=e[0],d=e[e.length-1],{ISOWeek:f,fixedWeeks:g,broadcastCalendar:b}=n??{},{addDays:_,differenceInCalendarDays:S,differenceInCalendarMonths:R,endOfBroadcastWeek:C,endOfISOWeek:E,endOfMonth:A,endOfWeek:M,isAfter:I,startOfBroadcastWeek:j,startOfISOWeek:q,startOfWeek:Q}=o,te=b?j(l,o):f?q(l):Q(l),F=b?C(d):f?E(A(d)):M(A(d)),V=t&&(b?C(t):f?E(t):M(t)),ne=V&&I(F,V)?V:F,ae=S(ne,te),se=R(d,l)+1,Oe=[];for(let $e=0;$e<=ae;$e++){const Ae=_(te,$e);Oe.push(Ae)}const oe=(b?35:42)*se;if(g&&Oe.length<oe){const $e=oe-Oe.length;for(let Ae=0;Ae<$e;Ae++){const je=_(Oe[Oe.length-1],1);Oe.push(je)}}return Oe}function getDays(e){const t=[];return e.reduce((n,o)=>{const l=o.weeks.reduce((d,f)=>d.concat(f.days.slice()),t.slice());return n.concat(l.slice())},t.slice())}function getDisplayMonths(e,t,n,o){const{numberOfMonths:l=1}=n,d=[];for(let f=0;f<l;f++){const g=o.addMonths(e,f);if(t&&g>t)break;d.push(g)}return d}function getInitialMonth(e,t,n,o){const{month:l,defaultMonth:d,today:f=o.today(),numberOfMonths:g=1}=e;let b=l||d||f;const{differenceInCalendarMonths:_,addMonths:S,startOfMonth:R}=o;if(n&&_(n,b)<g-1){const C=-1*(g-1);b=S(n,C)}return t&&_(b,t)<0&&(b=t),R(b)}function getMonths(e,t,n,o){const{addDays:l,endOfBroadcastWeek:d,endOfISOWeek:f,endOfMonth:g,endOfWeek:b,getISOWeek:_,getWeek:S,startOfBroadcastWeek:R,startOfISOWeek:C,startOfWeek:E}=o,A=e.reduce((M,I)=>{const j=n.broadcastCalendar?R(I,o):n.ISOWeek?C(I):E(I),q=n.broadcastCalendar?d(I):n.ISOWeek?f(g(I)):b(g(I)),Q=t.filter(ne=>ne>=j&&ne<=q),te=n.broadcastCalendar?35:42;if(n.fixedWeeks&&Q.length<te){const ne=t.filter(ae=>{const se=te-Q.length;return ae>q&&ae<=l(q,se)});Q.push(...ne)}const F=Q.reduce((ne,ae)=>{const se=n.ISOWeek?_(ae):S(ae),Oe=ne.find(oe=>oe.weekNumber===se),Ne=new CalendarDay(ae,I,o);return Oe?Oe.days.push(Ne):ne.push(new CalendarWeek(se,[Ne])),ne},[]),V=new CalendarMonth(I,F);return M.push(V),M},[]);return n.reverseMonths?A.reverse():A}function getNavMonths(e,t){let{startMonth:n,endMonth:o}=e;const{startOfYear:l,startOfDay:d,startOfMonth:f,endOfMonth:g,addYears:b,endOfYear:_,newDate:S,today:R}=t,{fromYear:C,toYear:E,fromMonth:A,toMonth:M}=e;!n&&A&&(n=A),!n&&C&&(n=t.newDate(C,0,1)),!o&&M&&(o=M),!o&&E&&(o=S(E,11,31));const I=e.captionLayout==="dropdown"||e.captionLayout==="dropdown-years";return n?n=f(n):C?n=S(C,0,1):!n&&I&&(n=l(b(e.today??R(),-100))),o?o=g(o):E?o=S(E,11,31):!o&&I&&(o=_(e.today??R())),[n&&d(n),o&&d(o)]}function getNextMonth(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:d=1}=n,{startOfMonth:f,addMonths:g,differenceInCalendarMonths:b}=o,_=l?d:1,S=f(e);if(!t)return g(S,_);if(!(b(t,e)<d))return g(S,_)}function getPreviousMonth(e,t,n,o){if(n.disableNavigation)return;const{pagedNavigation:l,numberOfMonths:d}=n,{startOfMonth:f,addMonths:g,differenceInCalendarMonths:b}=o,_=l?d??1:1,S=f(e);if(!t)return g(S,-_);if(!(b(S,t)<=0))return g(S,-_)}function getWeeks(e){const t=[];return e.reduce((n,o)=>n.concat(o.weeks.slice()),t.slice())}function useControlledValue(e,t){const[n,o]=React.useState(e);return[t===void 0?n:t,o]}function useCalendar(e,t){var te;const[n,o]=getNavMonths(e,t),{startOfMonth:l,endOfMonth:d}=t,f=getInitialMonth(e,n,o,t),[g,b]=useControlledValue(f,e.month?f:void 0);React.useEffect(()=>{const F=getInitialMonth(e,n,o,t);b(F)},[e.timeZone]);const{months:_,weeks:S,days:R,previousMonth:C,nextMonth:E}=React.useMemo(()=>{const F=getDisplayMonths(g,o,{numberOfMonths:e.numberOfMonths},t),V=getDates(F,e.endMonth?d(e.endMonth):void 0,{ISOWeek:e.ISOWeek,fixedWeeks:e.fixedWeeks,broadcastCalendar:e.broadcastCalendar},t),ne=getMonths(F,V,{broadcastCalendar:e.broadcastCalendar,fixedWeeks:e.fixedWeeks,ISOWeek:e.ISOWeek,reverseMonths:e.reverseMonths},t),ae=getWeeks(ne),se=getDays(ne),Oe=getPreviousMonth(g,n,e,t),Ne=getNextMonth(g,o,e,t);return{months:ne,weeks:ae,days:se,previousMonth:Oe,nextMonth:Ne}},[t,g.getTime(),o==null?void 0:o.getTime(),n==null?void 0:n.getTime(),e.disableNavigation,e.broadcastCalendar,(te=e.endMonth)==null?void 0:te.getTime(),e.fixedWeeks,e.ISOWeek,e.numberOfMonths,e.pagedNavigation,e.reverseMonths]),{disableNavigation:A,onMonthChange:M}=e,I=F=>S.some(V=>V.days.some(ne=>ne.isEqualTo(F))),j=F=>{if(A)return;let V=l(F);n&&V<l(n)&&(V=l(n)),o&&V>l(o)&&(V=l(o)),b(V),M==null||M(V)};return{months:_,weeks:S,days:R,navStart:n,navEnd:o,previousMonth:C,nextMonth:E,goToMonth:j,goToDay:F=>{I(F)||j(F.date)}}}var FocusTargetPriority;(function(e){e[e.Today=0]="Today",e[e.Selected=1]="Selected",e[e.LastFocused=2]="LastFocused",e[e.FocusedModifier=3]="FocusedModifier"})(FocusTargetPriority||(FocusTargetPriority={}));function isFocusableDay(e){return!e[DayFlag.disabled]&&!e[DayFlag.hidden]&&!e[DayFlag.outside]}function calculateFocusTarget(e,t,n,o){let l,d=-1;for(const f of e){const g=t(f);isFocusableDay(g)&&(g[DayFlag.focused]&&d<FocusTargetPriority.FocusedModifier?(l=f,d=FocusTargetPriority.FocusedModifier):o!=null&&o.isEqualTo(f)&&d<FocusTargetPriority.LastFocused?(l=f,d=FocusTargetPriority.LastFocused):n(f.date)&&d<FocusTargetPriority.Selected?(l=f,d=FocusTargetPriority.Selected):g[DayFlag.today]&&d<FocusTargetPriority.Today&&(l=f,d=FocusTargetPriority.Today))}return l||(l=e.find(f=>isFocusableDay(t(f)))),l}function getFocusableDate(e,t,n,o,l,d,f){const{ISOWeek:g,broadcastCalendar:b}=d,{addDays:_,addMonths:S,addWeeks:R,addYears:C,endOfBroadcastWeek:E,endOfISOWeek:A,endOfWeek:M,max:I,min:j,startOfBroadcastWeek:q,startOfISOWeek:Q,startOfWeek:te}=f;let V={day:_,week:R,month:S,year:C,startOfWeek:ne=>b?q(ne,f):g?Q(ne):te(ne),endOfWeek:ne=>b?E(ne):g?A(ne):M(ne)}[e](n,t==="after"?1:-1);return t==="before"&&o?V=I([o,V]):t==="after"&&l&&(V=j([l,V])),V}function getNextFocus(e,t,n,o,l,d,f,g=0){if(g>365)return;const b=getFocusableDate(e,t,n.date,o,l,d,f),_=!!(d.disabled&&dateMatchModifiers(b,d.disabled,f)),S=!!(d.hidden&&dateMatchModifiers(b,d.hidden,f)),R=b,C=new CalendarDay(b,R,f);return!_&&!S?C:getNextFocus(e,t,C,o,l,d,f,g+1)}function useFocus(e,t,n,o,l){const{autoFocus:d}=e,[f,g]=React.useState(),b=calculateFocusTarget(t.days,n,o||(()=>!1),f),[_,S]=React.useState(d?b:void 0);return{isFocusTarget:M=>!!(b!=null&&b.isEqualTo(M)),setFocused:S,focused:_,blur:()=>{g(_),S(void 0)},moveFocus:(M,I)=>{if(!_)return;const j=getNextFocus(M,I,_,t.navStart,t.navEnd,e,l);j&&(e.disableNavigation&&!t.days.some(Q=>Q.isEqualTo(j))||(t.goToDay(j),S(j)))}}}function useMulti(e,t){const{selected:n,required:o,onSelect:l}=e,[d,f]=useControlledValue(n,l?n:void 0),g=l?n:d,{isSameDay:b}=t,_=E=>(g==null?void 0:g.some(A=>b(A,E)))??!1,{min:S,max:R}=e;return{selected:g,select:(E,A,M)=>{let I=[...g??[]];if(_(E)){if((g==null?void 0:g.length)===S||o&&(g==null?void 0:g.length)===1)return;I=g==null?void 0:g.filter(j=>!b(j,E))}else(g==null?void 0:g.length)===R?I=[E]:I=[...I,E];return l||f(I),l==null||l(I,E,A,M),I},isSelected:_}}function addToRange(e,t,n=0,o=0,l=!1,d=defaultDateLib){const{from:f,to:g}=t||{},{isSameDay:b,isAfter:_,isBefore:S}=d;let R;if(!f&&!g)R={from:e,to:n>0?void 0:e};else if(f&&!g)b(f,e)?n===0?R={from:f,to:e}:l?R={from:f,to:void 0}:R=void 0:S(e,f)?R={from:e,to:f}:R={from:f,to:e};else if(f&&g)if(b(f,e)&&b(g,e))l?R={from:f,to:g}:R=void 0;else if(b(f,e))R={from:f,to:n>0?void 0:e};else if(b(g,e))R={from:e,to:n>0?void 0:e};else if(S(e,f))R={from:e,to:g};else if(_(e,f))R={from:f,to:e};else if(_(e,g))R={from:f,to:e};else throw new Error("Invalid range");if(R!=null&&R.from&&(R!=null&&R.to)){const C=d.differenceInCalendarDays(R.to,R.from);o>0&&C>o?R={from:e,to:void 0}:n>1&&C<n&&(R={from:e,to:void 0})}return R}function rangeContainsDayOfWeek(e,t,n=defaultDateLib){const o=Array.isArray(t)?t:[t];let l=e.from;const d=n.differenceInCalendarDays(e.to,e.from),f=Math.min(d,6);for(let g=0;g<=f;g++){if(o.includes(l.getDay()))return!0;l=n.addDays(l,1)}return!1}function rangeOverlaps(e,t,n=defaultDateLib){return rangeIncludesDate(e,t.from,!1,n)||rangeIncludesDate(e,t.to,!1,n)||rangeIncludesDate(t,e.from,!1,n)||rangeIncludesDate(t,e.to,!1,n)}function rangeContainsModifiers(e,t,n=defaultDateLib){const o=Array.isArray(t)?t:[t];if(o.filter(g=>typeof g!="function").some(g=>typeof g=="boolean"?g:n.isDate(g)?rangeIncludesDate(e,g,!1,n):isDatesArray(g,n)?g.some(b=>rangeIncludesDate(e,b,!1,n)):isDateRange(g)?g.from&&g.to?rangeOverlaps(e,{from:g.from,to:g.to},n):!1:isDayOfWeekType(g)?rangeContainsDayOfWeek(e,g.dayOfWeek,n):isDateInterval(g)?n.isAfter(g.before,g.after)?rangeOverlaps(e,{from:n.addDays(g.after,1),to:n.addDays(g.before,-1)},n):dateMatchModifiers(e.from,g,n)||dateMatchModifiers(e.to,g,n):isDateAfterType(g)||isDateBeforeType(g)?dateMatchModifiers(e.from,g,n)||dateMatchModifiers(e.to,g,n):!1))return!0;const f=o.filter(g=>typeof g=="function");if(f.length){let g=e.from;const b=n.differenceInCalendarDays(e.to,e.from);for(let _=0;_<=b;_++){if(f.some(S=>S(g)))return!0;g=n.addDays(g,1)}}return!1}function useRange(e,t){const{disabled:n,excludeDisabled:o,selected:l,required:d,onSelect:f}=e,[g,b]=useControlledValue(l,f?l:void 0),_=f?l:g;return{selected:_,select:(C,E,A)=>{const{min:M,max:I}=e,j=C?addToRange(C,_,M,I,d,t):void 0;return o&&n&&(j!=null&&j.from)&&j.to&&rangeContainsModifiers({from:j.from,to:j.to},n,t)&&(j.from=C,j.to=void 0),f||b(j),f==null||f(j,C,E,A),j},isSelected:C=>_&&rangeIncludesDate(_,C,!1,t)}}function useSingle(e,t){const{selected:n,required:o,onSelect:l}=e,[d,f]=useControlledValue(n,l?n:void 0),g=l?n:d,{isSameDay:b}=t;return{selected:g,select:(R,C,E)=>{let A=R;return!o&&g&&g&&b(R,g)&&(A=void 0),l||f(A),l==null||l(A,R,C,E),A},isSelected:R=>g?b(g,R):!1}}function useSelection(e,t){const n=useSingle(e,t),o=useMulti(e,t),l=useRange(e,t);switch(e.mode){case"single":return n;case"multiple":return o;case"range":return l;default:return}}function toTimeZone(e,t){return e instanceof TZDate&&e.timeZone===t?e:new TZDate(e,t)}function convertMatcher(e,t){return typeof e=="boolean"||typeof e=="function"?e:e instanceof Date?toTimeZone(e,t):Array.isArray(e)?e.map(n=>n instanceof Date?toTimeZone(n,t):n):isDateRange(e)?{...e,from:e.from?toTimeZone(e.from,t):e.from,to:e.to?toTimeZone(e.to,t):e.to}:isDateInterval(e)?{before:toTimeZone(e.before,t),after:toTimeZone(e.after,t)}:isDateAfterType(e)?{after:toTimeZone(e.after,t)}:isDateBeforeType(e)?{before:toTimeZone(e.before,t)}:e}function convertMatchersToTimeZone(e,t){return e&&(Array.isArray(e)?e.map(n=>convertMatcher(n,t)):convertMatcher(e,t))}function DayPicker(e){var Vn;let t=e;const n=t.timeZone;if(n&&(t={...e,timeZone:n},t.today&&(t.today=toTimeZone(t.today,n)),t.month&&(t.month=toTimeZone(t.month,n)),t.defaultMonth&&(t.defaultMonth=toTimeZone(t.defaultMonth,n)),t.startMonth&&(t.startMonth=toTimeZone(t.startMonth,n)),t.endMonth&&(t.endMonth=toTimeZone(t.endMonth,n)),t.mode==="single"&&t.selected?t.selected=toTimeZone(t.selected,n):t.mode==="multiple"&&t.selected?t.selected=(Vn=t.selected)==null?void 0:Vn.map(Jt=>toTimeZone(Jt,n)):t.mode==="range"&&t.selected&&(t.selected={from:t.selected.from?toTimeZone(t.selected.from,n):t.selected.from,to:t.selected.to?toTimeZone(t.selected.to,n):t.selected.to}),t.disabled!==void 0&&(t.disabled=convertMatchersToTimeZone(t.disabled,n)),t.hidden!==void 0&&(t.hidden=convertMatchersToTimeZone(t.hidden,n)),t.modifiers)){const Jt={};Object.keys(t.modifiers).forEach(Qt=>{var Ut;Jt[Qt]=convertMatchersToTimeZone((Ut=t.modifiers)==null?void 0:Ut[Qt],n)}),t.modifiers=Jt}const{components:o,formatters:l,labels:d,dateLib:f,locale:g,classNames:b}=React.useMemo(()=>{const Jt={...enUS,...t.locale};return{dateLib:new DateLib({locale:Jt,weekStartsOn:t.broadcastCalendar?1:t.weekStartsOn,firstWeekContainsDate:t.firstWeekContainsDate,useAdditionalWeekYearTokens:t.useAdditionalWeekYearTokens,useAdditionalDayOfYearTokens:t.useAdditionalDayOfYearTokens,timeZone:t.timeZone,numerals:t.numerals},t.dateLib),components:getComponents(t.components),formatters:getFormatters(t.formatters),labels:{...defaultLabels,...t.labels},locale:Jt,classNames:{...getDefaultClassNames(),...t.classNames}}},[t.locale,t.broadcastCalendar,t.weekStartsOn,t.firstWeekContainsDate,t.useAdditionalWeekYearTokens,t.useAdditionalDayOfYearTokens,t.timeZone,t.numerals,t.dateLib,t.components,t.formatters,t.labels,t.classNames]);t.today||(t={...t,today:f.today()});const{captionLayout:_,mode:S,navLayout:R,numberOfMonths:C=1,onDayBlur:E,onDayClick:A,onDayFocus:M,onDayKeyDown:I,onDayMouseEnter:j,onDayMouseLeave:q,onNextClick:Q,onPrevClick:te,showWeekNumber:F,styles:V}=t,{formatCaption:ne,formatDay:ae,formatMonthDropdown:se,formatWeekNumber:Oe,formatWeekNumberHeader:Ne,formatWeekdayName:oe,formatYearDropdown:$e}=l,Ae=useCalendar(t,f),{days:je,months:Be,navStart:qe,navEnd:Ve,previousMonth:Le,nextMonth:He,goToMonth:We}=Ae,ze=createGetModifiers(je,t,qe,Ve,f),{isSelected:Xe,select:nt,selected:Je}=useSelection(t,f)??{},{blur:st,focused:et,isFocusTarget:at,moveFocus:tt,setFocused:ot}=useFocus(t,Ae,ze,Xe??(()=>!1),f),{labelDayButton:lt,labelGridcell:Ge,labelGrid:$t,labelMonthDropdown:rt,labelNav:Rt,labelPrevious:dt,labelNext:It,labelWeekday:Mt,labelWeekNumber:Ct,labelWeekNumberHeader:Ke,labelYearDropdown:Ye}=d,Ze=React.useMemo(()=>getWeekdays(f,t.ISOWeek,t.broadcastCalendar,t.today),[f,t.ISOWeek,t.broadcastCalendar,t.today]),ct=S!==void 0||A!==void 0,mt=React.useCallback(()=>{Le&&(We(Le),te==null||te(Le))},[Le,We,te]),ft=React.useCallback(()=>{He&&(We(He),Q==null||Q(He))},[We,He,Q]),yt=React.useCallback((Jt,Qt)=>Ut=>{Ut.preventDefault(),Ut.stopPropagation(),ot(Jt),!Qt.disabled&&(nt==null||nt(Jt.date,Qt,Ut),A==null||A(Jt.date,Qt,Ut))},[nt,A,ot]),Ht=React.useCallback((Jt,Qt)=>Ut=>{ot(Jt),M==null||M(Jt.date,Qt,Ut)},[M,ot]),Kt=React.useCallback((Jt,Qt)=>Ut=>{st(),E==null||E(Jt.date,Qt,Ut)},[st,E]),un=React.useCallback((Jt,Qt)=>Ut=>{const tn={ArrowLeft:[Ut.shiftKey?"month":"day",t.dir==="rtl"?"after":"before"],ArrowRight:[Ut.shiftKey?"month":"day",t.dir==="rtl"?"before":"after"],ArrowDown:[Ut.shiftKey?"year":"week","after"],ArrowUp:[Ut.shiftKey?"year":"week","before"],PageUp:[Ut.shiftKey?"year":"month","before"],PageDown:[Ut.shiftKey?"year":"month","after"],Home:["startOfWeek","before"],End:["endOfWeek","after"]};if(tn[Ut.key]){Ut.preventDefault(),Ut.stopPropagation();const[Yt,an]=tn[Ut.key];tt(Yt,an)}I==null||I(Jt.date,Qt,Ut)},[tt,I,t.dir]),hn=React.useCallback((Jt,Qt)=>Ut=>{j==null||j(Jt.date,Qt,Ut)},[j]),qt=React.useCallback((Jt,Qt)=>Ut=>{q==null||q(Jt.date,Qt,Ut)},[q]),An=React.useCallback(Jt=>Qt=>{const Ut=Number(Qt.target.value),tn=f.setMonth(f.startOfMonth(Jt),Ut);We(tn)},[f,We]),xn=React.useCallback(Jt=>Qt=>{const Ut=Number(Qt.target.value),tn=f.setYear(f.startOfMonth(Jt),Ut);We(tn)},[f,We]),{className:Rn,style:vn}=React.useMemo(()=>({className:[b[UI.Root],t.className].filter(Boolean).join(" "),style:{...V==null?void 0:V[UI.Root],...t.style}}),[b,t.className,t.style,V]),Pn=getDataAttributes(t),Mn=React.useRef(null);useAnimation(Mn,!!t.animate,{classNames:b,months:Be,focused:et,dateLib:f});const $n={dayPickerProps:t,selected:Je,select:nt,isSelected:Xe,months:Be,nextMonth:He,previousMonth:Le,goToMonth:We,getModifiers:ze,components:o,classNames:b,styles:V,labels:d,formatters:l};return React.createElement(dayPickerContext.Provider,{value:$n},React.createElement(o.Root,{rootRef:t.animate?Mn:void 0,className:Rn,style:vn,dir:t.dir,id:t.id,lang:t.lang,nonce:t.nonce,title:t.title,role:t.role,"aria-label":t["aria-label"],"aria-labelledby":t["aria-labelledby"],...Pn},React.createElement(o.Months,{className:b[UI.Months],style:V==null?void 0:V[UI.Months]},!t.hideNavigation&&!R&&React.createElement(o.Nav,{"data-animated-nav":t.animate?"true":void 0,className:b[UI.Nav],style:V==null?void 0:V[UI.Nav],"aria-label":Rt(),onPreviousClick:mt,onNextClick:ft,previousMonth:Le,nextMonth:He}),Be.map((Jt,Qt)=>React.createElement(o.Month,{"data-animated-month":t.animate?"true":void 0,className:b[UI.Month],style:V==null?void 0:V[UI.Month],key:Qt,displayIndex:Qt,calendarMonth:Jt},R==="around"&&!t.hideNavigation&&Qt===0&&React.createElement(o.PreviousMonthButton,{type:"button",className:b[UI.PreviousMonthButton],tabIndex:Le?void 0:-1,"aria-disabled":Le?void 0:!0,"aria-label":dt(Le),onClick:mt,"data-animated-button":t.animate?"true":void 0},React.createElement(o.Chevron,{disabled:Le?void 0:!0,className:b[UI.Chevron],orientation:t.dir==="rtl"?"right":"left"})),React.createElement(o.MonthCaption,{"data-animated-caption":t.animate?"true":void 0,className:b[UI.MonthCaption],style:V==null?void 0:V[UI.MonthCaption],calendarMonth:Jt,displayIndex:Qt},_!=null&&_.startsWith("dropdown")?React.createElement(o.DropdownNav,{className:b[UI.Dropdowns],style:V==null?void 0:V[UI.Dropdowns]},(()=>{const Ut=_==="dropdown"||_==="dropdown-months"?React.createElement(o.MonthsDropdown,{key:"month",className:b[UI.MonthsDropdown],"aria-label":rt(),classNames:b,components:o,disabled:!!t.disableNavigation,onChange:An(Jt.date),options:getMonthOptions(Jt.date,qe,Ve,l,f),style:V==null?void 0:V[UI.Dropdown],value:f.getMonth(Jt.date)}):React.createElement("span",{key:"month"},se(Jt.date,f)),tn=_==="dropdown"||_==="dropdown-years"?React.createElement(o.YearsDropdown,{key:"year",className:b[UI.YearsDropdown],"aria-label":Ye(f.options),classNames:b,components:o,disabled:!!t.disableNavigation,onChange:xn(Jt.date),options:getYearOptions(qe,Ve,l,f,!!t.reverseYears),style:V==null?void 0:V[UI.Dropdown],value:f.getYear(Jt.date)}):React.createElement("span",{key:"year"},$e(Jt.date,f));return f.getMonthYearOrder()==="year-first"?[tn,Ut]:[Ut,tn]})(),React.createElement("span",{role:"status","aria-live":"polite",style:{border:0,clip:"rect(0 0 0 0)",height:"1px",margin:"-1px",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap",wordWrap:"normal"}},ne(Jt.date,f.options,f))):React.createElement(o.CaptionLabel,{className:b[UI.CaptionLabel],role:"status","aria-live":"polite"},ne(Jt.date,f.options,f))),R==="around"&&!t.hideNavigation&&Qt===C-1&&React.createElement(o.NextMonthButton,{type:"button",className:b[UI.NextMonthButton],tabIndex:He?void 0:-1,"aria-disabled":He?void 0:!0,"aria-label":It(He),onClick:ft,"data-animated-button":t.animate?"true":void 0},React.createElement(o.Chevron,{disabled:He?void 0:!0,className:b[UI.Chevron],orientation:t.dir==="rtl"?"left":"right"})),Qt===C-1&&R==="after"&&!t.hideNavigation&&React.createElement(o.Nav,{"data-animated-nav":t.animate?"true":void 0,className:b[UI.Nav],style:V==null?void 0:V[UI.Nav],"aria-label":Rt(),onPreviousClick:mt,onNextClick:ft,previousMonth:Le,nextMonth:He}),React.createElement(o.MonthGrid,{role:"grid","aria-multiselectable":S==="multiple"||S==="range","aria-label":$t(Jt.date,f.options,f)||void 0,className:b[UI.MonthGrid],style:V==null?void 0:V[UI.MonthGrid]},!t.hideWeekdays&&React.createElement(o.Weekdays,{"data-animated-weekdays":t.animate?"true":void 0,className:b[UI.Weekdays],style:V==null?void 0:V[UI.Weekdays]},F&&React.createElement(o.WeekNumberHeader,{"aria-label":Ke(f.options),className:b[UI.WeekNumberHeader],style:V==null?void 0:V[UI.WeekNumberHeader],scope:"col"},Ne()),Ze.map(Ut=>React.createElement(o.Weekday,{"aria-label":Mt(Ut,f.options,f),className:b[UI.Weekday],key:String(Ut),style:V==null?void 0:V[UI.Weekday],scope:"col"},oe(Ut,f.options,f)))),React.createElement(o.Weeks,{"data-animated-weeks":t.animate?"true":void 0,className:b[UI.Weeks],style:V==null?void 0:V[UI.Weeks]},Jt.weeks.map(Ut=>React.createElement(o.Week,{className:b[UI.Week],key:Ut.weekNumber,style:V==null?void 0:V[UI.Week],week:Ut},F&&React.createElement(o.WeekNumber,{week:Ut,style:V==null?void 0:V[UI.WeekNumber],"aria-label":Ct(Ut.weekNumber,{locale:g}),className:b[UI.WeekNumber],scope:"row",role:"rowheader"},Oe(Ut.weekNumber,f)),Ut.days.map(tn=>{const{date:Yt}=tn,an=ze(tn);if(an[DayFlag.focused]=!an.hidden&&!!(et!=null&&et.isEqualTo(tn)),an[SelectionState.selected]=(Xe==null?void 0:Xe(Yt))||an.selected,isDateRange(Je)){const{from:Cn,to:Bn}=Je;an[SelectionState.range_start]=!!(Cn&&Bn&&f.isSameDay(Yt,Cn)),an[SelectionState.range_end]=!!(Cn&&Bn&&f.isSameDay(Yt,Bn)),an[SelectionState.range_middle]=rangeIncludesDate(Je,Yt,!0,f)}const mn=getStyleForModifiers(an,V,t.modifiersStyles),On=getClassNamesForModifiers(an,b,t.modifiersClassNames),Fn=!ct&&!an.hidden?Ge(Yt,an,f.options,f):void 0;return React.createElement(o.Day,{key:`${tn.isoDate}_${tn.displayMonthId}`,day:tn,modifiers:an,className:On.join(" "),style:mn,role:"gridcell","aria-selected":an.selected||void 0,"aria-label":Fn,"data-day":tn.isoDate,"data-month":tn.outside?tn.dateMonthId:void 0,"data-selected":an.selected||void 0,"data-disabled":an.disabled||void 0,"data-hidden":an.hidden||void 0,"data-outside":tn.outside||void 0,"data-focused":an.focused||void 0,"data-today":an.today||void 0},!an.hidden&&ct?React.createElement(o.DayButton,{className:b[UI.DayButton],style:V==null?void 0:V[UI.DayButton],type:"button",day:tn,modifiers:an,disabled:!an.focused&&an.disabled||void 0,"aria-disabled":an.focused&&an.disabled||void 0,tabIndex:at(tn)?0:-1,"aria-label":lt(Yt,an,f.options,f),onClick:yt(tn,an),onBlur:Kt(tn,an),onFocus:Ht(tn,an),onKeyDown:un(tn,an),onMouseEnter:hn(tn,an),onMouseLeave:qt(tn,an)},ae(Yt,f.options,f)):!an.hidden&&ae(tn.date,f.options,f))})))))))),t.footer&&React.createElement(o.Footer,{className:b[UI.Footer],style:V==null?void 0:V[UI.Footer],role:"status","aria-live":"polite"},t.footer)))}function Calendar({className:e,classNames:t,showOutsideDays:n=!0,captionLayout:o="label",buttonVariant:l="ghost",formatters:d,components:f,...g}){const b=getDefaultClassNames();return jsxRuntime.jsx(DayPicker,{showOutsideDays:n,className:cn("bg-background group/calendar p-3 [--cell-size:2rem] [[data-slot=card-content]_&]:bg-transparent [[data-slot=popover-content]_&]:bg-transparent",String.raw`rtl:**:[.rdp-button\_next>svg]:rotate-180`,String.raw`rtl:**:[.rdp-button\_previous>svg]:rotate-180`,e),captionLayout:o,formatters:{formatMonthDropdown:_=>_.toLocaleString("default",{month:"short"}),...d},classNames:{root:cn("w-fit",b.root),months:cn("relative flex flex-col gap-4 md:flex-row",b.months),month:cn("flex w-full flex-col gap-4",b.month),nav:cn("absolute inset-x-0 top-0 flex w-full items-center justify-between gap-1",b.nav),button_previous:cn(buttonVariants({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",b.button_previous),button_next:cn(buttonVariants({variant:l}),"h-[--cell-size] w-[--cell-size] select-none p-0 aria-disabled:opacity-50",b.button_next),month_caption:cn("flex h-[--cell-size] w-full items-center justify-center px-[--cell-size]",b.month_caption),dropdowns:cn("flex h-[--cell-size] w-full items-center justify-center gap-1.5 text-sm font-medium",b.dropdowns),dropdown_root:cn("has-focus:border-ring border-input shadow-xs has-focus:ring-ring/50 has-focus:ring-[3px] relative rounded-md border",b.dropdown_root),dropdown:cn("bg-popover absolute inset-0 opacity-0",b.dropdown),caption_label:cn("select-none font-medium",o==="label"?"text-sm":"[&>svg]:text-muted-foreground flex h-8 items-center gap-1 rounded-md pl-2 pr-1 text-sm [&>svg]:size-3.5",b.caption_label),table:"w-full border-collapse",weekdays:cn("flex",b.weekdays),weekday:cn("text-muted-foreground flex-1 select-none rounded-md text-[0.8rem] font-normal",b.weekday),week:cn("mt-2 flex w-full",b.week),week_number_header:cn("w-[--cell-size] select-none",b.week_number_header),week_number:cn("text-muted-foreground select-none text-[0.8rem]",b.week_number),day:cn("group/day relative aspect-square h-full w-full select-none p-0 text-center [&:first-child[data-selected=true]_button]:rounded-l-md [&:last-child[data-selected=true]_button]:rounded-r-md",b.day),range_start:cn("bg-accent rounded-l-md",b.range_start),range_middle:cn("rounded-none",b.range_middle),range_end:cn("bg-accent rounded-r-md",b.range_end),today:cn("bg-accent text-accent-foreground rounded-md data-[selected=true]:rounded-none",b.today),outside:cn("text-muted-foreground aria-selected:text-muted-foreground",b.outside),disabled:cn("text-muted-foreground opacity-50",b.disabled),hidden:cn("invisible",b.hidden),...t},components:{Root:({className:_,rootRef:S,...R})=>jsxRuntime.jsx("div",{"data-slot":"calendar",ref:S,className:cn(_),...R}),Chevron:({className:_,orientation:S,...R})=>S==="left"?jsxRuntime.jsx(ChevronLeft,{className:cn("size-4",_),...R}):S==="right"?jsxRuntime.jsx(ChevronRight,{className:cn("size-4",_),...R}):jsxRuntime.jsx(ChevronDown,{className:cn("size-4",_),...R}),DayButton:CalendarDayButton,WeekNumber:({children:_,...S})=>jsxRuntime.jsx("td",{...S,children:jsxRuntime.jsx("div",{className:"flex size-[--cell-size] items-center justify-center text-center",children:_})}),...f},...g})}function CalendarDayButton({className:e,day:t,modifiers:n,...o}){const l=getDefaultClassNames(),d=React__namespace.useRef(null);return React__namespace.useEffect(()=>{var f;n.focused&&((f=d.current)==null||f.focus())},[n.focused]),jsxRuntime.jsx(Button$1,{ref:d,variant:"ghost",size:"icon","data-day":t.date.toLocaleDateString(),"data-selected-single":n.selected&&!n.range_start&&!n.range_end&&!n.range_middle,"data-range-start":n.range_start,"data-range-end":n.range_end,"data-range-middle":n.range_middle,className:cn("data-[selected-single=true]:bg-primary data-[selected-single=true]:text-primary-foreground data-[range-middle=true]:bg-accent data-[range-middle=true]:text-accent-foreground data-[range-start=true]:bg-primary data-[range-start=true]:text-primary-foreground data-[range-end=true]:bg-primary data-[range-end=true]:text-primary-foreground group-data-[focused=true]/day:border-ring group-data-[focused=true]/day:ring-ring/50 flex aspect-square h-auto w-full min-w-[--cell-size] flex-col gap-1 font-normal leading-none data-[range-end=true]:rounded-md data-[range-middle=true]:rounded-none data-[range-start=true]:rounded-md group-data-[focused=true]/day:relative group-data-[focused=true]/day:z-10 group-data-[focused=true]/day:ring-[3px] [&>span]:text-xs [&>span]:opacity-70",l.day,e),...o})}function AssistantChat(e){return jsxRuntime.jsx(Card,{className:"max-w-6xl",children:jsxRuntime.jsx(AIChatLayout,{className:"h-[40em]",userId:e.userId,userName:e.userName,initialPrompt:e.initialPrompt})})}function formatDateToISO(e){if(!e||!isValidDate(e))return"";const t=e.getTimezoneOffset()*6e4;return new Date(e.getTime()-t).toISOString().split("T")[0]}function isValidDate(e){return e instanceof Date&&!isNaN(e.getTime())}function DatePicker({date:e,onDateChange:t,label:n,id:o,className:l}){const[d,f]=React__namespace.useState(!1),[g,b]=React__namespace.useState(e),[_,S]=React__namespace.useState(formatDateToISO(e));React__namespace.useEffect(()=>{S(formatDateToISO(e)),isValidDate(e)&&b(e)},[e]);const R=E=>{const M=E.target.value.replace(/\D/g,"").slice(0,8);let I=M;if(M.length>4&&(I=`${M.slice(0,4)}-${M.slice(4)}`),M.length>6&&(I=`${M.slice(0,4)}-${M.slice(4,6)}-${M.slice(6)}`),S(I),M.length===8){const j=new Date(I),q=new Date(j.getUTCFullYear(),j.getUTCMonth(),j.getUTCDate());isValidDate(q)?(t(q),b(q)):t(void 0)}else t(void 0)},C=E=>{E&&(t(E),S(formatDateToISO(E))),f(!1)};return jsxRuntime.jsxs("div",{className:cn("flex flex-col gap-2",l),children:[n&&jsxRuntime.jsx(Label$2,{htmlFor:o,children:n}),jsxRuntime.jsxs("div",{className:"relative",children:[jsxRuntime.jsx(Input,{id:o,value:_,placeholder:"YYYY-MM-DD",className:"bg-background pr-10",onChange:R,onKeyDown:E=>{E.key==="ArrowDown"&&(E.preventDefault(),f(!0))}}),jsxRuntime.jsxs(Popover,{open:d,onOpenChange:f,children:[jsxRuntime.jsx(PopoverTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"absolute right-1 top-1/2 h-7 w-7 -translate-y-1/2","aria-label":"Select date",children:jsxRuntime.jsx(Calendar$1,{className:"h-4 w-4"})})}),jsxRuntime.jsx(PopoverContent,{className:"w-auto min-w-[280px] p-0",align:"end",sideOffset:8,children:jsxRuntime.jsx(Calendar,{mode:"single",selected:e,onSelect:C,month:g,onMonthChange:b,initialFocus:!0,className:"w-full"})})]})]})]})}function ExternalProductCard({product:e,viewProductLink:t}){return e?jsxRuntime.jsx(Card,{className:"@container border-dashed border-2 hover:shadow-md transition-shadow h-full",children:jsxRuntime.jsxs(CardContent,{className:"p-6 flex flex-col h-full",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start mb-4 @[36rem]:hidden",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg pr-4 text-center w-full",children:e.Title||e.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:e.ManufacturerId,name:e.ManufacturerName,width:96,height:40})})]}),jsxRuntime.jsxs("div",{className:"flex flex-col gap-x-6 gap-y-4 flex-grow @[36rem]:flex-row",children:[jsxRuntime.jsx("div",{className:"mx-auto flex-shrink-0 @[36rem]:mx-0 @[36rem]:w-48",children:jsxRuntime.jsx(ProductImage,{randmarSKU:e.RandmarSKU||"",alt:e.RandmarTitle||""})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col text-center @[36rem]:text-left",children:[jsxRuntime.jsxs("div",{className:"hidden @[36rem]:flex justify-between items-start mb-4",children:[jsxRuntime.jsx("h3",{className:"font-semibold text-lg pr-4",children:e.Title||e.RandmarTitle}),jsxRuntime.jsx("div",{className:"w-24 h-10 flex-shrink-0",children:jsxRuntime.jsx(PartnerLogo,{id:e.ManufacturerId,name:e.ManufacturerName,width:96,height:40})})]}),jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 justify-center @[36rem]:hidden",children:[jsxRuntime.jsxs(Badge,{variant:"outline",className:"border-orange-300 bg-orange-50 text-orange-800",children:[jsxRuntime.jsx(Telescope,{className:"mr-2 h-3 w-3"}),jsxRuntime.jsx("span",{children:"External Product"})]}),jsxRuntime.jsxs(Badge,{variant:"outline",className:"border-randmar-red bg-red-50 text-randmar-red",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2 h-3 w-3"}),jsxRuntime.jsxs("span",{children:["Held by ",jsxRuntime.jsx("b",{children:"Randmar"})]})]})]}),jsxRuntime.jsxs("div",{className:"hidden @[36rem]:grid grid-cols-2 gap-2",children:[jsxRuntime.jsxs("div",{className:"flex items-center rounded-md bg-orange-50 px-4 py-2 text-orange-800 border-1 border-orange-800 text-sm",children:[jsxRuntime.jsx(Telescope,{className:"mr-2 h-5 w-5 flex-shrink-0"}),jsxRuntime.jsx("span",{children:"External Product"})]}),jsxRuntime.jsxs("div",{className:"flex items-center rounded-md bg-red-50 px-4 py-2 text-randmar-red border-1 border-randmar-red text-sm",children:[jsxRuntime.jsx(Warehouse,{className:"mr-2 h-5 w-5 flex-shrink-0"}),jsxRuntime.jsxs("span",{children:["Held by ",jsxRuntime.jsx("b",{children:"Randmar"})]})]})]}),t&&jsxRuntime.jsx("div",{className:"mt-auto pt-4 flex justify-center @[36rem]:justify-end",children:jsxRuntime.jsx(reactRouterDom.Link,{to:t,children:jsxRuntime.jsxs(Button$1,{variant:"secondary",className:"w-full @[36rem]:w-auto",children:[jsxRuntime.jsx(Eye,{className:"mr-2 h-4 w-4"}),"View Product"]})})})]})]})]})}):jsxRuntime.jsx(Card,{className:"@container border-dashed border-2 h-full",children:jsxRuntime.jsx(CardContent,{className:"p-6 flex flex-col h-full",children:jsxRuntime.jsxs("div",{className:"flex flex-col gap-6 flex-grow @[36rem]:flex-row",children:[jsxRuntime.jsx("div",{className:"flex-shrink-0 @[36rem]:w-48",children:jsxRuntime.jsx(Skeleton,{className:"aspect-square w-full h-auto"})}),jsxRuntime.jsxs("div",{className:"flex flex-1 flex-col gap-4",children:[jsxRuntime.jsxs("div",{className:"flex justify-between items-start",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-1/2"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-24 rounded"})]}),jsxRuntime.jsxs("div",{children:[jsxRuntime.jsxs("div",{className:"flex flex-wrap gap-2 justify-center @[36rem]:hidden",children:[jsxRuntime.jsx(Skeleton,{className:"h-6 w-36 rounded-full"}),jsxRuntime.jsx(Skeleton,{className:"h-6 w-36 rounded-full"})]}),jsxRuntime.jsxs("div",{className:"hidden @[36rem]:grid grid-cols-2 gap-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md"}),jsxRuntime.jsx(Skeleton,{className:"h-10 w-full rounded-md"})]})]}),jsxRuntime.jsx("div",{className:"mt-auto pt-4 flex justify-center @[36rem]:justify-end",children:jsxRuntime.jsx(Skeleton,{className:"h-10 w-full @[36rem]:w-40"})})]})]})})})}function getEndDateStatus(e){if(!e)return{text:"No End Date",variant:"neutral",daysRemaining:null};const t=new Date(e);if(isNaN(t.getTime()))return{text:"Invalid Date",variant:"neutral",daysRemaining:null};const n=new Date,o=new Date(t.getFullYear(),t.getMonth(),t.getDate()),l=new Date(n.getFullYear(),n.getMonth(),n.getDate()),d=o.getTime()-l.getTime(),f=Math.ceil(d/(1e3*60*60*24));return f<0?{text:`Ended ${Math.abs(f)}d ago`,variant:"destructive",daysRemaining:f}:f===0?{text:"Ends today",variant:"destructive",daysRemaining:f}:f<=7?{text:`Ends in ${f}d`,variant:"destructive",daysRemaining:f}:f<=30?{text:`Ends in ${f}d`,variant:"warning",daysRemaining:f}:{text:`Ends in ${f}d`,variant:"neutral",daysRemaining:f}}const formatDate=e=>{if(!e)return"N/A";try{const t=new Date(e);return isNaN(t.getTime())?"Invalid Date":t.toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}catch{return"Invalid Date"}};function OpportunitiesTable({applicationId:e,opportunities:t=null,loading:n=!1}){var ne;const{toast:o}=useToast(),[l,d]=React.useState({}),[f,g]=React.useState(!1),[b,_]=React.useState(""),[S,R]=React.useState(null),{data:C}=useGetV4PartnerByApplicationIdAccountQuery({applicationId:e},{skip:!e}),E=React.useCallback((ae,se,Oe)=>{d(Ne=>({...Ne,[ae]:{...Ne[ae],[se]:Oe}}))},[]),[A]=usePutV4ResellerByRouteResellerIdOpportunityAndManufacturerIdDefaultMutation(),M=React.useCallback(async ae=>{if(!(C!=null&&C.IsReseller))return;if(!ae.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot set default.",variant:"destructive"});return}const se=ae.BidNumber;E(se,"isSettingDefault",!0),A({routeResellerId:e,manufacturerId:ae.ManufacturerId??"",opportunityNumber:se}).unwrap().then(()=>{o({title:"Success",description:`Opportunity "${ae.OpportunityName||ae.Opportunity||se}" was successfully set as default.`,variant:"success"})}).catch(Oe=>{var Ne;console.error("Set as default error:",Oe),o({title:"Error",description:((Ne=Oe.data)==null?void 0:Ne.message)||Oe.message||"An error occurred while setting this opportunity as default.",variant:"destructive"})}).finally(()=>{E(se,"isSettingDefault",!1)})},[e,A,o,E,C==null?void 0:C.IsReseller]),[I]=usePostV4ResellerByRouteResellerIdOpportunityAndManufacturerIdBidNumberEmailMutation(),j=React.useCallback(ae=>{if(C!=null&&C.IsReseller){if(!ae.BidNumber){o({title:"Error",description:"Bid Number is missing, cannot prepare report.",variant:"destructive"});return}R(ae),_(""),g(!0)}},[o,C==null?void 0:C.IsReseller]),q=React.useCallback(async()=>{if(!(C!=null&&C.IsReseller))return;if(!S||!S.BidNumber){o({title:"Error",description:"No opportunity selected or Bid Number is missing.",variant:"destructive"});return}if(!b.trim()||!/\S+@\S+\.\S+/.test(b)){o({title:"Validation Error",description:"Please enter a valid email address.",variant:"destructive"});return}const ae=S.BidNumber;E(ae,"isSendingReport",!0),I({routeResellerId:e,manufacturerId:S.ManufacturerId??"",bidNumber:ae,emailAddress:b}).unwrap().then(()=>{o({title:"Success",description:`A report for "${S.OpportunityName||S.Opportunity||ae}" was successfully sent to ${b}.`,variant:"success"}),g(!1)}).catch(se=>{var Oe;console.error("Send report by email error:",se),o({title:"Error",description:((Oe=se.data)==null?void 0:Oe.message)||se.message||"An error occurred while sending the report by email.",variant:"destructive"})}).finally(()=>{E(ae,"isSendingReport",!1),f||(R(null),_(""))})},[S,b,e,I,o,E,g]),Q=React.useMemo(()=>[{accessorKey:"ManufacturerId",header:"Manuf.",cell:({row:ae})=>jsxRuntime.jsx("div",{className:"w-20 h-8",children:jsxRuntime.jsx(PartnerLogo,{id:ae.original.ManufacturerId,width:80,height:32})}),enableSorting:!0,enableFiltering:!0},{id:"opportunityDisplay",accessorFn:ae=>ae.OpportunityName||ae.Opportunity,header:"Opportunity",cell:({getValue:ae})=>jsxRuntime.jsx("div",{className:"min-w-[150px]",children:ae()??"N/A"}),enableSorting:!0,enableFiltering:!0},{accessorKey:"BidNumber",header:"Bid Number",cell:({row:ae})=>ae.original.BidNumber??"N/A",enableSorting:!0,enableFiltering:!0},{id:"statusInfo",header:"Status",cell:({row:ae})=>{const se=ae.original,Oe=se.Active===!0,Ne=getEndDateStatus(se.EndDate);let oe="border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400";return Ne.variant==="destructive"?oe="border-red-500 bg-red-100 text-red-700 dark:border-red-600 dark:bg-red-900/50 dark:text-red-400":Ne.variant==="warning"&&(oe="border-yellow-500 bg-yellow-100 text-yellow-700 dark:border-yellow-600 dark:bg-yellow-900/50 dark:text-yellow-400"),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2 min-w-[200px]",children:[jsxRuntime.jsx(Badge,{variant:"outline",className:Oe?"border-green-500 bg-green-100 text-green-700 dark:border-green-600 dark:bg-green-900/50 dark:text-green-400 font-medium":"border-gray-400 bg-gray-100 text-gray-600 dark:border-gray-600 dark:bg-gray-800/50 dark:text-gray-400 font-medium",children:Oe?"Active":"Inactive"}),se.EndDate&&jsxRuntime.jsx(Badge,{variant:"outline",className:`${oe} font-medium`,children:Ne.text}),jsxRuntime.jsx(TooltipProvider,{delayDuration:100,children:jsxRuntime.jsxs(Tooltip$1,{children:[jsxRuntime.jsx(TooltipTrigger,{asChild:!0,children:jsxRuntime.jsx(Button$1,{variant:"ghost",size:"icon",className:"h-6 w-6 p-0 data-[state=delayed-open]:bg-accent data-[state=instant-open]:bg-accent",children:jsxRuntime.jsx(Info,{className:"h-4 w-4 text-muted-foreground"})})}),jsxRuntime.jsx(TooltipContent,{side:"top",align:"center",className:"bg-popover text-popover-foreground p-2 rounded shadow-lg",children:jsxRuntime.jsxs("div",{className:"text-sm space-y-1",children:[jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Start:"})," ",formatDate(se.StartDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"End:"})," ",formatDate(se.EndDate)]}),jsxRuntime.jsxs("p",{children:[jsxRuntime.jsx("strong",{children:"Updated:"})," ",formatDate(se.LastUpdate)]})]})})]})})]})},enableFiltering:!1},{id:"actions",header:"Actions",cell:({row:ae})=>{var Be,qe;const se=ae.original;if(!se.BidNumber)return jsxRuntime.jsx("span",{className:"text-xs text-muted-foreground",children:"Actions unavailable"});const Oe=se.BidNumber,Ne=(Be=l[Oe])==null?void 0:Be.isSettingDefault,oe=(S==null?void 0:S.BidNumber)===Oe&&((qe=l[Oe])==null?void 0:qe.isSendingReport),$e=Ne||oe,Ae=se.CanBeSetAsDefault===!0,je=C!=null&&C.IsManufacturer?`/${e}/Opportunity/${se.BidNumber}`:`/${e}/Opportunity/${se.ManufacturerId}/${se.BidNumber}`;return jsxRuntime.jsxs("div",{className:"flex space-x-2",children:[jsxRuntime.jsx(reactRouterDom.Link,{to:je,children:jsxRuntime.jsxs(Button$1,{variant:"outline",size:"sm",className:"flex items-center",children:[jsxRuntime.jsx(Star,{className:"mr-2 h-4 w-4"})," View"]})}),(C==null?void 0:C.IsReseller)&&jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Button$1,{variant:"outline",size:"sm",onClick:()=>M(se),disabled:$e||!Ae,title:Ae?"Set as default":"This opportunity cannot be set as default",className:"flex items-center",children:[Ne?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Star,{className:"mr-2 h-4 w-4"})," Set Default"]}),jsxRuntime.jsxs(Button$1,{variant:"outline",size:"sm",onClick:()=>j(se),disabled:$e,title:"Send report by email",className:"flex items-center",children:[oe?jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"}):jsxRuntime.jsx(Send,{className:"mr-2 h-4 w-4"})," Send Report"]})]})]})}}],[l,M,j,S,C==null?void 0:C.IsReseller,e]),te=React.useMemo(()=>{const ae={};if(t){const se=Array.from(new Set(t.map(Ne=>Ne.ManufacturerId).filter(Ne=>Ne!=null)));ae.ManufacturerId=se;const Oe=Array.from(new Set(t.map(Ne=>Ne.OpportunityName||Ne.Opportunity).filter(Ne=>Ne!=null)));ae.opportunityDisplay=Oe}return ae},[t]),F=t||[],V=S!=null&&S.BidNumber?(ne=l[S.BidNumber])==null?void 0:ne.isSendingReport:!1;return n?jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(Skeleton,{className:"h-7 w-48"})," "]}),jsxRuntime.jsxs(CardContent,{className:"space-y-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-12 w-full rounded-md border"}),jsxRuntime.jsx(Skeleton,{className:"h-48 w-full rounded-md border"}),jsxRuntime.jsxs("div",{className:"flex items-center justify-between pt-4",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-[130px]"}),jsxRuntime.jsxs("div",{className:"flex items-center space-x-2",children:[jsxRuntime.jsx(Skeleton,{className:"h-9 w-20"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-24"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})," ",jsxRuntime.jsx(Skeleton,{className:"h-9 w-9"})]})]})]})]}):jsxRuntime.jsxs(jsxRuntime.Fragment,{children:[jsxRuntime.jsxs(Card,{className:"w-full",children:[jsxRuntime.jsxs(CardHeader,{children:[" ",jsxRuntime.jsx(CardTitle,{className:"text-1xl font-bold",children:"Opportunities"})," "]}),jsxRuntime.jsx(CardContent,{children:jsxRuntime.jsx(DataTable,{columns:Q,data:F,uniqueValues:te})})]}),jsxRuntime.jsx(Dialog,{open:f,onOpenChange:ae=>{g(ae),ae||(R(null),_(""))},children:jsxRuntime.jsxs(DialogContent,{className:"@sm:max-w-[425px]",children:[jsxRuntime.jsxs(DialogHeader,{children:[jsxRuntime.jsx(DialogTitle,{children:"Send Opportunity Report"}),jsxRuntime.jsxs(DialogDescription,{children:["Enter the email address to send the report for opportunity: ",jsxRuntime.jsx("br",{}),jsxRuntime.jsx("span",{className:"font-semibold",children:(S==null?void 0:S.OpportunityName)||(S==null?void 0:S.Opportunity)||"N/A"}),(S==null?void 0:S.BidNumber)&&jsxRuntime.jsxs("span",{className:"block text-sm text-muted-foreground",children:["Bid Number: ",S.BidNumber]})]})]}),jsxRuntime.jsx("div",{className:"grid gap-4 py-4",children:jsxRuntime.jsxs("div",{className:"grid grid-cols-4 items-center gap-4",children:[jsxRuntime.jsx(Label$2,{htmlFor:"email",className:"text-right",children:"Email"}),jsxRuntime.jsx(Input,{id:"email",type:"email",value:b,onChange:ae=>_(ae.target.value),placeholder:"recipient@example.com",className:"col-span-3",disabled:V})]})}),jsxRuntime.jsxs(DialogFooter,{children:[jsxRuntime.jsx(Button$1,{variant:"outline",onClick:()=>g(!1),disabled:V,children:"Cancel"}),jsxRuntime.jsxs(Button$1,{type:"submit",onClick:q,disabled:V,children:[V&&jsxRuntime.jsx(LoaderCircle,{className:"mr-2 h-4 w-4 animate-spin"})," Send Report"]})]})]})})]})}function useLoadScript(e){const[t,n]=React.useState(!0),[o,l]=React.useState(null),[d,f]=React.useState(!1),g=()=>{n(!1),f(!0)};return React.useEffect(()=>{if(!document){const R=new Error(`[ScriptLoadingError] document not defined when attempting to load ${e}`);l(R);return}const b=document.querySelector(`script[src="${e}"]`);if(b!=null&&b.dataset.loaded){g();return}const _=b||document.createElement("script");b||(_.src=e);const S=()=>{_.dataset.loaded="1",g()};_.addEventListener("load",S),_.addEventListener("error",R=>{console.error("Failed to load script:",e,R);const C=new Error(`[ScriptLoadingError] Failed to load script: ${e}`);l(C)}),b||document.head.append(_)},[]),{isLoading:t,error:o,isSuccess:d}}const isGoogleReady=e=>e&&e.charts,isGoogleChartsReady=(e,t)=>{const{controls:n,toolbarItems:o,getChartEditor:l}=e;return t&&t.charts&&t.visualization&&t.visualization.ChartWrapper&&t.visualization.Dashboard&&(!n||t.visualization.ChartWrapper)&&(!l||t.visualization.ChartEditor)&&(!o||t.visualization.drawToolbar)},getGoogleInstanceFromWindow=e=>window.google;function useLoadGoogleCharts(e){const{chartVersion:t="current",chartPackages:n=["corechart","controls"],chartLanguage:o="en",mapsApiKey:l}=e,[d,f]=React.useState(null),[g,b]=React.useState(null),[_,S]=React.useState(null),{isLoading:R,error:C,isSuccess:E}=useLoadScript(e.chartLoaderScriptUrl||"https://www.gstatic.com/charts/loader.js");return React.useEffect(()=>{if(!E)return;const A=getGoogleInstanceFromWindow();if(!isGoogleReady(A)){const M=new Error("[ScriptInitializationError] Script loaded but Google not attached to window.");b(M);return}if(isGoogleChartsReady(e,A)){f(A);return}A.charts.load(t,{packages:n,language:o,mapsApiKey:l}),A.charts.setOnLoadCallback(()=>{if(!isGoogleChartsReady(e,A)){const M=new Error("[GoogleChartsInitializationError] Google Charts not ready after load callback.");console.error(M),S(M);return}f(A)})},[E]),{error:C||g||_,isLoading:R,google:d}}const chartDefaultProps={legend_toggle:!1,options:{},legendToggle:!1,getChartWrapper:()=>{},spreadSheetQueryParameters:{headers:1,gid:1},rootProps:{},chartWrapperParams:{},chartLoaderScriptUrl:"https://www.gstatic.com/charts/loader.js"},GoogleChartControls=e=>{const{isReady:t,chartControls:n,filter:o}=e;return!t||!n||!(n!=null&&n.length)?null:React.createElement(React.Fragment,null,n.filter(l=>{let{controlProp:d,control:f}=l;return o?o({control:f,controlProp:d}):!0}).map(l=>{let{control:d}=l;return React.createElement("div",{key:d.getContainerId(),id:d.getContainerId()})}))};let uniqueID=0;const generateUniqueID=()=>(uniqueID+=1,`reactgooglegraph-${uniqueID}`),jn=class jn{};en(jn,"initializeControls",t=>{for(let n=0;n<t.length;n+=1){const{controlType:o,options:l,controlWrapperParams:d}=t[n].controlProp;d&&"state"in d&&t[n].control.setState(d.state),t[n].control.setOptions(l),t[n].control.setControlType(o)}}),en(jn,"listenToControlEvents",(t,n)=>{const{google:o}=n;return t.flatMap(l=>{const{control:d,controlProp:f}=l,{controlEvents:g=[]}=f;return g.map(b=>{const{callback:_,eventName:S}=b;return o.visualization.events.addListener(d,S,function(){for(var R=arguments.length,C=new Array(R),E=0;E<R;E++)C[E]=arguments[E];_({chartWrapper:null,controlWrapper:d,props:n,google:o,eventArgs:C})})})})}),en(jn,"createControlId",t=>{let n;return typeof t>"u"?n=`googlechart-control-${generateUniqueID()}`:n=t,n}),en(jn,"createChartControls",t=>{const{controls:n,google:o}=t;return n?n.map((l,d)=>{const{controlID:f,controlType:g,options:b,controlWrapperParams:_}=l,S=jn.createControlId(f);return{controlProp:l,control:new o.visualization.ControlWrapper({containerId:S,controlType:g,options:b,..._})}}):null}),en(jn,"addControls",t=>{const{chartWrapper:n,chartDashboard:o}=t,l=jn.createChartControls(t);return!l||!o||!n?null:(o.bind(l.map(d=>{let{control:f}=d;return f}),n),jn.initializeControls(l),l)});let GoogleChartControlsInternal=jn;const useCreateChartControls=e=>{const[t,n]=React__namespace.useState(null);return[React__namespace.useMemo(()=>!t||!e?null:e.map((l,d)=>{const f=t[d];return f?{controlProp:l,control:f}:void 0}).flatMap(l=>l?[l]:[]),[t,e]),n]},useListenToControlEvents=(e,t)=>{React__namespace.useEffect(()=>{const n=GoogleChartControlsInternal.listenToControlEvents(e??[],t);return()=>{n.forEach(o=>{t.google.visualization.events.removeListener(o)})}},[e,t])},useChartControls=e=>{const[t,n]=useCreateChartControls(e.controls);return useListenToControlEvents(t??[],e),{addControls:l=>{const d=GoogleChartControlsInternal.addControls(l);n((d==null?void 0:d.map(f=>f.control))??null)},renderControl:l=>{const{chartWrapper:d,chartDashboard:f}=e;return React__namespace.createElement(GoogleChartControls,{...e,isReady:!!(d&&f),chartControls:t,filter:l})}}},useChartId=e=>{const t=React__namespace.useRef(null);return{chartId:(()=>{const{graphID:l,graph_id:d}=e,f=l||d;let g;return f?g=f:g=t.current||generateUniqueID(),t.current=g,t.current})()}},DEFAULT_CHART_COLORS=["#3366CC","#DC3912","#FF9900","#109618","#990099","#3B3EAC","#0099C6","#DD4477","#66AA00","#B82E2E","#316395","#994499","#22AA99","#AAAA11","#6633CC","#E67300","#8B0707","#329262","#5574A6","#3B3EAC"],loadDataTableFromSpreadSheet=async function(e,t){let n=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{};return new Promise((o,l)=>{const d=`${n.headers?`headers=${n.headers}`:"headers=0"}`,f=`${n.query?`&tq=${encodeURIComponent(n.query)}`:""}`,g=`${n.gid?`&gid=${n.gid}`:""}`,b=`${n.sheet?`&sheet=${n.sheet}`:""}`,_=`${n.access_token?`&access_token=${n.access_token}`:""}`,S=`${d}${g}${b}${f}${_}`,R=`${t}/gviz/tq?${S}`;new e.visualization.Query(R).send(E=>{E.isError()?l(`Error in query: ${E.getMessage()} ${E.getDetailedMessage()}`):o(E.getDataTable())})})},GRAY_COLOR="#CCCCCC",Tn=class Tn{};en(Tn,"grayOutHiddenColumnsLabel",(t,n)=>{const{googleChartWrapper:o,options:l}=t;if(!o){console.error("googleChartWrapper is not defined");return}const d=o.getDataTable();if(!d)return;const f=d.getNumberOfColumns();if(n.length>0===!1)return;const b=Array.from({length:f-1}).map((_,S)=>{const R=Tn.getColumnId(d,S+1);return n.includes(R)?GRAY_COLOR:l&&l.colors?l.colors[S]:DEFAULT_CHART_COLORS[S]});o.setOptions({...l,colors:b}),o.draw()}),en(Tn,"listenToLegendToggle",(t,n)=>{const[o,l]=n,{google:d,googleChartWrapper:f}=t;if(!f){console.error("googleChartWrapper is not defined");return}return d.visualization.events.addListener(f,"select",()=>{const b=f.getChart().getSelection(),_=f.getDataTable();if(b.length===0||b[0].row!==null||!_)return;const S=b[0].column,R=Tn.getColumnId(_,S);o!=null&&o.includes(R)?l(C=>[...C.filter(E=>E!==R)]):l(C=>[...C,R])})}),en(Tn,"draw",async t=>{const{data:n,diffdata:o,rows:l,columns:d,options:f,chartType:g,formatters:b,spreadSheetUrl:_,spreadSheetQueryParameters:S,googleChartDashboard:R,googleChartWrapper:C,google:E,hiddenColumns:A,legendToggle:M,legend_toggle:I}=t;if(!C){console.error("draw was called with googleChartWrapper = null");return}let j,q=null;if(o){const ne=E.visualization.arrayToDataTable(o.old),ae=E.visualization.arrayToDataTable(o.new);q=E.visualization[g].prototype.computeDiff(ne,ae)}n?n instanceof E.visualization.DataTable?j=n:Array.isArray(n)?j=E.visualization.arrayToDataTable(n):j=new E.visualization.DataTable(n):l&&d?j=E.visualization.arrayToDataTable([d,...l]):_?j=await loadDataTableFromSpreadSheet(E,_,S):j=E.visualization.arrayToDataTable([]);const Q=j.getNumberOfColumns(),te=Array(Q).fill(0).map((ne,ae)=>{const se=Tn.getColumnId(j,ae);return A.includes(se)?{label:j.getColumnLabel(ae),type:j.getColumnType(ae),calc:()=>null}:ae}),F=C.getChart();C.getChartType()==="Timeline"&&F&&F.clearChart(),C.setChartType(g),C.setOptions(f||{});const V=new E.visualization.DataView(j);V.setColumns(te),C.setDataTable(V),C.draw(),R&&R.draw(j),q&&(C.setDataTable(q),C.draw()),b&&(Tn.applyFormatters({dataTable:j,formatters:b,google:E}),C.setDataTable(j),C.draw()),(M===!0||I===!0)&&Tn.grayOutHiddenColumnsLabel(t,A)}),en(Tn,"getColumnId",(t,n)=>t.getColumnId(n)||t.getColumnLabel(n)),en(Tn,"applyFormatters",t=>{let{dataTable:n,formatters:o,google:l}=t;for(let d of o)switch(d.type){case"ArrowFormat":{new l.visualization.ArrowFormat(d.options).format(n,d.column);return}case"BarFormat":{new l.visualization.BarFormat(d.options).format(n,d.column);return}case"ColorFormat":{const f=new l.visualization.ColorFormat(d.options),{ranges:g}=d;if(g)for(let b of g)f.addRange(...b);f.format(n,d.column);return}case"DateFormat":{new l.visualization.DateFormat(d.options).format(n,d.column);return}case"NumberFormat":{new l.visualization.NumberFormat(d.options).format(n,d.column);return}case"PatternFormat":{new l.visualization.PatternFormat(d.options).format(n,d.column);return}default:{console.warn(`Unknown formatter type: ${d.type}`);return}}});let GoogleChartInternal=Tn;const useGoogleChartDataTable=e=>{const{google:t,googleChartWrapper:n,googleChartDashboard:o}=e,[l,d]=React__namespace.useState([]);React__namespace.useEffect(()=>{n&&GoogleChartInternal.draw({...e,hiddenColumns:l,googleChartWrapper:n,googleChartDashboard:o,google:t})},[l,e.data,e.rows,e.columns,e.options,e.chartLoaderScriptUrl,e.chartType,e.formatters,e.spreadSheetUrl,e.spreadSheetQueryParameters,e.legendToggle,e.legend_toggle]);const f=()=>{const{googleChartWrapper:_}=e;_&&_.draw()},g=_=>{const S=[],{legendToggle:R,legend_toggle:C}=e;if(GoogleChartInternal.draw({...e,hiddenColumns:l,googleChartWrapper:_,googleChartDashboard:o,google:t}),window.addEventListener("resize",f),C||R){const E=GoogleChartInternal.listenToLegendToggle(e,[l,d]);E&&S.push(E)}return S},b=(_,S)=>{window.removeEventListener("resize",f),S.forEach(R=>{t.visualization.events.removeListener(R)}),_.getChartType()==="Timeline"&&_.getChart()&&_.getChart().clearChart()};React__namespace.useEffect(()=>{if(!n)return;const _=g(n);return()=>{b(n,_)}},[n,g,b])},listenToEvents=e=>{const{chartEvents:t,google:n,googleChartWrapper:o}=e;if(t){if(!o){console.warn("listenToEvents was called before chart wrapper ready.");return}return t.map(l=>{let{eventName:d,callback:f}=l;return n.visualization.events.addListener(o,d,function(){for(var g=arguments.length,b=new Array(g),_=0;_<g;_++)b[_]=arguments[_];f({chartWrapper:o,props:e,google:n,eventArgs:b})})})}},useGoogleChartEvents=e=>{React.useEffect(()=>{if(!e.googleChartWrapper)return;const t=listenToEvents(e);return()=>{t==null||t.forEach(n=>{e.google.visualization.events.removeListener(n)})}},[e])},GoogleChart=e=>{const[t,n]=React__namespace.useState(null),[o,l]=React__namespace.useState(null),{addControls:d,renderControl:f}=useChartControls({...e,chartDashboard:o,chartWrapper:t});useGoogleChartEvents({...e,googleChartWrapper:t});const{chartId:g}=useChartId(e),b=React__namespace.useRef(null),_=React__namespace.useRef(null);React__namespace.useEffect(()=>{const{options:j,google:q,chartType:Q,chartWrapperParams:te,toolbarItems:F,getChartEditor:V,getChartWrapper:ne,onLoad:ae}=e,se={chartType:Q,options:j,containerId:g,...te},Oe=new q.visualization.ChartWrapper(se);Oe.setOptions(j||{}),ne==null||ne(Oe,q);const Ne=new q.visualization.Dashboard(b.current);F&&q.visualization.drawToolbar(_.current,F);let oe=null;V&&(oe=new q.visualization.ChartEditor,V({chartEditor:oe,chartWrapper:Oe,google:q})),d({...e,chartDashboard:Ne,chartWrapper:Oe}),n(Oe),l(Ne),ae==null||ae(q,{google:q,chartWrapper:Oe,chartEditor:oe,chartDashboard:Ne})},[]),useGoogleChartDataTable({...e,googleChartWrapper:t,googleChartDashboard:o});const S=()=>{const{width:j,height:q,options:Q,style:te,className:F,rootProps:V,google:ne}=e,ae={height:q||Q&&Q.height,width:j||Q&&Q.width,...te};return React__namespace.createElement("div",{id:g,style:ae,className:F,...V})},R=()=>e.toolbarItems?React__namespace.createElement("div",{ref:_}):null,{width:C,height:E,options:A,style:M}=e,I={height:E||A&&A.height,width:C||A&&A.width,...M};return e.render?React__namespace.createElement("div",{ref:b,style:I},React__namespace.createElement("div",{ref:_,id:"toolbar"}),e.render({renderChart:S,renderControl:f,renderToolbar:R})):React__namespace.createElement("div",{ref:b,style:I},f(j=>{let{controlProp:q}=j;return q.controlPosition!=="bottom"}),S(),f(j=>{let{controlProp:q}=j;return q.controlPosition==="bottom"}),R())},ChartContext=React__namespace.createContext(chartDefaultProps),ContextProvider=e=>{let{children:t,value:n}=e;return React__namespace.createElement(ChartContext.Provider,{value:n},t)},ChartView=e=>{const{google:t,isLoading:n,error:o}=useLoadGoogleCharts(e);return n?e.loader??null:o?e.errorElement??null:t?React.createElement(GoogleChart,{google:t,...e}):null},Chart=e=>{const t={...chartDefaultProps,...e};return React.createElement(ContextProvider,{value:t},React.createElement(ChartView,t))};var GoogleDataTableColumnRoleType;(function(e){e.annotation="annotation",e.annotationText="annotationText",e.certainty="certainty",e.emphasis="emphasis",e.interval="interval",e.scope="scope",e.style="style",e.tooltip="tooltip",e.domain="domain"})(GoogleDataTableColumnRoleType||(GoogleDataTableColumnRoleType={}));function parseHsl(e){const t=e.match(/(\d+\.?\d*)\s*(\d+\.?\d*)%\s*(\d+\.?\d*)%/);return t?{h:parseFloat(t[1]),s:parseFloat(t[2]),l:parseFloat(t[3])}:null}function hslToHex(e,t,n){n/=100;const o=t*Math.min(n,1-n)/100,l=d=>{const f=(d+e/30)%12,g=n-o*Math.max(Math.min(f-3,9-f,1),-1);return Math.round(255*g).toString(16).padStart(2,"0")};return`#${l(0)}${l(8)}${l(4)}`}const Treemap=React__namespace.forwardRef(({data:e,options:t,height:n="500px",className:o,loading:l,disableClick:d=!0,...f},g)=>{const b=React__namespace.useRef(null),[_,S]=React__namespace.useState(null);React__namespace.useEffect(()=>{if(!b.current)return;const E=b.current,A=()=>{const q=getComputedStyle(E).getPropertyValue("--primary").trim();if(q){const Q=parseHsl(q);if(Q){const{h:te,s:F,l:V}=Q;S({minColor:hslToHex(te,F,Math.min(100,V+50)),midColor:hslToHex(te,F,Math.min(100,V+35)),maxColor:hslToHex(te,F,Math.min(100,V+20))})}return!0}return!1};if(A())return;let M=0;const I=20,j=setInterval(()=>{(A()||M>=I)&&clearInterval(j),M++},100);return()=>{j&&clearInterval(j)}},[]);const R=React__namespace.useMemo(()=>{const E={headerHeight:0,fontSize:14,showScale:!1,isHtml:!0,backgroundColor:"hsl(var(--background))",generateTooltip:(A,M)=>{var q;const I=(q=e[A+1])==null?void 0:q[0];if(!I)return"";const j=formatMoney(M);return`<div class="p-2 bg-background text-foreground border rounded-md shadow-lg">
|
|
1456
1456
|
<strong>${I}</strong><br>Value: ${j}
|
|
1457
1457
|
</div>`}};return _&&(!t||!t.colorAxis)&&(E.minColor=_.minColor,E.midColor=_.midColor,E.maxColor=_.maxColor),{...E,...t}},[e,t,_]),C=React__namespace.useMemo(()=>d?[{eventName:"select",callback:({chartWrapper:A})=>{A.getChart().setSelection(null)}}]:void 0,[d]);return React__namespace.useImperativeHandle(g,()=>b.current,[]),l?jsxRuntime.jsx("div",{ref:b,className:cn("w-full",o),style:{height:n},...f,children:jsxRuntime.jsx(Skeleton,{className:"h-full w-full"})}):!e||e.length<=2?jsxRuntime.jsx("div",{ref:b,className:cn("w-full flex items-center justify-center text-muted-foreground",o),style:{height:n},...f,children:"No data available"}):jsxRuntime.jsx("div",{ref:b,className:cn("w-full",o),style:{height:n},...f,children:jsxRuntime.jsx(Chart,{chartType:"TreeMap",width:"100%",height:"100%",data:e,options:R,chartEvents:C,loader:jsxRuntime.jsx(Skeleton,{className:"h-full w-full"})})})});Treemap.displayName="Treemap";const TopPercentTreemap=({data:e,topPercent:t=80,title:n,loading:o,...l})=>{const d=React__namespace.useMemo(()=>{if(!e||e.length===0)return[["ID","Parent","Value"],["Root",null,0]];const g=[...e].sort((A,M)=>M.value-A.value),_=g.reduce((A,M)=>A+M.value,0)*(t/100),S=[["ID","Parent","Value"],["Root",null,0]],R=[],C=[];let E=0;for(const A of g)E<_?(R.push(A),E+=A.value):C.push(A);if(R.forEach(A=>{S.push([A.name,"Root",A.value])}),C.length>0){const A=`More... (${C.length} items)`;S.push([A,"Root",0]),C.forEach(M=>{S.push([M.name,A,M.value])})}return S},[e,t]),f=React__namespace.useMemo(()=>({title:n,maxDepth:1,backgroundColor:"hsl(var(--background))"}),[n]);return jsxRuntime.jsx(Treemap,{data:d,options:f,className:cn("h-full",l.className),loading:o,disableClick:!1,...l})};exports.AIChatLayout=AIChatLayout,exports.Accordion=Accordion,exports.AccordionContent=AccordionContent,exports.AccordionItem=AccordionItem,exports.AccordionTrigger=AccordionTrigger,exports.ActiveOrdersCard=ActiveOrdersCard,exports.AiGeneratedContent=AiGeneratedContent,exports.Alert=Alert,exports.AlertDescription=AlertDescription,exports.AlertDialog=AlertDialog,exports.AlertDialogAction=AlertDialogAction,exports.AlertDialogCancel=AlertDialogCancel,exports.AlertDialogContent=AlertDialogContent,exports.AlertDialogDescription=AlertDialogDescription,exports.AlertDialogFooter=AlertDialogFooter,exports.AlertDialogHeader=AlertDialogHeader,exports.AlertDialogTitle=AlertDialogTitle,exports.AlertDialogTrigger=AlertDialogTrigger,exports.AlertTitle=AlertTitle,exports.AreaChart=AreaChart,exports.AssistantChat=AssistantChat,exports.AssistantInsight=AssistantInsight,exports.Avatar=Avatar,exports.AvatarFallback=AvatarFallback,exports.AvatarFooter=AvatarFooter,exports.AvatarImage=AvatarImage,exports.Badge=Badge,exports.Button=Button$1,exports.Calendar=Calendar,exports.Card=Card,exports.CardContent=CardContent,exports.CardDescription=CardDescription,exports.CardFooter=CardFooter,exports.CardHeader=CardHeader,exports.CardTitle=CardTitle,exports.ChatLayout=ChatLayout,exports.ChatProvider=ChatProvider,exports.Checkbox=Checkbox,exports.Command=Command,exports.CommandDialog=CommandDialog,exports.CommandEmpty=CommandEmpty,exports.CommandGroup=CommandGroup,exports.CommandInput=CommandInput,exports.CommandItem=CommandItem,exports.CommandList=CommandList,exports.CommandSeparator=CommandSeparator,exports.CommandShortcut=CommandShortcut,exports.CountryFlag=CountryFlag,exports.DataTable=DataTable,exports.DatePicker=DatePicker,exports.Dialog=Dialog,exports.DialogClose=DialogClose,exports.DialogContent=DialogContent,exports.DialogDescription=DialogDescription,exports.DialogFooter=DialogFooter,exports.DialogHeader=DialogHeader,exports.DialogOverlay=DialogOverlay,exports.DialogPortal=DialogPortal,exports.DialogTitle=DialogTitle,exports.DialogTrigger=DialogTrigger,exports.DropdownMenu=DropdownMenu,exports.DropdownMenuCheckboxItem=DropdownMenuCheckboxItem,exports.DropdownMenuContent=DropdownMenuContent,exports.DropdownMenuGroup=DropdownMenuGroup,exports.DropdownMenuItem=DropdownMenuItem,exports.DropdownMenuLabel=DropdownMenuLabel,exports.DropdownMenuPortal=DropdownMenuPortal,exports.DropdownMenuRadioGroup=DropdownMenuRadioGroup,exports.DropdownMenuRadioItem=DropdownMenuRadioItem,exports.DropdownMenuSeparator=DropdownMenuSeparator,exports.DropdownMenuShortcut=DropdownMenuShortcut,exports.DropdownMenuSub=DropdownMenuSub,exports.DropdownMenuSubContent=DropdownMenuSubContent,exports.DropdownMenuSubTrigger=DropdownMenuSubTrigger,exports.DropdownMenuTrigger=DropdownMenuTrigger,exports.ExploreManufacturers=ExploreManufacturers,exports.ExternalProductCard=ExternalProductCard,exports.GeminiApiKeyProvider=GeminiApiKeyProvider,exports.GeneralDocumentCard=GeneralDocumentCard,exports.Input=Input,exports.InputOTP=InputOTP,exports.InputOTPGroup=InputOTPGroup,exports.InputOTPSeparator=InputOTPSeparator,exports.InputOTPSlot=InputOTPSlot,exports.Label=Label$2,exports.Layout=Layout,exports.ManufacturerCard=ManufacturerCard,exports.ManufacturerGetStartedButton=ManufacturerGetStartedButton,exports.ManufacturerOverviewPage=ManufacturerOverviewPage,exports.ManufacturerReorderingCard=ManufacturerReorderingCard,exports.MultiSelect=MultiSelect,exports.Navbar=Navbar,exports.OpportunitiesTable=OpportunitiesTable,exports.OrdersCard=OrdersCard,exports.PageHeader=PageHeader,exports.PartnerActions=PartnerActions,exports.PartnerCard=PartnerCard,exports.PartnerRelationshipPage=PartnerRelationshipPage,exports.Popover=Popover,exports.PopoverAnchor=PopoverAnchor,exports.PopoverContent=PopoverContent,exports.PopoverTrigger=PopoverTrigger,exports.Preloader=Preloader,exports.ProductCard=ProductCard,exports.ProductImage=ProductImage,exports.ProductInventoryGrid=ProductInventoryGrid,exports.ProductOverviewPage=ProductOverviewPage,exports.Progress=Progress,exports.RadioGroup=RadioGroup$1,exports.RadioGroupItem=RadioGroupItem,exports.ResellerBillingOverviewCard=ResellerBillingOverviewCard,exports.ResellerCard=ResellerCard,exports.ResellerOverview=ResellerOverview,exports.ResellerQualificationsCard=ResellerQualificationsCard,exports.ReturnsTable=ReturnsTable,exports.RichTextEditor=RichTextEditor,exports.SalesChart=SalesChart,exports.SalesOverviewCard=SalesOverviewCard,exports.ScrollArea=ScrollArea,exports.ScrollBar=ScrollBar,exports.SearchPage=SearchPage,exports.SearchPageGrid=SearchPageGrid,exports.Select=Select$1,exports.SelectContent=SelectContent,exports.SelectGroup=SelectGroup,exports.SelectItem=SelectItem,exports.SelectLabel=SelectLabel,exports.SelectScrollDownButton=SelectScrollDownButton,exports.SelectScrollUpButton=SelectScrollUpButton,exports.SelectTrigger=SelectTrigger,exports.SelectValue=SelectValue,exports.Separator=Separator$1,exports.Sheet=Sheet,exports.SheetClose=SheetClose,exports.SheetContent=SheetContent,exports.SheetDescription=SheetDescription,exports.SheetFooter=SheetFooter,exports.SheetHeader=SheetHeader,exports.SheetOverlay=SheetOverlay,exports.SheetPortal=SheetPortal,exports.SheetTitle=SheetTitle,exports.SheetTrigger=SheetTrigger,exports.Sidebar=Sidebar,exports.SidebarContent=SidebarContent,exports.SidebarFooter=SidebarFooter,exports.SidebarGroup=SidebarGroup,exports.SidebarGroupAction=SidebarGroupAction,exports.SidebarGroupContent=SidebarGroupContent,exports.SidebarGroupLabel=SidebarGroupLabel,exports.SidebarHeader=SidebarHeader,exports.SidebarInput=SidebarInput,exports.SidebarInset=SidebarInset,exports.SidebarMenu=SidebarMenu,exports.SidebarMenuAction=SidebarMenuAction,exports.SidebarMenuBadge=SidebarMenuBadge,exports.SidebarMenuButton=SidebarMenuButton,exports.SidebarMenuItem=SidebarMenuItem,exports.SidebarMenuSkeleton=SidebarMenuSkeleton,exports.SidebarMenuSub=SidebarMenuSub,exports.SidebarMenuSubButton=SidebarMenuSubButton,exports.SidebarMenuSubItem=SidebarMenuSubItem,exports.SidebarProvider=SidebarProvider,exports.SidebarRail=SidebarRail,exports.SidebarSeparator=SidebarSeparator,exports.SidebarTrigger=SidebarTrigger,exports.Skeleton=Skeleton,exports.Switch=Switch,exports.Table=Table,exports.TableBody=TableBody,exports.TableCaption=TableCaption,exports.TableCell=TableCell,exports.TableFooter=TableFooter,exports.TableHead=TableHead,exports.TableHeader=TableHeader,exports.TableRow=TableRow,exports.Tabs=Tabs,exports.TabsContent=TabsContent,exports.TabsList=TabsList,exports.TabsTrigger=TabsTrigger,exports.Textarea=Textarea,exports.Toast=Toast,exports.ToastAction=ToastAction,exports.ToastClose=ToastClose,exports.ToastDescription=ToastDescription,exports.ToastProvider=ToastProvider,exports.ToastTitle=ToastTitle,exports.ToastViewport=ToastViewport,exports.Toaster=Toaster,exports.Tooltip=Tooltip$1,exports.TooltipContent=TooltipContent,exports.TooltipProvider=TooltipProvider,exports.TooltipTrigger=TooltipTrigger,exports.TopPercentTreemap=TopPercentTreemap,exports.Topbar=Topbar,exports.Treemap=Treemap,exports.badgeVariants=badgeVariants,exports.buttonVariants=buttonVariants,exports.formatMoney=formatMoney,exports.formatNumber=formatNumber,exports.formatYYYYMMDDIntToDateString=formatYYYYMMDDIntToDateString,exports.toast=toast,exports.useChat=useChat,exports.useGeminiApiKey=useGeminiApiKey,exports.useIsMobile=useIsMobile,exports.useSidebar=useSidebar,exports.useToast=useToast,Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"})}));
|